net.pleso.framework.client.ui.controls.tabcontrol
Class TabPanel

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.google.gwt.user.client.ui.Composite
              extended by net.pleso.framework.client.ui.controls.tabcontrol.TabPanel
All Implemented Interfaces:
com.google.gwt.user.client.EventListener, com.google.gwt.user.client.ui.HasWidgets, com.google.gwt.user.client.ui.IndexedPanel, com.google.gwt.user.client.ui.SourcesTabEvents, com.google.gwt.user.client.ui.TabListener, RemoveTabListener

public class TabPanel
extends com.google.gwt.user.client.ui.Composite
implements com.google.gwt.user.client.ui.TabListener, com.google.gwt.user.client.ui.SourcesTabEvents, com.google.gwt.user.client.ui.HasWidgets, com.google.gwt.user.client.ui.IndexedPanel, RemoveTabListener

A panel that represents a tabbed set of pages, each of which contains another widget. Its child widgets are shown as the user selects the various tabs associated with them. The tabs can contain arbitrary HTML. Modified for "Close tab" button functionality.

Note that this widget is not a panel per se, but rather a Composite that aggregates a TabBar and a DeckPanel. It does, however, implement HasWidgets.

CSS Style Rules

Example


Constructor Summary
TabPanel()
          Creates an empty tab panel.
 
Method Summary
 void add(com.google.gwt.user.client.ui.Widget w)
           
 void add(com.google.gwt.user.client.ui.Widget w, java.lang.String tabText)
          Adds a widget to the tab panel.
 void add(com.google.gwt.user.client.ui.Widget w, java.lang.String tabText, boolean asHTML)
          Adds a widget to the tab panel.
 void addTabListener(com.google.gwt.user.client.ui.TabListener listener)
           
 void clear()
           
 void fireBeforeRemoveTab(int index)
          Calls when before remove tab event
 com.google.gwt.user.client.ui.DeckPanel getDeckPanel()
          Gets the deck panel within this tab panel.
 RemoveTabListener getRemoveTabListener()
           
 TabBar getTabBar()
          Gets the tab bar within this tab panel.
 com.google.gwt.user.client.ui.Widget getWidget(int index)
           
 int getWidgetCount()
           
 int getWidgetIndex(com.google.gwt.user.client.ui.Widget widget)
           
 void insert(com.google.gwt.user.client.ui.Widget widget, java.lang.String tabText, boolean asHTML, int beforeIndex)
          Inserts a widget into the tab panel.
 void insert(com.google.gwt.user.client.ui.Widget widget, java.lang.String tabText, int beforeIndex)
          Inserts a widget into the tab panel.
 java.util.Iterator iterator()
           
 boolean onBeforeTabSelected(com.google.gwt.user.client.ui.SourcesTabEvents sender, int tabIndex)
           
 void onTabSelected(com.google.gwt.user.client.ui.SourcesTabEvents sender, int tabIndex)
           
 boolean remove(int index)
           
 boolean remove(com.google.gwt.user.client.ui.Widget widget)
          Removes the given widget, and its associated tab.
 void removeTabListener(com.google.gwt.user.client.ui.TabListener listener)
           
 void selectTab(int index)
          Programmatically selects the specified tab.
 void setRemoveTabListener(RemoveTabListener removeTabListener)
           
 
Methods inherited from class com.google.gwt.user.client.ui.Composite
getElement
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
getParent, isAttached, onBrowserEvent, removeFromParent
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleName, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleName, getTitle, isVisible, isVisible, removeStyleName, setHeight, setPixelSize, setSize, setStyleName, setTitle, setVisible, setVisible, setWidth, sinkEvents, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TabPanel

public TabPanel()
Creates an empty tab panel.

Method Detail

add

public void add(com.google.gwt.user.client.ui.Widget w)
Specified by:
add in interface com.google.gwt.user.client.ui.HasWidgets

add

public void add(com.google.gwt.user.client.ui.Widget w,
                java.lang.String tabText)
Adds a widget to the tab panel.

Parameters:
w - the widget to be added
tabText - the text to be shown on its tab

add

public void add(com.google.gwt.user.client.ui.Widget w,
                java.lang.String tabText,
                boolean asHTML)
Adds a widget to the tab panel.

Parameters:
w - the widget to be added
tabText - the text to be shown on its tab
asHTML - true to treat the specified text as HTML

addTabListener

public void addTabListener(com.google.gwt.user.client.ui.TabListener listener)
Specified by:
addTabListener in interface com.google.gwt.user.client.ui.SourcesTabEvents

clear

public void clear()
Specified by:
clear in interface com.google.gwt.user.client.ui.HasWidgets

getDeckPanel

public com.google.gwt.user.client.ui.DeckPanel getDeckPanel()
Gets the deck panel within this tab panel.

Returns:
the deck panel

getTabBar

public TabBar getTabBar()
Gets the tab bar within this tab panel.

Returns:
the tab bar

getWidget

public com.google.gwt.user.client.ui.Widget getWidget(int index)
Specified by:
getWidget in interface com.google.gwt.user.client.ui.IndexedPanel

getWidgetCount

public int getWidgetCount()
Specified by:
getWidgetCount in interface com.google.gwt.user.client.ui.IndexedPanel

getWidgetIndex

public int getWidgetIndex(com.google.gwt.user.client.ui.Widget widget)
Specified by:
getWidgetIndex in interface com.google.gwt.user.client.ui.IndexedPanel

insert

public void insert(com.google.gwt.user.client.ui.Widget widget,
                   java.lang.String tabText,
                   boolean asHTML,
                   int beforeIndex)
Inserts a widget into the tab panel.

Parameters:
widget - the widget to be inserted
tabText - the text to be shown on its tab
asHTML - true to treat the specified text as HTML
beforeIndex - the index before which it will be inserted

insert

public void insert(com.google.gwt.user.client.ui.Widget widget,
                   java.lang.String tabText,
                   int beforeIndex)
Inserts a widget into the tab panel.

Parameters:
widget - the widget to be inserted
tabText - the text to be shown on its tab
beforeIndex - the index before which it will be inserted

iterator

public java.util.Iterator iterator()
Specified by:
iterator in interface com.google.gwt.user.client.ui.HasWidgets

onBeforeTabSelected

public boolean onBeforeTabSelected(com.google.gwt.user.client.ui.SourcesTabEvents sender,
                                   int tabIndex)
Specified by:
onBeforeTabSelected in interface com.google.gwt.user.client.ui.TabListener

onTabSelected

public void onTabSelected(com.google.gwt.user.client.ui.SourcesTabEvents sender,
                          int tabIndex)
Specified by:
onTabSelected in interface com.google.gwt.user.client.ui.TabListener

remove

public boolean remove(int index)
Specified by:
remove in interface com.google.gwt.user.client.ui.IndexedPanel

remove

public boolean remove(com.google.gwt.user.client.ui.Widget widget)
Removes the given widget, and its associated tab.

Specified by:
remove in interface com.google.gwt.user.client.ui.HasWidgets
Parameters:
widget - the widget to be removed

removeTabListener

public void removeTabListener(com.google.gwt.user.client.ui.TabListener listener)
Specified by:
removeTabListener in interface com.google.gwt.user.client.ui.SourcesTabEvents

selectTab

public void selectTab(int index)
Programmatically selects the specified tab.

Parameters:
index - the index of the tab to be selected

getRemoveTabListener

public RemoveTabListener getRemoveTabListener()

setRemoveTabListener

public void setRemoveTabListener(RemoveTabListener removeTabListener)

fireBeforeRemoveTab

public void fireBeforeRemoveTab(int index)
Description copied from interface: RemoveTabListener
Calls when before remove tab event

Specified by:
fireBeforeRemoveTab in interface RemoveTabListener
Parameters:
index - index of tab


Copyright © 2006-2007 pleso.net crew All Rights Reserved.