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(@NotNull java.lang.String ident,
@NotNull javax.swing.JComponent component,
@NotNull Location defaultLocation,
boolean alternativeLocation,
int index,
boolean defaultOpen)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addTabListener(@NotNull TabListener listener)
Adds a
TabListener to be notified. |
@NotNull javax.swing.AbstractButton |
getButton()
Returns the
AbstractButton for showing or hiding the component. |
@NotNull java.awt.Component |
getComponent()
Returns the
Component that is shown when this tab is active. |
@NotNull Location |
getLocation()
Returns the tab's location.
|
@NotNull javax.swing.JMenu |
getMoveToMenu()
Returns the "Move To" menu within the button's context menu.
|
@NotNull javax.swing.JPopupMenu |
getPopupMenu()
Returns the button's context menu.
|
@NotNull 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(@NotNull TabListener listener)
Removes a
TabListener to be notified. |
void |
setAlternativeLocation(boolean alternativeLocation)
Sets whether the button is shown in the alternative location.
|
void |
setLocation(@NotNull Location location)
Sets the tab's location.
|
void |
setOpen(boolean open)
Sets the tab's open status.
|
protected void |
setSeverity(@NotNull Severity severity)
Sets the tab's
Severity . |
void |
setSize(int size)
Sets the tab's size.
|
void |
setSplitModeAction(@Nullable net.sf.japi.swing.action.ToggleAction splitModeAction)
Sets the
ToggleAction to update if the "split mode" state
changes. |
public Tab(@NotNull @NotNull java.lang.String ident, @NotNull @NotNull javax.swing.JComponent component, @NotNull @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 @NotNull TabListener listener)
TabListener
to be notified.listener
- the listenerpublic void removeTabListener(@NotNull @NotNull TabListener listener)
TabListener
to be notified.listener
- the listener@NotNull public @NotNull java.awt.Component getComponent()
Component
that is shown when this tab is active.@NotNull public @NotNull javax.swing.AbstractButton getButton()
AbstractButton
for showing or hiding the component.@NotNull public @NotNull javax.swing.JPopupMenu getPopupMenu()
@NotNull public @NotNull javax.swing.JMenu getMoveToMenu()
public void setSplitModeAction(@Nullable @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 @NotNull Location getLocation()
public void setLocation(@NotNull @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 @NotNull Severity getSeverity()
Severity
.