bibliothek.gui.dock.themes.basic.action
Class DefaultDockActionImportanceOrder
java.lang.Object
bibliothek.gui.dock.themes.basic.action.DefaultDockActionImportanceOrder
- All Implemented Interfaces:
- DockActionImportanceOrder
- Direct Known Subclasses:
- CActionImportanceOrder
public class DefaultDockActionImportanceOrder
- extends Object
- implements DockActionImportanceOrder
This class orders DockAction
s depending on the annotation DockActionImportance
. It
can be subclassed in order to override the default behavior.
- Author:
- Benjamin Sigg
Method Summary |
protected double |
getImportance(DockAction action)
Tells how important action is. |
void |
order(DockAction[] actions)
Sorts the actions by their important, the most important action
has to be at index 0 , while the least important action
is at index actions.length-1 . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultDockActionImportanceOrder
public DefaultDockActionImportanceOrder()
order
public void order(DockAction[] actions)
- Description copied from interface:
DockActionImportanceOrder
- Sorts the actions by their important, the most important action
has to be at index
0
, while the least important action
is at index actions.length-1
. This method must not add or remove
any actions from action
, it must only rearrange the content of
actions
- Specified by:
order
in interface DockActionImportanceOrder
- Parameters:
actions
- the array of actions to sort
getImportance
protected double getImportance(DockAction action)
- Tells how important
action
is. The default implementation just searches for
a DockActionImportance
, but subclasses may change the behavior.
- Parameters:
action
- the action whose importance is searched
- Returns:
- the importance, the default value is 1.0