org.araneaframework.uilib.tab
Interface TabContainerContext

All Superinterfaces:
Serializable
All Known Implementing Classes:
TabContainerWidget

public interface TabContainerContext
extends Serializable

This context represents interface of tab management component.

Since:
1.1
Author:
Taimo Peelo (taimo@araneaframework.org)

Nested Class Summary
static interface TabContainerContext.TabSwitchListener
          An interface for tab switch listeners.
 
Method Summary
 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.
 boolean enableTab(String id)
          Enables the tab with the id that previously was disabled.
 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).
 boolean removeTab(String id)
          Removes tab with given id.
 boolean selectTab(String id)
          Switches selected tab to one identified by id.
 void setTabSwitchListener(TabContainerContext.TabSwitchListener tabSwitchListener)
          Sets the listener for tab switch events.
 

Method Detail

addTab

void addTab(String id,
            String labelId,
            Widget contentWidget)
Adds the stateful tab with specified identifier.

Parameters:
id - tab identifier
labelId - key to resource text to be used as tab label
contentWidget - tab's content widget

addTab

void addTab(String id,
            Widget labelWidget,
            Widget contentWidget)
Adds the stateful tab with specified identifier.

Parameters:
id - tab identifier
labelWidget - tab's label widget
contentWidget - tab's content widget

addTab

void addTab(String id,
            String labelId,
            WidgetFactory contentWidgetFactory)
Adds the stateless (content widget is destroyed when tab is deselected) tab with specified identifier.

Parameters:
id - tab identifier
labelId - key to resource text to be used as tab label
contentWidgetFactory - WidgetFactory that produces tab's contents.

addTab

void addTab(String id,
            Widget labelWidget,
            WidgetFactory contentWidgetFactory)
Adds the stateless (content widget is destroyed when tab is deselected) tab with specified identifier.

Parameters:
id - tab identifier
labelWidget - tab's label widget
contentWidgetFactory -

removeTab

boolean removeTab(String id)
Removes tab with given id.

Returns:
whether the tab existed and was really removed

disableTab

boolean disableTab(String id)
Disables the tab with given id — the label be shown but tab cannot be selected before it is enabled again.

Returns:
whether tab with given id existed

enableTab

boolean enableTab(String id)
Enables the tab with the id that previously was disabled.

Returns:
whether the tab with given id existed.

selectTab

boolean selectTab(String id)
Switches selected tab to one identified by id.

Returns:
whether tab with given id existed.

isTabSelected

boolean isTabSelected(String id)
Specifies whether the specified tab is currently active (selected).

Returns:
whether the specified tab is currently active (selected).

getSelectedTab

TabContext getSelectedTab()
Returns the currently selected tab widget, which is the container for the widget that was added using the addTab(..) method.

Returns:
The currently selected TabContext.

getTabs

Map getTabs()
Returns all the tabs present in this TabContainerContext. Keys in the map are tab identifiers, values are implementation dependent structures that hold tab information. Returned Map must be unmodifiable.

Returns:
A map of tabs.

setTabSwitchListener

void setTabSwitchListener(TabContainerContext.TabSwitchListener tabSwitchListener)
Sets the listener for tab switch events. There can be only one listener per tab container. The tabSwitchListener parameter cannot be null. Tab switch occurs when the currently selected tab changes.

Parameters:
tabSwitchListener - A listener for listening tab switch events.
Since:
1.2.2

getTabSwitchListener

TabContainerContext.TabSwitchListener getTabSwitchListener()
Returns the current listener for tab switch events.

Returns:
the current listener for tab switch events.
Since:
1.2.2