Class JMenuMerge
- java.lang.Object
- 
- com.inductiveautomation.ignition.designer.model.menu.AbstractMenuMerge
- 
- com.inductiveautomation.ignition.designer.model.menu.JMenuMerge
 
 
- 
- All Implemented Interfaces:
- IMenuMergeModel
 
 public class JMenuMerge extends AbstractMenuMerge Represents a menu merge for a JMenu. This may be a top-level menu (like "file") or a sub-menu. That is, a JMenuMerge can contain a mix of other JMenuMerge children and individual item merges. This class has convenience functions that allow for easily adding menu items based on StateChangeActions and JMenuItems. To create JMenuMerges that merge items into the main menus, use the constants found in WellKnownMenuConstants. For example, suppose a module wanted to add a menu item to the File > New menu. You would create a JMenuMerge using the file menu's name, and add it at the file menu's location. You would create the following MenuBarMerge and return it from your Designer module hook'sDesignerModuleHook.getModuleMenu()function.Action myNewAction = new AbstractAction("New Thingamajig") { public void actionPerformed(ActionEvent ae) { System.out.println("Do something here..."); } }; MenuBarMerge menu = new MenuBarMerge("mymodule-id"); JMenuMerge file = new JMenuMerge(WellKnownMenuConstants.FILE_MENU_NAME); JMenuMerge fileNew = new JMenuMerge("new"); fileNew.add(myNewAction); file.add(WellKnownMenuConstants.FILE_OPENSAVE_GROUP, fileNew); menu.add(WellKnownMenuConstants.FILE_MENU_LOCATION, file);
- 
- 
Field Summary- 
Fields inherited from class com.inductiveautomation.ignition.designer.model.menu.AbstractMenuMergecurrentImplicitGroup, displayKey, groups, icon, log, menuId, name
 
- 
 - 
Constructor SummaryConstructors Constructor Description JMenuMerge(java.lang.String name)JMenuMerge(java.lang.String name, java.lang.String displayKey)JMenuMerge(java.lang.String name, java.lang.String displayKey, javax.swing.Icon icon)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int separatorGroup, javax.swing.JMenu menu)Used to add opaque (non-mergable) menusvoidadd(int separatorGroup, javax.swing.JMenuItem menuItem)voidadd(javax.swing.JMenu menu)Used to add opaque (non-mergable) menusvoidadd(javax.swing.JMenuItem menuItem)voidaddCheckBox(int separatorGroup, StateChangeAction action)voidaddCheckBox(StateChangeAction action)voidaddRadioGroup(int separatorGroup, StateChangeAction... actions)voidaddRadioGroup(StateChangeAction... actions)protected voidaddSeparator(javax.swing.JComponent menu)Subclasses must define how "separator" components get added to the parent menu item.javax.swing.JMenucreateMenu()Create the parent menu item represented by this object, that all of its children should be contained in.voiddispose()removes all internal bindings which allows this merge to be garbage collected.javax.swing.JComponentinstall(javax.swing.JComponent menuToInstall)Merges this model into the menu.voiduninstall(javax.swing.JComponent menuToUninstall)Reverses the merge of this model into the given menu- 
Methods inherited from class com.inductiveautomation.ignition.designer.model.menu.AbstractMenuMergeadd, add, add, add, addSeparator, getMenuId, getName, iterate, setMenuId
 
- 
 
- 
- 
- 
Method Detail- 
addCheckBoxpublic void addCheckBox(StateChangeAction action) 
 - 
addRadioGrouppublic void addRadioGroup(StateChangeAction... actions) 
 - 
addpublic void add(javax.swing.JMenuItem menuItem) 
 - 
addpublic void add(javax.swing.JMenu menu) Used to add opaque (non-mergable) menus
 - 
addCheckBoxpublic void addCheckBox(int separatorGroup, StateChangeAction action)
 - 
addRadioGrouppublic void addRadioGroup(int separatorGroup, StateChangeAction... actions)
 - 
addpublic void add(int separatorGroup, javax.swing.JMenuItem menuItem)
 - 
addpublic void add(int separatorGroup, javax.swing.JMenu menu)Used to add opaque (non-mergable) menus
 - 
installpublic javax.swing.JComponent install(javax.swing.JComponent menuToInstall) Description copied from interface:IMenuMergeModelMerges this model into the menu. The JComponent will be either a CommandMenuBar or a JMenu- Specified by:
- installin interface- IMenuMergeModel
- Overrides:
- installin class- AbstractMenuMerge
 
 - 
uninstallpublic void uninstall(javax.swing.JComponent menuToUninstall) Description copied from interface:IMenuMergeModelReverses the merge of this model into the given menu- Specified by:
- uninstallin interface- IMenuMergeModel
- Overrides:
- uninstallin class- AbstractMenuMerge
 
 - 
createMenupublic javax.swing.JMenu createMenu() Description copied from class:AbstractMenuMergeCreate the parent menu item represented by this object, that all of its children should be contained in.- Specified by:
- createMenuin class- AbstractMenuMerge
 
 - 
addSeparatorprotected void addSeparator(javax.swing.JComponent menu) Description copied from class:AbstractMenuMergeSubclasses must define how "separator" components get added to the parent menu item.- Specified by:
- addSeparatorin class- AbstractMenuMerge
 
 - 
disposepublic void dispose() removes all internal bindings which allows this merge to be garbage collected.
 
- 
 
-