org.netbeans.api.editor
Annotation Type EditorActionRegistration
@Retention(value=SOURCE)
@Target(value={TYPE,METHOD})
public @interface EditorActionRegistration
Registration of an editor action so that it's automatically added into the list
of editor actions even without being explicitly created by BaseKit.createActions().
The corresponding annotation processor will build a xml-layer entry file
in the corresponding /Editors/<mime-type>/Actions folder.
- Since:
- 1.10
|
Required Element Summary |
String |
name
Name of the action that will appear as Action.NAME attribute's value. |
|
Optional Element Summary |
String |
iconResource
Resource specification for small icon. |
String |
menuPath
Path of this action in main menu e.g. |
int |
menuPosition
Integer position of the main menu item among the other menu items. |
String |
menuText
Menu text bundle key of the registered action. |
String |
mimeType
Mime type for which the action will be registered. |
String |
popupPath
Path of this action in popup menu e.g. |
int |
popupPosition
Integer position of the popup menu item among the other popup menu (or submenu) items. |
String |
popupText
Popup menu text bundle key of the registered action. |
String |
preferencesKey
Boolean key in preferences that corresponds to action's selected state. |
String |
shortDescription
Short description bundle key of the action being registered. |
int |
toolBarPosition
Integer position of this action in editor toolbar. |
int |
weight
Allows to make an override of an action by adding a "weight" attribute
into a generated file object in the system filesystem
- see MultiFileSystem. |
name
public abstract String name
- Name of the action that will appear as
Action.NAME attribute's value.
The Swing's text package actions use convention of lowercase letters with hyphens
e.g. "caret-end-word" - see String constants in DefaultEditorKit.
- Returns:
- value of Action.NAME attribute.
mimeType
public abstract String mimeType
- Mime type for which the action will be registered.
It implies the target folder of the registration /Editors/<mime-type>/Actions.
- Returns:
- mime-type of the action registration (for example "text/x-java"
or empty string which means that the action will be registered as global (for all mime-types).
- Default:
- ""
iconResource
public abstract String iconResource
- Resource specification for small icon.
- Returns:
- icon resource specification or default (empty string which means no icon).
- Default:
- ""
shortDescription
public abstract String shortDescription
- Short description bundle key of the action being registered.
Several constructions are allowed:
-
Leave the annotation's default value which means that the short description
will be searched in a bundle located in the same package as the action's class
by a key equal to action's name (value of Action.NAME property).
-
Value starting with a hash "#key" searches in a bundle in the same package
as the action's class.
-
"bundle#key" allows specification of both bundle and a corresponding key.
-
Empty string "" means that nothing will be generated and
the value of Action.SHORT_DESCRIPTION property will be null.
- Default:
- "BY_ACTION_NAME"
menuText
public abstract String menuText
- Menu text bundle key of the registered action.
If an empty string is used (the default) it will be set to the same value
like action's short description.
Value starting with a hash "#key" searches in a bundle in the same package
as the action's class.
"bundle#key" allows specification of both bundle and a corresponding key.
- Default:
- ""
popupText
public abstract String popupText
- Popup menu text bundle key of the registered action.
If an empty string is used (the default) it will be set to the same value
like menu text.
Value starting with a hash "#key" searches in a bundle in the same package
as the action's class.
"bundle#key" allows specification of both bundle and a corresponding key.
- Default:
- ""
menuPath
public abstract String menuPath
- Path of this action in main menu e.g. "Edit".
- Default:
- ""
menuPosition
public abstract int menuPosition
- Integer position of the main menu item among the other menu items.
The default Integer.MAX_VALUE value means no menu representation.
- Default:
- 2147483647
popupPath
public abstract String popupPath
- Path of this action in popup menu e.g. "" for appearance right in the context menu
or a corresponding path for nested submenu appearance.
- Default:
- ""
popupPosition
public abstract int popupPosition
- Integer position of the popup menu item among the other popup menu (or submenu) items.
The default Integer.MAX_VALUE value means no popup menu representation.
- Default:
- 2147483647
toolBarPosition
public abstract int toolBarPosition
- Integer position of this action in editor toolbar.
The default Integer.MAX_VALUE value means no toolbar representation.
- Default:
- 2147483647
preferencesKey
public abstract String preferencesKey
- Boolean key in preferences that corresponds to action's selected state.
If set to non-empty string the action will be represented by a check-box
in menu and popup menu and the corresponding key will be set in
global mime-lookup MimeLookup.getLookup(MimePath.EMPTY).
- Default:
- ""
weight
public abstract int weight
- Allows to make an override of an action by adding a "weight" attribute
into a generated file object in the system filesystem
- see
MultiFileSystem.
- Returns:
- value of the weight attribute. When omitted (default value 0 is used)
then no weight attribute gets generated.
- Default:
- 0