|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.araneaframework.core.BaseComponent
org.araneaframework.core.BaseService
org.araneaframework.core.BaseWidget
org.araneaframework.core.BaseApplicationWidget
org.araneaframework.uilib.tab.TabContainerWidget
public class TabContainerWidget
This class represents a UI widget that contains tabs (TabWidget)s.
Only one tab can be selected (active) at a time, such tab is specified with
selectTab(String). When on creation the selected tab is not
specified, the first tab is marked as selected. Tabs are added with
addTab(String, String, Widget), removed with
removeTab(String) and disabled (user cannot select them) with
disableTab(String). By default tabs preserve the addition order and
are also presented in that order. When this TabContainerWidget has a
Comparator set, it will sort and present the tabs in an order
specified by that Comparator.
| Nested Class Summary | |
|---|---|
protected class |
TabContainerWidget.ComponentImpl
|
protected class |
TabContainerWidget.SelectionEventListener
Tab selection listener. |
class |
TabContainerWidget.TabSwitchClosure
This closure handles tab switching of this instance of TabContainerWidget. |
| Nested classes/interfaces inherited from class org.araneaframework.core.BaseApplicationWidget |
|---|
BaseApplicationWidget.CompositeImpl, BaseApplicationWidget.ViewableImpl, BaseApplicationWidget.ViewModel |
| Nested classes/interfaces inherited from class org.araneaframework.core.BaseWidget |
|---|
BaseWidget.WidgetImpl |
| Nested classes/interfaces inherited from class org.araneaframework.core.BaseService |
|---|
BaseService.ServiceImpl |
| Nested classes/interfaces inherited from interface org.araneaframework.uilib.tab.TabContainerContext |
|---|
TabContainerContext.TabSwitchListener |
| Nested classes/interfaces inherited from interface org.araneaframework.core.ApplicationWidget |
|---|
ApplicationWidget.WidgetViewModel |
| Nested classes/interfaces inherited from interface org.araneaframework.core.ApplicationService |
|---|
ApplicationService.ServiceViewModel |
| Nested classes/interfaces inherited from interface org.araneaframework.core.ApplicationComponent |
|---|
ApplicationComponent.ComponentViewModel |
| Nested classes/interfaces inherited from interface org.araneaframework.Composite |
|---|
Composite.CompositeComponent, Composite.CompositeService, Composite.CompositeWidget |
| Nested classes/interfaces inherited from interface org.araneaframework.Viewable |
|---|
Viewable.ViewableComponent, Viewable.ViewableService, Viewable.ViewableWidget |
| Nested classes/interfaces inherited from interface org.araneaframework.Widget |
|---|
Widget.Interface |
| Field Summary | |
|---|---|
protected String |
defaultSelectedTabId
|
protected boolean |
dying
This is just to make sure that we do not initialize ANY tabs after destroying process has already begun. |
protected TabWidget |
selected
|
static String |
TAB_SELECT_EVENT_ID
|
protected Map |
tabs
|
protected TabContainerContext.TabSwitchListener |
tabSwitchListener
|
| Fields inherited from class org.araneaframework.core.BaseService |
|---|
currentInputData, currentOutputData |
| Fields inherited from interface org.araneaframework.core.ApplicationWidget |
|---|
EVENT_HANDLER_ID_KEY, EVENT_PARAMETER_KEY, EVENT_PATH_KEY |
| Fields inherited from interface org.araneaframework.core.ApplicationService |
|---|
ACTION_HANDLER_ID_KEY, ACTION_PARAMETER_KEY, ACTION_PATH_KEY |
| Constructor Summary | |
|---|---|
TabContainerWidget()
|
|
TabContainerWidget(Comparator comparator)
|
|
| Method Summary | |
|---|---|
Component.Interface |
_getComponent()
The factory method returning the implementation of the Component. |
void |
addTab(String id,
String labelId,
Widget contentWidget)
Adds the stateful tab with specified identifier. |
void |
addTab(String id,
String labelId,
WidgetFactory contentWidgetFactory)
Adds the stateless (content widget is destroyed when tab is deselected) tab with specified identifier. |
void |
addTab(String id,
Widget labelWidget,
Widget contentWidget)
Adds the stateful tab with specified identifier. |
void |
addTab(String id,
Widget labelWidget,
WidgetFactory contentWidgetFactory)
Adds the stateless (content widget is destroyed when tab is deselected) tab with specified identifier. |
boolean |
disableTab(String id)
Disables the tab with given id — the label be shown but tab cannot be selected before it is enabled again. |
void |
disableWidget(Object key)
Overrides for disableWidget()/enableWidget() |
boolean |
enableTab(String id)
Enables the tab with the id that previously was disabled. |
void |
enableWidget(Object key)
Enables the widget with the specified key. |
protected Environment |
getChildWidgetEnvironment()
Returns the widget's Environment by default. |
String |
getDefaultSelectedTabId()
Provides the current default ID of a tab that will be automatically selected once added. |
TabContext |
getSelectedTab()
Returns the currently selected tab widget, which is the container for the widget that was added using the addTab(..) method. |
Map |
getTabs()
Returns all the tabs present in this TabContainerContext. |
TabContainerContext.TabSwitchListener |
getTabSwitchListener()
Returns the current listener for tab switch events. |
boolean |
isTabSelected(String id)
Specifies whether the specified tab is currently active (selected). |
TabWidget |
registerTab(TabWidget tabWidget)
Invoked by TabWidget when it is initialized. |
boolean |
removeTab(String id)
Removes tab with given id. |
protected void |
selectFirst()
|
boolean |
selectTab(String id)
Switches selected tab to one identified by id. |
void |
setDefaultSelectedTabId(String defaultSelectedTabId)
Sets a default ID of a tab that will be automatically selected once added. |
void |
setTabSwitchListener(TabContainerContext.TabSwitchListener tabSwitchListener)
Sets the listener for tab switch events. |
TabWidget |
unregisterTab(TabWidget tabWidget)
Invoked by TabWidget when it is destroyed. |
| Methods inherited from class org.araneaframework.core.BaseApplicationWidget |
|---|
_getComposite, _getViewable, action, addActionListener, addEventListener, addWidget, addWidget, clearActionListeners, clearEventlisteners, clearGlobalEventListener, event, getActionId, getChildEnvironment, getChildren, getEnvironment, getEventId, getViewModel, getWidget, handleAction, handleEvent, handleUpdate, propagate, putViewData, putViewDataOnce, removeActionListener, removeEventListener, removeViewData, removeWidget, render, setGlobalEventListener, update |
| Methods inherited from class org.araneaframework.core.BaseWidget |
|---|
_getWidget, getInputData, getOutputData, handleWidgetException |
| Methods inherited from class org.araneaframework.core.BaseService |
|---|
_getService, handleServiceException |
| Methods inherited from class org.araneaframework.core.BaseComponent |
|---|
_addComponent, _addComponent, _checkCall, _disableComponent, _enableComponent, _endCall, _endWaitingCall, _getChildren, _getDisabledChildren, _propagate, _relocateComponent, _removeComponent, _setEnvironment, _setScope, _startCall, _startWaitingCall, _strictCheckCall, _strictStartCall, _waitNoCall, destroy, disable, enable, getScope, handleException, init, isAlive, isDead, isInitialized |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.araneaframework.Widget |
|---|
_getWidget |
| Methods inherited from interface org.araneaframework.Service |
|---|
_getService |
| Methods inherited from interface org.araneaframework.Component |
|---|
getScope, isAlive |
| Field Detail |
|---|
public static final String TAB_SELECT_EVENT_ID
protected Map tabs
protected TabWidget selected
protected String defaultSelectedTabId
protected TabContainerContext.TabSwitchListener tabSwitchListener
protected transient boolean dying
| Constructor Detail |
|---|
public TabContainerWidget()
public TabContainerWidget(Comparator comparator)
| Method Detail |
|---|
protected Environment getChildWidgetEnvironment()
throws Exception
BaseApplicationWidget
getChildWidgetEnvironment in class BaseApplicationWidgetExceptionprotected void selectFirst()
public void addTab(String id,
String labelId,
Widget contentWidget)
TabContainerContext
addTab in interface TabContainerContextid - tab identifierlabelId - key to resource text to be used as tab labelcontentWidget - tab's content widget
public void addTab(String id,
String labelId,
WidgetFactory contentWidgetFactory)
TabContainerContext
addTab in interface TabContainerContextid - tab identifierlabelId - key to resource text to be used as tab labelcontentWidgetFactory - WidgetFactory that produces tab's
contents.
public void addTab(String id,
Widget labelWidget,
Widget contentWidget)
TabContainerContext
addTab in interface TabContainerContextid - tab identifierlabelWidget - tab's label widgetcontentWidget - tab's content widget
public void addTab(String id,
Widget labelWidget,
WidgetFactory contentWidgetFactory)
TabContainerContext
addTab in interface TabContainerContextid - tab identifierlabelWidget - tab's label widgetpublic boolean disableTab(String id)
TabContainerContext
disableTab in interface TabContainerContextpublic boolean enableTab(String id)
TabContainerContext
enableTab in interface TabContainerContextpublic boolean removeTab(String id)
TabContainerContext
removeTab in interface TabContainerContextpublic boolean selectTab(String id)
TabContainerContext
selectTab in interface TabContainerContextpublic boolean isTabSelected(String id)
TabContainerContext
isTabSelected in interface TabContainerContextpublic TabContext getSelectedTab()
TabContainerContextaddTab(..) method.
getSelectedTab in interface TabContainerContextTabContext.public Map getTabs()
TabContainerContextTabContainerContext. Keys in
the map are tab identifiers, values are implementation dependent structures
that hold tab information. Returned Map must be
unmodifiable.
getTabs in interface TabContainerContextpublic String getDefaultSelectedTabId()
null value means that no default ID is
used.
public void setDefaultSelectedTabId(String defaultSelectedTabId)
null value means that no default ID is used. Should be
called before tabs are added.
defaultSelectedTabId - selectTab(String)public void setTabSwitchListener(TabContainerContext.TabSwitchListener tabSwitchListener)
TabContainerContexttabSwitchListener parameter cannot be
null. Tab switch occurs when the currently
selected tab changes.
setTabSwitchListener in interface TabContainerContexttabSwitchListener - A listener for listening tab switch events.public TabContainerContext.TabSwitchListener getTabSwitchListener()
TabContainerContext
getTabSwitchListener in interface TabContainerContextpublic TabWidget registerTab(TabWidget tabWidget)
TabRegistrationContextTabWidget when it is initialized.
registerTab in interface TabRegistrationContextTabRegistrationContext.registerTab(org.araneaframework.uilib.tab.TabWidget)public TabWidget unregisterTab(TabWidget tabWidget)
TabRegistrationContextTabWidget when it is destroyed.
unregisterTab in interface TabRegistrationContextTabRegistrationContext.unregisterTab(org.araneaframework.uilib.tab.TabWidget)public void disableWidget(Object key)
disableWidget in class BaseApplicationWidgetpublic void enableWidget(Object key)
BaseApplicationWidget
enableWidget in class BaseApplicationWidgetpublic Component.Interface _getComponent()
Component
_getComponent in interface Component_getComponent in class BaseComponent
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||