javax.rad.genui.container
Class UITabsetPanel

java.lang.Object
  extended by javax.rad.genui.UIResource<C>
      extended by javax.rad.genui.UIComponent<C>
          extended by javax.rad.genui.UIContainer<ITabsetPanel>
              extended by javax.rad.genui.container.UITabsetPanel
All Implemented Interfaces:
ITranslatable, ITabsetPanel, IComponent, IContainer, IResource, INamedObject, ITranslator

public class UITabsetPanel
extends UIContainer<ITabsetPanel>
implements ITabsetPanel

Platform and technology independent TabSetPanel. It is designed for use with AWT, Swing, SWT, JSP, JSF, ... .


Field Summary
 
Fields inherited from class javax.rad.genui.UIContainer
allComponents, components
 
Fields inherited from class javax.rad.genui.UIComponent
bTranslate, lLastTranslationModified, parent, popupMenu
 
Fields inherited from class javax.rad.genui.UIResource
uiResource
 
Fields inherited from interface javax.rad.ui.container.ITabsetPanel
PLACEMENT_BOTTOM, PLACEMENT_LEFT, PLACEMENT_RIGHT, PLACEMENT_TOP, TAB_LAYOUT_SCROLL, TAB_LAYOUT_WRAP
 
Constructor Summary
  UITabsetPanel()
          Creates a new instance of UITabsetPanel.
protected UITabsetPanel(ITabsetPanel pPanel)
          Creates a new instance of UITabsetPanel with the given tabset panel.
 
Method Summary
 void add(IComponent pComponent, java.lang.Object pConstraints, int pIndex)
          Adds the specified IComponent to this container with the specified constraints at the specified index.
 void doTabClosed(UITabsetEvent pEvent)
          Notification that a tab was closed.
 void doTabMoved(UITabsetEvent pEvent)
          Notfication that a tab was moved.
 TabsetHandler<ITabActivatedListener> eventTabActivated()
          The TabsetHandler for the activated event.
 TabsetHandler<ITabClosedListener> eventTabClosed()
          The TabsetHandler for the closed event.
 TabsetHandler<ITabDeactivatedListener> eventTabDeactivated()
          The TabsetHandler for the activated event.
 TabsetHandler<ITabMovedListener> eventTabMoved()
          The TabsetHandler for the moved event.
 IImage getIconAt(int pIndex)
          Returns the tab icon at pIndex.
 int getSelectedIndex()
          Returns the currently selected index for this tabbedpane.
 int getTabLayoutPolicy()
          Returns the policy used by the tabbedpane to layout the tabs when all the tabs will not fit within a single run.
 int getTabPlacement()
          Gets the tab placement.
 java.lang.String getTextAt(int pIndex)
          Returns the tab text at pIndex.
 boolean isClosableAt(int pTabPosition)
          Returns whether a tab is closable.
 boolean isDragable()
          Returns whether the tabs are dragable.
 boolean isEnabledAt(int pTabPosition)
          Returns if a tab is en- or disabled.
 boolean isNavigationKeysEnabled()
          Determines whether the navigation with the keyboard is enabled.
 void remove(int pIndex)
          Removes the IComponent, specified by index, from this container.
 void setClosableAt(int pTabPosition, boolean pClosable)
          Sets a tab closable.
 void setClosableAtIfExists(int pTabPosition, boolean pClosable)
          Sets the tab closable, if it exists.
 void setDragable(boolean pDragable)
          Sets a tabs dragable.
 void setEnabledAt(int pTabPosition, boolean pEnabled)
          Sets a tab en- or disabled.
 void setEnabledAtIfExists(int pTabPosition, boolean pEnabled)
          Sets the tab enabled, if it exists.
 void setIconAt(int pIndex, IImage pImage)
          Sets the icon at pIndex to pImage which can be null.
 void setIconAtIfExists(int pIndex, IImage pImage)
          Sets the tab icon, if it exists.
 void setNavigationKeysEnabled(boolean pEnabled)
          En- or disables the tab navigation with the keyboard.
 void setSelectedIndex(int pIndex)
          Sets the selected index for this tabbedpane.
 void setSelectedIndexIfExists(int pIndex)
          Selects the tab, if it exists.
 void setTabLayoutPolicy(int pLayoutPolicy)
          Sets the policy which the tabbedpane will use in laying out the tabs when all the tabs will not fit within a single run.
 void setTabPlacement(int pPlacement)
          Sets the tab placement.
 void setTextAt(int pIndex, java.lang.String pText)
          Sets the text at pIndex to pText which can be null.
 void setTextAtIfExists(int pTabPosition, java.lang.String pText)
          Sets the tab text, if it exists.
 void updateTranslation()
          Notification for updating the translation.
 
Methods inherited from class javax.rad.genui.UIContainer
add, add, add, addInternal, addNotify, beforeAddNotify, checkAdd, contains, getComponent, getComponentCount, getComponents, getInsets, getLayout, getUIResourceContainer, indexOf, remove, removeAll, removeInternal, removeNotify, setLayout, setUIResourceContainer, setZOrder
 
Methods inherited from class javax.rad.genui.UIComponent
capture, createComponentName, createComponentNamePrefix, debug, doEventKey, doTriggerPopMenu, equals, error, eventComponentMoved, eventComponentResized, eventFocusGained, eventFocusLost, eventKey, eventKeyPressed, eventKeyReleased, eventKeyTyped, eventMouseClicked, eventMouseEntered, eventMouseExited, eventMousePressed, eventMouseReleased, getBackground, getBounds, getComponentUIResource, getCurrentTranslation, getCursor, getDefaultName, getEventSource, getExistingNames, getFactory, getFont, getForeground, getLocation, getLocationOffset, getLocationRelativeTo, getMaximumSize, getMinimumSize, getName, getParent, getPopupMenu, getPreferredSize, getResource, getRootName, getSize, getStyle, getTabIndex, getToolTipText, getTranslation, getUIComponent, hashCode, incrementNameIfExists, info, invokeAndWait, invokeAndWait, invokeInThread, invokeInThread, invokeLater, invokeLater, isBackgroundSet, isBeforeNotified, isCursorSet, isEnabled, isFocusable, isFontSet, isForegroundSet, isMaximumSizeSet, isMinimumSizeSet, isNotified, isPreferredSizeSet, isTranslationChanged, isTranslationEnabled, isVisible, requestFocus, setBackground, setBounds, setBounds, setCursor, setDefaultName, setEnabled, setEventSource, setFocusable, setFont, setForeground, setLocation, setLocation, setLocationRelativeTo, setMaximumSize, setMaximumSize, setMinimumSize, setMinimumSize, setName, setParent, setPopupMenu, setPreferredSize, setPreferredSize, setRootName, setSize, setSize, setStyle, setTabIndex, setToolTipText, setTranslation, setTranslationEnabled, setUIComponent, setVisible, translate
 
Methods inherited from class javax.rad.genui.UIResource
eventResourceChanged, eventResourceChanged, fireResourceChanged, getObject, getObjectNames, getUIResource, hasResourceHandler, putObject, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.rad.ui.IContainer
add, add, add, getComponent, getComponentCount, getLayout, indexOf, remove, removeAll, setLayout
 
Methods inherited from interface javax.rad.ui.IComponent
capture, eventComponentMoved, eventComponentResized, eventFocusGained, eventFocusLost, eventKeyPressed, eventKeyReleased, eventKeyTyped, eventMouseClicked, eventMouseEntered, eventMouseExited, eventMousePressed, eventMouseReleased, getBackground, getBounds, getCursor, getEventSource, getFactory, getFont, getForeground, getLocation, getLocationRelativeTo, getMaximumSize, getMinimumSize, getName, getParent, getPreferredSize, getSize, getStyle, getTabIndex, getToolTipText, isBackgroundSet, isCursorSet, isEnabled, isFocusable, isFontSet, isForegroundSet, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isVisible, requestFocus, setBackground, setBounds, setCursor, setEnabled, setEventSource, setFocusable, setFont, setForeground, setLocation, setLocationRelativeTo, setMaximumSize, setMinimumSize, setName, setParent, setPreferredSize, setSize, setStyle, setTabIndex, setToolTipText, setVisible
 
Methods inherited from interface javax.rad.ui.IResource
getResource
 

Constructor Detail

UITabsetPanel

public UITabsetPanel()
Creates a new instance of UITabsetPanel.

See Also:
ITabsetPanel

UITabsetPanel

protected UITabsetPanel(ITabsetPanel pPanel)
Creates a new instance of UITabsetPanel with the given tabset panel.

Parameters:
pPanel - the tabset panel
See Also:
ITabsetPanel
Method Detail

setTabPlacement

public void setTabPlacement(int pPlacement)
Sets the tab placement.

Specified by:
setTabPlacement in interface ITabsetPanel
Parameters:
pPlacement - one of the following values: ITabsetPanel.PLACEMENT_TOP, ITabsetPanel.PLACEMENT_LEFT, ITabsetPanel.PLACEMENT_RIGHT, ITabsetPanel.PLACEMENT_BOTTOM

getTabPlacement

public int getTabPlacement()
Gets the tab placement.

Specified by:
getTabPlacement in interface ITabsetPanel
Returns:
one of the following values: ITabsetPanel.PLACEMENT_TOP, ITabsetPanel.PLACEMENT_LEFT, ITabsetPanel.PLACEMENT_RIGHT, ITabsetPanel.PLACEMENT_BOTTOM

setEnabledAt

public void setEnabledAt(int pTabPosition,
                         boolean pEnabled)
Sets a tab en- or disabled.

Specified by:
setEnabledAt in interface ITabsetPanel
Parameters:
pTabPosition - the position of the tab
pEnabled - true to enable and false to disable the tab

isEnabledAt

public boolean isEnabledAt(int pTabPosition)
Returns if a tab is en- or disabled.

Specified by:
isEnabledAt in interface ITabsetPanel
Parameters:
pTabPosition - the position of the tab
Returns:
true if the tab is enabled or false if the tab is disabled

setTabLayoutPolicy

public void setTabLayoutPolicy(int pLayoutPolicy)
Sets the policy which the tabbedpane will use in laying out the tabs when all the tabs will not fit within a single run. Possible values are: The default value, if not set by the UI, is ITabsetPanel.TAB_LAYOUT_WRAP.

Specified by:
setTabLayoutPolicy in interface ITabsetPanel
Parameters:
pLayoutPolicy - the policy used to layout the tabs
See Also:
ITabsetPanel.getTabLayoutPolicy()

getTabLayoutPolicy

public int getTabLayoutPolicy()
Returns the policy used by the tabbedpane to layout the tabs when all the tabs will not fit within a single run.

Specified by:
getTabLayoutPolicy in interface ITabsetPanel
Returns:
the tab layout policy
See Also:
ITabsetPanel.setTabLayoutPolicy(int)

setSelectedIndex

public void setSelectedIndex(int pIndex)
Sets the selected index for this tabbedpane. The index must be a valid tab index or -1, which indicates that no tab should be selected (can also be used when there are no tabs in the tabbedpane). If a -1 value is specified when the tabbedpane contains one or more tabs, then the results will be implementation defined.

Specified by:
setSelectedIndex in interface ITabsetPanel
Parameters:
pIndex - the index to be selected
See Also:
ITabsetPanel.getSelectedIndex()

getSelectedIndex

public int getSelectedIndex()
Returns the currently selected index for this tabbedpane. Returns -1 if there is no currently selected tab.

Specified by:
getSelectedIndex in interface ITabsetPanel
Returns:
the index of the selected tab
See Also:
ITabsetPanel.setSelectedIndex(int)

getIconAt

public IImage getIconAt(int pIndex)
Returns the tab icon at pIndex.

Specified by:
getIconAt in interface ITabsetPanel
Parameters:
pIndex - the index of the item being queried
Returns:
the icon at pIndex
See Also:
ITabsetPanel.setIconAt(int, javax.rad.ui.IImage)

setIconAt

public void setIconAt(int pIndex,
                      IImage pImage)
Sets the icon at pIndex to pImage which can be null. This does not set disabled icon at icon. If the new Icon is different than the current Icon and disabled icon is not explicitly set, the LookAndFeel will be asked to generate a disabled Icon. To explicitly set disabled icon, use setDisableIconAt(). An internal exception is raised if there is no tab at that index.

Specified by:
setIconAt in interface ITabsetPanel
Parameters:
pIndex - the tab index where the icon should be set
pImage - the icon to be displayed in the tab
See Also:
ITabsetPanel.getIconAt(int)

setClosableAt

public void setClosableAt(int pTabPosition,
                          boolean pClosable)
Sets a tab closable.

Specified by:
setClosableAt in interface ITabsetPanel
Parameters:
pTabPosition - the position of the tab
pClosable - true to set closable and false to be not closable

isClosableAt

public boolean isClosableAt(int pTabPosition)
Returns whether a tab is closable.

Specified by:
isClosableAt in interface ITabsetPanel
Parameters:
pTabPosition - the position of the tab
Returns:
true if the tab is closable or false if the tab is not closable

setDragable

public void setDragable(boolean pDragable)
Sets a tabs dragable.

Specified by:
setDragable in interface ITabsetPanel
Parameters:
pDragable - true to set the tabs dragable and false prevent.

isDragable

public boolean isDragable()
Returns whether the tabs are dragable.

Specified by:
isDragable in interface ITabsetPanel
Returns:
true if the tabs are dragable or false if the they are not dragable.

setTextAt

public void setTextAt(int pIndex,
                      java.lang.String pText)
Sets the text at pIndex to pText which can be null.

Specified by:
setTextAt in interface ITabsetPanel
Parameters:
pIndex - the tab index where the text should be set
pText - the text to be displayed in the tab
See Also:
ITabsetPanel.getTextAt(int)

getTextAt

public java.lang.String getTextAt(int pIndex)
Returns the tab text at pIndex.

Specified by:
getTextAt in interface ITabsetPanel
Parameters:
pIndex - the index of the tab
Returns:
the text at pIndex
See Also:
ITabsetPanel.setTextAt(int, String)

setNavigationKeysEnabled

public void setNavigationKeysEnabled(boolean pEnabled)
En- or disables the tab navigation with the keyboard.

Specified by:
setNavigationKeysEnabled in interface ITabsetPanel
Parameters:
pEnabled - true to enable the navigation with the keyboard, otherwise false

isNavigationKeysEnabled

public boolean isNavigationKeysEnabled()
Determines whether the navigation with the keyboard is enabled.

Specified by:
isNavigationKeysEnabled in interface ITabsetPanel
Returns:
true if the keyboard navigation is enabled, otherwise false

eventTabClosed

public TabsetHandler<ITabClosedListener> eventTabClosed()
The TabsetHandler for the closed event. The TabClosed event occurs whenever a tab has been closed by the user.

Specified by:
eventTabClosed in interface ITabsetPanel
Returns:
the TabsetHandler for the closed event.

eventTabMoved

public TabsetHandler<ITabMovedListener> eventTabMoved()
The TabsetHandler for the moved event. The TabMoved event occurs always after a tab has been dragged.

Specified by:
eventTabMoved in interface ITabsetPanel
Returns:
the TabsetHandler for the moved event.

eventTabActivated

public TabsetHandler<ITabActivatedListener> eventTabActivated()
The TabsetHandler for the activated event. The TabActivated event occurs whenever a tab has been selected and became active.

Specified by:
eventTabActivated in interface ITabsetPanel
Returns:
the TabsetHandler for the activated event.

eventTabDeactivated

public TabsetHandler<ITabDeactivatedListener> eventTabDeactivated()
The TabsetHandler for the activated event. The TabDeactivated event occurs whenever a tab is not the selected/active tab any longer.

Specified by:
eventTabDeactivated in interface ITabsetPanel
Returns:
the TabsetHandler for the deactivated event.

add

public void add(IComponent pComponent,
                java.lang.Object pConstraints,
                int pIndex)
Adds the specified IComponent to this container with the specified constraints at the specified index. Also notifies the layout manager to add the component to the this container's layout using the specified constraints object.

Specified by:
add in interface IContainer
Overrides:
add in class UIContainer<ITabsetPanel>
Parameters:
pComponent - the IComponent to be added
pConstraints - an object expressing layout contraints for this
pIndex - the position in the container's list at which to insert the IComponent; -1 means insert at the end component
See Also:
IComponent

remove

public void remove(int pIndex)
Removes the IComponent, specified by index, from this container. This method also notifies the layout manager to remove the component from this container's layout via the removeLayoutComponent method.

Specified by:
remove in interface IContainer
Overrides:
remove in class UIContainer<ITabsetPanel>
Parameters:
pIndex - the index of the IComponent to be removed
See Also:
IContainer.add(javax.rad.ui.IComponent), IContainer.getComponentCount()

updateTranslation

public void updateTranslation()
Notification for updating the translation. This method will be called when the UIComponent will be added to a displayable containment hierarchy, when its containment hierarchy is made displayable or the translation table will be changed.

Overrides:
updateTranslation in class UIContainer<ITabsetPanel>
See Also:
UIComponent.setTranslation(TranslationMap), UIComponent.addNotify()

doTabClosed

public void doTabClosed(UITabsetEvent pEvent)
Notification that a tab was closed.

Parameters:
pEvent - the event from the tabset

doTabMoved

public void doTabMoved(UITabsetEvent pEvent)
Notfication that a tab was moved.

Parameters:
pEvent - the event from the tabset

setSelectedIndexIfExists

public void setSelectedIndexIfExists(int pIndex)
Selects the tab, if it exists.

Parameters:
pIndex - the tab position

setEnabledAtIfExists

public void setEnabledAtIfExists(int pTabPosition,
                                 boolean pEnabled)
Sets the tab enabled, if it exists.

Parameters:
pTabPosition - the tab position
pEnabled - true, if enabled.

setTextAtIfExists

public void setTextAtIfExists(int pTabPosition,
                              java.lang.String pText)
Sets the tab text, if it exists.

Parameters:
pTabPosition - the tab position
pText - the text

setIconAtIfExists

public void setIconAtIfExists(int pIndex,
                              IImage pImage)
Sets the tab icon, if it exists.

Parameters:
pIndex - the tab position
pImage - the image

setClosableAtIfExists

public void setClosableAtIfExists(int pTabPosition,
                                  boolean pClosable)
Sets the tab closable, if it exists.

Parameters:
pTabPosition - the tab position
pClosable - true, if closable


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.