public class StationChildrenActionSource extends AbstractDockActionSource
DockActionSource is a wrapper around a Dockable or a DockStation
and adds one DockAction for each child of the station to itself. Subclasses may implement
a filter to show more or less actions.| Modifier and Type | Class and Description |
|---|---|
protected class |
StationChildrenActionSource.FocusAction
An action that can transfer the focus
|
listeners| Constructor and Description |
|---|
StationChildrenActionSource(Dockable dockable,
LocationHint hint)
Creates a new action source.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addDockActionSourceListener(DockActionSourceListener listener)
Adds a listener to this source.
|
protected DockAction |
createActionFor(Dockable dockable)
Creates the
DockAction which is shown for dockable. |
Dockable |
getDockable()
Gets the dockable or station which is managed by 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.
|
protected boolean |
shouldShow(Dockable dockable)
Tells which children to show and which not.
|
protected void |
sort(List<Dockable> dockables)
Puts an order in the dockables, telling which items to show when.
|
fireAdded, fireRemoved, hasListeners, indexOfclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic StationChildrenActionSource(Dockable dockable, LocationHint hint)
dockable - the dockable or station whose children to show, not nullhint - the preferred location of this DockActionSource, may be nullpublic Dockable getDockable()
nullpublic LocationHint getLocationHint()
DockActionSourceActionOffer can choose to ignore these hints, or interpret
them in an unexpected way.public DockAction getDockAction(int index)
DockActionSourceDockAction of this source.index - The index of the actionpublic int getDockActionCount()
DockActionSourceDockActions which are
provided by this source.DockActionspublic Iterator<DockAction> iterator()
public void addDockActionSourceListener(DockActionSourceListener listener)
DockActionSourceDockActionSourceListener should
be informed whenever some DockActions are added or
removed from this source.addDockActionSourceListener in interface DockActionSourceaddDockActionSourceListener in class AbstractDockActionSourcelistener - The listenerpublic void removeDockActionSourceListener(DockActionSourceListener listener)
DockActionSourceremoveDockActionSourceListener in interface DockActionSourceremoveDockActionSourceListener in class AbstractDockActionSourcelistener - The listener to removeDockActionSource.addDockActionSourceListener(DockActionSourceListener)protected DockAction createActionFor(Dockable dockable)
DockAction which is shown for dockable. The
default behavior is to create a ButtonDockAction which can be pressed
and will transfer the focus to dockable.dockable - the item for which an action is requirednullprotected void sort(List<Dockable> dockables)
DockStations
and Dockables). Subclasses may also modify the list by adding or removing items,
although a filter is better implemented by overriding shouldShow(Dockable)dockables - the array to orderprotected boolean shouldShow(Dockable dockable)
true for
any direct child or true if the monitored dockable is no station at all.dockable - the child to checktrue if there should be a button, false otherwiseCopyright © 2017 Docking Frames. All rights reserved.