public class DefaultActionGroup extends ActionGroup
ActionGroup
. Provides the ability
to add children actions and separators between them. In most of the
cases you will be using this implementation but note that there are
cases (for example "Recent files" dialog) where children are determined
on rules different than just positional constraints, that's when you need
to implement your own ActionGroup
.AnAction.TransparentUpdate
EMPTY_GROUP
ACTIONS_KEY, EMPTY_ARRAY
Modifier | Constructor and Description |
---|---|
|
DefaultActionGroup() |
|
DefaultActionGroup(AnAction... actions)
Creates an action group containing the specified actions.
|
|
DefaultActionGroup(java.util.List<? extends AnAction> actions)
Creates an action group containing the specified actions.
|
|
DefaultActionGroup(java.lang.String shortName,
boolean popup) |
|
DefaultActionGroup(java.lang.String name,
java.util.List<? extends AnAction> actions) |
protected |
DefaultActionGroup(java.util.function.Supplier<java.lang.String> shortName,
boolean popup) |
|
DefaultActionGroup(java.util.function.Supplier<java.lang.String> name,
java.util.List<? extends AnAction> actions) |
Modifier and Type | Method and Description |
---|---|
void |
add(AnAction action) |
void |
add(AnAction action,
ActionManager actionManager)
Adds the specified action to the tail.
|
void |
add(AnAction action,
Constraints constraint)
Adds the specified action with the specified constraint.
|
void |
add(AnAction action,
Constraints constraint,
ActionManager actionManager) |
ActionInGroup |
addAction(AnAction action) |
ActionInGroup |
addAction(AnAction action,
Constraints constraint) |
ActionInGroup |
addAction(AnAction action,
Constraints constraint,
ActionManager actionManager) |
void |
addAll(ActionGroup group) |
void |
addAll(AnAction... actions) |
void |
addAll(java.util.Collection<? extends AnAction> actionList) |
void |
addAll(java.util.Collection<? extends AnAction> actionList,
ActionManager actionManager) |
void |
addSeparator()
Adds a separator to the tail.
|
void |
addSeparator(java.lang.String separatorText) |
void |
copyFromGroup(DefaultActionGroup other)
Copies content from
group . |
static DefaultActionGroup |
createFlatGroup(java.util.function.Supplier<java.lang.String> shortName) |
static DefaultActionGroup |
createPopupGroup(java.util.function.Supplier<java.lang.String> shortName) |
static DefaultActionGroup |
createPopupGroupWithEmptyText() |
static DefaultActionGroup |
createUserDataAwareGroup(java.lang.String templateText)
Creates an action group with specified template text.
|
AnAction [] |
getChildActionsOrStubs() |
AnAction [] |
getChildren(AnActionEvent e)
Returns the children of the group.
|
AnAction [] |
getChildren(AnActionEvent e,
ActionManager actionManager)
Returns group's children in the order determined by constraints.
|
int |
getChildrenCount()
Returns the number of contained children (including separators).
|
int |
getModificationStamp() |
void |
remove(AnAction action)
Removes specified action from group.
|
void |
remove(AnAction action,
ActionManager actionManager) |
void |
remove(AnAction action,
java.lang.String id) |
void |
removeAll()
Removes all children actions (separators as well) from the group.
|
boolean |
replaceAction(AnAction oldAction,
AnAction newAction)
Replaces specified action with the a one.
|
actionPerformed, addPropertyChangeListener, canBePerformed, disableIfNoVisibleChildren, firePropertyChange, hideIfNoVisibleChildren, isDumbAware, isPopup, isPopup, isPrimary, removePropertyChangeListener, replace, setPopup
addTextOverride, applyTextOverride, beforeActionPerformedUpdate, copyFrom, copyShortcutFrom, displayTextInToolbar, getEventProject, getShortcutSet, getTemplatePresentation, getTemplateText, isDefaultIcon, isEnabledInModalContext, isInInjectedContext, isTransparentUpdate, registerCustomShortcutSet, registerCustomShortcutSet, registerCustomShortcutSet, registerCustomShortcutSet, setDefaultIcon, setEnabledInModalContext, setInjectedContext, setShortcutSet, startInTransaction, toString, unregisterCustomShortcutSet, update, useSmallerFontForTextInToolbar
public DefaultActionGroup()
public DefaultActionGroup(AnAction... actions)
actions
- the actions to add to the grouppublic DefaultActionGroup(java.util.List<? extends AnAction> actions)
actions
- the actions to add to the grouppublic DefaultActionGroup(java.util.function.Supplier<java.lang.String> name, java.util.List<? extends AnAction> actions)
public DefaultActionGroup(java.lang.String name, java.util.List<? extends AnAction> actions)
public DefaultActionGroup(java.lang.String shortName, boolean popup)
protected DefaultActionGroup(java.util.function.Supplier<java.lang.String> shortName, boolean popup)
public static DefaultActionGroup createPopupGroup(java.util.function.Supplier<java.lang.String> shortName)
public static DefaultActionGroup createFlatGroup(java.util.function.Supplier<java.lang.String> shortName)
public static DefaultActionGroup createPopupGroupWithEmptyText()
public int getModificationStamp()
public final void add(AnAction action, ActionManager actionManager)
action
- Action to be addedactionManager
- ActionManager instancepublic final void add(AnAction action)
public final ActionInGroup addAction(AnAction action)
public final void addSeparator()
public final void add(AnAction action, Constraints constraint)
action
- Action to be added; cannot be nullconstraint
- Constraint to be used for determining action's position; cannot be nulljava.lang.IllegalArgumentException
- in case when:
public final ActionInGroup addAction(AnAction action, Constraints constraint)
public final void add(AnAction action, Constraints constraint, ActionManager actionManager)
public final ActionInGroup addAction(AnAction action, Constraints constraint, ActionManager actionManager)
public final void remove(AnAction action)
action
- Action to be removedpublic final void remove(AnAction action, ActionManager actionManager)
public final void remove(AnAction action, java.lang.String id)
public final void removeAll()
public boolean replaceAction(AnAction oldAction, AnAction newAction)
public void copyFromGroup(DefaultActionGroup other)
group
.other
- group to copy frompublic AnAction [] getChildren(AnActionEvent e)
ActionGroup
getChildren
in class ActionGroup
null
.public final AnAction [] getChildren(AnActionEvent e, ActionManager actionManager)
getChildren
in class ActionGroup
e
- not usedpublic final int getChildrenCount()
public final AnAction [] getChildActionsOrStubs()
public final void addAll(ActionGroup group)
public final void addAll(java.util.Collection<? extends AnAction> actionList)
public final void addAll(java.util.Collection<? extends AnAction> actionList, ActionManager actionManager)
public final void addAll(AnAction... actions)
public void addSeparator(java.lang.String separatorText)
public static DefaultActionGroup createUserDataAwareGroup(java.lang.String templateText)
templateText
- template text which will be used in statistics