|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.lwuit.Component com.sun.lwuit.Container com.sun.lwuit.TabbedPane
public class TabbedPane
A component that lets the user switch between a group of components by clicking on a tab with a given title and/or icon.
Tabs/components are added to a TabbedPane
object by using the
addTab
and insertTab
methods.
A tab is represented by an index corresponding
to the position it was added in, where the first tab has an index equal to 0
and the last tab has an index equal to the tab count minus 1.
The TabbedPane
uses a SingleSelectionModel
to represent the set of tab indices and the currently selected index.
If the tab count is greater than 0, then there will always be a selected
index, which by default will be initialized to the first tab.
If the tab count is 0, then the selected index will be -1.
Field Summary |
---|
Fields inherited from class com.sun.lwuit.Component |
---|
BOTTOM, BRB_CENTER_OFFSET, BRB_CONSTANT_ASCENT, BRB_CONSTANT_DESCENT, BRB_OTHER, CENTER, LEFT, RIGHT, TOP |
Constructor Summary | |
---|---|
TabbedPane()
Deprecated. Creates an empty TabbedPane with a default
tab placement of Component.TOP . |
|
TabbedPane(int tabPlacement)
Deprecated. Creates an empty TabbedPane with the specified tab placement
of either: Component.TOP , Component.BOTTOM ,
Component.LEFT , or Component.RIGHT . |
Method Summary | |
---|---|
void |
addTab(java.lang.String title,
Component component)
Deprecated. Adds a component
represented by a title and no icon . |
void |
addTab(java.lang.String title,
Image icon,
Component component)
Deprecated. Adds a component
represented by a title and/or icon ,
either of which can be null . |
void |
addTabsListener(SelectionListener listener)
Deprecated. This method adds a listener to the tabs. |
boolean |
animate()
Deprecated. Allows the animation to reduce "repaint" calls when it returns false. |
protected Dimension |
calcPreferredSize()
Deprecated. Calculates the preferred size based on component content. |
int |
getSelectedIndex()
Deprecated. Returns the currently selected index for this tabbedpane. |
int |
getTabbedPaneBorderWidth()
Deprecated. The TabbedPane surrounded border width |
Component |
getTabComponentAt(int index)
Deprecated. Returns the tab at index . |
int |
getTabCount()
Deprecated. Returns the number of tabs in this tabbedpane . |
int |
getTabPlacement()
Deprecated. Returns the placement of the tabs for this tabbedpane. |
Transition |
getTransitionLeft()
Deprecated. Indicates the transition to use when switching between tabs from right to left. |
Transition |
getTransitionRight()
Deprecated. Indicates the transition to use when switching between tabs from left to right. |
boolean |
hasFocus()
Deprecated. Returns true if the component has focus |
int |
indexOfComponent(Component component)
Deprecated. Returns the index of the tab for the specified component. |
void |
insertTab(java.lang.String title,
Image icon,
Component component,
int index)
Deprecated. Inserts a component , at index ,
represented by a title and/or icon ,
either of which may be null . |
void |
paint(Graphics g)
Deprecated. This method paints the Component on the screen, it should be overriden by subclasses to perform custom drawing or invoke the UI API's to let the PLAF perform the rendering. |
void |
refreshTheme()
Deprecated. Makes sure the component is up to date with the current style object |
void |
removeTabAt(int index)
Deprecated. Removes the tab at index . |
void |
requestFocus()
Deprecated. Changes the current component to the focused component, will work only for a component that belongs to a parent form. |
void |
setContentPaneSelectedStyle(Style style)
Deprecated. Sets the content pane selected style |
void |
setContentPaneUnselectedStyle(Style unselectedStyle)
Deprecated. Sets the content pane un selected style |
void |
setFocus(boolean b)
Deprecated. This flag doesn't really give focus, its a state that determines what colors from the Style should be used when painting the component. |
void |
setFocusable(boolean b)
Deprecated. A simple setter to determine if this Component can get focused |
void |
setPadding(int orientation,
int gap)
Deprecated. |
void |
setPadding(int top,
int bottom,
int left,
int right)
Deprecated. |
void |
setSelectedIndex(int index)
Deprecated. Sets the selected index for this tabbedpane. |
void |
setTabbedPaneBorderWidth(int tabbedPaneBorderWidth)
Deprecated. Setting the TabbedPane surrounded border width |
void |
setTabPlacement(int tabPlacement)
Deprecated. Sets the tab placement for this tabbedpane. |
void |
setTabsSelectedStyle(Style style)
Deprecated. Sets the tabs selected style |
void |
setTabsUnselectedStyle(Style unselectedStyle)
Deprecated. Sets the tabs un selected style |
void |
setTabTitle(java.lang.String title,
Image icon,
int index)
Deprecated. Updates the information about the tab details |
void |
setTabTitlePrototype(java.lang.String title)
Deprecated. The prototype is optionally used in calculating the size of an individual tab and is recommended for performance reasons. |
void |
setTransitionLeft(Transition transitionLeft)
Deprecated. Indicates the transition to use when switching between tabs from right to left. |
void |
setTransitionRight(Transition transitionRight)
Deprecated. Indicates the transition to use when switching between tabs from left to right. |
java.lang.String |
toString()
Deprecated. Overriden to return a useful value for debugging purposes |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TabbedPane()
TabbedPane
with a default
tab placement of Component.TOP
.
public TabbedPane(int tabPlacement)
TabbedPane
with the specified tab placement
of either: Component.TOP
, Component.BOTTOM
,
Component.LEFT
, or Component.RIGHT
.
tabPlacement
- the placement for the tabs relative to the contentMethod Detail |
---|
public boolean animate()
Animation
Display
class.
animate
in interface Animation
animate
in class Component
public void setTransitionLeft(Transition transitionLeft)
transitionLeft
- transition to use when switching tabs or null to avoid transitionpublic Transition getTransitionLeft()
public void setTransitionRight(Transition transitionRight)
transitionRight
- transition to use when switching tabs or null to avoid transitionpublic Transition getTransitionRight()
public void setFocusable(boolean b)
Component
setFocusable
in class Component
b
- indicate whether this component can get focusedpublic void setFocus(boolean b)
Component
setFocus
in class Component
b
- sets the state that determines what colors from the
Style should be used when painting a focused componentComponent.requestFocus()
public boolean hasFocus()
Component
hasFocus
in class Component
Component.setFocus(boolean)
public void addTabsListener(SelectionListener listener)
listener
- a selection listener to gets the selection
eventspublic void requestFocus()
Component
requestFocus
in class Component
protected Dimension calcPreferredSize()
Component
calcPreferredSize
in class Container
public void setTabPlacement(int tabPlacement)
Component.TOP
Component.BOTTOM
Component.LEFT
Component.RIGHT
Component.TOP
.
tabPlacement
- the placement for the tabs relative to the contentpublic void addTab(java.lang.String title, Image icon, Component component)
component
represented by a title
and/or icon
,
either of which can be null
.
Cover method for insertTab
.
title
- the title to be displayed in this tabicon
- the icon to be displayed in this tabcomponent
- the component to be displayed when this tab is clickedinsertTab(java.lang.String, com.sun.lwuit.Image, com.sun.lwuit.Component, int)
,
removeTabAt(int)
public void addTab(java.lang.String title, Component component)
component
represented by a title
and no icon
.
Cover method for insertTab
.
title
- the title to be displayed in this tabcomponent
- the component to be displayed when this tab is clickedinsertTab(java.lang.String, com.sun.lwuit.Image, com.sun.lwuit.Component, int)
,
removeTabAt(int)
public void insertTab(java.lang.String title, Image icon, Component component, int index)
component
, at index
,
represented by a title
and/or icon
,
either of which may be null
.
Uses java.util.Vector internally, see insertElementAt
for details of insertion conventions.
title
- the title to be displayed in this tabicon
- the icon to be displayed in this tabcomponent
- The component to be displayed when this tab is clicked.index
- the position to insert this new tabaddTab(java.lang.String, com.sun.lwuit.Image, com.sun.lwuit.Component)
,
removeTabAt(int)
public void setTabTitle(java.lang.String title, Image icon, int index)
title
- the title to be displayed in this tabicon
- the icon to be displayed in this tabindex
- the position to insert this new tabpublic void removeTabAt(int index)
index
.
After the component associated with index
is removed,
its visibility is reset to true to ensure it will be visible
if added to other containers.
index
- the index of the tab to be removed
java.lang.IndexOutOfBoundsException
- if index is out of range
(index < 0 || index >= tab count)addTab(java.lang.String, com.sun.lwuit.Image, com.sun.lwuit.Component)
,
insertTab(java.lang.String, com.sun.lwuit.Image, com.sun.lwuit.Component, int)
public Component getTabComponentAt(int index)
index
.
index
- the index of the tab to be removed
java.lang.IndexOutOfBoundsException
- if index is out of range
(index < 0 || index >= tab count)addTab(java.lang.String, com.sun.lwuit.Image, com.sun.lwuit.Component)
,
insertTab(java.lang.String, com.sun.lwuit.Image, com.sun.lwuit.Component, int)
public int indexOfComponent(Component component)
component
- the component for the tab
public int getTabCount()
tabbedpane
.
public int getSelectedIndex()
public void setTabTitlePrototype(java.lang.String title)
This operation is not essential and if it isn't invoked the size of the first few tabs is used to determine the overall size of a tab.
This allows the size calculations to work across look and feels and allows developers to predetermin size for the tabs.
e.g. For tabs which you would like to always be 5 characters wide you can use a prototype "XXXXX" which would use the preferred size of the XXXXX String to determine the size of the tabs..
title
- a string to determine the size.public java.lang.String toString()
Component
toString
in class Component
public void paint(Graphics g)
Component
paint
in interface Animation
paint
in class Container
g
- the component graphicspublic void setTabsSelectedStyle(Style style)
style
- public void setTabsUnselectedStyle(Style unselectedStyle)
unselectedStyle
- the stylepublic void setContentPaneSelectedStyle(Style style)
style
- public void setContentPaneUnselectedStyle(Style unselectedStyle)
unselectedStyle
- the stylepublic void refreshTheme()
Component
refreshTheme
in class Container
public int getTabPlacement()
setTabPlacement(int)
public int getTabbedPaneBorderWidth()
public void setTabbedPaneBorderWidth(int tabbedPaneBorderWidth)
tabbedPaneBorderWidth
- TabbedPane surrounded border widthpublic void setPadding(int top, int bottom, int left, int right)
public void setPadding(int orientation, int gap)
public void setSelectedIndex(int index)
index
- the index to be selected
java.lang.IndexOutOfBoundsException
- if index is out of range
(index < 0 || index >= tab count)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |