public class DockActionDistributorSource extends AbstractDockActionSource
DockActionSource
, this source can be used in combination with
DockActionDistributor
to completely hide the existence of the DockActionDistributor
.setDockable(Dockable)
to enable or disable this source.listeners
Constructor and Description |
---|
DockActionDistributorSource(DockActionDistributor.Target target,
PropertyKey<DockActionDistributor> key)
Creates a new action source
|
DockActionDistributorSource(DockActionDistributor.Target target,
PropertyKey<DockActionDistributor> key,
Dockable dockable)
Creates a new action source
|
Modifier and Type | Method and Description |
---|---|
void |
addDockActionSourceListener(DockActionSourceListener listener)
Adds a listener to this source.
|
DockAction |
getDockAction(int index)
Gets the index'th
DockAction of this source. |
int |
getDockActionCount()
Gets the number of
DockActions which are
provided by this source. |
LocationHint |
getLocationHint()
Gets a hint where to put this source in relation to other sources.
|
Iterator<DockAction> |
iterator() |
void |
removeDockActionSourceListener(DockActionSourceListener listener)
Removes an earlier added listener.
|
void |
setDockable(Dockable dockable)
Sets the
Dockable whose DockActionSource this should be. |
fireAdded, fireRemoved, hasListeners, indexOf
public DockActionDistributorSource(DockActionDistributor.Target target, PropertyKey<DockActionDistributor> key)
target
- where this action source will be shownkey
- the name of the property pointing to a DockActionDistributor
public DockActionDistributorSource(DockActionDistributor.Target target, PropertyKey<DockActionDistributor> key, Dockable dockable)
target
- where this action source will be shownkey
- the name of the property pointing to a DockActionDistributor
dockable
- the item for which this source will be usedpublic DockAction getDockAction(int index)
DockActionSource
DockAction
of this source.index
- The index of the actionpublic int getDockActionCount()
DockActionSource
DockActions
which are
provided by this source.DockActions
public LocationHint getLocationHint()
DockActionSource
ActionOffer
can choose to ignore these hints, or interpret
them in an unexpected way.public Iterator<DockAction> iterator()
public void setDockable(Dockable dockable)
Dockable
whose DockActionSource
this should be.dockable
- the new owner, can be null
public void addDockActionSourceListener(DockActionSourceListener listener)
DockActionSource
DockActionSourceListener
should
be informed whenever some DockActions
are added or
removed from this source.addDockActionSourceListener
in interface DockActionSource
addDockActionSourceListener
in class AbstractDockActionSource
listener
- The listenerpublic void removeDockActionSourceListener(DockActionSourceListener listener)
DockActionSource
removeDockActionSourceListener
in interface DockActionSource
removeDockActionSourceListener
in class AbstractDockActionSource
listener
- The listener to removeDockActionSource.addDockActionSourceListener(DockActionSourceListener)