public abstract class AbstractDockActionSource extends Object implements DockActionSource
DockActionSource
that just handles
the listeners
for sources.Modifier and Type | Field and Description |
---|---|
protected List<DockActionSourceListener> |
listeners
The listeners which are registered on this source
|
Constructor and Description |
---|
AbstractDockActionSource() |
Modifier and Type | Method and Description |
---|---|
void |
addDockActionSourceListener(DockActionSourceListener listener)
Adds a listener to this source.
|
protected void |
fireAdded(int firstIndex,
int lastIndex)
Invokes the
actionsAdded -method
on all registered DockActionSourceListeners . |
protected void |
fireRemoved(int firstIndex,
int lastIndex)
Invokes the
actionRemoved -method
on all registered DockActionSourceListeners . |
boolean |
hasListeners()
Checks whether this
DockActionSource has at least one registered DockActionSourceListener . |
int |
indexOf(DockAction action)
Gets the index of the given
action |
void |
removeDockActionSourceListener(DockActionSourceListener listener)
Removes an earlier added listener.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDockAction, getDockActionCount, getLocationHint
protected List<DockActionSourceListener> listeners
public void addDockActionSourceListener(DockActionSourceListener listener)
DockActionSource
DockActionSourceListener
should
be informed whenever some DockActions
are added or
removed from this source.addDockActionSourceListener
in interface DockActionSource
listener
- The listenerpublic void removeDockActionSourceListener(DockActionSourceListener listener)
DockActionSource
removeDockActionSourceListener
in interface DockActionSource
listener
- The listener to removeDockActionSource.addDockActionSourceListener(DockActionSourceListener)
public boolean hasListeners()
DockActionSource
has at least one registered DockActionSourceListener
.protected void fireAdded(int firstIndex, int lastIndex)
actionsAdded
-method
on all registered DockActionSourceListeners
.firstIndex
- The index of the first action that was addedlastIndex
- The index of the last action that was addedprotected void fireRemoved(int firstIndex, int lastIndex)
actionRemoved
-method
on all registered DockActionSourceListeners
.firstIndex
- The old index of the first action that was removedlastIndex
- The old index of the last action that was removedpublic int indexOf(DockAction action)
action
action
- The action to search in this source