|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object bibliothek.gui.dock.action.actions.AbstractStandardDockAction bibliothek.gui.dock.action.actions.SimpleDockAction bibliothek.gui.dock.action.actions.SimpleDropDownAction
@Todo(priority=ENHANCEMENT, compatibility=COMPATIBLE, target=VERSION_1_1_0, description="Allow clients to set the DockActionSource directly") public class SimpleDropDownAction
A dropdown action that has the same properties for all Dockables.
Constructor Summary | |
---|---|
SimpleDropDownAction()
|
Method Summary | ||
---|---|---|
void |
add(DockAction action)
Adds an action to the menu. |
|
void |
addDropDownActionListener(DropDownActionListener listener)
Adds a listener to this action. |
|
|
createView(ViewTarget<V> target,
ActionViewConverter converter,
Dockable dockable)
Creates a view for this action, for the platform target and
with help of converter . |
|
protected void |
fireSelectionChanged()
Informs all listeners that the selection has changed. |
|
DropDownFilterFactory |
getFilter(Dockable dockable)
Gets a filter that chooses the values that will be shown for this action and its selection. |
|
protected DropDownActionListener[] |
getListeners()
Gets an array of all listeners that are registered to this action. |
|
DockAction |
getSelection(Dockable dockable)
Gets the last selected action, which may be null . |
|
DefaultDockActionSource |
getSubActions(Dockable dockable)
Gets the actions that should be shown for this action. |
|
void |
insert(int index,
DockAction... action)
Inserts a list of actions into the menu. |
|
void |
insert(int index,
DockAction action)
Inserts an action into the menu. |
|
void |
remove(DockAction action)
Removes action from the menu. |
|
void |
remove(int index)
Removes an action from the menu. |
|
void |
removeDropDownActionListener(DropDownActionListener listener)
Removes a listener from this action. |
|
void |
setFilter(DropDownFilterFactory filter)
Sets the filter that will be used to filter text, icon, tooltips, etc. |
|
void |
setSelection(Dockable dockable,
DockAction selection)
Sets the current selection. |
|
void |
setSelection(DockAction selection)
Changes the selection of this drop-down-action. |
|
int |
size()
Gets the number of actions shown in the menu. |
|
boolean |
trigger(Dockable dockable)
Does the appropriate action that can be done respecting the current state of this action. |
Methods inherited from class bibliothek.gui.dock.action.actions.SimpleDockAction |
---|
bound, getAccelerator, getDisabledIcon, getDisabledIcon, getIcon, getIcon, getText, getText, getTooltip, getTooltipText, getTooltipText, isEnabled, isEnabled, setAccelerator, setDisabledIcon, setEnabled, setIcon, setText, setTooltip, trigger, unbound |
Methods inherited from class bibliothek.gui.dock.action.actions.AbstractStandardDockAction |
---|
addDockActionListener, bind, fireActionDisabledIconChanged, fireActionEnabledChanged, fireActionIconChanged, fireActionTextChanged, fireActionTooltipTextChanged, getBoundDockables, isBound, removeDockActionListener, unbind |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface bibliothek.gui.dock.action.StandardDockAction |
---|
addDockActionListener, getDisabledIcon, getIcon, getText, getTooltipText, isEnabled, removeDockActionListener |
Methods inherited from interface bibliothek.gui.dock.action.DockAction |
---|
bind, unbind |
Constructor Detail |
---|
public SimpleDropDownAction()
Method Detail |
---|
public <V> V createView(ViewTarget<V> target, ActionViewConverter converter, Dockable dockable)
DockAction
target
and
with help of converter
. Clients might use their own
code to create a new view, but the preferred way is to call
ActionViewConverter.createView(ActionType, DockAction, ViewTarget, Dockable)
with an ActionType
that fits to this DockAction.
createView
in interface DockAction
V
- the type of view requestedtarget
- The platform on which the view will be usedconverter
- A set of methods that can be used to create a viewdockable
- The Dockable for which the view will be shown. Note that
this action may not yet be bound
to this action.
public DockAction getSelection(Dockable dockable)
DropDownAction
null
.
getSelection
in interface DropDownAction
dockable
- the Dockable for which the last action is requested
null
public void setSelection(Dockable dockable, DockAction selection)
DropDownAction
selection
should
be part of the menu
it should be selectable. The behavior of this method is not
defined if those two conditions are not fulfilled.
setSelection
in interface DropDownAction
dockable
- the dockable for which the selection has been changedselection
- the new selection, may be null
public void setSelection(DockAction selection)
selection
- the newly selected actionpublic void setFilter(DropDownFilterFactory filter)
filter
- the filter, not null
public DropDownFilterFactory getFilter(Dockable dockable)
DropDownAction
getFilter
in interface DropDownAction
dockable
- the dockable for which all values will be used
public void add(DockAction action)
action
- the action to addpublic void insert(int index, DockAction action)
index
- the location of the actionaction
- the new actionpublic void insert(int index, DockAction... action)
index
- the location of the first actionaction
- the actions to addpublic void remove(int index)
index
- the location of the actionpublic int size()
public void remove(DockAction action)
action
from the menu.
action
- the action to removepublic DefaultDockActionSource getSubActions(Dockable dockable)
DropDownAction
getSubActions
in interface DropDownAction
dockable
- the Dockable
for which the actions are requested
public void addDropDownActionListener(DropDownActionListener listener)
DropDownAction
addDropDownActionListener
in interface DropDownAction
listener
- the listenerpublic void removeDropDownActionListener(DropDownActionListener listener)
DropDownAction
removeDropDownActionListener
in interface DropDownAction
listener
- the listener to removeprotected DropDownActionListener[] getListeners()
protected void fireSelectionChanged()
public boolean trigger(Dockable dockable)
DockAction
trigger
in interface DockAction
dockable
- the element for which this action is called
true
if this action could do anything, false
if this action was not able to react in any way to the event.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |