Skip navigation links
org.netbeans.modules.editor.lib2/1 2.19.1 55
org.netbeans.api.editor

Annotation Type EditorActionRegistration

    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element and Description
      String name
      Name of the action that will appear as Action.NAME attribute's value.
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element and Description
      String category
      Name of the keymap-category.
      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.
      boolean noIconInMenu
      True if the action should not display its icon in menu.
      boolean noKeyBinding
      True if the action should not be displayed in customizer for key bindings assignment.
      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.
      boolean preferencesDefault
      Whether or not the action should be in checked state by default.
      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.
    • Element Detail

      • 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
      • noIconInMenu

        public abstract boolean noIconInMenu
        True if the action should not display its icon in menu.
        False by default (icon visible in menu).
        Since:
        1.74
        Default:
        false
      • noKeyBinding

        public abstract boolean noKeyBinding
        True if the action should not be displayed in customizer for key bindings assignment.
        False by default (key binding can be configured for the action).
        Since:
        1.74
        Default:
        false
      • 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:
        ""
      • preferencesDefault

        public abstract boolean preferencesDefault
        Whether or not the action should be in checked state by default.
        If the preference should default to true or to false. Only valid in conjunction with preferencesKey().
        Since:
        1.67
        Default:
        false
      • 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
      • category

        public abstract String category
        Name of the keymap-category. Analog to org.openide.awt.ActionID#category
        Returns:
        string representing programmatic name of the category
        Since:
        2.15
        Default:
        ""

Built on March 4 2024.  |   Copyright © 2017-2024 Apache Software Foundation. All Rights Reserved.