|
org.netbeans.modules.editor.lib/1 1.14.0 3 | |||||||||
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.
Field Summary | |
---|---|
static int |
ABBREV_RESET
Reset abbreviation accounting to empty string |
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(String name)
|
|
BaseAction(String name,
int updateMask)
|
Method Summary | |
---|---|
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)
|
protected void |
settingsChange(SettingsChangeEvent evt,
Class kitClass)
This method is called once after the action is constructed and then each time the settings are changed. |
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, putValue, 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(String name)
public BaseAction(String name, int updateMask)
Method Detail |
---|
protected Object findValue(String key)
getShortDescriptionBundleClass()
public Object getValue(String key)
getValue
in interface Action
getValue
in class AbstractAction
protected Object createDefaultValue(String key)
AbstractAction.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)
.protected void settingsChange(SettingsChangeEvent evt, Class kitClass)
evt
- event describing the changed setting name. It's null
if it's called after the action construction.kitClass
- class of the kit that created the actionspublic 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.14.0 3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |