public class JMenuItemBuilder extends java.lang.Object implements ComponentBuilder<javax.swing.JMenuItem>
JMenuItem
. This class should be used as a prototype.Constructor and Description |
---|
JMenuItemBuilder() |
Modifier and Type | Method and Description |
---|---|
void |
addChild(ComponentBuilder<?> factory)
Add a child to the
Component we are building. |
javax.swing.JMenuItem |
instance()
Create and return the
Component . |
void |
setAccelerator(javax.swing.KeyStroke accelerator)
Set the accelerator for the JMenuItem.
|
void |
setAction(javax.swing.Action action)
Set the action to invoke when the
JMenuItem is selected. |
void |
setMnemonic(java.lang.String text)
Set the mnemonic of the
JMenuItem . |
void |
setText(java.lang.String text)
Set the label of the
JMenuItem . |
java.lang.String |
toString() |
public void setText(java.lang.String text)
JMenuItem
.public void setMnemonic(java.lang.String text)
JMenuItem
.text
- The name of a constant on the KeyEvent class.public void setAccelerator(javax.swing.KeyStroke accelerator)
public void setAction(javax.swing.Action action)
JMenuItem
is selected.public void addChild(ComponentBuilder<?> factory)
ComponentBuilder
Component
we are building.addChild
in interface ComponentBuilder<javax.swing.JMenuItem>
public javax.swing.JMenuItem instance()
ComponentBuilder
Component
.instance
in interface ComponentBuilder<javax.swing.JMenuItem>
public java.lang.String toString()
toString
in class java.lang.Object