|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object bibliothek.gui.dock.action.actions.AbstractStandardDockAction bibliothek.gui.dock.action.actions.SimpleDockAction bibliothek.gui.dock.action.actions.SimpleDropDownItemAction bibliothek.gui.dock.action.actions.SimpleSelectableAction
public abstract class SimpleSelectableAction
A DockAction
that has a state selected
. That state
has always the same value for every Dockable
using this action.
Nested Class Summary | |
---|---|
static class |
SimpleSelectableAction.Check
A SimpleSelectableAction that is visualized as
a ActionType.CHECK . |
static class |
SimpleSelectableAction.Radio
A SimpleSelectableAction that is visualized as
a ActionType.RADIO . |
Constructor Summary | |
---|---|
SimpleSelectableAction(ActionType<SelectableDockAction> type)
Creates a new action. |
Method Summary | ||
---|---|---|
void |
addSelectableListener(SelectableDockActionListener listener)
Adds a listener to this action. |
|
|
createView(ViewTarget<V> target,
ActionViewConverter converter,
Dockable dockable)
Creates a view for this action, for the platform target and
with help of converter . |
|
protected void |
fireSelectedChanged()
Fires an event to all observers of type SelectableDockActionListener . |
|
protected javax.swing.Icon |
firstNonNull(javax.swing.Icon... icons)
Gets the first element of icons that is not null . |
|
javax.swing.Icon |
getDisabledIcon(Dockable dockable)
Gets the Icon of this DockAction, when this DockAction is shown together with dockable and is not enabled. |
|
javax.swing.Icon |
getDisabledSelectedIcon()
Gets the icon that is shown, when this action is selected but not enabled. |
|
javax.swing.Icon |
getIcon(Dockable dockable)
Gets the Icon of this DockAction, when this DockAction is shown together with dockable . |
|
javax.swing.Icon |
getSelectedIcon()
Gets the icon that is shown when this action is selected. |
|
boolean |
isSelected()
Gets the selected-state of this action. |
|
boolean |
isSelected(Dockable dockable)
Tells whether this DockAction is selected or not (in respect to the given dockable ). |
|
void |
removeSelectableListener(SelectableDockActionListener listener)
Removes a listener from this action. |
|
void |
setDisabledSelectedIcon(javax.swing.Icon disabledSelectedIcon)
Sets the icon that will be shown when this action is selected but not enabled. |
|
void |
setSelected(boolean selected)
Sets the state of this action. |
|
void |
setSelected(Dockable dockable,
boolean selected)
Sets the selected state for dockable . |
|
void |
setSelectedIcon(javax.swing.Icon selectedIcon)
Sets the icon that will be shown, when this action is selected. |
Methods inherited from class bibliothek.gui.dock.action.actions.SimpleDropDownItemAction |
---|
isDropDownSelectable, isDropDownSelectable, isDropDownTriggerable, isDropDownTriggerableNotSelected, isDropDownTriggerableSelected, setDropDownSelectable, setDropDownTriggerableNotSelected, setDropDownTriggerableSelected |
Methods inherited from class bibliothek.gui.dock.action.actions.SimpleDockAction |
---|
bound, getAccelerator, getDisabledIcon, getDockableRepresentation, getDockableRepresentation, getIcon, getText, getText, getTooltip, getTooltipText, getTooltipText, isEnabled, isEnabled, setAccelerator, setDisabledIcon, setDockableRepresentation, setEnabled, setIcon, setText, setTooltip, trigger, unbound |
Methods inherited from class bibliothek.gui.dock.action.actions.AbstractStandardDockAction |
---|
addDockActionListener, bind, fireActionDisabledIconChanged, fireActionEnabledChanged, fireActionIconChanged, fireActionRepresentativeChanged, fireActionTextChanged, fireActionTooltipTextChanged, getBoundDockables, isBound, removeDockActionListener, unbind |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface bibliothek.gui.dock.action.dropdown.DropDownItemAction |
---|
isDropDownSelectable, isDropDownTriggerable |
Constructor Detail |
---|
public SimpleSelectableAction(ActionType<SelectableDockAction> type)
type
- how this action is to be visualizedMethod Detail |
---|
public <V> V createView(ViewTarget<V> target, ActionViewConverter converter, Dockable dockable)
DockAction
target
and
with help of converter
. Clients might use their own
code to create a new view, but the preferred way is to call
ActionViewConverter.createView(ActionType, DockAction, ViewTarget, Dockable)
with an ActionType
that fits to this DockAction.
createView
in interface DockAction
V
- the type of view requestedtarget
- The platform on which the view will be usedconverter
- A set of methods that can be used to create a viewdockable
- The Dockable for which the view will be shown. Note that
this action may not yet be bound
to this action.
public void addSelectableListener(SelectableDockActionListener listener)
SelectableDockAction
Dockable
changes.
addSelectableListener
in interface SelectableDockAction
listener
- the new listenerpublic void removeSelectableListener(SelectableDockActionListener listener)
SelectableDockAction
removeSelectableListener
in interface SelectableDockAction
listener
- the listener to removeprotected void fireSelectedChanged()
SelectableDockActionListener
.
public boolean isSelected(Dockable dockable)
SelectableDockAction
dockable
).
isSelected
in interface SelectableDockAction
dockable
- The Dockable
for which this action may be selected
or not selected
true
if this DockAction is selcted, false
otherwisepublic void setSelected(Dockable dockable, boolean selected)
SelectableDockAction
dockable
.
setSelected
in interface SelectableDockAction
dockable
- the affected dockableselected
- the new statepublic boolean isSelected()
setSelected(boolean)
public void setSelected(boolean selected)
selected
- the new statepublic javax.swing.Icon getIcon(Dockable dockable)
StandardDockAction
dockable
.
getIcon
in interface StandardDockAction
getIcon
in class SimpleDockAction
dockable
- The Dockable
for which the action-icon
should be chosen.
dockable
, or null
.protected javax.swing.Icon firstNonNull(javax.swing.Icon... icons)
icons
that is not null
.
icons
- a list of icons
public javax.swing.Icon getSelectedIcon()
null
setSelectedIcon(Icon)
,
isSelected()
public void setSelectedIcon(javax.swing.Icon selectedIcon)
selectedIcon
- The icon, can be null
setSelected(boolean)
public javax.swing.Icon getDisabledSelectedIcon()
null
setDisabledSelectedIcon(Icon)
,
SimpleDockAction.isEnabled()
,
isSelected()
public javax.swing.Icon getDisabledIcon(Dockable dockable)
StandardDockAction
dockable
and is not enabled.
getDisabledIcon
in interface StandardDockAction
getDisabledIcon
in class SimpleDockAction
dockable
- The Dockable
for which the action-icon
should be chosen.
dockable
, or null
.public void setDisabledSelectedIcon(javax.swing.Icon disabledSelectedIcon)
disabledSelectedIcon
- The icon, null
is allowedsetSelected(boolean)
,
SimpleDockAction.setEnabled(boolean)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |