public interface ContextMenu extends TransientObject
Modifier and Type | Method and Description |
---|---|
ContextMenuEntry |
addMenuButton(MenuButton button,
int index)
Adds a menu bar button to the context menu.
|
ContextMenuEntry |
addMenuLabel(String label,
int index)
Adds a label to the context menu.
|
void |
addSeparator(int index)
Adds a separator to the context menu.
|
ContextMenu |
addSubmenu(String label,
int index)
Adds a submenu to the context menu.
|
ContextMenuEntry |
getEntry(int index)
Returns the
ContextMenuEntry at the specified index in the menu. |
ContextMenuEntry |
getEntryWithName(String name)
Given the name of a menu entry, returns the first
ContextMenuEntry in this menu which
matches. |
int |
getIndexOfEntry(ContextMenuEntry entry)
Returns the index of the
ContextMenuEntry
object within this menu. |
ContextMenu |
getSubmenu(int index)
Returns the submenu for the entry at the specified index in the menu.
|
boolean |
hasEntryWithName(String name)
Indicates whether or not this menu contains a
ContextMenuEntry which
has the given name. |
void |
hideEntry(ContextMenuEntry entry)
Prevents the indicated menu entry from being shown on the menu.
|
void |
moveEntry(ContextMenuEntry entry,
int index)
Reorders the menu to move a menu entry to a new position in the list.
|
int |
numberOfEntries()
Returns the number of
ContextMenuEntry objects in this menu. |
void |
setDefaultEntry(ContextMenuEntry entry)
Makes a specified menu entry the default for the menu.
|
_value, dispose, printTestData, printTestData
int numberOfEntries() throws NXException, RemoteException
ContextMenuEntry
objects in this menu.
NXException
RemoteException
ContextMenuEntry getEntry(int index) throws NXException, RemoteException
ContextMenuEntry
at the specified index in the menu.
index
- index of menu entry to returnNXException
RemoteException
ContextMenu getSubmenu(int index) throws NXException, RemoteException
ContextMenuEntry.Type.SUBMENU
.
index
- index of submenu to returnNXException
RemoteException
boolean hasEntryWithName(String name) throws NXException, RemoteException
ContextMenuEntry
which
has the given name.
name
- name of menu entry to search forNXException
RemoteException
ContextMenuEntry getEntryWithName(String name) throws NXException, RemoteException
ContextMenuEntry
in this menu which
matches.
name
- name of menu entry to search forNXException
RemoteException
int getIndexOfEntry(ContextMenuEntry entry) throws NXException, RemoteException
ContextMenuEntry
object within this menu.
entry
- an entry in the menuNXException
RemoteException
ContextMenuEntry addMenuButton(MenuButton button, int index) throws NXException, RemoteException
MenuBarManager.getButtonFromName(java.lang.String)
to find the button to add to the menu.
button
- the menu bar button to add to the menuindex
- position at which to create the new button. Use -1 to add the button to the end of the menu.NXException
RemoteException
void addSeparator(int index) throws NXException, RemoteException
index
- position at which to create the separator. Use -1 to add the separator to the end of the menu.NXException
RemoteException
ContextMenuEntry addMenuLabel(String label, int index) throws NXException, RemoteException
label
- label for the label entryindex
- position at which to create the label entry. Use -1 to add the label to the end of the menu.NXException
RemoteException
ContextMenu addSubmenu(String label, int index) throws NXException, RemoteException
label
- label for the cascade menuindex
- position at which to create the sub-menu. Use -1 to add the sub-menu to the end of the menu.NXException
RemoteException
void setDefaultEntry(ContextMenuEntry entry) throws NXException, RemoteException
ContextMenuEntry.Type.PUSH_BUTTON
or ContextMenuEntry.Type.TOGGLE_BUTTON
.
entry
- the menu entry to become the default for the menuNXException
RemoteException
void hideEntry(ContextMenuEntry entry) throws NXException, RemoteException
entry
- the menu entry to hideNXException
RemoteException
void moveEntry(ContextMenuEntry entry, int index) throws NXException, RemoteException
entry
- the menu entry to be movedindex
- the new positionNXException
RemoteException
Copyright 2017 Siemens Product Lifecycle Management Software Inc. All Rights Reserved.