public class Tab
extends java.lang.Object
TabbedPanel
component. It consists of an AbstractButton
to show or hide an associated JComponent
that is
displayed when the tab is active. Each tab is associated with a Location
.Constructor and Description |
---|
Tab(java.lang.String ident,
javax.swing.JComponent component,
Location defaultLocation,
boolean alternativeLocation,
int index,
boolean defaultOpen)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addTabListener(TabListener listener)
Adds a
TabListener to be notified. |
javax.swing.AbstractButton |
getButton()
Returns the
AbstractButton for showing or hiding the component. |
java.awt.Component |
getComponent()
Returns the
Component that is shown when this tab is active. |
Location |
getLocation()
Returns the tab's location.
|
javax.swing.JMenu |
getMoveToMenu()
Returns the "Move To" menu within the button's context menu.
|
javax.swing.JPopupMenu |
getPopupMenu()
Returns the button's context menu.
|
Severity |
getSeverity()
Returns the tab's
Severity . |
int |
getSize()
Returns the tab's size.
|
boolean |
isAlternativeLocation()
Returns whether the button is shown in the alternative location.
|
boolean |
isOpen()
Returns the tab's open status.
|
void |
removeTabListener(TabListener listener)
Removes a
TabListener to be notified. |
void |
setAlternativeLocation(boolean alternativeLocation)
Sets whether the button is shown in the alternative location.
|
void |
setLocation(Location location)
Sets the tab's location.
|
void |
setOpen(boolean open)
Sets the tab's open status.
|
protected void |
setSeverity(Severity severity)
Sets the tab's
Severity . |
void |
setSize(int size)
Sets the tab's size.
|
void |
setSplitModeAction(net.sf.japi.swing.action.ToggleAction splitModeAction)
Sets the
ToggleAction to update if the "split mode" state
changes. |
public Tab(@NotNull java.lang.String ident, @NotNull javax.swing.JComponent component, @NotNull Location defaultLocation, boolean alternativeLocation, int index, boolean defaultOpen)
ident
- the tab's identification stringcomponent
- the component that is shown when this tab is activedefaultLocation
- the tab's default locationalternativeLocation
- whether the tab is shown in the alternative
locationindex
- the tab's index for orderingdefaultOpen
- the tab's default opened statuspublic void addTabListener(@NotNull TabListener listener)
TabListener
to be notified.listener
- the listenerpublic void removeTabListener(@NotNull TabListener listener)
TabListener
to be notified.listener
- the listener@NotNull public java.awt.Component getComponent()
Component
that is shown when this tab is active.@NotNull public javax.swing.AbstractButton getButton()
AbstractButton
for showing or hiding the component.@NotNull public javax.swing.JPopupMenu getPopupMenu()
@NotNull public javax.swing.JMenu getMoveToMenu()
public void setSplitModeAction(@Nullable net.sf.japi.swing.action.ToggleAction splitModeAction)
ToggleAction
to update if the "split mode" state
changes.splitModeAction
- the toggle actionpublic boolean isAlternativeLocation()
public void setAlternativeLocation(boolean alternativeLocation)
alternativeLocation
- whether the button is shown in the alternative
location@NotNull public Location getLocation()
public void setLocation(@NotNull Location location)
location
- the locationpublic int getSize()
public void setSize(int size)
size
- the size; depending on the tab's location either width or
heightpublic boolean isOpen()
public void setOpen(boolean open)
open
- the tab's open status@NotNull public Severity getSeverity()
Severity
.