|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.wings.SComponent
org.wings.SContainer
org.wings.STabbedPane
public class STabbedPane
Shows one tab, usually a panel, at a time and allows switching between them.
| Field Summary | |
|---|---|
protected int |
maxTabsPerLine
the maximum tabs per line |
protected SingleSelectionModel |
model
The default selection model |
protected int |
selectedIndex
Number of selected tab. |
static Selector |
SELECTOR_CONTENT
A Pseudo selector addressing the container area of this container. |
static Selector |
SELECTOR_DISABLED_TAB
A Pseudo CSS selector addressing the unselected tab Refer to SComponent.setAttribute(org.wings.style.Selector, org.wings.style.CSSProperty, String) |
static Selector |
SELECTOR_SELECTED_TAB
A Pseudo CSS selector addressing the selected tab Refer to SComponent.setAttribute(org.wings.style.Selector, org.wings.style.CSSProperty, String) |
static Selector |
SELECTOR_TABS
A Pseudo CSS selector addressing the area which contains the tab buttons. |
static Selector |
SELECTOR_UNSELECTED_TAB
A Pseudo CSS selector addressing the unselected tab Refer to SComponent.setAttribute(org.wings.style.Selector, org.wings.style.CSSProperty, String) |
protected int |
tabPlacement
Where the tabs are placed. |
| Fields inherited from class org.wings.SComponent |
|---|
DONE_RENDERING, dynamicStyles, enabled, propertyChangeSupport, SELECTOR_ALL, START_RENDERING, visible, WHEN_FOCUSED_OR_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_IN_FOCUSED_FRAME |
| Constructor Summary | |
|---|---|
STabbedPane()
Creates a new empty Tabbed Pane with the tabs at the top. |
|
STabbedPane(int tabPlacement)
Creates an empty TabbedPane with the specified tab placement of either: TOP, BOTTOM, LEFT, or RIGHT. |
|
| Method Summary | |
|---|---|
SComponent |
add(String title,
SComponent component)
Adds a component with the specified tab title. |
void |
addChangeListener(ChangeListener cl)
Add a listener to the list of change listeners. |
SComponent |
addComponent(SComponent component,
Object constraints)
Adds a component at the specified tab index. |
SComponent |
addComponent(SComponent component,
Object constraints,
int index)
Adds a component at the specified tab index. |
void |
addTab(String title,
SComponent component)
Adds a component represented by a title and no icon. |
void |
addTab(String title,
SIcon icon,
SComponent component)
Adds a component represented by a title and/or icon, either of which can be null. |
void |
addTab(String title,
SIcon icon,
SComponent component,
String tip)
Adds a component and tip represented by a title and/or icon, either of which can be null. |
void |
fireFinalEvents()
Sets selection and fire changeevents, if user changed tab selection. |
void |
fireIntermediateEvents()
Does nothin'. |
protected void |
fireStateChanged()
Fire ChangeEvents at all registered change listeners. |
Color |
getBackgroundAt(int index)
Returns the tab background color at index. |
SComponent |
getComponentAt(int index)
Returns the component at index. |
SIcon |
getDisabledIconAt(int index)
Returns the tab disabled icon at index. |
Color |
getForegroundAt(int index)
Returns the tab foreground color at index. |
SIcon |
getIconAt(int index)
Returns the tab icon at index. |
int |
getMaxTabsPerLine()
Returns the maximum tabs per line. |
SingleSelectionModel |
getModel()
Returns the model associated with this tabbedpane. |
SComponent |
getSelectedComponent()
Returns the currently selected component for this tabbedpane. |
int |
getSelectedIndex()
Returns the currently selected index for this tabbedpane. |
Color |
getSelectionBackground()
Return the background color. |
SFont |
getSelectionFont()
Return the font. |
Color |
getSelectionForeground()
Return the foreground color. |
String |
getStyleAt(int index)
Returns the tab style at index. |
int |
getTabCount()
Returns the number of tabs in this tabbedpane. |
int |
getTabPlacement()
Returns the placement of the tabs for this tabbedpane. |
String |
getTitleAt(int index)
Returns the tab title at index. |
String |
getToolTipTextAt(int index)
Get the tooltip text from tab at index |
int |
indexOfComponent(SComponent component)
Returns the index of the tab for the specified component. |
int |
indexOfTab(SIcon icon)
Returns the first tab index with a given icon. |
int |
indexOfTab(String title)
Returns the first tab index with a given title, Returns -1 if no tab has this title. |
void |
insertTab(String title,
SIcon icon,
SComponent component,
String tip,
int index)
Inserts a component, at index, represented by a title and/or icon, either of which may be null. |
boolean |
isEnabledAt(int index)
Returns whether or not the tab at index is currently enabled. |
boolean |
isEpochCheckEnabled()
Asks the low-level event listener if epoch checking should be perfomed on it. |
void |
processLowLevelEvent(String action,
String[] values)
Tab was clicked. |
void |
remove(SComponent component)
Removes the tab which corresponds to the specified component. |
void |
removeAllTabs()
|
void |
removeChangeListener(ChangeListener cl)
Remove listener from the list of change listeners. |
void |
removeTabAt(int index)
Removes the tab at index. |
void |
setBackgroundAt(int index,
Color background)
Sets the background color at index to background which can be null, in which case the tab's background color will default to the background color of the tabbedpane. |
void |
setCG(TabbedPaneCG cg)
|
void |
setComponent(int index,
SComponent component)
Sets the component at index to component. |
void |
setComponentAt(int index,
SComponent component)
Sets the component at index to component which must not be null. |
void |
setDisabledIconAt(int index,
SIcon disabledIcon)
Sets the disabled icon at index to icon which can be null. |
void |
setEnabledAt(int index,
boolean enabled)
Sets whether or not the tab at index is enabled. |
void |
setEpochCheckEnabled(boolean epochCheckEnabled)
|
void |
setForegroundAt(int index,
Color foreground)
Sets the foreground color at index to foreground which can be null, in which case the tab's foreground color will default to the foreground color of this tabbedpane. |
void |
setIconAt(int index,
SIcon icon)
Sets the icon at index to icon which can be null. |
void |
setMaxTabsPerLine(int tabs)
Sets the maximum tabs per line. |
void |
setModel(SingleSelectionModel model)
Sets the model to be used with this tabbedpane. |
void |
setParentFrame(SFrame f)
Set the parent frame of this tabbed pane |
void |
setSelectedComponent(SComponent c)
Sets the selected component for this tabbedpane. |
void |
setSelectedIndex(int index)
Sets the selected index for this tabbedpane. |
void |
setSelectionBackground(Color color)
Set the foreground color. |
void |
setSelectionFont(SFont font)
Set the font. |
void |
setSelectionForeground(Color color)
Set the foreground color. |
void |
setStyleAt(int index,
String style)
Sets the style at index to style which can be null, in which case the tab's style will default to the style of this tabbedpane. |
void |
setTabPlacement(int tabPlacement)
Sets the tab placement for this tabbedpane. |
void |
setTitleAt(int index,
String title)
Sets the title at index to title which can be null. |
void |
setToolTipTextAt(int index,
String toolTip)
Set the tooltip text for tab at index |
| Methods inherited from class org.wings.SContainer |
|---|
add, add, add, add, addComponent, addComponent, addContainerListener, addNotify, clone, fireContainerEvent, getComponent, getComponentCount, getComponentList, getComponents, getConstraintAt, getConstraintList, getLayout, invite, inviteEachComponent, isShowingChildren, processContainerEvent, remove, removeAll, removeContainerListener, removeNotify, setCG, setLayout, updateCG |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.wings.LowLevelEventListener |
|---|
getLowLevelEventId, getName, isEnabled |
| Field Detail |
|---|
public static final Selector SELECTOR_CONTENT
SComponent.setAttribute(org.wings.style.Selector, org.wings.style.CSSProperty, String)
public static final Selector SELECTOR_TABS
SComponent.setAttribute(org.wings.style.Selector, org.wings.style.CSSProperty, String)
public static final Selector SELECTOR_SELECTED_TAB
SComponent.setAttribute(org.wings.style.Selector, org.wings.style.CSSProperty, String)
public static final Selector SELECTOR_UNSELECTED_TAB
SComponent.setAttribute(org.wings.style.Selector, org.wings.style.CSSProperty, String)
public static final Selector SELECTOR_DISABLED_TAB
SComponent.setAttribute(org.wings.style.Selector, org.wings.style.CSSProperty, String)
protected int tabPlacement
setTabPlacement(int)protected SingleSelectionModel model
protected int maxTabsPerLine
protected int selectedIndex
| Constructor Detail |
|---|
public STabbedPane()
addTab(java.lang.String, org.wings.SIcon, org.wings.SComponent, java.lang.String)public STabbedPane(int tabPlacement)
tabPlacement - the placement for the tabs relative to the contentaddTab(java.lang.String, org.wings.SIcon, org.wings.SComponent, java.lang.String)| Method Detail |
|---|
public Color getSelectionBackground()
public void setSelectionBackground(Color color)
color - the new foreground colorpublic Color getSelectionForeground()
public void setSelectionForeground(Color color)
color - the new foreground colorpublic void setSelectionFont(SFont font)
font - the new fontpublic SFont getSelectionFont()
public void addChangeListener(ChangeListener cl)
cl - add to listener listpublic void removeChangeListener(ChangeListener cl)
cl - remove from listener listprotected void fireStateChanged()
public int getTabPlacement()
setTabPlacement(int)public void setTabPlacement(int tabPlacement)
tabPlacement - the placement for the tabs relative to the contentpublic SingleSelectionModel getModel()
setModel(javax.swing.SingleSelectionModel)public void setModel(SingleSelectionModel model)
model - the model to be usedgetModel()public int getSelectedIndex()
setSelectedIndex(int)public void setSelectedIndex(int index)
getSelectedIndex(),
SingleSelectionModel.setSelectedIndex(int)public SComponent getSelectedComponent()
setSelectedComponent(org.wings.SComponent)public void setSelectedComponent(SComponent c)
getSelectedComponent()public int indexOfComponent(SComponent component)
component - the component for the tabpublic int getTabCount()
public void insertTab(String title,
SIcon icon,
SComponent component,
String tip,
int index)
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.tip - the tooltip to be displayed for this tabindex - the position to insert this new tabaddTab(java.lang.String, org.wings.SIcon, org.wings.SComponent, java.lang.String),
removeTabAt(int)
public void addTab(String title,
SIcon icon,
SComponent component,
String tip)
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.tip - the tooltip to be displayed for this tabinsertTab(java.lang.String, org.wings.SIcon, org.wings.SComponent, java.lang.String, int),
removeTabAt(int)
public void addTab(String title,
SIcon icon,
SComponent component)
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.insertTab(java.lang.String, org.wings.SIcon, org.wings.SComponent, java.lang.String, int),
removeTabAt(int)
public void addTab(String title,
SComponent component)
title - the title to be displayed in this tabcomponent - The component to be displayed when this tab is clicked.insertTab(java.lang.String, org.wings.SIcon, org.wings.SComponent, java.lang.String, int),
removeTabAt(int)
public SComponent add(String title,
SComponent component)
title - the title to be displayed in this tabcomponent - The component to be displayed when this tab is clicked.insertTab(java.lang.String, org.wings.SIcon, org.wings.SComponent, java.lang.String, int),
removeTabAt(int)
public SComponent addComponent(SComponent component,
Object constraints)
addComponent in class SContainercomponent - The component to be displayed when this tab is clicked.constraints - the object to be displayed in the tab
insertTab(java.lang.String, org.wings.SIcon, org.wings.SComponent, java.lang.String, int),
removeTabAt(int)
public SComponent addComponent(SComponent component,
Object constraints,
int index)
addComponent in class SContainercomponent - The component to be displayed when this tab is clicked.constraints - the object to be displayed in the tabindex - the position to insert this new tab
insertTab(java.lang.String, org.wings.SIcon, org.wings.SComponent, java.lang.String, int),
removeTabAt(int)public void removeTabAt(int index)
index - the index of the tab to be removedaddTab(java.lang.String, org.wings.SIcon, org.wings.SComponent, java.lang.String),
insertTab(java.lang.String, org.wings.SIcon, org.wings.SComponent, java.lang.String, int)public void remove(SComponent component)
remove in class SContainercomponent - the component to remove from the tabbedpaneaddTab(java.lang.String, org.wings.SIcon, org.wings.SComponent, java.lang.String),
removeTabAt(int)public void setMaxTabsPerLine(int tabs)
public int getMaxTabsPerLine()
public SComponent getComponentAt(int index)
setComponentAt(int, org.wings.SComponent)public String getTitleAt(int index)
setTitleAt(int, java.lang.String)public SIcon getIconAt(int index)
setIconAt(int, org.wings.SIcon)public SIcon getDisabledIconAt(int index)
setDisabledIconAt(int, org.wings.SIcon)public Color getBackgroundAt(int index)
setBackgroundAt(int, java.awt.Color)public Color getForegroundAt(int index)
setForegroundAt(int, java.awt.Color)public String getStyleAt(int index)
setStyleAt(int, java.lang.String)public boolean isEnabledAt(int index)
setEnabledAt(int, boolean)
public void setComponentAt(int index,
SComponent component)
index - the tab index where the title should be setcomponent - the component for the tabgetComponentAt(int)
public void setTitleAt(int index,
String title)
index - the tab index where the title should be settitle - the title to be displayed in the tabgetTitleAt(int)
public void setIconAt(int index,
SIcon icon)
index - the tab index where the icon should be seticon - the icon to be displayed in the tabgetIconAt(int)
public void setDisabledIconAt(int index,
SIcon disabledIcon)
index - the tab index where the disabled icon should be setdisabledIcon - the icon to be displayed in the tab when disabledgetDisabledIconAt(int)
public void setBackgroundAt(int index,
Color background)
index - the tab index where the background should be setbackground - the color to be displayed in the tab's backgroundgetBackgroundAt(int)
public void setForegroundAt(int index,
Color foreground)
index - the tab index where the foreground should be setforeground - the color to be displayed as the tab's foregroundgetForegroundAt(int)
public void setStyleAt(int index,
String style)
index - the tab index where the style should be setstyle - the style to be used as the tab's stylegetStyleAt(int)
public void setEnabledAt(int index,
boolean enabled)
index - the tab index which should be enabled/disabledenabled - whether or not the tab should be enabledisEnabledAt(int)
public void setToolTipTextAt(int index,
String toolTip)
index - set the tooltip for this tabpublic String getToolTipTextAt(int index)
public void setComponent(int index,
SComponent component)
index - the tab index where this component is being placedcomponent - the component for the tabSContainer.getComponent(int)public int indexOfTab(String title)
title - the title for the tabpublic int indexOfTab(SIcon icon)
icon - the icon for the tabpublic void setParentFrame(SFrame f)
setParentFrame in class SContainerf - the parent frame.public void setCG(TabbedPaneCG cg)
public void processLowLevelEvent(String action,
String[] values)
processLowLevelEvent in interface LowLevelEventListenerprocessLowLevelEvent in class SComponentaction - the name-value-pair's namevalues - the name-value-pair's valuesLowLevelEventListener.processLowLevelEvent(String, String[])public void fireIntermediateEvents()
fireIntermediateEvents in interface LowLevelEventListenerpublic void fireFinalEvents()
fireFinalEvents in interface LowLevelEventListenerfireFinalEvents in class SComponentpublic boolean isEpochCheckEnabled()
LowLevelEventListenertrue the Dispatcher will ignore request originating from old views
(typically iniated by triggering browser back and clicking somewhere.)
isEpochCheckEnabled in interface LowLevelEventListenertrue if epoch checking should be perfomed, false
if all request for this component should be processed.LowLevelEventListener.isEpochCheckEnabled()public void setEpochCheckEnabled(boolean epochCheckEnabled)
LowLevelEventListener.isEpochCheckEnabled()public void removeAllTabs()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||