org.zkoss.zul
Class Tab

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.Tab
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, org.zkoss.zk.ui.Component, org.zkoss.zk.ui.sys.ComponentCtrl

public class Tab
extends LabelImageElement

A tab.

Author:
tomyeh
See Also:
Serialized Form

Nested Class Summary
protected  class Tab.ExtraCtrl
          A utility class to implement AbstractComponent.getExtraCtrl().
 
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
Tab()
           
Tab(java.lang.String label)
           
Tab(java.lang.String label, java.lang.String image)
           
 
Method Summary
 int getIndex()
          Returns the index of this panel, or -1 if it doesn't belong to any tabs.
 Tabpanel getLinkedPanel()
          Returns the panel associated with this tab.
 java.lang.String getOuterAttrs()
           
 java.lang.String getSclass()
          Returns the style class.
 Tabbox getTabbox()
          Returns the tabbox owns this component.
 void invalidate()
           
 boolean isChildable()
          No child is allowed.
 boolean isClosable()
          Returns whether this tab is closable.
 boolean isSelected()
          Returns whether this tab is selected.
protected  java.lang.Object newExtraCtrl()
           
 void onClose()
          Process the onClose event sent when the close button is pressed.
 void setClosable(boolean closable)
          Sets whether this tab is closable.
 void setParent(org.zkoss.zk.ui.Component parent)
           
 void setSelected(boolean selected)
          Sets whether this tab is selected.
 
Methods inherited from class org.zkoss.zul.impl.LabelImageElement
getImage, getImageContent, getImgTag, getSrc, isImageAssigned, 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, 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, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onDrawNewChild, onWrongValue, redraw, removeAttribute, removeAttribute, removeChild, response, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setComponentDefinition, setId, setMold, setPage, setVariable, setVisible, smartUpdate, smartUpdate, smartUpdate, toString, unsetVariable
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Tab

public Tab()

Tab

public Tab(java.lang.String label)

Tab

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

isClosable

public boolean isClosable()
Returns whether this tab is closable. If closable, a button is displayed and the onClose event is sent if an user clicks the button.

Default: false.


setClosable

public void setClosable(boolean closable)
Sets whether this tab is closable. If closable, a button is displayed and the onClose event is sent if an user clicks the button.

Default: false.

You can intercept the default behavior by either overriding onClose(), or listening the onClose event.


onClose

public void onClose()
Process the onClose event sent when the close button is pressed.

Default: detach itself and the corresponding Tabpanel.


getTabbox

public Tabbox getTabbox()
Returns the tabbox owns this component.


getLinkedPanel

public Tabpanel getLinkedPanel()
Returns the panel associated with this tab.


isSelected

public final boolean isSelected()
Returns whether this tab is selected.


setSelected

public void setSelected(boolean selected)
Sets whether this tab is selected.


getIndex

public int getIndex()
Returns the index of this panel, or -1 if it doesn't belong to any tabs.


getOuterAttrs

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

getSclass

public java.lang.String getSclass()
Returns the style class. Note: 1) if not specified (or setSclass(null)), "tab" is assumed; 2) if selected, it appends "sel" to super's getSclass().

Overrides:
getSclass in class org.zkoss.zk.ui.HtmlBasedComponent

invalidate

public void invalidate()
Specified by:
invalidate in interface org.zkoss.zk.ui.Component
Overrides:
invalidate in class org.zkoss.zk.ui.AbstractComponent

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

setParent

public void setParent(org.zkoss.zk.ui.Component parent)
Specified by:
setParent in interface org.zkoss.zk.ui.Component
Overrides:
setParent in class org.zkoss.zk.ui.AbstractComponent

newExtraCtrl

protected java.lang.Object newExtraCtrl()
Overrides:
newExtraCtrl in class LabelImageElement


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