Class AbstractMenuMerge
- java.lang.Object
- 
- com.inductiveautomation.ignition.designer.model.menu.AbstractMenuMerge
 
- 
- All Implemented Interfaces:
- IMenuMergeModel
 - Direct Known Subclasses:
- DockableBarMerge,- JMenuMerge,- MenuBarMerge,- ToolbarMerge
 
 public abstract class AbstractMenuMerge extends java.lang.Object implements IMenuMergeModel Abstract base class for all menu merges that represent a collection, for example a menu or a toolbar, as opposed to a single item. This class requires a name which is the logical name of the collection it represents. Remember that the whole point of the menu merge system is that more than one menu merge may represent the same logical name. For example, you might have 3 menu merges for the "file" menu - and they'll all merge together. The way a menu merge works is to store lists of other menu-merge models. Each list of sub-models forms a group and has its own ordering value, which is used to separate it from other groups. The index value determines the relative ordering of all menu groups. You can add individual items to any group by using its ordering value. You can use implicit or explicit group ordering depending on which version of the add functions you use. If you use implicit ordering, your first group has a value of 10,000 and you create new groups by calling addSeparator()
- 
- 
Field SummaryFields Modifier and Type Field Description protected intcurrentImplicitGroupprotected java.lang.StringdisplayKeyprotected java.util.SortedMap<java.lang.Integer,com.inductiveautomation.ignition.designer.model.menu.AbstractMenuMerge.SeparatorGroup>groupsprotected javax.swing.Iconiconprotected org.apache.log4j.Loggerlogprotected java.lang.StringmenuIdprotected java.lang.Stringname
 - 
Constructor SummaryConstructors Constructor Description AbstractMenuMerge(java.lang.String name)AbstractMenuMerge(java.lang.String name, java.lang.String displayKey)AbstractMenuMerge(java.lang.String name, java.lang.String displayKey, javax.swing.Icon icon)
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidadd(int separatorGroup, IMenuMergeModel item)Adds a new menu merge model to the specified group numbervoidadd(int separatorGroup, javax.swing.Action action)Adds a new action, wrapped in aActionMenuItemMerge, to the specified group numbervoidadd(IMenuMergeModel item)Adds a new menu merge model to the current implicit groupvoidadd(javax.swing.Action action)Adds an action to the current implicit group.voidaddSeparator()Increments the implicit group ID so that subsequent additions will start forming a new groupprotected abstract voidaddSeparator(javax.swing.JComponent menu)Subclasses must define how "separator" components get added to the parent menu item.abstract javax.swing.JComponentcreateMenu()Create the parent menu item represented by this object, that all of its children should be contained in.java.lang.StringgetMenuId()java.lang.StringgetName()javax.swing.JComponentinstall(javax.swing.JComponent menu)Merges this model into the menu.protected java.lang.Iterable<javax.swing.JComponent>iterate(javax.swing.JComponent menu)Creates an Iterable<JComponent> for the menu.voidsetMenuId(java.lang.String moduleId)voiduninstall(javax.swing.JComponent menu)Reverses the merge of this model into the given menu
 
- 
- 
- 
Field Detail- 
menuIdprotected java.lang.String menuId 
 - 
nameprotected java.lang.String name 
 - 
displayKeyprotected java.lang.String displayKey 
 - 
iconprotected javax.swing.Icon icon 
 - 
groupsprotected java.util.SortedMap<java.lang.Integer,com.inductiveautomation.ignition.designer.model.menu.AbstractMenuMerge.SeparatorGroup> groups 
 - 
currentImplicitGroupprotected int currentImplicitGroup 
 - 
logprotected org.apache.log4j.Logger log 
 
- 
 - 
Constructor Detail- 
AbstractMenuMergepublic AbstractMenuMerge(java.lang.String name) 
 - 
AbstractMenuMergepublic AbstractMenuMerge(java.lang.String name, java.lang.String displayKey)
 - 
AbstractMenuMergepublic AbstractMenuMerge(java.lang.String name, java.lang.String displayKey, javax.swing.Icon icon)
 
- 
 - 
Method Detail- 
addSeparatorpublic void addSeparator() Increments the implicit group ID so that subsequent additions will start forming a new group
 - 
addpublic void add(javax.swing.Action action) Adds an action to the current implicit group. Wraps the action in aActionMenuItemMerge
 - 
addpublic void add(IMenuMergeModel item) Adds a new menu merge model to the current implicit group
 - 
addpublic void add(int separatorGroup, javax.swing.Action action)Adds a new action, wrapped in aActionMenuItemMerge, to the specified group number
 - 
addpublic void add(int separatorGroup, IMenuMergeModel item)Adds a new menu merge model to the specified group number
 - 
installpublic javax.swing.JComponent install(javax.swing.JComponent menu) 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
 
 - 
uninstallpublic void uninstall(javax.swing.JComponent menu) Description copied from interface:IMenuMergeModelReverses the merge of this model into the given menu- Specified by:
- uninstallin interface- IMenuMergeModel
 
 - 
addSeparatorprotected abstract void addSeparator(javax.swing.JComponent menu) Subclasses must define how "separator" components get added to the parent menu item.
 - 
createMenupublic abstract javax.swing.JComponent createMenu() Create the parent menu item represented by this object, that all of its children should be contained in.
 - 
getMenuIdpublic java.lang.String getMenuId() 
 - 
setMenuIdpublic void setMenuId(java.lang.String moduleId) 
 - 
getNamepublic java.lang.String getName() 
 - 
iterateprotected java.lang.Iterable<javax.swing.JComponent> iterate(javax.swing.JComponent menu) Creates an Iterable<JComponent> for the menu. If menu is a JMenu, it'll iterate over the menu components contained within (menu components don't directly contain their children - they're contained within a private PopupMenu), otherwise it uses normal JComponent iteration.- Parameters:
- menu- the- JMenuto iterate
 
 
- 
 
-