Package org.apache.hop.ui.core.gui
Class GuiMenuWidgets
- java.lang.Object
-
- org.apache.hop.ui.core.gui.BaseGuiWidgets
-
- org.apache.hop.ui.core.gui.GuiMenuWidgets
-
public class GuiMenuWidgets extends BaseGuiWidgets
This class contains the widgets for Menu Bars
-
-
Field Summary
-
Fields inherited from class org.apache.hop.ui.core.gui.BaseGuiWidgets
guiPluginClassName, guiPluginObject, instanceId
-
-
Constructor Summary
Constructors Constructor Description GuiMenuWidgets()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidappendShortCut(org.eclipse.swt.widgets.MenuItem menuItem, KeyboardShortcut shortcut)voidcreateMenuWidgets(String root, org.eclipse.swt.widgets.Shell shell, org.eclipse.swt.widgets.Menu parent)org.eclipse.swt.widgets.MenuItemenableMenuItem(String id, boolean enabled)Find the menu item with the given ID.org.eclipse.swt.widgets.MenuItemenableMenuItem(IHopFileType fileType, String id, String permission)Find the menu item with the given ID.org.eclipse.swt.widgets.MenuItemenableMenuItem(IHopFileType fileType, String id, String permission, boolean active)Find the menu item with the given ID.static voidexecuteMenuItem(GuiMenuItem guiMenuItem, String instanceId)KeyboardShortcutfindKeyboardShortcut(String id)org.eclipse.swt.widgets.MenuItemfindMenuItem(String id)Find the menu item with the given IDstatic intgetAccelerator(KeyboardShortcut shortcut)Map<String,Boolean>getMenuEnabledMap()Gets menuEnabledMapMap<String,org.eclipse.swt.widgets.MenuItem>getMenuItemMap()Gets menuItemMapMap<String,KeyboardShortcut>getShortcutMap()Gets shortcutMapstatic StringgetShortcutString(KeyboardShortcut shortcut)voidsetMenuEnabledMap(Map<String,Boolean> menuEnabledMap)Sets menuEnabledMapvoidsetMenuItemMap(Map<String,org.eclipse.swt.widgets.MenuItem> menuItemMap)voidsetShortcutMap(Map<String,KeyboardShortcut> shortcutMap)Sets shortcutMap-
Methods inherited from class org.apache.hop.ui.core.gui.BaseGuiWidgets
addDeRegisterGuiPluginObjectListener, dispose, findGuiPluginInstance, getComboItems, getGuiPluginClassName, getGuiPluginObject, getInstanceId, getListener, registerGuiPluginObject, setGuiPluginClassName, setGuiPluginObject, setInstanceId
-
-
-
-
Method Detail
-
createMenuWidgets
public void createMenuWidgets(String root, org.eclipse.swt.widgets.Shell shell, org.eclipse.swt.widgets.Menu parent)
-
executeMenuItem
public static void executeMenuItem(GuiMenuItem guiMenuItem, String instanceId) throws Exception
- Throws:
Exception
-
appendShortCut
public static void appendShortCut(org.eclipse.swt.widgets.MenuItem menuItem, KeyboardShortcut shortcut)
-
getAccelerator
public static int getAccelerator(KeyboardShortcut shortcut)
-
getShortcutString
public static String getShortcutString(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
-
findKeyboardShortcut
public KeyboardShortcut findKeyboardShortcut(String id)
-
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 forenabled- 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 forpermission-- 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 forpermission-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
-
getShortcutMap
public Map<String,KeyboardShortcut> getShortcutMap()
Gets shortcutMap- Returns:
- value of shortcutMap
-
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
-
-