public class MenuItem extends BaseFormsObject
In some cases, using methods on this class may result in a
JdapiIllegalStateException being thrown. When this happens, you are using
an object that refers to a Forms object that has been deleted - your
reference is no longer valid. You can check if an instance of this
class is valid by using the isValidFormsObject()
method.
If you code correctly, this should not happen. It will tend to happen
if you keep references (for extended periods) to Forms objects rather
than look them up dynamically. Of course you will only have this
problem if you destroy Forms objects.
BaseAPI
m_clientInfo, m_pd2fob
PROPERTY_DEFAULT_VALUE, PROPERTY_INHERITED_VALUE, PROPERTY_OVERRIDDEN_DEFAULT_VALUE, PROPERTY_OVERRIDDEN_INHERITED_VALUE, PROPERTY_STATE_UNKNOWN
Modifier | Constructor and Description |
---|---|
protected |
MenuItem(long pd2fmni)
Protected constructor, used internally to create MenuItem
objects.
|
|
MenuItem(Menu parent,
java.lang.String name)
Constructor used to create MenuItem objects in the context of
a Menu parent object.
|
|
MenuItem(Menu parent,
java.lang.String name,
MenuItem base)
Constructor used to create MenuItem objects in the context of a
Menu parent object.
|
|
MenuItem(Menu parent,
java.lang.String name,
PropertyClass base)
Constructor used to create MenuItem objects in the context of a
Menu parent object.
|
|
MenuItem(ObjectLibrary olb,
ObjectLibraryTab tab,
java.lang.String name)
Constructor used to create MenuItem objects in the context of
an ObjectLibraryTab parent object.
|
|
MenuItem(ObjectLibrary olb,
ObjectLibraryTab tab,
java.lang.String name,
MenuItem base)
Constructor used to create MenuItem objects in the context of an
ObjectLibraryTab parent object.
|
|
MenuItem(ObjectLibrary olb,
ObjectLibraryTab tab,
java.lang.String name,
PropertyClass base)
Constructor used to create MenuItem objects in the context of an
ObjectLibraryTab parent object.
|
Modifier and Type | Method and Description |
---|---|
void |
addRole(int index,
java.lang.String role)
Adds a role to the list of roles for a menu item.
|
MenuItem |
clone(Menu parent,
java.lang.String newName)
Creates a copy of the object as a child of 'parent'
|
MenuItem |
clone(ObjectLibraryTab parent,
java.lang.String newName)
Creates a copy of the object as a child of 'parent'
|
static MenuItem |
find(Menu parent,
java.lang.String name)
Find an instance of MenuItem that is a child of a Menu.
|
static MenuItem |
find(ObjectLibraryTab parent,
java.lang.String name)
Find an instance of MenuItem that is a child of a ObjectLibraryTab.
|
java.lang.String |
getCommandText()
Get text property CommandText (COMMAND_TEXT_PTID).
|
int |
getCommandType()
Get number property CommandType (COMMAND_TYPE_PTID).
|
java.lang.String |
getComment()
Get text property Comment (COMMENT_PTID).
|
java.lang.String |
getFontName()
Get text property FontName (FONT_NAME_PTID).
|
int |
getFontSize()
Get number property FontSize (FONT_SIZE_PTID).
|
int |
getFontSpacing()
Get number property FontSpacing (FONT_SPACING_PTID).
|
int |
getFontStyle()
Get number property FontStyle (FONT_STYLE_PTID).
|
int |
getFontWeight()
Get number property FontWeight (FONT_WEIGHT_PTID).
|
java.lang.String |
getHint()
Get text property Hint (HINT_PTID).
|
java.lang.String |
getIconFilename()
Get text property IconFilename (ICON_FILENAME_PTID).
|
java.lang.String |
getKeyboardAccelerator()
Get text property KeyboardAccelerator (KEYBOARD_ACCELERATOR_PTID).
|
java.lang.String |
getLabel()
Get text property Label (LABEL_PTID).
|
int |
getMagicItem()
Get number property MagicItem (MAGIC_ITEM_PTID).
|
java.lang.String |
getMenuItemCode()
Get text property MenuItemCode (MENU_ITEM_CODE_PTID).
|
java.lang.String |
getMenuItemRadioGroup()
Get text property MenuItemRadioGroup (MENU_ITEM_RADIO_GROUP_PTID).
|
int |
getMenuItemType()
Get number property MenuItemType (MENU_ITEM_TYPE_PTID).
|
JdapiObject |
getModule()
Get object property Module (MODULE_PTID).
|
java.lang.String |
getName()
Get text property Name (NAME_PTID).
|
JdapiObject |
getOwner()
Get object property Owner (OWNER_PTID).
|
java.lang.String |
getParentFilename()
Get text property ParentFilename (PARENT_FILENAME_PTID).
|
java.lang.String |
getParentFilepath()
Get text property ParentFilepath (PARENT_FILEPATH_PTID).
|
java.lang.String |
getParentModule()
Get text property ParentModule (PARENT_MODULE_PTID).
|
int |
getParentModuleType()
Get number property ParentModuleType (PARENT_MODULETYPE_PTID).
|
java.lang.String |
getParentName()
Get text property ParentName (PARENT_NAME_PTID).
|
java.lang.String |
getParentSourceLevel1ObjectName()
Get text property ParentSourceLevel1ObjectName (PARENT_SOURCELEVEL1OBJECT_NAME_PTID).
|
int |
getParentSourceLevel1ObjectType()
Get number property ParentSourceLevel1ObjectType (PARENT_SOURCELEVEL1OBJECT_TYPE_PTID).
|
int |
getParentType()
Get number property ParentType (PARENT_TYPE_PTID).
|
int |
getPersistentClientInfoLength()
Get number property PersistentClientInfoLength (PERSISTENT_CLIENT_INFO_LENGTH_PTID).
|
java.lang.String |
getRole(int index)
Gets the name of a role from a menu item's list of roles.
|
int |
getRoleCount()
Get number property RoleCount (ROLE_COUNT_PTID).
|
JdapiObject |
getSource()
Get object property Source (SOURCE_PTID).
|
java.lang.String |
getSubMenuName()
Get text property SubMenuName (SUB_MENU_NAME_PTID).
|
MenuItem |
getSubMenuObject()
Get object property SubMenuObject (SUB_MENU_OBJECT_PTID).
|
int |
getTypeId()
Gets the HtmlForms object type ID.
|
java.lang.String |
getVisualAttributeName()
Get text property VisualAttributeName (VISUALATTRIBUTE_NAME_PTID).
|
VisualAttribute |
getVisualAttributeObject()
Get object property VisualAttributeObject (VISUALATTRIBUTE_OBJECT_PTID).
|
boolean |
isDirtyInfo()
Get boolean property DirtyInfo (DIRTY_INFO_PTID).
|
boolean |
isDisplayNoPriv()
Get boolean property DisplayNoPriv (DISPLAY_NO_PRIV_PTID).
|
boolean |
isEnabled()
Get boolean property Enabled (ENABLED_PTID).
|
boolean |
isIconInMenu()
Get boolean property IconInMenu (ICON_IN_MENU_PTID).
|
boolean |
isSubclassSubObject()
Get boolean property SubclassSubObject (SUBCLASS_SUBOBJECT_PTID).
|
boolean |
isVisible()
Get boolean property Visible (VISIBLE_PTID).
|
boolean |
isVisibleInHorizontalMenuToolbar()
Get boolean property VisibleInHorizontalMenuToolbar (VISIBLE_IN_HORIZONTAL_MENU_TOOLBAR_PTID).
|
boolean |
isVisibleInMenu()
Get boolean property VisibleInMenu (VISIBLE_IN_MENU_PTID).
|
boolean |
isVisibleInVerticalMenuToolbar()
Get boolean property VisibleInVerticalMenuToolbar (VISIBLE_IN_VERTICAL_MENU_TOOLBAR_PTID).
|
void |
removeRole(int index)
Removes a role from the list of roles for a menu item.
|
void |
setCommandText(java.lang.String value)
Sets text property CommandText (COMMAND_TEXT_PTID).
|
void |
setCommandType(int value)
Sets number property CommandType (COMMAND_TYPE_PTID).
|
void |
setComment(java.lang.String value)
Sets text property Comment (COMMENT_PTID).
|
void |
setDirtyInfo(boolean value)
Sets boolean property DirtyInfo (DIRTY_INFO_PTID).
|
void |
setDisplayNoPriv(boolean value)
Sets boolean property DisplayNoPriv (DISPLAY_NO_PRIV_PTID).
|
void |
setEnabled(boolean value)
Sets boolean property Enabled (ENABLED_PTID).
|
void |
setFontName(java.lang.String value)
Sets text property FontName (FONT_NAME_PTID).
|
void |
setFontSize(int value)
Sets number property FontSize (FONT_SIZE_PTID).
|
void |
setFontSpacing(int value)
Sets number property FontSpacing (FONT_SPACING_PTID).
|
void |
setFontStyle(int value)
Sets number property FontStyle (FONT_STYLE_PTID).
|
void |
setFontWeight(int value)
Sets number property FontWeight (FONT_WEIGHT_PTID).
|
void |
setHint(java.lang.String value)
Sets text property Hint (HINT_PTID).
|
void |
setIconFilename(java.lang.String value)
Sets text property IconFilename (ICON_FILENAME_PTID).
|
void |
setIconInMenu(boolean value)
Sets boolean property IconInMenu (ICON_IN_MENU_PTID).
|
void |
setKeyboardAccelerator(java.lang.String value)
Sets text property KeyboardAccelerator (KEYBOARD_ACCELERATOR_PTID).
|
void |
setLabel(java.lang.String value)
Sets text property Label (LABEL_PTID).
|
void |
setMagicItem(int value)
Sets number property MagicItem (MAGIC_ITEM_PTID).
|
void |
setMenuItemCode(java.lang.String value)
Sets text property MenuItemCode (MENU_ITEM_CODE_PTID).
|
void |
setMenuItemRadioGroup(java.lang.String value)
Sets text property MenuItemRadioGroup (MENU_ITEM_RADIO_GROUP_PTID).
|
void |
setMenuItemType(int value)
Sets number property MenuItemType (MENU_ITEM_TYPE_PTID).
|
void |
setName(java.lang.String value)
Sets text property Name (NAME_PTID).
|
void |
setParentFilename(java.lang.String value)
Sets text property ParentFilename (PARENT_FILENAME_PTID).
|
void |
setParentFilepath(java.lang.String value)
Sets text property ParentFilepath (PARENT_FILEPATH_PTID).
|
void |
setParentModule(java.lang.String value)
Sets text property ParentModule (PARENT_MODULE_PTID).
|
void |
setParentModuleType(int value)
Sets number property ParentModuleType (PARENT_MODULETYPE_PTID).
|
void |
setParentName(java.lang.String value)
Sets text property ParentName (PARENT_NAME_PTID).
|
void |
setParentSourceLevel1ObjectName(java.lang.String value)
Sets text property ParentSourceLevel1ObjectName (PARENT_SOURCELEVEL1OBJECT_NAME_PTID).
|
void |
setParentSourceLevel1ObjectType(int value)
Sets number property ParentSourceLevel1ObjectType (PARENT_SOURCELEVEL1OBJECT_TYPE_PTID).
|
void |
setParentType(int value)
Sets number property ParentType (PARENT_TYPE_PTID).
|
void |
setPersistentClientInfoLength(int value)
Sets number property PersistentClientInfoLength (PERSISTENT_CLIENT_INFO_LENGTH_PTID).
|
void |
setSubclassSubObject(boolean value)
Sets boolean property SubclassSubObject (SUBCLASS_SUBOBJECT_PTID).
|
void |
setSubMenuName(java.lang.String value)
Sets text property SubMenuName (SUB_MENU_NAME_PTID).
|
void |
setSubMenuObject(MenuItem value)
Set object property SubMenuObject (SUB_MENU_OBJECT_PTID).
|
void |
setVisible(boolean value)
Sets boolean property Visible (VISIBLE_PTID).
|
void |
setVisibleInHorizontalMenuToolbar(boolean value)
Sets boolean property VisibleInHorizontalMenuToolbar (VISIBLE_IN_HORIZONTAL_MENU_TOOLBAR_PTID).
|
void |
setVisibleInMenu(boolean value)
Sets boolean property VisibleInMenu (VISIBLE_IN_MENU_PTID).
|
void |
setVisibleInVerticalMenuToolbar(boolean value)
Sets boolean property VisibleInVerticalMenuToolbar (VISIBLE_IN_VERTICAL_MENU_TOOLBAR_PTID).
|
void |
setVisualAttributeName(java.lang.String value)
Sets text property VisualAttributeName (VISUALATTRIBUTE_NAME_PTID).
|
void |
setVisualAttributeObject(VisualAttribute value)
Set object property VisualAttributeObject (VISUALATTRIBUTE_OBJECT_PTID).
|
changeOwner, clearObjectPointer, clone, createSubclassedChild, destroy, equals, getBooleanProperty, getChildObjectProperty, getClassName, getClientInfo, getIntegerProperty, getIntegerPropertyString, getJdapiMetaObject, getMetaProperties, getObjectPointer, getObjectProperty, getObjProp, getOwnedObjects, getPersistentClientInfoBlob, getPersistentClientInfoObject, getPropertyState, getPropertyValueName, getQualifiedName, getStringIDProperty, getStringProperty, getSubclassParent, hasDefaultedProperty, hasInheritedProperty, hasOverriddenProperty, hasProperty, inheritProperty, isSubclassed, isValidFormsObject, move, queryType, reattach, setBooleanProperty, setClientInfo, setIntegerProperty, setObjectProperty, setObjProp, setPersistentClientInfo, setPersistentClientInfo, setStringProperty, setSubclassParent, toString, unsetSubclassParent
public MenuItem(Menu parent, java.lang.String name)
parent
- Parent objectname
- Name of the new objectpublic MenuItem(Menu parent, java.lang.String name, MenuItem base)
parent
- Parent objectname
- Name of the new objectbase
- MenuItem object to derive frompublic MenuItem(Menu parent, java.lang.String name, PropertyClass base)
parent
- Parent objectname
- Name of the new objectbase
- PropertyClass object to derive frompublic MenuItem(ObjectLibrary olb, ObjectLibraryTab tab, java.lang.String name)
olb
- The ObjectLibrary module to create this object intab
- The tab in the passed ObjectLibrary to attach the new object toname
- Name of the new objectpublic MenuItem(ObjectLibrary olb, ObjectLibraryTab tab, java.lang.String name, MenuItem base)
olb
- The ObjectLibrary module to create this object intab
- The tab in the passed ObjectLibrary to attach the new object toname
- Name of the new objectbase
- MenuItem object to derive frompublic MenuItem(ObjectLibrary olb, ObjectLibraryTab tab, java.lang.String name, PropertyClass base)
olb
- The ObjectLibrary module to create this object intab
- The tab in the passed ObjectLibrary to attach the new object toname
- Name of the new objectbase
- PropertyClass object to derive fromprotected MenuItem(long pd2fmni)
Do NOT use this constructor, even within the Jdapi package. If you have a pointer and need to instantiate it's Java representation, get the object via the context cache, e.g.
myBaseObject = Jdapi.getObject(myPointer);
pd2fmni
- C pointer to Forms objectpublic int getTypeId()
getTypeId
in interface JdapiObject
getTypeId
in class BaseFormsObject
queryType
public MenuItem clone(Menu parent, java.lang.String newName)
parent
- Parent objectnewName
- Name of object that's being createdpublic MenuItem clone(ObjectLibraryTab parent, java.lang.String newName)
parent
- Parent objectnewName
- Name of object that's being createdpublic static MenuItem find(Menu parent, java.lang.String name)
parent
- Parent object of object you wish to findname
- Name of object you wish to findpublic static MenuItem find(ObjectLibraryTab parent, java.lang.String name)
parent
- Parent object of object you wish to findname
- Name of object you wish to findpublic void addRole(int index, java.lang.String role)
index
- Index to add role atrole
- The name of the rolepublic void removeRole(int index)
index
- Index of role to removepublic java.lang.String getRole(int index)
index
- Index of role to getpublic java.lang.String getCommandText()
public void setCommandText(java.lang.String value)
value
- Value to set property topublic java.lang.String getComment()
public void setComment(java.lang.String value)
value
- Value to set property topublic java.lang.String getFontName()
public void setFontName(java.lang.String value)
value
- Value to set property topublic java.lang.String getHint()
public void setHint(java.lang.String value)
value
- Value to set property topublic java.lang.String getIconFilename()
public void setIconFilename(java.lang.String value)
value
- Value to set property topublic java.lang.String getKeyboardAccelerator()
public void setKeyboardAccelerator(java.lang.String value)
value
- Value to set property topublic java.lang.String getLabel()
public void setLabel(java.lang.String value)
value
- Value to set property topublic java.lang.String getMenuItemCode()
public void setMenuItemCode(java.lang.String value)
value
- Value to set property topublic java.lang.String getMenuItemRadioGroup()
public void setMenuItemRadioGroup(java.lang.String value)
value
- Value to set property topublic java.lang.String getName()
getName
in interface JdapiObject
getName
in class BaseFormsObject
public void setName(java.lang.String value)
value
- Value to set property topublic java.lang.String getParentFilename()
public void setParentFilename(java.lang.String value)
value
- Value to set property topublic java.lang.String getParentFilepath()
public void setParentFilepath(java.lang.String value)
value
- Value to set property topublic java.lang.String getParentModule()
public void setParentModule(java.lang.String value)
value
- Value to set property topublic java.lang.String getParentName()
public void setParentName(java.lang.String value)
value
- Value to set property topublic java.lang.String getParentSourceLevel1ObjectName()
public void setParentSourceLevel1ObjectName(java.lang.String value)
value
- Value to set property topublic java.lang.String getSubMenuName()
public void setSubMenuName(java.lang.String value)
value
- Value to set property topublic java.lang.String getVisualAttributeName()
public void setVisualAttributeName(java.lang.String value)
value
- Value to set property topublic int getCommandType()
public void setCommandType(int value)
value
- Value to set property topublic int getFontSize()
public void setFontSize(int value)
value
- Value to set property topublic int getFontSpacing()
public void setFontSpacing(int value)
value
- Value to set property topublic int getFontStyle()
public void setFontStyle(int value)
value
- Value to set property topublic int getFontWeight()
public void setFontWeight(int value)
value
- Value to set property topublic int getMagicItem()
public void setMagicItem(int value)
value
- Value to set property topublic int getMenuItemType()
public void setMenuItemType(int value)
value
- Value to set property topublic int getParentModuleType()
public void setParentModuleType(int value)
value
- Value to set property topublic int getParentSourceLevel1ObjectType()
public void setParentSourceLevel1ObjectType(int value)
value
- Value to set property topublic int getParentType()
public void setParentType(int value)
value
- Value to set property topublic int getPersistentClientInfoLength()
public void setPersistentClientInfoLength(int value)
value
- Value to set property topublic int getRoleCount()
public boolean isDirtyInfo()
public void setDirtyInfo(boolean value)
value
- Value to set property topublic boolean isDisplayNoPriv()
public void setDisplayNoPriv(boolean value)
value
- Value to set property topublic boolean isEnabled()
public void setEnabled(boolean value)
value
- Value to set property topublic boolean isIconInMenu()
public void setIconInMenu(boolean value)
value
- Value to set property topublic boolean isSubclassSubObject()
public void setSubclassSubObject(boolean value)
value
- Value to set property topublic boolean isVisible()
public void setVisible(boolean value)
value
- Value to set property topublic boolean isVisibleInHorizontalMenuToolbar()
public void setVisibleInHorizontalMenuToolbar(boolean value)
value
- Value to set property topublic boolean isVisibleInMenu()
public void setVisibleInMenu(boolean value)
value
- Value to set property topublic boolean isVisibleInVerticalMenuToolbar()
public void setVisibleInVerticalMenuToolbar(boolean value)
value
- Value to set property topublic JdapiObject getModule()
getModule
in interface JdapiObject
getModule
in class BaseFormsObject
public JdapiObject getOwner()
getOwner
in interface JdapiObject
getOwner
in class BaseFormsObject
public JdapiObject getSource()
public MenuItem getSubMenuObject()
public void setSubMenuObject(MenuItem value)
value
- MenuItem object to set property topublic VisualAttribute getVisualAttributeObject()
public void setVisualAttributeObject(VisualAttribute value)
value
- VisualAttribute object to set property to