|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.salespointframework.core.MenuSheetObject
org.salespointframework.core.MenuSheetItem
public class MenuSheetItem
A MenuSheetItem that has a label and an associated action.
Action
,
MenuSheet
,
MenuSheetSeparator
Field Summary | |
---|---|
private static int |
DEFAULT_IMAGE
|
private static int |
DISABLED_IMAGE
|
private static int |
DISABLED_SELECTED_IMAGE
|
protected Action |
m_aAction
The action associated with this MenuSheetItem. |
protected javax.swing.ImageIcon[] |
m_aiImages
The Images associated with the icons of this MenuSheetItem( [0]:DefaultImage, [1]:PressedImage, [2]:DisabledImage, [3]:PressedDiabledImage ). |
protected char |
m_cMnemonic
The Mnemonic of this MenuSheetItem. |
private boolean |
m_fEnabled
Can this MenuSheetItem be clicked? |
protected javax.swing.JMenuItem |
m_jmiPeer
The JMenuItem peer. |
protected javax.swing.JMenu |
m_jmMenuPeer
The JMenu peer. |
protected javax.swing.KeyStroke |
m_ksKeyStroke
The KeyStroke of this MenuSheetItem. |
private java.lang.Object |
m_oActionLock
The monitor synchronizing accesses to m_aAction. |
private java.lang.Object |
m_oPeerLock
The monitor synchronizing access to the peers. |
protected java.lang.String |
m_sToolTip
The ToolTip of this MenuSheeItemt. |
private static int |
SELECTED_IMAGE
|
Fields inherited from class org.salespointframework.core.MenuSheetObject |
---|
m_msParent, m_pAttached, m_spAttached |
Constructor Summary | |
---|---|
MenuSheetItem(java.lang.String sCaption,
Action aAction)
Creates a new MenuSheetItem with caption and action. |
|
MenuSheetItem(java.lang.String sCaption,
java.lang.String sTag,
Action aAction)
Creates a new MenuSheetItem with caption, tag and action; initially enabled. |
|
MenuSheetItem(java.lang.String sCaption,
java.lang.String sTag,
Action aAction,
char cMnemonic)
Creates a new MenuSheetItem with caption, tag, an action and a mnemonic. |
Method Summary | |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
Hook method called whenever the user selects the MenuSheetItem. |
javax.swing.KeyStroke |
getAccelerator()
Get the accelerator of this MenuSheetItem. |
protected java.lang.Object |
getActionLock()
Return the monitor used to synchronized access to the m_aAction. |
javax.swing.ImageIcon |
getDefaultIcon()
Get the default icon of this MenuSheetItem. |
javax.swing.ImageIcon |
getDisabledIcon()
Get the disabled item of this MenuSheetItem. |
javax.swing.ImageIcon |
getDisabledSelectedIcon()
Get the disabled selected item of this MenuSheetItem. |
javax.swing.JMenu |
getMenuPeer()
Return the JMenu peer for this MenuSheetItem. |
char |
getMnemonic()
Get the Mnemonic of this MenuSheetItem. |
javax.swing.JMenuItem |
getPeer()
Get the JMenuItem peer of the MenuSheetItem. |
protected java.lang.Object |
getPeerLock()
Return the monitor used to synchronized access to the peers. |
javax.swing.ImageIcon |
getSelectedIcon()
Get the selected icon of this MenuSheetItem. |
java.lang.String |
getToolTipText()
Get the ToolTip of this MenuSheetItem. |
boolean |
isEnabled()
Return the current enabled state of this MenuSheetItem. |
void |
setAccelerator(javax.swing.KeyStroke ks)
Set the accelerator of this MenuSheetItem. |
Action |
setAction(Action aAction)
Set the action to perform when this item is selected. |
void |
setCaption(java.lang.String sCaption)
Set the caption of this MenuSheetItem. |
void |
setDefaultIcon(javax.swing.ImageIcon iiImageIcon)
Set the default icon of this MenuSheetItem. |
void |
setDisabledIcon(javax.swing.ImageIcon iiImageIcon)
Set the disabled icon of this MenuSheetItem. |
void |
setDisabledSelectedIcon(javax.swing.ImageIcon iiImageIcon)
Set the disabled selected icon of this MenuSheetItem. |
void |
setEnabled(boolean fEnabled)
Set the enabled state of this MenuSheetItem. |
private void |
setIcon(javax.swing.ImageIcon iiImageIcon,
int nIndex)
|
void |
setMnemonic(char cMnemonic)
Set the mnemonic of this MenuSheetItem. |
void |
setSelectedIcon(javax.swing.ImageIcon iiImageIcon)
Set the selected icon of this MenuSheetItem. |
void |
setToolTipText(java.lang.String s)
Set the ToolTip of this MenuSheetItem. |
void |
setVisible(boolean fVisible)
Mark the item visible or invisible. |
Methods inherited from class org.salespointframework.core.MenuSheetObject |
---|
attach, attach, detachSaleProcess, detachSalesPoint, equals, getCaption, getParent, getTag, getTaggedItem, getTaggedItem, isSeparator, isVisible, setParent |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected transient javax.swing.JMenuItem m_jmiPeer
protected transient javax.swing.JMenu m_jmMenuPeer
private transient java.lang.Object m_oPeerLock
protected Action m_aAction
private transient java.lang.Object m_oActionLock
private boolean m_fEnabled
protected javax.swing.ImageIcon[] m_aiImages
protected char m_cMnemonic
protected javax.swing.KeyStroke m_ksKeyStroke
protected java.lang.String m_sToolTip
private static final int DEFAULT_IMAGE
private static final int SELECTED_IMAGE
private static final int DISABLED_IMAGE
private static final int DISABLED_SELECTED_IMAGE
Constructor Detail |
---|
public MenuSheetItem(java.lang.String sCaption, java.lang.String sTag, Action aAction, char cMnemonic)
sCaption
- the caption of the new MenuSheetItem.sTag
- the tag that will identify this MenuSheetItem.aAction
- the action to perform when this MenuSheetItem is selected.cMnemonic
- the mnemonic of the new MenuSheetItempublic MenuSheetItem(java.lang.String sCaption, java.lang.String sTag, Action aAction)
sCaption
- the caption of the new MenuSheetItem.sTag
- the tag that will identify this MenuSheetItem.aAction
- the action to perform when this MenuSheetItem is selected.public MenuSheetItem(java.lang.String sCaption, Action aAction)
sCaption
- the caption of the new MenuSheetItem.aAction
- the action to perform when this MenuSheetItem is selected.Method Detail |
---|
protected java.lang.Object getPeerLock()
protected java.lang.Object getActionLock()
private void setIcon(javax.swing.ImageIcon iiImageIcon, int nIndex)
public void setCaption(java.lang.String sCaption)
setCaption
in class MenuSheetObject
sCaption
- the new caption.public void setEnabled(boolean fEnabled)
fEnabled
- the new enabled state.public boolean isEnabled()
public void setVisible(boolean fVisible)
setVisible
in class MenuSheetObject
fVisible
- the visibility state of the MenuSheetObject.public Action setAction(Action aAction)
aAction
- the action to perform when this item is selected.
public void setMnemonic(char cMnemonic)
If there is a peer it will reflect the changes immediately.
cMnemonic
- the new mnemonic.public void setAccelerator(javax.swing.KeyStroke ks)
If there is a peer it will reflect the changes immediately.
ks
- the new keystroke.public void setToolTipText(java.lang.String s)
If there is a peer it will reflect the changes immediately.
s
- the new ToolTip-Text.public void setDefaultIcon(javax.swing.ImageIcon iiImageIcon)
If there is a peer it will reflect the changes immediately.
iiImageIcon
- the new icon.public void setSelectedIcon(javax.swing.ImageIcon iiImageIcon)
If there is a peer it will reflect the changes immediately.
iiImageIcon
- the new icon.public void setDisabledIcon(javax.swing.ImageIcon iiImageIcon)
If there is a peer it will reflect the changes immediately.
iiImageIcon
- the new icon.public void setDisabledSelectedIcon(javax.swing.ImageIcon iiImageIcon)
If there is a peer it will reflect the changes immediately.
iiImageIcon
- the new icon.public javax.swing.JMenuItem getPeer()
getPeer
in class MenuSheetObject
public javax.swing.JMenu getMenuPeer()
getMenuPeer
in class MenuSheetObject
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
setAction(org.salespointframework.core.Action)
,
SalesPoint
,
SaleProcess
public char getMnemonic()
public javax.swing.KeyStroke getAccelerator()
public java.lang.String getToolTipText()
public javax.swing.ImageIcon getDefaultIcon()
public javax.swing.ImageIcon getSelectedIcon()
public javax.swing.ImageIcon getDisabledIcon()
public javax.swing.ImageIcon getDisabledSelectedIcon()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |