org.zkoss.zul
Class Toolbarbutton

java.lang.Object
  extended by org.zkoss.zk.ui.AbstractComponent
      extended by org.zkoss.zk.ui.HtmlBasedComponent
          extended by org.zkoss.zul.impl.XulElement
              extended by org.zkoss.zul.impl.LabelElement
                  extended by org.zkoss.zul.impl.LabelImageElement
                      extended by org.zkoss.zul.Toolbarbutton
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, org.zkoss.zk.ui.Component, org.zkoss.zk.ui.sys.ComponentCtrl

public class Toolbarbutton
extends LabelImageElement

A tool button.

The default CSS class is "button".

Non-xul extension: Toolbarbutton supports getHref(). If getHref() is not null, the onClick handler is ignored and this element is degenerated to HTML's A tag.

Author:
tomyeh
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.zkoss.zul.impl.LabelImageElement
LabelImageElement.ExtraCtrl
 
Field Summary
 
Fields inherited from class org.zkoss.zk.ui.HtmlBasedComponent
RS_NO_DISPLAY, RS_NO_HEIGHT, RS_NO_WIDTH
 
Fields inherited from interface org.zkoss.zk.ui.Component
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE
 
Constructor Summary
Toolbarbutton()
           
Toolbarbutton(java.lang.String label)
           
Toolbarbutton(java.lang.String label, java.lang.String image)
           
 
Method Summary
 java.lang.String getDir()
          Returns the direction.
 java.lang.String getHref()
          Returns the href.
 java.lang.String getOrient()
          Returns the orient.
 java.lang.String getOuterAttrs()
           
 int getTabindex()
          Returns the tab order of this component.
 java.lang.String getTarget()
          Returns the target frame or window.
 boolean isChildable()
          No child is allowed.
 void setDir(java.lang.String dir)
          Sets the direction.
 void setHref(java.lang.String href)
          Sets the href.
 void setOrient(java.lang.String orient)
          Sets the orient.
 void setTabindex(int tabindex)
          Sets the tab order of this component.
 void setTarget(java.lang.String target)
          Sets the target frame or window.
 
Methods inherited from class org.zkoss.zul.impl.LabelImageElement
getImage, getImageContent, getImgTag, getSrc, isImageAssigned, newExtraCtrl, setImage, setImageContent, setSrc
 
Methods inherited from class org.zkoss.zul.impl.LabelElement
getLabel, setLabel
 
Methods inherited from class org.zkoss.zul.impl.XulElement
getAction, getAllOnClickAttrs, getContext, getInnerAttrs, getPopup, getTooltip, setAction, setContext, setPopup, setTooltip
 
Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent
addEventListener, appendAsapAttr, focus, getDraggable, getDroppable, getHeight, getLeft, getRealStyle, getRealStyleFlags, getSclass, getStyle, getTooltiptext, getTop, getWidth, getZIndex, isAsapRequired, removeEventListener, setClass, setDraggable, setDroppable, setHeight, setLeft, setSclass, setStyle, setTooltiptext, setTop, setWidth, setZIndex
 
Methods inherited from class org.zkoss.zk.ui.AbstractComponent
addAnnotation, addAnnotation, addEventHandler, addSharedAnnotationMap, addSharedEventHandlerMap, appendChild, applyProperties, clone, containsVariable, detach, equals, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotation, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttributes, getAttributes, getChildren, getDefinition, getDesktop, getEventHandler, getExtraCtrl, getFellow, getFellowIfAny, getId, getListenerIterator, getMold, getMoldURI, getNamespace, getPage, getParent, getPropagatee, getRoot, getSpaceOwner, getUuid, getVariable, insertBefore, invalidate, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onDrawNewChild, onWrongValue, redraw, removeAttribute, removeAttribute, removeChild, response, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setComponentDefinition, setId, setMold, setPage, setParent, setVariable, setVisible, smartUpdate, smartUpdate, smartUpdate, toString, unsetVariable
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Toolbarbutton

public Toolbarbutton()

Toolbarbutton

public Toolbarbutton(java.lang.String label)

Toolbarbutton

public Toolbarbutton(java.lang.String label,
                     java.lang.String image)
Method Detail

getDir

public java.lang.String getDir()
Returns the direction.

Default: "normal".


setDir

public void setDir(java.lang.String dir)
            throws org.zkoss.zk.ui.WrongValueException
Sets the direction.

Parameters:
dir - either "normal" or "reverse".
Throws:
org.zkoss.zk.ui.WrongValueException

getHref

public java.lang.String getHref()
Returns the href.

Default: null. If null, the button has no function unless you specify the onClick handler.


setHref

public void setHref(java.lang.String href)
             throws org.zkoss.zk.ui.WrongValueException
Sets the href.

Throws:
org.zkoss.zk.ui.WrongValueException

getOrient

public java.lang.String getOrient()
Returns the orient.

Default: "horizontal".


setOrient

public void setOrient(java.lang.String orient)
               throws org.zkoss.zk.ui.WrongValueException
Sets the orient.

Parameters:
orient - either "horizontal" or "vertical".
Throws:
org.zkoss.zk.ui.WrongValueException

getTarget

public java.lang.String getTarget()
Returns the target frame or window.

Note: it is useful only if href (setHref(java.lang.String)) is specified (i.e., use the onClick listener).

Default: null.


setTarget

public void setTarget(java.lang.String target)
Sets the target frame or window.

Parameters:
target - the name of the frame or window to hyperlink.

getTabindex

public int getTabindex()
Returns the tab order of this component.

Default: -1 (means the same as browser's default).


setTabindex

public void setTabindex(int tabindex)
                 throws org.zkoss.zk.ui.WrongValueException
Sets the tab order of this component.

Throws:
org.zkoss.zk.ui.WrongValueException

getOuterAttrs

public java.lang.String getOuterAttrs()
Overrides:
getOuterAttrs in class XulElement

isChildable

public boolean isChildable()
No child is allowed.

Specified by:
isChildable in interface org.zkoss.zk.ui.Component
Overrides:
isChildable in class org.zkoss.zk.ui.AbstractComponent


Copyright © 2005-2007 Potix Corporation. All Rights Reserved.