public class MultiDockActionSource extends AbstractDockActionSource
DockActionSource that combines various sources in one source.
This source behaves like a list of DockActionSources.listeners| Constructor and Description |
|---|
MultiDockActionSource(DockActionSource... sources)
Constructs a new source.
|
MultiDockActionSource(LocationHint hint,
DockActionSource... sources)
Constructs a new source.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(DockAction... actions)
Adds several actions to this source.
|
void |
add(DockActionSource source)
Adds a source as child of this source.
|
void |
addDockActionSourceListener(DockActionSourceListener listener)
Adds a listener to this source.
|
void |
addSeparator()
Adds a separator at the end of the current list of actions
|
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. |
protected int |
getDockActionCountUntil(int index,
boolean allowUpdate)
Counts how many
DockActions are provided by the
source-children with index 0 (incl) to index (excl). |
LocationHint |
getLocationHint()
Gets a hint where to put this source in relation to other sources.
|
protected int |
getSource(DockAction action)
Gets the index of the child-source which contains
action. |
boolean |
isSeparateSources()
Tells whether there is a separator between sources or not
|
Iterator<DockAction> |
iterator() |
void |
remove(DockActionSource source)
Removes
source from this MultiDockActionSource. |
void |
removeAll()
Removes all children of this source.
|
void |
removeDockActionSourceListener(DockActionSourceListener listener)
Removes an earlier added listener.
|
void |
setHint(LocationHint hint)
Sets the location-hint of this source.
|
void |
setSeparateSources(boolean separateSources)
Sets whether there are separators between the children of this
source or not.
|
fireAdded, fireRemoved, hasListeners, indexOfclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic MultiDockActionSource(DockActionSource... sources)
sources are added as children
of this source.sources - The children of this sourcepublic MultiDockActionSource(LocationHint hint, DockActionSource... sources)
sources are added as children
of this source.hint - the preferred location of this sourcesources - The children of this sourcepublic 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)public LocationHint getLocationHint()
DockActionSourceActionOffer can choose to ignore these hints, or interpret
them in an unexpected way.public void setHint(LocationHint hint)
hint - the hint that tells an ActionOffer where to
put this source.public void addSeparator()
public boolean isSeparateSources()
true if there is a separatorpublic void setSeparateSources(boolean separateSources)
separateSources - true if children should be separatedpublic void add(DockActionSource source)
DockActions
of source will be presented as actions of this source.source - the new childpublic void remove(DockActionSource source)
source from this MultiDockActionSource.source - the child to removepublic void removeAll()
public void add(DockAction... actions)
actions - the new actionspublic int getDockActionCount()
DockActionSourceDockActions which are
provided by this source.DockActionsprotected int getSource(DockAction action)
action.action - the action for which is searchedprotected int getDockActionCountUntil(int index,
boolean allowUpdate)
DockActions are provided by the
source-children with index 0 (incl) to index (excl).index - the index of the first source that should not be countedallowUpdate - whether the updateSeparators() can be called
by this method or notindex
child-sources.public DockAction getDockAction(int index)
DockActionSourceDockAction of this source.index - The index of the actionCopyright © 2017 Docking Frames. All rights reserved.