public abstract class AnActionButton extends AnAction implements ShortcutProvider
Modifier and Type | Class and Description |
---|---|
static interface |
AnActionButton.ActionButtonListener |
static class |
AnActionButton.AnActionButtonWrapper |
static class |
AnActionButton.AnActionEventWrapper |
static class |
AnActionButton.CheckedAnActionButton |
AnAction.TransparentUpdate
ACTIONS_KEY, EMPTY_ARRAY
Constructor and Description |
---|
AnActionButton() |
AnActionButton(java.lang.String text) |
AnActionButton(java.lang.String text,
javax.swing.Icon icon) |
AnActionButton(java.lang.String text,
java.lang.String description,
javax.swing.Icon icon) |
AnActionButton(java.util.function.Supplier<java.lang.String> dynamicText) |
AnActionButton(java.util.function.Supplier<java.lang.String> dynamicText,
javax.swing.Icon icon) |
AnActionButton(java.util.function.Supplier<java.lang.String> dynamicText,
java.util.function.Supplier<java.lang.String> dynamicDescription,
javax.swing.Icon icon) |
Modifier and Type | Method and Description |
---|---|
void |
addActionButtonListener(AnActionButton.ActionButtonListener l,
Disposable parentDisposable) |
void |
addCustomUpdater(AnActionButtonUpdater updater) |
static AnActionButton |
fromAction(AnAction action) |
javax.swing.JComponent |
getContextComponent() |
DataContext |
getDataContext() |
RelativePoint |
getPreferredPopupPoint() |
ShortcutSet |
getShortcut() |
boolean |
isEnabled() |
boolean |
isVisible() |
boolean |
removeActionButtonListener(AnActionButton.ActionButtonListener l) |
void |
setContextComponent(javax.swing.JComponent contextComponent) |
void |
setEnabled(boolean enabled) |
void |
setShortcut(ShortcutSet shortcut) |
void |
setVisible(boolean visible) |
void |
update(AnActionEvent e)
Updates the state of the action.
|
void |
updateButton(AnActionEvent e) |
actionPerformed, 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, useSmallerFontForTextInToolbar
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
isDumbAware
public AnActionButton(java.lang.String text)
public AnActionButton(java.util.function.Supplier<java.lang.String> dynamicText)
public AnActionButton(java.lang.String text, java.lang.String description, javax.swing.Icon icon)
public AnActionButton(java.util.function.Supplier<java.lang.String> dynamicText, java.util.function.Supplier<java.lang.String> dynamicDescription, javax.swing.Icon icon)
public AnActionButton(java.lang.String text, javax.swing.Icon icon)
public AnActionButton(java.util.function.Supplier<java.lang.String> dynamicText, javax.swing.Icon icon)
public AnActionButton()
public static AnActionButton fromAction(AnAction action)
public boolean isEnabled()
public void setEnabled(boolean enabled)
public boolean isVisible()
public void setVisible(boolean visible)
public final void update(AnActionEvent e)
AnAction
AnAction.actionPerformed(AnActionEvent)
method and notify
the user that action cannot be executed if it's the case.
If the action is added to a toolbar, its "update" can be called twice a second, but only if there was
any user activity or a focus transfer. If your action's availability is changed
in absence of any of these events, please call ActivityTracker.getInstance().inc()
to notify
action subsystem to update all toolbar actions when your subsystem's determines that its actions' visibility might be affected.public final void addCustomUpdater(AnActionButtonUpdater updater)
public void updateButton(AnActionEvent e)
public ShortcutSet getShortcut()
getShortcut
in interface ShortcutProvider
public void setShortcut(ShortcutSet shortcut)
public void setContextComponent(javax.swing.JComponent contextComponent)
public javax.swing.JComponent getContextComponent()
public DataContext getDataContext()
public final RelativePoint getPreferredPopupPoint()
public void addActionButtonListener(AnActionButton.ActionButtonListener l, Disposable parentDisposable)
public boolean removeActionButtonListener(AnActionButton.ActionButtonListener l)