public class ActionUtils
extends java.lang.Object
Action related functions.| Modifier and Type | Field and Description |
|---|---|
static @NotNull java.lang.String |
DEFAULT_ACCELERATOR_KEY
Action key to store the default shortcut. |
static @NotNull java.lang.String |
NO_SHORTCUT
The shortcut description for actions without shortcuts.
|
| Modifier and Type | Method and Description |
|---|---|
static @NotNull java.lang.String |
getActionCategory(@NotNull javax.swing.Action action)
Returns an
Action's category. |
static @NotNull java.lang.String |
getActionDescription(@NotNull javax.swing.Action action)
Returns the description for an
Action. |
static @Nullable javax.swing.Icon |
getActionIcon(@NotNull javax.swing.Action action)
Returns an
Icon associated with the action. |
static @NotNull java.lang.String |
getActionId(@NotNull javax.swing.Action action)
Returns an
Action's ID string. |
static @NotNull java.lang.String |
getActionName(@NotNull javax.swing.Action action)
Returns the name of an
Action. |
static @Nullable javax.swing.KeyStroke |
getAlternativeShortcut(@NotNull javax.swing.Action action)
Returns the alternative shortcut of an
Action. |
static @Nullable javax.swing.KeyStroke |
getShortcut(@NotNull javax.swing.Action action)
Returns the shortcut of an
Action. |
static @NotNull java.lang.String |
getShortcutDescription(@NotNull javax.swing.Action action,
@NotNull java.lang.String key)
Returns a description of the shortcut of an
Action. |
static @NotNull javax.swing.Action |
newAction(@NotNull net.sf.japi.swing.action.ActionBuilder actionBuilder,
@NotNull java.lang.String category,
@NotNull EditorAction editorAction,
@NotNull java.lang.String key)
Creates a new
Action instance. |
static @NotNull javax.swing.Action |
newToggleAction(@NotNull net.sf.japi.swing.action.ActionBuilder actionBuilder,
@NotNull java.lang.String category,
@NotNull EditorAction editorAction,
@NotNull java.lang.String key)
Creates a new
Action instance. |
static void |
setActionShortcut(@NotNull javax.swing.Action action,
@Nullable javax.swing.KeyStroke shortcut)
Sets the shortcut of an
Action. |
@NotNull public static final @NotNull java.lang.String NO_SHORTCUT
@NotNull public static final @NotNull java.lang.String DEFAULT_ACCELERATOR_KEY
Action key to store the default shortcut.@NotNull
public static @NotNull java.lang.String getActionName(@NotNull
@NotNull javax.swing.Action action)
Action.action - the action@NotNull
public static @NotNull java.lang.String getActionId(@NotNull
@NotNull javax.swing.Action action)
Action's ID string.action - the actionjava.lang.IllegalArgumentException - if the action does not define an ID
string@NotNull
public static @NotNull java.lang.String getActionDescription(@NotNull
@NotNull javax.swing.Action action)
Action.action - the action@Nullable
public static @Nullable javax.swing.KeyStroke getShortcut(@NotNull
@NotNull javax.swing.Action action)
Action.action - the actionnull@Nullable
public static @Nullable javax.swing.KeyStroke getAlternativeShortcut(@NotNull
@NotNull javax.swing.Action action)
Action.action - the actionnullpublic static void setActionShortcut(@NotNull
@NotNull javax.swing.Action action,
@Nullable
@Nullable javax.swing.KeyStroke shortcut)
Action.action - the actionshortcut - the shortcut or null to remove it@NotNull
public static @NotNull java.lang.String getShortcutDescription(@NotNull
@NotNull javax.swing.Action action,
@NotNull
@NotNull java.lang.String key)
Action. Returns
NO_SHORTCUT if the action defines no shortcut.action - the actionkey - the action key to query@Nullable
public static @Nullable javax.swing.Icon getActionIcon(@NotNull
@NotNull javax.swing.Action action)
Icon associated with the action.action - the actionnull@NotNull
public static @NotNull javax.swing.Action newAction(@NotNull
@NotNull net.sf.japi.swing.action.ActionBuilder actionBuilder,
@NotNull
@NotNull java.lang.String category,
@NotNull
@NotNull EditorAction editorAction,
@NotNull
@NotNull java.lang.String key)
Action instance. It is basically the same as ActionBuilder.createAction(boolean, String, Object) except that the
category is set.actionBuilder - the action builder to usecategory - the category to seteditorAction - the object which defines the action methodkey - the action's key@NotNull
public static @NotNull javax.swing.Action newToggleAction(@NotNull
@NotNull net.sf.japi.swing.action.ActionBuilder actionBuilder,
@NotNull
@NotNull java.lang.String category,
@NotNull
@NotNull EditorAction editorAction,
@NotNull
@NotNull java.lang.String key)
Action instance. It is basically the same as ActionBuilder.createToggle(boolean, String, Object) except that the
category is set.actionBuilder - the action builder to usecategory - the category to seteditorAction - the object which defines the action methodkey - the action's key@NotNull
public static @NotNull java.lang.String getActionCategory(@NotNull
@NotNull javax.swing.Action action)
Action's category.action - the action