|
org.netbeans.modules.editor.lib/1 1.43.0 9 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.swing.AbstractAction
javax.swing.text.TextAction
org.netbeans.editor.BaseAction
public abstract class BaseAction
This is the parent of majority of the actions. It implements
the necessary resetting depending of what is required
by constructor of target action.
The other thing implemented here is macro recording.
Property "noIconInMenu" can be set to inform menu items not to use action's icon.
| Field Summary | |
|---|---|
static int |
ABBREV_RESET
Deprecated. Not used anymore. |
static int |
CLEAR_STATUS_TEXT
Clear status bar text |
static String |
ICON_RESOURCE_PROPERTY
Resource for the icon |
static String |
LOCALE_DESC_PREFIX
Prefix for the name of the key for description in locale support |
static String |
LOCALE_POPUP_PREFIX
Prefix for the name of the key for popup description in locale support |
static int |
MAGIC_POSITION_RESET
Reset magic caret position |
static String |
NO_KEYBINDING
The name of Action property. |
static int |
NO_RECORDING
The action will not be recorded if in macro recording |
static String |
POPUP_MENU_TEXT
Text of the menu item in popup menu for this action |
static int |
SAVE_POSITION
Save current position in the jump list |
static int |
SELECTION_REMOVE
Remove the selected text at the action begining |
static int |
UNDO_MERGE_RESET
Prevents adding the new undoable edit to the old one when the next document change occurs. |
protected int |
updateMask
Bit mask of what should be updated when the action is performed before the action's real task is invoked. |
static int |
WORD_MATCH_RESET
Reset word-match table |
| Fields inherited from class javax.swing.AbstractAction |
|---|
changeSupport, enabled |
| Fields inherited from interface javax.swing.Action |
|---|
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON |
| Constructor Summary | |
|---|---|
BaseAction()
|
|
BaseAction(int updateMask)
|
|
BaseAction(String name)
|
|
BaseAction(String name,
int updateMask)
|
|
| Method Summary | |
|---|---|
protected void |
actionNameUpdate(String actionName)
Called by #putValue(String,String) when Action.NAME property
is set to a non-null String value. |
void |
actionPerformed(ActionEvent evt)
This method is made final here as there's an important processing that must be done before the real action functionality is performed. |
abstract void |
actionPerformed(ActionEvent evt,
JTextComponent target)
The target method that performs the real action functionality. |
protected boolean |
asynchonous()
|
protected Object |
createDefaultValue(String key)
This method is called when there is no value for the particular key. |
protected Object |
findValue(String key)
Deprecated. this method is deprecated like the LocaleSupport which it uses by default. It should be replaced by implementing getShortDescriptionBundleClass() |
protected Object |
getDefaultShortDescription()
Get the default value for Action.SHORT_DESCRIPTION property. |
JMenuItem |
getPopupMenuItem(JTextComponent target)
|
String |
getPopupMenuText(JTextComponent target)
|
protected Class |
getShortDescriptionBundleClass()
Get the class in a package where resource bundle for localization of the short description of this action resides. |
Object |
getValue(String key)
|
void |
putValue(String key,
Object value)
|
void |
updateComponent(JTextComponent target)
Update the component according to the update mask specified in the constructor of the action. |
void |
updateComponent(JTextComponent target,
int updateMask)
Update the component according to the given update mask |
| Methods inherited from class javax.swing.text.TextAction |
|---|
augmentList, getFocusedComponent, getTextComponent |
| Methods inherited from class javax.swing.AbstractAction |
|---|
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, isEnabled, removePropertyChangeListener, setEnabled |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String POPUP_MENU_TEXT
public static final String LOCALE_DESC_PREFIX
public static final String LOCALE_POPUP_PREFIX
public static final String ICON_RESOURCE_PROPERTY
public static final int SELECTION_REMOVE
public static final int MAGIC_POSITION_RESET
public static final int ABBREV_RESET
public static final int UNDO_MERGE_RESET
public static final int WORD_MATCH_RESET
public static final int CLEAR_STATUS_TEXT
public static final int NO_RECORDING
public static final int SAVE_POSITION
public static final String NO_KEYBINDING
protected int updateMask
| Constructor Detail |
|---|
public BaseAction()
public BaseAction(int updateMask)
public BaseAction(String name)
public BaseAction(String name,
int updateMask)
| Method Detail |
|---|
protected Object findValue(String key)
getShortDescriptionBundleClass()
public Object getValue(String key)
getValue in interface ActiongetValue in class AbstractAction
public void putValue(String key,
Object value)
putValue in interface ActionputValue in class AbstractActionprotected void actionNameUpdate(String actionName)
#putValue(String,String) when Action.NAME property
is set to a non-null String value. This allows a "polymorphic" action (with
Action.NAME-specific behavior) to update certain properties (e.g. an icon)
according to the name that was set.
actionName - non-null action's name (value of Action.NAME property).protected Object createDefaultValue(String key)
putValue(String, Object) so in that case this method
is only called once.
Note: When overriding this method super implementation
should always be called.
key - key for which the default value should be found.
protected Class getShortDescriptionBundleClass()
protected Object getDefaultShortDescription()
Action.SHORT_DESCRIPTION property.
Action.getValue(Action.SHORT_DESCRIPTION).public final void actionPerformed(ActionEvent evt)
public abstract void actionPerformed(ActionEvent evt,
JTextComponent target)
evt - action event describing the action that occuredtarget - target component where the action occured. It's retrieved
by the TextAction.getTextComponent(evt).protected boolean asynchonous()
public JMenuItem getPopupMenuItem(JTextComponent target)
public String getPopupMenuText(JTextComponent target)
public void updateComponent(JTextComponent target)
target - target component to be updated.
public void updateComponent(JTextComponent target,
int updateMask)
target - target component to be updated.updateMask - mask that specifies what will be updated
|
org.netbeans.modules.editor.lib/1 1.43.0 9 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||