public class Tabbox extends XulElement
Event:
Mold:
Toolbar
only works in the horizontal default mold and
the isTabscroll()
to be true. (since 3.6.3)
Default getZclass()
: z-tabbox. (since 3.5.0)
Besides creating Tab
and Tabpanel
programmatically, you could
assign a data model (a ListModel
to a Tabbox via setModel(ListModel)
and then the tabbox will retrieve data via ListModel.getElementAt(int)
when
necessary. (since 7.0.0) [ZK EE]
Besides assign a list model, you could assign a renderer (a
TabboxRenderer
instance) to a Tabbox, such that the Tabbox will
use this renderer to render the data returned by
ListModel.getElementAt(int)
. If not assigned, the default renderer, which
assumes a label per Tab and Tabpanel, is used. In other words, the default renderer
adds a label to a Tab and Tabpanel by calling toString against the object returned by
ListModel.getElementAt(int)
(since 7.0.0) [ZK EE]
To retrieve what are selected in Tabbox with a Selectable
ListModel
, you shall use Selectable.getSelection()
to get what
is currently selected object in ListModel
rather than using
getSelectedTab()
. That is, you shall operate on the data of
the ListModel
rather than on the Tab
of the Tabbox
if you use the Selectable
ListModel
. (since 7.0.0) [ZK EE]
Set selection = ((Selectable)getModel()).getSelection();
Constructor and Description |
---|
Tabbox() |
Modifier and Type | Method and Description |
---|---|
void |
beforeChildAdded(org.zkoss.zk.ui.Component child,
org.zkoss.zk.ui.Component refChild) |
protected void |
clearSelectedTab() |
Object |
clone() |
TabboxEngine |
getEngine()
Returns the implementation tabbox engine.
|
<T> ListModel<T> |
getModel()
Returns the model associated with this selectbox, or null if this
selectbox is not associated with any list data model.
|
String |
getOrient()
Returns the orient.
|
String |
getPanelSpacing()
Returns the spacing between
Tabpanel . |
Selectable<Object> |
getSelectableModel() |
int |
getSelectedIndex()
Returns the selected index.
|
Tabpanel |
getSelectedPanel()
Returns the selected tab panel.
|
Tab |
getSelectedTab()
Returns the selected tab.
|
<T> TabboxRenderer<T> |
getTabboxRenderer()
Returns the renderer to render each tab and tabpanel, or null if the default renderer
is used.
|
Tabpanels |
getTabpanels()
Returns the tabpanels that this tabbox owns.
|
Tabs |
getTabs()
Returns the tabs that this tabbox owns.
|
Toolbar |
getToolbar()
Returns the auxiliary toolbar that this tabbox owns.
|
String |
getZclass() |
boolean |
insertBefore(org.zkoss.zk.ui.Component child,
org.zkoss.zk.ui.Component refChild) |
boolean |
isBottom()
Returns whether it is the bottom orientation.
|
boolean |
isHorizontal()
Returns whether it is a horizontal tabbox.
|
boolean |
isLeft()
Returns whether it is the left orientation.
|
boolean |
isMaximalHeight()
Returns whether to use maximum height of all tabpanel in initial phase.
|
boolean |
isRight()
Returns whether it is the right orientation.
|
boolean |
isTabscroll()
Returns whether the tab scrolling is enabled.
|
boolean |
isTop()
Returns whether it is the top orientation.
|
boolean |
isVertical()
Returns whether it is a vertical tabbox.
|
protected TabboxEngine |
newTabboxEngine()
Instantiates the default tabbox engine.
|
void |
onChildRemoved(org.zkoss.zk.ui.Component child) |
void |
onInitRender() |
void |
onPageAttached(org.zkoss.zk.ui.Page newpage,
org.zkoss.zk.ui.Page oldpage) |
void |
onPageDetached(org.zkoss.zk.ui.Page page) |
void |
postOnInitRender()
Component internal use only.
|
protected void |
renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer) |
void |
setEngine(TabboxEngine engine)
Sets the tabbox engine for
ListModel |
void |
setMaximalHeight(boolean maximalHeight)
Sets whether to use maximum height of all tabpanel in initial phase.
|
void |
setModel(ListModel<?> model)
Sets the list model associated with this t.
|
void |
setMold(String mold)
Sets the mold.
|
void |
setOrient(String orient)
Sets the orient.
|
void |
setPanelSpacing(String panelSpacing)
Sets the spacing between
Tabpanel . |
void |
setSelectedIndex(int j)
Sets the selected index.
|
void |
setSelectedPanel(Tabpanel panel)
Sets the selected tab panel.
|
void |
setSelectedTab(Tab tab)
Sets the selected tab.
|
void |
setTabboxRenderer(String clsnm)
Sets the renderer by use of a class name.
|
void |
setTabboxRenderer(TabboxRenderer<?> renderer)
Sets the renderer which is used to render each tab and tabpanel if
getModel()
is not null. |
void |
setTabscroll(boolean tabscroll)
Sets whether to enable the tab scrolling.
|
getContext, getCtrlKeys, getPopup, getPropertyAccess, getTooltip, setContext, setContext, setContextAttributes, setCtrlKeys, setPopup, setPopup, setPopupAttributes, setTooltip, setTooltip, setTooltipAttributes
addSclass, focus, getAction, getDraggable, getDroppable, getExtraCtrl, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTabindex, getTabindexInteger, getTooltiptext, getTop, getVflex, getWidth, getZindex, getZIndex, removeSclass, removeSclass, service, setAction, setClass, setDraggable, setDroppable, setFocus, setHeight, setHeight0, setHeightDirectly, setHflex, setHflex0, setHflexDirectly, setLeft, setLeftDirectly, setRenderdefer, setSclass, setStyle, setTabindex, setTabindex, setTooltiptext, setTop, setTopDirectly, setVflex, setVflex0, setVflexDirectly, setWidth, setWidth0, setWidthDirectly, setZclass, setZindex, setZIndex, setZIndexDirectly
addAnnotation, addAnnotation, addCallback, addClientEvent, addEventHandler, addEventListener, addEventListener, addForward, addForward, addForward, addForward, addMoved, addRedrawCallback, addScopeListener, addShadowRoot, addShadowRootBefore, addSharedEventHandlerMap, appendChild, applyProperties, beforeChildRemoved, beforeParentChanged, detach, didActivate, didActivate, didDeserialize, didDeserialize, disableBindingAnnotation, disableClientUpdate, enableBindingAnnotation, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotation, getAnnotations, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getAutag, getCallback, getChildren, getClientAttribute, getClientDataAttribute, getClientEvents, getDefaultMold, getDefinition, getDesktop, getEventHandler, getEventHandlerNames, getEventListenerMap, getEventListeners, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getNextSibling, getPage, getParent, getPreviousSibling, getRedrawCallback, getRoot, getShadowFellowIfAny, getShadowRoots, getShadowVariable, getShadowVariable, getShadowVariable0, getSpaceOwner, getSpecialRendererOutput, getStubonly, getSubBindingAnnotationCount, getTemplate, getTemplateNames, getUuid, getWidgetAttribute, getWidgetAttributeNames, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttribute, hasAttributeOrFellow, hasBindingAnnotation, hasFellow, hasFellow, hasSubBindingAnnotation, invalidate, isChildable, isInvalidated, isListenerAvailable, isVisible, onChildAdded, onWrongValue, query, queryAll, redraw, redrawChildren, removeAttribute, removeAttribute, removeAttribute, removeCallback, removeChild, removeEventListener, removeForward, removeForward, removeRedrawCallback, removeScopeListener, removeShadowRoot, render, render, render, replace, response, response, response, service, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setAttribute, setAuService, setAutag, setClientAttribute, setClientDataAttribute, setDefinition, setDefinition, setId, setPage, setPageBefore, setParent, setStubonly, setStubonly, setSubBindingAnnotationCount, setTemplate, setVisible, setVisibleDirectly, setWidgetAttribute, setWidgetClass, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, toString, updateByClient, updateSubBindingAnnotationCount, willPassivate, willPassivate, willSerialize, willSerialize
public TabboxEngine getEngine() throws org.zkoss.zk.ui.UiException
org.zkoss.zk.ui.UiException
- if failed to load the engine.public void setEngine(TabboxEngine engine)
ListModel
protected TabboxEngine newTabboxEngine() throws org.zkoss.zk.ui.UiException
setEngine(org.zkoss.zul.impl.TabboxEngine)
is not called with non-null
engine.
By default, it looks up the library property called
org.zkoss.zul.tabbox.engine.class.
If found, the value is assumed to be
the class name of the tabbox engine (it must implement
TabboxEngine
).
If not found, UiException
is thrown.
Derived class might override this method to provide your own default class.
org.zkoss.zk.ui.UiException
- if failed to instantiate the enginepublic Selectable<Object> getSelectableModel()
public void setModel(ListModel<?> model)
model
- the list model to associate, or null to dissociate any
previous model.org.zkoss.zk.ui.UiException
- if failed to initialize with the modelpublic <T> TabboxRenderer<T> getTabboxRenderer()
public void setTabboxRenderer(TabboxRenderer<?> renderer)
getModel()
is not null. [ZK EE]
Note: changing a render will not cause the tabbox to re-render. If you
want it to re-render, you could assign the same model again (i.e.,
setModel(null) and than setModel(oldModel)), or fire an ListDataEvent
event.
renderer
- the renderer, or null to use the default.org.zkoss.zk.ui.UiException
- if failed to initialize with the modelpublic void setTabboxRenderer(String clsnm) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InstantiationException, InvocationTargetException
public void onInitRender()
public void postOnInitRender()
public <T> ListModel<T> getModel()
public Tabs getTabs()
public Toolbar getToolbar()
public Tabpanels getTabpanels()
public boolean isTabscroll()
public void setTabscroll(boolean tabscroll)
public boolean isMaximalHeight()
Default: false.
public void setMaximalHeight(boolean maximalHeight)
The Client ROD feature will be disabled if it is set to true.
public String getPanelSpacing()
Tabpanel
. This is used by certain
molds, such as accordion.
Default: null (no spacing).
public void setPanelSpacing(String panelSpacing)
Tabpanel
. This is used by certain molds,
such as accordion.public int getSelectedIndex()
public void setSelectedIndex(int j)
public Tabpanel getSelectedPanel()
public void setSelectedPanel(Tabpanel panel)
public Tab getSelectedTab()
public void setSelectedTab(Tab tab)
public String getOrient()
Default: "top".
Note: only the default mold supports it (not supported if accordion).
public void setMold(String mold)
setMold
in interface org.zkoss.zk.ui.Component
setMold
in class org.zkoss.zk.ui.AbstractComponent
mold
- default , accordion and accordion-litepublic void setOrient(String orient) throws org.zkoss.zk.ui.WrongValueException
orient
- either "top", "left", "bottom or "right".org.zkoss.zk.ui.WrongValueException
public boolean isHorizontal()
public boolean isTop()
public boolean isBottom()
public boolean isVertical()
public boolean isLeft()
public boolean isRight()
public String getZclass()
getZclass
in class org.zkoss.zk.ui.HtmlBasedComponent
public void beforeChildAdded(org.zkoss.zk.ui.Component child, org.zkoss.zk.ui.Component refChild)
beforeChildAdded
in interface org.zkoss.zk.ui.sys.ComponentCtrl
beforeChildAdded
in class org.zkoss.zk.ui.AbstractComponent
public boolean insertBefore(org.zkoss.zk.ui.Component child, org.zkoss.zk.ui.Component refChild)
insertBefore
in interface org.zkoss.zk.ui.Component
insertBefore
in class org.zkoss.zk.ui.AbstractComponent
public void onChildRemoved(org.zkoss.zk.ui.Component child)
onChildRemoved
in interface org.zkoss.zk.ui.sys.ComponentCtrl
onChildRemoved
in class org.zkoss.zk.ui.AbstractComponent
protected void clearSelectedTab()
public Object clone()
clone
in interface org.zkoss.zk.ui.Component
clone
in class XulElement
protected void renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer) throws IOException
renderProperties
in class XulElement
IOException
public void onPageAttached(org.zkoss.zk.ui.Page newpage, org.zkoss.zk.ui.Page oldpage)
onPageAttached
in interface org.zkoss.zk.ui.sys.ComponentCtrl
onPageAttached
in class org.zkoss.zk.ui.AbstractComponent
public void onPageDetached(org.zkoss.zk.ui.Page page)
onPageDetached
in interface org.zkoss.zk.ui.sys.ComponentCtrl
onPageDetached
in class org.zkoss.zk.ui.AbstractComponent
Copyright © 2019. All rights reserved.