Class MenuUtil


  • public class MenuUtil
    extends java.lang.Object
    Provides utilities and constants for use with the new menus API.
    Since:
    3.3
    Restriction:
    This class is not intended to be subclassed by clients.
    Restriction:
    This class is not intended to be instantiated by clients.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String ANY_POPUP
      -Any- Popup Menu
      static java.lang.String MAIN_MENU
      Main Menu
      static java.lang.String MAIN_TOOLBAR
      Main ToolBar (CoolBar)
      static java.lang.String QUERY_AFTER
      Valid query attribute.
      static java.lang.String QUERY_BEFORE
      Valid query attribute.
      static java.lang.String QUERY_ENDOF
      Valid query attribute.
      static java.lang.String SHOW_IN_MENU_ID
      Contributions of targets to this location will be included with the show in menu.
      static java.lang.String TRIM_COMMAND1
      Top Left Trim Area
      static java.lang.String TRIM_COMMAND2
      Top Right Trim Area
      static java.lang.String TRIM_STATUS
      Bottom (Status) Trim Area
      static java.lang.String TRIM_VERTICAL1
      Left Vertical Trim Area
      static java.lang.String TRIM_VERTICAL2
      Right Vertical Trim Area
      static java.lang.String WORKBENCH_MENU
      Workbench Menu.
    • Constructor Summary

      Constructors 
      Constructor Description
      MenuUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String menuAddition​(java.lang.String id)
      Convenience method to create a standard menu addition The resulting string has the format: "menu:[id]?
      static java.lang.String menuAddition​(java.lang.String id, java.lang.String location, java.lang.String refId)  
      static java.lang.String menuUri​(java.lang.String id)  
      static java.lang.String toolbarAddition​(java.lang.String id)
      Convenience method to create a standard toolbar addition The resulting string has the format: "toolbar:[id]?
      static java.lang.String toolbarAddition​(java.lang.String id, java.lang.String location, java.lang.String refId)  
      static java.lang.String toolbarUri​(java.lang.String id)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • WORKBENCH_MENU

        public static final java.lang.String WORKBENCH_MENU
        Workbench Menu. On supported platforms, this menu is shown when no workbench windows are active
        Since:
        3.7
        See Also:
        Constant Field Values
      • MAIN_TOOLBAR

        public static final java.lang.String MAIN_TOOLBAR
        Main ToolBar (CoolBar)
        See Also:
        Constant Field Values
      • ANY_POPUP

        public static final java.lang.String ANY_POPUP
        -Any- Popup Menu
        See Also:
        Constant Field Values
      • TRIM_COMMAND1

        public static final java.lang.String TRIM_COMMAND1
        Top Left Trim Area
        See Also:
        Constant Field Values
      • TRIM_COMMAND2

        public static final java.lang.String TRIM_COMMAND2
        Top Right Trim Area
        See Also:
        Constant Field Values
      • TRIM_VERTICAL1

        public static final java.lang.String TRIM_VERTICAL1
        Left Vertical Trim Area
        See Also:
        Constant Field Values
      • TRIM_VERTICAL2

        public static final java.lang.String TRIM_VERTICAL2
        Right Vertical Trim Area
        See Also:
        Constant Field Values
      • TRIM_STATUS

        public static final java.lang.String TRIM_STATUS
        Bottom (Status) Trim Area
        See Also:
        Constant Field Values
      • QUERY_BEFORE

        public static final java.lang.String QUERY_BEFORE
        Valid query attribute. Usage menu:menu.id?before=contribution.id.
        Since:
        3.6
        See Also:
        Constant Field Values
      • QUERY_AFTER

        public static final java.lang.String QUERY_AFTER
        Valid query attribute. Usage menu:menu.id?after=contribution.id.
        Since:
        3.6
        See Also:
        Constant Field Values
      • QUERY_ENDOF

        public static final java.lang.String QUERY_ENDOF
        Valid query attribute. Usage menu:menu.id?endof=contribution.id.

        This menu contribution will be placed at the end of the group defined by contribution.id (usually right in front of the next group marker or separator). Further contribution processing can still place other contributions after this one.

        Since:
        3.6
        See Also:
        Constant Field Values
      • SHOW_IN_MENU_ID

        public static final java.lang.String SHOW_IN_MENU_ID
        Contributions of targets to this location will be included with the show in menu.
        Since:
        3.4
        See Also:
        Constant Field Values
    • Constructor Detail

      • MenuUtil

        public MenuUtil()
    • Method Detail

      • menuUri

        public static java.lang.String menuUri​(java.lang.String id)
        Parameters:
        id - The menu's id
        Returns:
        The locator URI for a menu with the given id
      • menuAddition

        public static java.lang.String menuAddition​(java.lang.String id,
                                                    java.lang.String location,
                                                    java.lang.String refId)
        Parameters:
        id - The id of the menu
        location - The relative location specifier
        refId - The id of the menu element to be relative to
        Returns:
        A location URI formatted with the given parameters
      • menuAddition

        public static java.lang.String menuAddition​(java.lang.String id)
        Convenience method to create a standard menu addition The resulting string has the format: "menu:[id]?after=additions"
        Parameters:
        id - The id of the root element to contribute to
        Returns:
        The formatted string
      • toolbarUri

        public static java.lang.String toolbarUri​(java.lang.String id)
        Parameters:
        id - The toolbar's id
        Returns:
        The lcoation URI for a toolbar with the given id
      • toolbarAddition

        public static java.lang.String toolbarAddition​(java.lang.String id,
                                                       java.lang.String location,
                                                       java.lang.String refId)
        Parameters:
        id - The id of the toolbar
        location - The relative location specifier
        refId - The id of the toolbar element to be relative to
        Returns:
        A location URI formatted with the given parameters
      • toolbarAddition

        public static java.lang.String toolbarAddition​(java.lang.String id)
        Convenience method to create a standard toolbar addition The resulting string has the format: "toolbar:[id]?after=additions"
        Parameters:
        id - The id of the root element to contribute to
        Returns:
        The formatted string