@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.
|
BaseElement |
getFirstElement(Tree tree)
Returns first selected element in a given tree.
|
java.util.Collection<? extends BaseElement> |
getSelectedBaseElements()
Collects selected base elements in tree
|
protected java.lang.Object |
getSelectedObject() |
static java.lang.Object |
getSelectedObject(Tree tree)
Returns first selected object in a given tree.
|
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, isUseShortcutSchema, updateState
accept, addAction, addPropertyChangeListener, addShortcut, addShotcut, addWeakPropertyChangeListener, clone, compareTo, createMenuItem, equals, firePropertyChange, forEach, forEachIncludingSelf, getActions, getCommandKey, getDescription, getGroup, getIcon, getID, getLargeIcon, getLargeOrSmallIcon, getMenuShortcutMaskAsString, getMnemonicKey, getName, getPropertyChangeListeners, getShortcuts, getSmallIcon, getSmallOrLargeIcon, getTinyIcon, hashCode, hasMenuShortcutMask, isIDGenerated, removeAction, removeIf, 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 java.lang.Object getSelectedObject(@CheckForNull Tree tree)
tree
- given tree@CheckForNull public BaseElement getFirstElement(@CheckForNull Tree tree)
tree
- given tree@CheckForNull public BaseElement getFirstElement()
@CheckForNull protected java.lang.Object getSelectedObject()
public java.util.Collection<?> getSelectedObjects()
public java.util.Collection<? extends BaseElement> getSelectedBaseElements()