@OpenApiAll public class DefaultBrowserAction extends MDAction implements BrowserAction
ACTION_SHORTCUTS, BELONGS_TO_SEPARATE_GROUP_IN_UI, DO_NO_SHOW_ACTION_NAME_IN_UI, GENERATED_ID_PREFIX, GROUP, ID, LARGE_ICON, MENU_SHORTCUT_MASK, TINY_ICON
Constructor and Description |
---|
DefaultBrowserAction(java.lang.String actionID,
java.lang.String actionName,
javax.swing.KeyStroke stroke,
java.lang.String group)
Constructs new action.
|
Modifier and Type | Method and Description |
---|---|
BaseElement |
getFirstElement()
Returns first selected element.
|
static BaseElement |
getFirstElement(Tree tree)
Returns first selected element in a given tree.
|
protected java.lang.Object |
getSelectedObject() |
java.util.Collection<?> |
getSelectedObjects()
Collect selected user objects in tree
|
Tree |
getTree()
Return tree of this action.
|
protected Tree |
getTreeOrActiveTree() |
void |
setTree(Tree tree)
Set tree for this action.
|
actionPerformed, updateState
accept, addAction, addPropertyChangeListener, addShortcut, addShotcut, addWeakPropertyChangeListener, clone, compareTo, createMenuItem, equals, firePropertyChange, getActions, getCommandKey, getDescription, getGroup, getIcon, getID, getLargeIcon, getLargeOrSmallIcon, getMenuShortcutMaskAsString, getMnemonicKey, getName, getPropertyChangeListeners, getShortcuts, getSmallIcon, getSmallOrLargeIcon, getTinyIcon, hashCode, hasMenuShortcutMask, isIDGenerated, removeAction, removePropertyChangeListener, removeShortcut, removeWeakPropertyChangeListener, setActions, setDescription, setGroup, setIcon, setLargeIcon, setMnemonicKey, setName, setShortcuts, setSmallIcon, setTinyIcon, shallowClone, toString
@OpenApi public DefaultBrowserAction(@CheckForNull java.lang.String actionID, java.lang.String actionName, @CheckForNull javax.swing.KeyStroke stroke, @CheckForNull java.lang.String group)
actionID
- the action ID.actionName
- the action name.stroke
- the action stroke.group
- the action group.public void setTree(@CheckForNull Tree tree)
setTree
in interface BrowserAction
tree
- the browser for this action.@CheckForNull public Tree getTree()
@CheckForNull protected Tree getTreeOrActiveTree()
@CheckForNull public static BaseElement getFirstElement(Tree tree)
tree
- given tree@CheckForNull public BaseElement getFirstElement()
@CheckForNull protected java.lang.Object getSelectedObject()
public java.util.Collection<?> getSelectedObjects()