Class GuiMenuWidgets


  • public class GuiMenuWidgets
    extends BaseGuiWidgets
    This class contains the widgets for Menu Bars
    • Constructor Detail

      • GuiMenuWidgets

        public GuiMenuWidgets()
    • Method Detail

      • createMenuWidgets

        public void createMenuWidgets​(String root,
                                      org.eclipse.swt.widgets.Shell shell,
                                      org.eclipse.swt.widgets.Menu parent)
      • appendShortCut

        public static void appendShortCut​(org.eclipse.swt.widgets.MenuItem menuItem,
                                          KeyboardShortcut shortcut)
      • getAccelerator

        public static int getAccelerator​(KeyboardShortcut shortcut)
      • findMenuItem

        public org.eclipse.swt.widgets.MenuItem findMenuItem​(String id)
        Find the menu item with the given ID
        Parameters:
        id - The ID to look for
        Returns:
        The menu item or null if nothing is found
      • enableMenuItem

        public org.eclipse.swt.widgets.MenuItem enableMenuItem​(String id,
                                                               boolean enabled)
        Find the menu item with the given ID. If we find it we enable or disable it.
        Parameters:
        id - The ID to look for
        enabled - true if the item needs to be enabled.
        Returns:
        The menu item or null if nothing is found
      • enableMenuItem

        public org.eclipse.swt.widgets.MenuItem enableMenuItem​(IHopFileType fileType,
                                                               String id,
                                                               String permission)
        Find the menu item with the given ID. Check the capability in the given file type Enable or disable accordingly.
        Parameters:
        fileType -
        id - The ID of the widget to look for
        permission -
        Returns:
        The menu item or null if nothing is found
      • enableMenuItem

        public org.eclipse.swt.widgets.MenuItem enableMenuItem​(IHopFileType fileType,
                                                               String id,
                                                               String permission,
                                                               boolean active)
        Find the menu item with the given ID. Check the capability in the given file type Enable or disable accordingly.
        Parameters:
        fileType -
        id - The ID of the widget to look for
        permission -
        active - The state if the permission is available
        Returns:
        The menu item or null if nothing is found
      • getMenuItemMap

        public Map<String,​org.eclipse.swt.widgets.MenuItem> getMenuItemMap()
        Gets menuItemMap
        Returns:
        value of menuItemMap
      • setMenuItemMap

        public void setMenuItemMap​(Map<String,​org.eclipse.swt.widgets.MenuItem> menuItemMap)
        Parameters:
        menuItemMap - The menuItemMap to set
      • setShortcutMap

        public void setShortcutMap​(Map<String,​KeyboardShortcut> shortcutMap)
        Sets shortcutMap
        Parameters:
        shortcutMap - value of shortcutMap
      • getMenuEnabledMap

        public Map<String,​Boolean> getMenuEnabledMap()
        Gets menuEnabledMap
        Returns:
        value of menuEnabledMap
      • setMenuEnabledMap

        public void setMenuEnabledMap​(Map<String,​Boolean> menuEnabledMap)
        Sets menuEnabledMap
        Parameters:
        menuEnabledMap - value of menuEnabledMap