Package org.apache.pivot.wtk.content
Class MenuItemData
- java.lang.Object
-
- org.apache.pivot.wtk.content.BaseContent
-
- org.apache.pivot.wtk.content.UserContent
-
- org.apache.pivot.wtk.content.ButtonData
-
- org.apache.pivot.wtk.content.MenuItemData
-
public class MenuItemData extends ButtonData
Default menu item data implementation.
-
-
Field Summary
-
Fields inherited from class org.apache.pivot.wtk.content.UserContent
userData
-
Fields inherited from class org.apache.pivot.wtk.content.BaseContent
icon, text
-
-
Constructor Summary
Constructors Constructor Description MenuItemData()
Constructor.MenuItemData(java.lang.String text)
Constructor.MenuItemData(BaseContent content)
Constructor.MenuItemData(Image icon)
Constructor.MenuItemData(Image icon, java.lang.String text)
Constructor.MenuItemData(Image icon, java.lang.String text, Keyboard.KeyStroke keyboardShortcut)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Keyboard.KeyStroke
getKeyboardShortcut()
void
setKeyboardShortcut(java.lang.String keyboardShortcut)
Set the keyboard shortcut for this menu item using a string recognizable by theKeyboard.KeyStroke.decode(java.lang.String)
method.void
setKeyboardShortcut(Keyboard.KeyStroke keyboardShortcut)
-
Methods inherited from class org.apache.pivot.wtk.content.UserContent
getUserData, setUserData
-
-
-
-
Constructor Detail
-
MenuItemData
public MenuItemData()
Constructor.
-
MenuItemData
public MenuItemData(Image icon)
Constructor.- Parameters:
icon
- The icon to display in the menu item.
-
MenuItemData
public MenuItemData(java.lang.String text)
Constructor.- Parameters:
text
- The text to display in the menu item.
-
MenuItemData
public MenuItemData(Image icon, java.lang.String text)
Constructor.- Parameters:
icon
- The icon to display in the menu item.text
- The text to display in the menu item.
-
MenuItemData
public MenuItemData(BaseContent content)
Constructor.- Parameters:
content
- The icon and text to display in the menu item.
-
MenuItemData
public MenuItemData(Image icon, java.lang.String text, Keyboard.KeyStroke keyboardShortcut)
Constructor.- Parameters:
icon
- The icon to display in the menu item.text
- The text to display in the menu item.keyboardShortcut
- The keyboard shortcut associated with this menu item.
-
-
Method Detail
-
getKeyboardShortcut
public Keyboard.KeyStroke getKeyboardShortcut()
-
setKeyboardShortcut
public void setKeyboardShortcut(Keyboard.KeyStroke keyboardShortcut)
-
setKeyboardShortcut
public void setKeyboardShortcut(java.lang.String keyboardShortcut)
Set the keyboard shortcut for this menu item using a string recognizable by theKeyboard.KeyStroke.decode(java.lang.String)
method.- Parameters:
keyboardShortcut
- The keystroke name.
-
-