public class ButtonContent extends Object
FlapDockStation
. What is actually
displayed also depends on the DockTitle
that is used, but all the default titles support all the settings
this class offers.Modifier and Type | Field and Description |
---|---|
static ButtonContentCondition |
FALSE
A
ButtonContentCondition that is always false |
static ButtonContent |
ICON_ACTIONS
Only the icon and the actions are painted.
|
static ButtonContent |
ICON_AND_TEXT_ACTIONS
Icon, title text and actions are painted.
|
static ButtonContent |
ICON_AND_TEXT_ONLY
Only the icon and the title text are painted.
|
static ButtonContent |
ICON_ONLY
Only the icon is painted.
|
static ButtonContent |
ICON_THEN_TEXT_ACTIONS
The icon, or if not present the title text, and the actions are painted.
|
static ButtonContent |
ICON_THEN_TEXT_ONLY
The icon, or if not present the title text, is painted.
|
static ButtonContentCondition |
IF_DOCKABLE
|
static ButtonContentCondition |
IF_STATION
|
static ButtonContentCondition |
NOT_IF_ICON
|
static ButtonContentCondition |
NOT_IF_TEXT
|
static ButtonContent |
TEXT_ACTIONS
Only the title text and the actions are painted.
|
static ButtonContent |
TEXT_ONLY
Only the title text is painted.
|
static ButtonContent |
TEXT_THEN_ICON_ACTIONS
The title text, or if not present the icon, and the actions are painted.
|
static ButtonContent |
TEXT_THEN_ICON_ONLY
The title text, or if not present the icon, is painted.
|
static ButtonContentCondition |
THEME
A
ButtonContentCondition that always returns the value a DockTheme would choose |
static ButtonContent |
THEME_DEPENDENT
the look and feel completely depends on the current
DockTheme . |
static ButtonContentCondition |
TRUE
A
ButtonContentCondition that is always true |
Constructor and Description |
---|
ButtonContent(ButtonContentCondition knob,
ButtonContentCondition icon,
ButtonContentCondition text,
ButtonContentCondition children,
ButtonContentCondition actions,
ButtonContentCondition filterActions)
Creates a new set of properties.
|
Modifier and Type | Method and Description |
---|---|
void |
addListener(Dockable dockable,
ButtonContentListener listener)
|
boolean |
filterActions(Dockable dockable,
boolean theme)
Tells whether actions should filtered before showing on the button of a
FlapDockStation . |
ButtonContentCondition |
getActions()
Gets the condition that decides the property for
showActions(Dockable, boolean) |
ButtonContentCondition |
getChildren()
Gets the condition that decides the property for
showChildren(Dockable, boolean) |
ButtonContentCondition |
getFilterActions()
Gets the condition that decides the property for
filterActions(Dockable, boolean) |
ButtonContentCondition |
getIcon()
Gets the condition that decides the property for
showIcon(Dockable, boolean) |
ButtonContentCondition |
getKnob()
Gets the condition that decides the property for
showKnob(Dockable, boolean) |
ButtonContentCondition |
getText()
Gets the condition that decides the property for
showText(Dockable, boolean) |
void |
handleChange(Dockable dockable) |
protected ButtonContentListener[] |
listeners(Dockable dockable)
Gets all the listeners that are currently monitoring
dockable . |
void |
removeListener(Dockable dockable,
ButtonContentListener listener)
Informs this
ButtonContent that listener no longer has to be observed. |
boolean |
showActions(Dockable dockable,
boolean theme)
Tells whether actions should be shown on the button of a
FlapDockStation
or not. |
boolean |
showChildren(Dockable dockable,
boolean theme)
Tells whether actions to focus a child of a
DockStation should be shown |
boolean |
showIcon(Dockable dockable,
boolean theme)
Tells whether an icon should be shown.
|
boolean |
showKnob(Dockable dockable,
boolean theme)
Tells whether a knob should be shown
|
boolean |
showText(Dockable dockable,
boolean theme)
Tells whether text should be shown.
|
public static final ButtonContentCondition TRUE
ButtonContentCondition
that is always true
public static final ButtonContentCondition FALSE
ButtonContentCondition
that is always false
public static final ButtonContentCondition THEME
ButtonContentCondition
that always returns the value a DockTheme
would choosepublic static final ButtonContentCondition NOT_IF_ICON
public static final ButtonContentCondition NOT_IF_TEXT
public static final ButtonContentCondition IF_STATION
public static final ButtonContentCondition IF_DOCKABLE
public static final ButtonContent THEME_DEPENDENT
DockTheme
.public static final ButtonContent ICON_ONLY
ButtonContent
would have the exact same effect.public static final ButtonContent TEXT_ONLY
ButtonContent
would have the exact same effect.public static final ButtonContent ICON_AND_TEXT_ONLY
ButtonContent
would have the exact same effect.public static final ButtonContent ICON_THEN_TEXT_ONLY
ButtonContent
would have the exact same effect.public static final ButtonContent TEXT_THEN_ICON_ONLY
ButtonContent
would have the exact same effect.public static final ButtonContent ICON_ACTIONS
ButtonContent
would have the exact same effect.public static final ButtonContent TEXT_ACTIONS
ButtonContent
would have the exact same effect.public static final ButtonContent ICON_AND_TEXT_ACTIONS
ButtonContent
would have the exact same effect.public static final ButtonContent ICON_THEN_TEXT_ACTIONS
ButtonContent
would have the exact same effect.public static final ButtonContent TEXT_THEN_ICON_ACTIONS
ButtonContent
would have the exact same effect.public ButtonContent(ButtonContentCondition knob, ButtonContentCondition icon, ButtonContentCondition text, ButtonContentCondition children, ButtonContentCondition actions, ButtonContentCondition filterActions)
null
, in which case they default
to THEME
knob
- whether to paint a "knob" where the user can grab the title and move around. A knob really is only
required if neither icon nor text is paintedicon
- whether to paint the icon of a Dockable
text
- whether to paint the title text of a Dockable
children
- whether to add a button for each child of a DockStation
. The button allows user to
open the station and focus one of its children with on click. If the represented Dockable
is not a
station, then only one button is painted.actions
- whether to show the normal DockAction
s of a Dockable
filterActions
- whether only important DockAction
s, as defined by ButtonContentFilter
, should be shownpublic void addListener(Dockable dockable, ButtonContentListener listener)
dockable
- the element to observelistener
- the listener that monitors dockable
public void removeListener(Dockable dockable, ButtonContentListener listener)
ButtonContent
that listener
no longer has to be observed.dockable
- the element that was observedlistener
- the listener that is no longer requiredprotected ButtonContentListener[] listeners(Dockable dockable)
dockable
.dockable
- the element which may be monitorednull
public void handleChange(Dockable dockable)
public boolean showKnob(Dockable dockable, boolean theme)
dockable
- the element for which the property is requestedtheme
- what the theme would dotrue
if the knob should be visiblepublic ButtonContentCondition getKnob()
showKnob(Dockable, boolean)
null
public boolean showActions(Dockable dockable, boolean theme)
FlapDockStation
or not.dockable
- the element for which the property is requestedtheme
- what the theme would dotrue
if the actions should be shownpublic ButtonContentCondition getActions()
showActions(Dockable, boolean)
null
public boolean filterActions(Dockable dockable, boolean theme)
FlapDockStation
.
If showActions(Dockable, boolean)
returns false
for dockable
, then
this method is ignored.dockable
- the element for which the property is requestedtheme
- what the theme would dotrue
if the actions should be filtered by the current ButtonContentFilter
public ButtonContentCondition getFilterActions()
filterActions(Dockable, boolean)
null
public boolean showIcon(Dockable dockable, boolean theme)
dockable
- the element for which the property is requestedtheme
- what the theme would dotrue
if icons should be shownpublic ButtonContentCondition getIcon()
showIcon(Dockable, boolean)
null
public boolean showText(Dockable dockable, boolean theme)
dockable
- the element for which the property is requestedtheme
- what the theme would dotrue
if text should be shownpublic ButtonContentCondition getText()
showText(Dockable, boolean)
null
public boolean showChildren(Dockable dockable, boolean theme)
DockStation
should be showndockable
- the element for which the property is requestedtheme
- what the theme would dotrue
if the buttons should be shownpublic ButtonContentCondition getChildren()
showChildren(Dockable, boolean)
null