com.vaadin.ui
Class TabSheet

java.lang.Object
  extended by com.vaadin.ui.AbstractComponent
      extended by com.vaadin.ui.AbstractComponentContainer
          extended by com.vaadin.ui.TabSheet
All Implemented Interfaces:
MethodEventSource, Paintable, Sizeable, VariableOwner, Component, ComponentContainer, Serializable, EventListener
Direct Known Subclasses:
Accordion

public class TabSheet
extends AbstractComponentContainer

Tabsheet component.

Since:
3.0
Version:
6.3.3
Author:
IT Mill Ltd.
See Also:
Serialized Form

Nested Class Summary
static interface TabSheet.CloseHandler
          CloseHandler is used to process tab closing events.
 class TabSheet.SelectedTabChangeEvent
          Selected Tab Change event.
static interface TabSheet.SelectedTabChangeListener
          Selected Tab Change Event listener
static interface TabSheet.Tab
           
 class TabSheet.TabSheetTabImpl
          TabSheet's implementation of Tab
 
Nested classes/interfaces inherited from class com.vaadin.ui.AbstractComponent
AbstractComponent.ComponentErrorEvent, AbstractComponent.ComponentErrorHandler
 
Nested classes/interfaces inherited from interface com.vaadin.ui.ComponentContainer
ComponentContainer.ComponentAttachEvent, ComponentContainer.ComponentAttachListener, ComponentContainer.ComponentDetachEvent, ComponentContainer.ComponentDetachListener
 
Nested classes/interfaces inherited from interface com.vaadin.ui.Component
Component.ErrorEvent, Component.ErrorListener, Component.Event, Component.Focusable, Component.Listener
 
Nested classes/interfaces inherited from interface com.vaadin.terminal.Paintable
Paintable.RepaintRequestEvent, Paintable.RepaintRequestListener
 
Field Summary
 
Fields inherited from interface com.vaadin.terminal.Sizeable
SIZE_UNDEFINED, UNIT_SYMBOLS, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS
 
Constructor Summary
TabSheet()
          Constructs a new Tabsheet.
 
Method Summary
 void addComponent(Component c)
          Adds a new tab into TabSheet.
 void addListener(TabSheet.SelectedTabChangeListener listener)
          Adds the selected tab change listener
 TabSheet.Tab addTab(Component c)
          Adds a new tab into TabSheet.
 TabSheet.Tab addTab(Component c, String caption, Resource icon)
          Adds a new tab into TabSheet.
 boolean areTabsHidden()
          Are tabs hidden.
 void changeVariables(Object source, Map variables)
          Invoked when the value of a variable has changed.
protected  void fireSelectedTabChange()
          Emits the options change event.
 Iterator<Component> getComponentIterator()
          Gets the component container iterator for going trough all the components in the container.
 Component getSelectedTab()
          Gets the selected tab.
 TabSheet.Tab getTab(Component c)
          Returns the Tab for the component.
 String getTabCaption(Component c)
          Deprecated. Use getTab(Component) and TabSheet.Tab.getCaption() instead.
 Resource getTabIcon(Component c)
          Deprecated. Use getTab(Component) and TabSheet.Tab.getIcon() instead.
 void hideTabs(boolean tabsHidden)
          Setter for property tabsHidden.
 void moveComponentsFrom(ComponentContainer source)
          Moves all components from another container to this container.
 void paintContent(PaintTarget target)
          Paints the content of this component.
 void removeComponent(Component c)
          Removes the component from this container.
 void removeListener(Paintable.RepaintRequestListener listener)
          Removes repaint request listener.
 void removeListener(TabSheet.SelectedTabChangeListener listener)
          Removes the selected tab change listener
 void replaceComponent(Component oldComponent, Component newComponent)
          Replaces the component in the container with another one without changing position.
 void setCloseHandler(TabSheet.CloseHandler handler)
          Provide a custom TabSheet.CloseHandler for this TabSheet if you wish to perform some additional tasks when a user clicks on a tabs close button, e.g.
 void setSelectedTab(Component c)
          Sets the selected tab.
 void setTabCaption(Component c, String caption)
          Deprecated. Use getTab(Component) and TabSheet.Tab.setCaption(String) instead.
 void setTabIcon(Component c, Resource icon)
          Deprecated. Use getTab(Component) and TabSheet.Tab.setIcon(Resource) instead.
 
Methods inherited from class com.vaadin.ui.AbstractComponentContainer
addListener, addListener, attach, detach, fireComponentAttachEvent, fireComponentDetachEvent, removeAllComponents, removeListener, removeListener, requestRepaintAll, setEnabled, setHeight, setWidth
 
Methods inherited from class com.vaadin.ui.AbstractComponent
addListener, addListener, addListener, addListener, addListener, addStyleName, childRequestedRepaint, fireComponentErrorEvent, fireComponentEvent, fireEvent, focus, getApplication, getCaption, getComponentError, getData, getDebugId, getDescription, getErrorHandler, getErrorMessage, getHeight, getHeightUnits, getIcon, getLocale, getParent, getStyle, getStyleName, getTag, getWidth, getWidthUnits, getWindow, handleError, isEnabled, isImmediate, isReadOnly, isVisible, paint, removeListener, removeListener, removeListener, removeListener, removeListener, removeStyleName, requestRepaint, requestRepaintRequests, setCaption, setComponentError, setData, setDebugId, setDescription, setErrorHandler, setHeight, setHeight, setHeightUnits, setIcon, setImmediate, setLocale, setParent, setReadOnly, setSizeFull, setSizeUndefined, setStyle, setStyleName, setVisible, setWidth, setWidth, setWidthUnits
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.vaadin.ui.Component
addListener, addStyleName, childRequestedRepaint, getApplication, getCaption, getIcon, getLocale, getParent, getStyleName, getWindow, isEnabled, isReadOnly, isVisible, removeListener, removeStyleName, setCaption, setIcon, setParent, setReadOnly, setStyleName, setVisible
 
Methods inherited from interface com.vaadin.terminal.Paintable
addListener, getDebugId, paint, requestRepaint, requestRepaintRequests, setDebugId
 
Methods inherited from interface com.vaadin.terminal.VariableOwner
isImmediate
 
Methods inherited from interface com.vaadin.terminal.Sizeable
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeight, setHeightUnits, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthUnits
 

Constructor Detail

TabSheet

public TabSheet()
Constructs a new Tabsheet. Tabsheet is immediate by default.

Method Detail

getComponentIterator

public Iterator<Component> getComponentIterator()
Gets the component container iterator for going trough all the components in the container.

Returns:
the Iterator of the components inside the container.

removeComponent

public void removeComponent(Component c)
Removes the component from this container.

Specified by:
removeComponent in interface ComponentContainer
Overrides:
removeComponent in class AbstractComponentContainer
Parameters:
c - the component to be removed.
See Also:
ComponentContainer.removeComponent(Component)

addComponent

public void addComponent(Component c)
Adds a new tab into TabSheet. Components caption and icon are rendered into tab.

Specified by:
addComponent in interface ComponentContainer
Overrides:
addComponent in class AbstractComponentContainer
Parameters:
c - the component to be added.
See Also:
ComponentContainer.addComponent(Component)

addTab

public TabSheet.Tab addTab(Component c,
                           String caption,
                           Resource icon)
Adds a new tab into TabSheet.

Parameters:
c - the component to be added onto tab.
caption - the caption to be set for the component and used rendered in tab bar
icon - the icon to be set for the component and used rendered in tab bar
Returns:
the created tab

addTab

public TabSheet.Tab addTab(Component c)
Adds a new tab into TabSheet. Components caption and icon are rendered into tab.

Parameters:
c - the component to be added onto tab.
Returns:
the created tab

moveComponentsFrom

public void moveComponentsFrom(ComponentContainer source)
Moves all components from another container to this container. The components are removed from the other container.

Specified by:
moveComponentsFrom in interface ComponentContainer
Overrides:
moveComponentsFrom in class AbstractComponentContainer
Parameters:
source - the container components are removed from.

paintContent

public void paintContent(PaintTarget target)
                  throws PaintException
Paints the content of this component.

Overrides:
paintContent in class AbstractComponent
Parameters:
event - the Paint Event.
Throws:
PaintException - if the paint operation failed.

areTabsHidden

public boolean areTabsHidden()
Are tabs hidden.

Returns:
the Property visibility.

hideTabs

public void hideTabs(boolean tabsHidden)
Setter for property tabsHidden.

Parameters:
tabsHidden - True if the tabs should be hidden.

getTabCaption

@Deprecated
public String getTabCaption(Component c)
Deprecated. Use getTab(Component) and TabSheet.Tab.getCaption() instead.

Gets the caption for a component.

Parameters:
c - the component.

setTabCaption

@Deprecated
public void setTabCaption(Component c,
                                     String caption)
Deprecated. Use getTab(Component) and TabSheet.Tab.setCaption(String) instead.

Sets tabs captions.

Parameters:
c - the component.
caption - the caption to set.

getTabIcon

@Deprecated
public Resource getTabIcon(Component c)
Deprecated. Use getTab(Component) and TabSheet.Tab.getIcon() instead.

Gets the icon for a component.

Parameters:
c - the component.

setTabIcon

@Deprecated
public void setTabIcon(Component c,
                                  Resource icon)
Deprecated. Use getTab(Component) and TabSheet.Tab.setIcon(Resource) instead.

Sets icon for the given component. Normally TabSheet uses icon from component

Parameters:
c - the component
icon - the icon to set

getTab

public TabSheet.Tab getTab(Component c)
Returns the Tab for the component. The Tab object can be used for setting caption,icon, etc for the tab.

Parameters:
c - the component
Returns:

setSelectedTab

public void setSelectedTab(Component c)
Sets the selected tab.

Parameters:
c -

getSelectedTab

public Component getSelectedTab()
Gets the selected tab.

Returns:
the selected tab.

changeVariables

public void changeVariables(Object source,
                            Map variables)
Invoked when the value of a variable has changed.

Specified by:
changeVariables in interface VariableOwner
Overrides:
changeVariables in class AbstractComponent
Parameters:
source - the Source of the variable change. This is the origin of the event. For example in Web Adapter this is the request.
variables - the Mapping from variable names to new variable values.
See Also:
AbstractComponent.changeVariables(java.lang.Object, java.util.Map)

replaceComponent

public void replaceComponent(Component oldComponent,
                             Component newComponent)
Description copied from interface: ComponentContainer
Replaces the component in the container with another one without changing position.

This method replaces component with another one is such way that the new component overtakes the position of the old component. If the old component is not in the container, the new component is added to the container. If the both component are already in the container, their positions are swapped. Component attach and detach events should be taken care as with add and remove.

Parameters:
oldComponent - the old component that will be replaced.
newComponent - the new component to be replaced.

addListener

public void addListener(TabSheet.SelectedTabChangeListener listener)
Adds the selected tab change listener

Parameters:
listener - the Listener to be added.

removeListener

public void removeListener(TabSheet.SelectedTabChangeListener listener)
Removes the selected tab change listener

Parameters:
listener - the Listener to be removed.

fireSelectedTabChange

protected void fireSelectedTabChange()
Emits the options change event.


removeListener

public void removeListener(Paintable.RepaintRequestListener listener)
Description copied from interface: Paintable
Removes repaint request listener.

Specified by:
removeListener in interface Paintable
Overrides:
removeListener in class AbstractComponent
Parameters:
listener - the listener to be removed.

setCloseHandler

public void setCloseHandler(TabSheet.CloseHandler handler)
Provide a custom TabSheet.CloseHandler for this TabSheet if you wish to perform some additional tasks when a user clicks on a tabs close button, e.g. show a confirmation dialogue before removing the tab. To remove the tab, if you provide your own close handler, you must call removeComponent(Component) yourself. The default CloseHandler for TabSheet will only remove the tab.

Parameters:
handler -


Copyright © 2000-2010 IT Mill Ltd. All Rights Reserved.