public class ActionItemModel extends java.lang.Object implements IActionItemModel
Constructor and Description |
---|
ActionItemModel()
Creates a new action item model
|
ActionItemModel(IAction action)
Creates a new action item model
|
ActionItemModel(IActionItemModelBuilder builder)
Creates a action item model defined by a builder
|
ActionItemModel(java.lang.String text)
Creates a new action item model
|
ActionItemModel(java.lang.String text,
IImageConstant icon)
Creates a new action item model
|
ActionItemModel(java.lang.String text,
java.lang.String toolTipText)
Creates a new action item model
|
ActionItemModel(java.lang.String text,
java.lang.String toolTipText,
IImageConstant icon)
Creates a new action item model
|
ActionItemModel(java.lang.String id,
java.lang.String text,
java.lang.String toolTipText,
IImageConstant icon)
Creates a new action item model
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed()
This fires an action performed event for the item.
|
void |
addActionListener(IActionListener actionListener)
Adds an action listener
|
void |
addDecorator(IDecorator<IAction> action)
Adds a decorator to the model.
|
void |
addItemModelListener(IItemModelListener listener)
Adds a item model listener
|
static IActionItemModelBuilder |
builder()
Creates a new action item model builder
|
static IActionItemModelBuilder |
builder(IAction action)
Creates a new action item model builder
|
static IActionItemModelBuilder |
builder(java.lang.String text)
Creates a new action item model builder
|
static IActionItemModelBuilder |
builder(java.lang.String text,
IImageConstant icon)
Creates a new action item model builder
|
static IActionItemModelBuilder |
builder(java.lang.String text,
java.lang.String toolTipText)
Creates a new action item model builder
|
static IActionItemModelBuilder |
builder(java.lang.String text,
java.lang.String toolTipText,
IImageConstant icon)
Creates a new action item model builder
|
static IActionItemModelBuilder |
builder(java.lang.String id,
java.lang.String text,
java.lang.String toolTipText,
IImageConstant icon)
Creates a new action item model builder
|
static IActionItemModel |
create()
Creates a new action item model
|
IActionItemModel |
createCopy()
Creates a deep copy of the item and its children.
|
boolean |
equals(java.lang.Object obj) |
Accelerator |
getAccelerator()
Gets the key accelerator that should be used for the item
|
IAction |
getAction()
Gets the bound action of the item
|
IImageConstant |
getIcon()
Gets the items icon
|
java.lang.String |
getId()
Gets the id of the item
|
protected IActionItemModel |
getItemModel() |
java.lang.Character |
getMnemonic()
Gets the mnemonic character
|
java.lang.String |
getText()
Gets the items label text
|
java.lang.String |
getToolTipText()
Gets the tooltip text of the item
|
int |
hashCode() |
boolean |
isEnabled()
Gets the enabled state of the item
Remark: Not all bound items may support to become disabled
|
boolean |
isVisible()
Gets the visible state of the item
|
void |
removeActionListener(IActionListener actionListener)
Removes an action listener
|
void |
removeDecorator(IDecorator<IAction> action)
Removes a decorator from the model.
|
void |
removeItemModelListener(IItemModelListener listener)
removes a item model listener
|
void |
setAccelerator(Accelerator accelerator)
Sets the key accelerator that should be used for the item
|
void |
setAccelerator(VirtualKey key,
Modifier... modifier)
Sets the key accelerator that should be used for the item
|
void |
setAction(IAction action)
Sets an action that should be bound to the model
|
void |
setEnabled(boolean enabled)
Sets the enabled state of the item.
|
void |
setIcon(IImageConstant icon)
Sets the items icon
|
void |
setMnemonic(char mnemonic)
Sets the mnemonic character
|
void |
setMnemonic(java.lang.Character mnemonic)
Sets the mnemonic character
|
void |
setText(java.lang.String text)
Sets the items label text
|
void |
setToolTipText(java.lang.String toolTipText)
Sets the tooltip text for the item
|
void |
setVisible(boolean visible)
Sets the visible state of an item
Items that was set invisible will be hidden in their container
|
IItemModel |
unwrap() |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
getAccelerator, getIcon, getId, getMnemonic, getText, getToolTipText, isEnabled, isVisible, setAccelerator, setAccelerator, setEnabled, setIcon, setMnemonic, setMnemonic, setText, setToolTipText, setVisible
addItemModelListener, removeItemModelListener
public ActionItemModel()
public ActionItemModel(IAction action)
action
- The action usepublic ActionItemModel(java.lang.String text)
text
- The label text to usepublic ActionItemModel(java.lang.String text, IImageConstant icon)
text
- The label text to useicon
- The icon to usepublic ActionItemModel(java.lang.String text, java.lang.String toolTipText)
text
- The label text to usetoolTipText
- The tooltip text to usepublic ActionItemModel(java.lang.String text, java.lang.String toolTipText, IImageConstant icon)
text
- The label text to usetoolTipText
- The tooltip text to useicon
- The icon to usepublic ActionItemModel(java.lang.String id, java.lang.String text, java.lang.String toolTipText, IImageConstant icon)
id
- The id to usetext
- The label text to usetoolTipText
- The tooltip text to useicon
- The icon to usepublic ActionItemModel(IActionItemModelBuilder builder)
builder
- The builder that defines the modelprotected IActionItemModel getItemModel()
public final void addActionListener(IActionListener actionListener)
IActionObservable
addActionListener
in interface IActionObservable
actionListener
- The listener to addpublic final void removeActionListener(IActionListener actionListener)
IActionObservable
removeActionListener
in interface IActionObservable
actionListener
- The listener to removepublic final IAction getAction()
IActionItemModel
getAction
in interface IActionItemModel
public final void setAction(IAction action)
IActionItemModel
setAction
in interface IActionItemModel
action
- The action to bind, may be nullpublic void addDecorator(IDecorator<IAction> action)
IActionItemModel
addDecorator
in interface IActionItemModel
action
- The decorator to addpublic void removeDecorator(IDecorator<IAction> action)
IActionItemModel
removeDecorator
in interface IActionItemModel
action
- The decorator to addpublic final void actionPerformed()
IActionItemModel
actionPerformed
in interface IActionItemModel
public IActionItemModel createCopy()
IItemModel
createCopy
in interface IActionItemModel
createCopy
in interface IItemModel
createCopy
in interface IMenuItemModel
public static IActionItemModel create()
public static IActionItemModelBuilder builder()
public static IActionItemModelBuilder builder(java.lang.String text)
text
- The label text to set on the builderpublic static IActionItemModelBuilder builder(IAction action)
action
- The action to set on the builderpublic static IActionItemModelBuilder builder(java.lang.String text, java.lang.String toolTipText)
text
- The label text to set on the buildertoolTipText
- The tooltip text to set on the builderpublic static IActionItemModelBuilder builder(java.lang.String text, IImageConstant icon)
text
- The label text to set on the buildericon
- The icon to set on the builderpublic static IActionItemModelBuilder builder(java.lang.String text, java.lang.String toolTipText, IImageConstant icon)
text
- The label text to set on the buildertoolTipText
- The tooltip text to set on the buildericon
- The icon to set on the builderpublic static IActionItemModelBuilder builder(java.lang.String id, java.lang.String text, java.lang.String toolTipText, IImageConstant icon)
id
- The id to set on buildertext
- The label text to set on the buildertoolTipText
- The tooltip text to set on the buildericon
- The icon to set on the builderpublic final java.lang.String getId()
IItemModel
getId
in interface IItemModel
public final java.lang.String getText()
IItemModel
getText
in interface IItemModel
public final java.lang.String getToolTipText()
IItemModel
getToolTipText
in interface IItemModel
public final IImageConstant getIcon()
IItemModel
getIcon
in interface IItemModel
public final Accelerator getAccelerator()
IItemModel
getAccelerator
in interface IItemModel
public final java.lang.Character getMnemonic()
IItemModel
getMnemonic
in interface IItemModel
public final boolean isEnabled()
IItemModel
isEnabled
in interface IItemModel
public final void setText(java.lang.String text)
IItemModel
setText
in interface IItemModel
text
- The label text of the item, may be nullpublic final void setToolTipText(java.lang.String toolTipText)
IItemModel
setToolTipText
in interface IItemModel
toolTipText
- The tooltip text to set, may be nullpublic final void setIcon(IImageConstant icon)
IItemModel
setIcon
in interface IItemModel
icon
- The icon to set, may be nullpublic final void setAccelerator(Accelerator accelerator)
IItemModel
setAccelerator
in interface IItemModel
accelerator
- The accelerator to set, may be nullpublic final void setAccelerator(VirtualKey key, Modifier... modifier)
IItemModel
setAccelerator
in interface IItemModel
key
- The character to usemodifier
- The modifier to usepublic final void setMnemonic(java.lang.Character mnemonic)
IItemModel
setMnemonic
in interface IItemModel
mnemonic
- The mnemonic character to set, may be nullpublic final void setMnemonic(char mnemonic)
IItemModel
setMnemonic
in interface IItemModel
mnemonic
- The mnemonic character to setpublic final void setEnabled(boolean enabled)
IItemModel
setEnabled
in interface IItemModel
enabled
- The enabled state to setpublic void setVisible(boolean visible)
IItemModel
setVisible
in interface IItemModel
visible
- The visible state to setpublic boolean isVisible()
IItemModel
isVisible
in interface IItemModel
public final void addItemModelListener(IItemModelListener listener)
IItemModelObservable
addItemModelListener
in interface IItemModelObservable
listener
- The listener to addpublic final void removeItemModelListener(IItemModelListener listener)
IItemModelObservable
removeItemModelListener
in interface IItemModelObservable
listener
- The listener to removepublic IItemModel unwrap()
unwrap
in interface IWrapper<IItemModel>
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
Siehe auch Jowidgets Nutzerhandbuch