|
SalesPoint Framework v3.0 | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--sale.MenuSheetObject
A generic menu element.
MenuSheet
,
MenuSheetItem
,
MenuSheetSeparator
, Serialized FormField Summary | |
protected MenuSheet |
m_msParent
The MenuSheet that contains this menu element. |
protected SaleProcess |
m_pAttached
The SaleProcess attached to this MenuSheetObject, if any. |
protected SalesPoint |
m_spAttached
The SalesPoint attached to this MenuSheetObject, if any. |
Constructor Summary | |
MenuSheetObject(String sCaption)
Create a new MenuSheetObject with a caption and a default tag. |
|
MenuSheetObject(String sCaption,
String sTag)
Create a new MenuSheetObject with a caption and a tag. |
Method Summary | |
SaleProcess |
attach(SaleProcess p)
Attach a SaleProcess to this MenuSheetObject. |
SalesPoint |
attach(SalesPoint sp)
Attach a SalesPoint to this MenuSheetObject. |
SaleProcess |
detachSaleProcess()
Detach the currently attached SaleProcess. |
SalesPoint |
detachSalesPoint()
Detach the currently attached SalesPoint. |
boolean |
equals(Object o)
Compare this MenuSheetObject to the given object and return true if they are equal. |
String |
getCaption()
Get the MenuSheetObject's caption. |
abstract JMenu |
getMenuPeer()
Return the JMenu peer for this MenuSheetObject. |
MenuSheet |
getParent()
Get the parent MenuSheet of this MenuSheetObject. |
abstract JMenuItem |
getPeer()
Return the JMenuItem peer for this MenuSheetObject. |
String |
getTag()
Get the MenuSheetObject's tag. |
MenuSheetObject |
getTaggedItem(String sTag)
Convenience method for in-depth search for a tagged item. |
MenuSheetObject |
getTaggedItem(String sTag,
boolean fTopLevelOnly)
Get the first MenuSheetObject with the given tag which is managed by this one. |
boolean |
isSeparator()
Return true if this is a separator. |
boolean |
isVisible()
Get the visibility state of this MenuSheetObject. |
void |
setCaption(String sCaption)
Set the MenuSheetObject's caption. |
void |
setVisible(boolean fVisible)
Mark this MenuSheetObject visible or invisible. |
Methods inherited from class java.lang.Object |
clone,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected MenuSheet m_msParent
protected SalesPoint m_spAttached
protected SaleProcess m_pAttached
Constructor Detail |
public MenuSheetObject(String sCaption, String sTag)
sCaption
- the caption of this MenuObjectsTag
- the tag of this MenuObject. If null
, a default, unique tag
will be given.public MenuSheetObject(String sCaption)
You can find out about the tag by calling getTag()
.
sCaption
- the caption of the MenuSheetObject.Method Detail |
public String getCaption()
public void setCaption(String sCaption)
sCaption
- the new caption.public String getTag()
null
and should be unique in the containing MenuSheet.MenuSheet
,
getTaggedItem(java.lang.String, boolean)
public MenuSheetObject getTaggedItem(String sTag, boolean fTopLevelOnly)
The default implementation returns this MenuSheetObject if it has the given tag,
and null
otherwise.
sTag
- the tag that is searched for.fTopLevelOnly
- if true, only the top level items are searched.public MenuSheetObject getTaggedItem(String sTag)
Equivalent to:
getTaggedItem (sTag, false);
sTag
- the tag to be searched for.public SalesPoint attach(SalesPoint sp)
sp
- the SalesPoint to be attached.public SalesPoint detachSalesPoint()
public SaleProcess attach(SaleProcess p)
p
- the process to be attached.public SaleProcess detachSaleProcess()
public MenuSheet getParent()
public void setVisible(boolean fVisible)
This method is usually not called directly.
fVisible
- the visibility state of the MenuSheetObject.public boolean isVisible()
public boolean isSeparator()
getPeer()
,
getMenuPeer()
public boolean equals(Object o)
For MenuSheetObjects equality of references is measured, i.e.
equals()
will only return true if this == o
.
o
- the object to compare to.public abstract JMenuItem getPeer()
public abstract JMenu getMenuPeer()
For MenuSheetItems and similar MenuSheetObjects it is recommended that you create a JMenu with the same caption and only one item, the MenuElement peer of the MenuSheetObject. Make sure, however, to create all these objects afresh for the JMenu peer, lest there should result inpredictably behaving menus. This does, of course not apply, if the MenuElement peer and the JMenu peer are entirely equal as is the case for MenuSheets.
Although JMenuItem peer and JMenu peer should be different objects, subsequent
calls to getMenuPeer()
can still return the same object.
|
SalesPoint Framework v3.0 | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |