Annotation Type ActionReference


@Retention(SOURCE) @Target({TYPE,FIELD,METHOD}) public @interface ActionReference
Registers an action under associated identifier specified by separate ActionID annotation on the same element. Usually it is used together with ActionRegistration. You can place your action reference into any path, here are few typical locations:
  • menu - path="Menu/File", path="Menu/Edit", etc.
  • toolbar - path="Toolbars/Edit" and other peer directories
  • shortcuts - path="Shortcuts" name="C-F2 D-A", see Utilities.stringToKeys(java.lang.String) and Utilities.stringToKey(java.lang.String) for description of valid reference names
  • context menus - path="Loaders/text/xml", and other mime types
Since:
7.27
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    Into which location one wants to place the reference? Translates to FileUtil.getConfigFile(java.lang.String).
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Identification of the action this reference shall point to.
    One can specify name of the reference.
    int
    Position in the location.
    int
    Shall a separator be placed after the action?
    int
    Shall a separator be placed before the action?
  • Element Details

    • path

      String path
      Into which location one wants to place the reference? Translates to FileUtil.getConfigFile(java.lang.String).
    • position

      int position
      Position in the location.
      Default:
      2147483647
    • id

      Identification of the action this reference shall point to. Usually this is specified as ActionID peer annotation, but in case one was to create references to actions defined by someone else, one can specify the id() here.
      Default:
      @org.openide.awt.ActionID(id="", category="")
    • name

      String name
      One can specify name of the reference. This is not necessary, then it is deduced from associated ActionID.
      Default:
      ""
    • separatorBefore

      int separatorBefore
      Shall a separator be placed before the action?
      Returns:
      position that is lower than position()
      Default:
      2147483647
    • separatorAfter

      int separatorAfter
      Shall a separator be placed after the action?
      Returns:
      position that is higher than position()
      Default:
      2147483647