public abstract class AbstractStandardDockAction extends java.lang.Object implements StandardDockAction
DockAction
-interface.
This implementation allows to register
some StandardDockActionListener
, and stores the Dockables
which are using this action.Modifier and Type | Field and Description |
---|---|
protected java.util.List<StandardDockActionListener> |
listeners
The listeners that are registered by this action
|
BUTTON_CONTENT_FILTER
Constructor and Description |
---|
AbstractStandardDockAction(boolean monitorDisabling)
Creates a new action.
|
Modifier and Type | Method and Description |
---|---|
void |
addDockActionListener(StandardDockActionListener listener)
Adds a listener to this DockAction.
|
void |
bind(Dockable dockable)
Informs this DockAction that icons, text, and other stuff like that,
will be requested from this DockAction.
|
protected void |
bound(Dockable dockable)
Invoked by this
AbstractStandardDockAction when a Dockable
was bound to this action the first time. |
protected void |
fireActionEnabledChanged(java.util.Set<Dockable> dockables)
Invokes the
actionEnabledChanged -
method of all currently registered StandardDockActionListener |
protected void |
fireActionIconChanged(ActionContentModifier modifier,
java.util.Set<Dockable> dockables)
Invokes the
actionIconChanged -
method of all currently registered StandardDockActionListener |
protected void |
fireActionRepresentativeChanged(java.util.Set<Dockable> dockables)
Invokes the
actionRepresentativeChanged -
method of all currently registered StandardDockActionListener |
protected void |
fireActionTextChanged(java.util.Set<Dockable> dockables)
Invokes the
actionTextChanged -
method of all currently registered StandardDockActionListener |
protected void |
fireActionTooltipTextChanged(java.util.Set<Dockable> dockables)
Invokes the
actionTooltipTextChanged -
method of all currently registered StandardDockActionListener |
java.util.Set<Dockable> |
getBoundDockables()
Gets a set of all
Dockables which are currently
bound to this DockAction . |
boolean |
isBound(Dockable dockable)
Tells whether the
dockable is bound with this
action, or not. |
boolean |
isEnabled(Dockable dockable)
This method chooses the result according to the current
DisablingStrategy . |
void |
removeDockActionListener(StandardDockActionListener listener)
Removes a listener from this DockStation.
|
void |
unbind(Dockable dockable)
|
protected void |
unbound(Dockable dockable)
Called by this
AbstractStandardDockAction when the Dockable
dockable will not be used in any means by this
action. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDockableRepresentation, getIcon, getIconContexts, getText, getTooltipText
createView, trigger
protected java.util.List<StandardDockActionListener> listeners
public AbstractStandardDockAction(boolean monitorDisabling)
monitorDisabling
- whether the current DisablingStrategy
should be monitoredpublic void addDockActionListener(StandardDockActionListener listener)
StandardDockAction
addDockActionListener
in interface StandardDockAction
listener
- The listener to addpublic void removeDockActionListener(StandardDockActionListener listener)
StandardDockAction
removeDockActionListener
in interface StandardDockAction
listener
- The listener to removeprotected void bound(Dockable dockable)
AbstractStandardDockAction
when a Dockable
was bound to this action the first time.dockable
- The Dockable that was not known to this action
before the method was invokedprotected void unbound(Dockable dockable)
AbstractStandardDockAction
when the Dockable
dockable
will not be used in any means by this
action. Note that the bound(Dockable)
-method can be
invoked again with the dockable
.dockable
- The Dockable which will not by used in any way.public boolean isBound(Dockable dockable)
dockable
is bound with this
action, or not.dockable
- The Dockable
to testtrue
if it is bound, false
otherwisepublic java.util.Set<Dockable> getBoundDockables()
Dockables
which are currently
bound to this DockAction
.public void bind(Dockable dockable)
DockAction
bind
in interface DockAction
dockable
- the Dockable
that may be used in the futureDockAction.unbind(Dockable)
public void unbind(Dockable dockable)
DockAction
dockable
was bound
to this DockAction, and if the dockable
will no longer be
used for any method calls (except bind
) on
this DockAction.unbind
in interface DockAction
dockable
- The Dockable
that will never be seen again, except
it is maybe bind
again.public boolean isEnabled(Dockable dockable)
DisablingStrategy
.isEnabled
in interface StandardDockAction
dockable
- The Dockable
for which this action maybe
triggered.true
if the user should be able to trigger
this action, false
otherwiseprotected void fireActionTextChanged(java.util.Set<Dockable> dockables)
actionTextChanged
-
method of all currently registered StandardDockActionListener
dockables
- The set of dockables for which the text has been
changed.protected void fireActionTooltipTextChanged(java.util.Set<Dockable> dockables)
actionTooltipTextChanged
-
method of all currently registered StandardDockActionListener
dockables
- The set of dockables for which the tooltip has been
changed.protected void fireActionIconChanged(ActionContentModifier modifier, java.util.Set<Dockable> dockables)
actionIconChanged
-
method of all currently registered StandardDockActionListener
modifier
- the context in which the changed icon was used, can be null
to indicate that all
icons changeddockables
- The set of dockables for which the icon has been
changed.protected void fireActionEnabledChanged(java.util.Set<Dockable> dockables)
actionEnabledChanged
-
method of all currently registered StandardDockActionListener
dockables
- The set of dockables for which the enabled-state has been
changed.protected void fireActionRepresentativeChanged(java.util.Set<Dockable> dockables)
actionRepresentativeChanged
-
method of all currently registered StandardDockActionListener
dockables
- The set of dockables for which the enabled-state has been
changed.