de.lessvoid.nifty.controls.tabs
Class TabsControl

java.lang.Object
  extended by de.lessvoid.nifty.controls.AbstractController
      extended by de.lessvoid.nifty.controls.tabs.TabsControl
All Implemented Interfaces:
Controller, NiftyControl, Tabs, org.bushe.swing.event.EventTopicSubscriber<ElementShowEvent>

public class TabsControl
extends AbstractController
implements Tabs, org.bushe.swing.event.EventTopicSubscriber<ElementShowEvent>

Author:
ractoc

Constructor Summary
TabsControl()
           
 
Method Summary
 void addTab(Element tab)
          Adds a single tab to the end of the Tab list.
 void bind(Nifty nifty, Screen screen, Element element, Properties parameter, Attributes controlDefinitionAttributes)
           
 String getSelectedTab()
          Gets the selected tab to the specified index.
 int getSelectedTabIndex()
          Gets the selected tab to the specified index.
 void init(Properties prprts, Attributes atrbts)
           
 boolean inputEvent(NiftyInputEvent inputEvent)
           
 void onEvent(String topic, ElementShowEvent data)
           
 void onStartScreen()
           
 void removeTab(int index)
          Removes the tab at the specified index.
 void removeTab(String tabId)
           
 void setSelectedTab(int index)
          Sets the selected tab to the specified index.
 void setSelectedTab(String tabId)
          Sets the selected tab based on the tabId;
 void switchTab(String tabId)
          Method used to switch between tabs.
 
Methods inherited from class de.lessvoid.nifty.controls.AbstractController
bind, disable, enable, getElement, getHeight, getId, getStyle, getWidth, hasFocus, isBound, isEnabled, layoutCallback, onFocus, setEnabled, setFocus, setFocusable, setHeight, setId, setStyle, setWidth
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.lessvoid.nifty.controls.NiftyControl
disable, enable, getElement, getHeight, getId, getStyle, getWidth, hasFocus, isBound, isEnabled, layoutCallback, setEnabled, setFocus, setFocusable, setHeight, setId, setStyle, setWidth
 

Constructor Detail

TabsControl

public TabsControl()
Method Detail

bind

public void bind(Nifty nifty,
                 Screen screen,
                 Element element,
                 Properties parameter,
                 Attributes controlDefinitionAttributes)
Specified by:
bind in interface Controller

init

public void init(Properties prprts,
                 Attributes atrbts)
Specified by:
init in interface Controller
Overrides:
init in class AbstractController

onStartScreen

public void onStartScreen()
Specified by:
onStartScreen in interface Controller

inputEvent

public boolean inputEvent(NiftyInputEvent inputEvent)
Specified by:
inputEvent in interface Controller

addTab

public void addTab(Element tab)
Description copied from interface: Tabs
Adds a single tab to the end of the Tab list.

Specified by:
addTab in interface Tabs
Parameters:
tab - Tab to be added.

removeTab

public void removeTab(int index)
Description copied from interface: Tabs
Removes the tab at the specified index.

Specified by:
removeTab in interface Tabs
Parameters:
index - Index of the tab to remove.

removeTab

public void removeTab(String tabId)

setSelectedTab

public void setSelectedTab(int index)
Description copied from interface: Tabs
Sets the selected tab to the specified index.

Specified by:
setSelectedTab in interface Tabs
Parameters:
index - The index of the tab to make the selected tab.

setSelectedTab

public void setSelectedTab(String tabId)
Description copied from interface: Tabs
Sets the selected tab based on the tabId;

Specified by:
setSelectedTab in interface Tabs
Parameters:
tabId - The TabId of the tab to make the selected tab.

getSelectedTab

public String getSelectedTab()
Description copied from interface: Tabs
Gets the selected tab to the specified index.

Specified by:
getSelectedTab in interface Tabs
Returns:
The id of the selected tab.

getSelectedTabIndex

public int getSelectedTabIndex()
Description copied from interface: Tabs
Gets the selected tab to the specified index.

Specified by:
getSelectedTabIndex in interface Tabs
Returns:
The index of the selected tab.

switchTab

public void switchTab(String tabId)
Method used to switch between tabs. This method is called when the tab caption button is clicked.

Parameters:
tabId - The id of the tab this button is linked to.

onEvent

public void onEvent(String topic,
                    ElementShowEvent data)
Specified by:
onEvent in interface org.bushe.swing.event.EventTopicSubscriber<ElementShowEvent>


Copyright © 2011. All Rights Reserved.