public final class ActionManagerImpl extends ActionManagerEx implements Disposable
Disposable.Parent
Modifier and Type | Method and Description |
---|---|
void |
addActionPopup(java.lang.Object menu) |
void |
addActionPopupMenuListener(ActionPopupMenuListener listener,
Disposable parentDisposable)
Allows to receive notifications when popup menus created from action groups are shown and hidden.
|
void |
addAnActionListener(AnActionListener listener) |
void |
addTimerListener(int delay,
TimerListener listener) |
void |
addTransparentTimerListener(int delay,
TimerListener listener) |
boolean |
canUnloadActions(IdeaPluginDescriptor pluginDescriptor) |
ActionPopupMenu |
createActionPopupMenu(java.lang.String place,
ActionGroup group)
Factory method that creates an
ActionPopupMenu from the
specified group. |
ActionPopupMenu |
createActionPopupMenu(java.lang.String place,
ActionGroup group,
PresentationFactory presentationFactory) |
ActionToolbar |
createActionToolbar(java.lang.String place,
ActionGroup group,
boolean horizontal)
Factory method that creates an
ActionToolbar from the
specified group. |
ActionToolbar |
createActionToolbar(java.lang.String place,
ActionGroup group,
boolean horizontal,
boolean decorateButtons) |
javax.swing.JComponent |
createButtonToolbar(java.lang.String actionPlace,
ActionGroup messageActionGroup)
Creates a panel with buttons which invoke actions from the specified action group.
|
void |
dispose()
Usually not invoked directly, see class javadoc.
|
void |
fireAfterActionPerformed(AnAction action,
DataContext dataContext,
AnActionEvent event) |
void |
fireBeforeActionPerformed(AnAction action,
DataContext dataContext,
AnActionEvent event) |
void |
fireBeforeEditorTyping(char c,
DataContext dataContext) |
AnAction |
getAction(java.lang.String id)
Returns action associated with the specified actionId.
|
java.util.Set<java.lang.String> |
getActionIds() |
java.lang.String [] |
getActionIds(java.lang.String idPrefix)
Returns the list of all registered action IDs with the specified prefix.
|
AnAction |
getActionOrStub(java.lang.String id) |
AnAction |
getBaseAction(OverridingAction overridingAction)
Returns the action overridden by the specified overriding action (with overrides="true" in plugin.xml).
|
java.lang.String |
getId(AnAction action)
Returns actionId associated with the specified action.
|
KeyboardShortcut |
getKeyboardShortcut(java.lang.String actionId) |
java.lang.String |
getLastPreformedActionId()
For logging purposes
|
DefaultActionGroup |
getParentGroup(java.lang.String groupId,
java.lang.String actionName,
PluginId pluginId) |
java.lang.String [] |
getPluginActions(PluginId pluginName) |
java.lang.String |
getPrevPreformedActionId() |
java.util.Comparator<java.lang.String> |
getRegistrationOrderComparator()
Comparator compares action ids (String) on order of action registration.
|
boolean |
isActionPopupStackEmpty() |
boolean |
isGroup(java.lang.String actionId)
Checks if the specified action ID represents an action group and not an individual action.
|
boolean |
isToolWindowContextMenuVisible() |
boolean |
isTransparentOnlyActionsUpdateNow() |
void |
preloadActions(ProgressIndicator indicator) |
void |
queueActionPerformedEvent(AnAction action,
DataContext context,
AnActionEvent event) |
void |
registerAction(java.lang.String actionId,
AnAction action)
Registers the specified action with the specified id.
|
void |
registerAction(java.lang.String actionId,
AnAction action,
PluginId pluginId)
Registers the specified action with the specified id.
|
void |
registerAction(java.lang.String actionId,
AnAction action,
PluginId pluginId,
java.lang.String projectType) |
void |
registerPluginActions(IdeaPluginDescriptorImpl plugin,
java.util.List<Element> actionDescriptionElements,
boolean initialStartup) |
void |
removeAnActionListener(AnActionListener listener) |
void |
removeTimerListener(TimerListener listener) |
void |
removeTransparentTimerListener(TimerListener listener) |
void |
replaceAction(java.lang.String actionId,
AnAction newAction)
Replaces an existing action with ID
actionId by newAction . |
ActionCallback |
tryToExecute(AnAction action,
java.awt.event.InputEvent inputEvent,
java.awt.Component contextComponent,
java.lang.String place,
boolean now) |
void |
unloadActions(IdeaPluginDescriptor pluginDescriptor) |
void |
unregisterAction(java.lang.String actionId)
Unregisters the action with the specified actionId.
|
fireBeforeActionPerformed, getInstanceEx, getKeyStroke
addAnActionListener, getComponentName, getInstance
public void dispose()
Disposable
dispose
in interface Disposable
public void addTimerListener(int delay, TimerListener listener)
addTimerListener
in class ActionManager
public void removeTimerListener(TimerListener listener)
removeTimerListener
in class ActionManager
public void addTransparentTimerListener(int delay, TimerListener listener)
addTransparentTimerListener
in class ActionManager
public void removeTransparentTimerListener(TimerListener listener)
removeTransparentTimerListener
in class ActionManager
public ActionPopupMenu createActionPopupMenu(java.lang.String place, ActionGroup group, PresentationFactory presentationFactory)
public ActionPopupMenu createActionPopupMenu(java.lang.String place, ActionGroup group)
ActionManager
ActionPopupMenu
from the
specified group. The specified place is associated with the created popup.createActionPopupMenu
in class ActionManager
place
- Determines the place that will be set for AnActionEvent
passed
when an action from the group is either performed or updated
See ActionPlaces
group
- Group from which the actions for the menu are taken.ActionPopupMenu
public ActionToolbar createActionToolbar(java.lang.String place, ActionGroup group, boolean horizontal)
ActionManager
ActionToolbar
from the
specified group. The specified place is associated with the created toolbar.createActionToolbar
in class ActionManager
place
- Determines the place that will be set for AnActionEvent
passed
when an action from the group is either performed or updated.
See ActionPlaces
group
- Group from which the actions for the toolbar are taken.horizontal
- The orientation of the toolbar (true
- horizontal, false
- vertical)ActionToolbar
public ActionToolbar createActionToolbar(java.lang.String place, ActionGroup group, boolean horizontal, boolean decorateButtons)
createActionToolbar
in class ActionManagerEx
public void registerPluginActions(IdeaPluginDescriptorImpl plugin, java.util.List<Element> actionDescriptionElements, boolean initialStartup)
public AnAction getAction(java.lang.String id)
ActionManager
getAction
in class ActionManager
id
- Id of the registered actionnull
if
there is no actions associated with the specified actionIdIdeActions
public java.lang.String getId(AnAction action)
ActionManager
getId
in class ActionManager
null
if action
is not registeredpublic java.lang.String [] getActionIds(java.lang.String idPrefix)
ActionManager
getActionIds
in class ActionManager
id
s which have the specified prefix.public boolean isGroup(java.lang.String actionId)
ActionManager
isGroup
in class ActionManager
actionId
- the ID to check.true
if the ID represents an action group, false
otherwise.public javax.swing.JComponent createButtonToolbar(java.lang.String actionPlace, ActionGroup messageActionGroup)
ActionManager
createButtonToolbar
in class ActionManager
actionPlace
- the place where the panel will be used (see ActionPlaces
).messageActionGroup
- the action group from which the toolbar is created.public AnAction getActionOrStub(java.lang.String id)
getActionOrStub
in class ActionManager
public DefaultActionGroup getParentGroup(java.lang.String groupId, java.lang.String actionName, PluginId pluginId)
public boolean canUnloadActions(IdeaPluginDescriptor pluginDescriptor)
public void unloadActions(IdeaPluginDescriptor pluginDescriptor)
public void registerAction(java.lang.String actionId, AnAction action, PluginId pluginId)
ActionManager
registerAction
in class ActionManager
actionId
- Id to associate with the actionaction
- Action to registerpluginId
- Identifier of the plugin owning the action. Used to show the actions in the
correct place under the "Plugins" node in the "Keymap" settings pane and similar dialogs.public void registerAction(java.lang.String actionId, AnAction action, PluginId pluginId, java.lang.String projectType)
public void registerAction(java.lang.String actionId, AnAction action)
ActionManager
registerAction
in class ActionManager
actionId
- Id to associate with the actionaction
- Action to registerpublic void unregisterAction(java.lang.String actionId)
ActionManager
ActionManager.replaceAction(String, AnAction)
instead, otherwise references in action groups may not be replaced.unregisterAction
in class ActionManager
actionId
- Id of the action to be unregisteredpublic java.util.Comparator<java.lang.String> getRegistrationOrderComparator()
ActionManagerEx
getRegistrationOrderComparator
in class ActionManagerEx
public java.lang.String [] getPluginActions(PluginId pluginName)
getPluginActions
in class ActionManagerEx
public void addActionPopup(java.lang.Object menu)
public void queueActionPerformedEvent(AnAction action, DataContext context, AnActionEvent event)
queueActionPerformedEvent
in class ActionManagerEx
public boolean isToolWindowContextMenuVisible()
public boolean isActionPopupStackEmpty()
isActionPopupStackEmpty
in class ActionManagerEx
public boolean isTransparentOnlyActionsUpdateNow()
isTransparentOnlyActionsUpdateNow
in class ActionManagerEx
public void addActionPopupMenuListener(ActionPopupMenuListener listener, Disposable parentDisposable)
ActionManagerEx
addActionPopupMenuListener
in class ActionManagerEx
public void replaceAction(java.lang.String actionId, AnAction newAction)
ActionManager
actionId
by newAction
. Using this method for changing behavior of a platform action
is not recommended, extract an extension point in the action implementation instead.replaceAction
in class ActionManager
public AnAction getBaseAction(OverridingAction overridingAction)
public void addAnActionListener(AnActionListener listener)
addAnActionListener
in class ActionManager
public void removeAnActionListener(AnActionListener listener)
removeAnActionListener
in class ActionManager
public void fireBeforeActionPerformed(AnAction action, DataContext dataContext, AnActionEvent event)
fireBeforeActionPerformed
in class ActionManagerEx
public void fireAfterActionPerformed(AnAction action, DataContext dataContext, AnActionEvent event)
fireAfterActionPerformed
in class ActionManagerEx
public KeyboardShortcut getKeyboardShortcut(java.lang.String actionId)
getKeyboardShortcut
in class ActionManager
public void fireBeforeEditorTyping(char c, DataContext dataContext)
fireBeforeEditorTyping
in class ActionManagerEx
public java.lang.String getLastPreformedActionId()
ActionManagerEx
getLastPreformedActionId
in class ActionManagerEx
public java.lang.String getPrevPreformedActionId()
getPrevPreformedActionId
in class ActionManagerEx
public java.util.Set<java.lang.String> getActionIds()
public void preloadActions(ProgressIndicator indicator)
public ActionCallback tryToExecute(AnAction action, java.awt.event.InputEvent inputEvent, java.awt.Component contextComponent, java.lang.String place, boolean now)
tryToExecute
in class ActionManager