|
SalesPoint Framework v3.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
An object that has a name that complies with a NameContext's rules.
When implementing nameable objects you migth want to subclass AbstractNameable
, which already
implements all the methods required by Nameable.
Catalog
,
Stock
,
CatalogItem
,
NameContext
Field Summary | |
static String |
NAME_PROPERTY
The programmatical name of the "name" property. |
Method Summary | |
void |
addNameListener(PropertyChangeListener pcl)
Add a PropertyChangeListener that will receive events whenever the "name" property changes. |
void |
addPropertyChangeListener(PropertyChangeListener pcl)
Register a listener to receive events whenever propertiy changes. |
NameContext |
attach(NameContext nc)
Attach a NameContext to this Nameable. |
NameContext |
detachNC()
Detach the current NameContext from this Nameable. |
String |
getName()
Get the name of this Nameable object. |
void |
removeNameListener(PropertyChangeListener pcl)
Remove a PropertyChangeListener for the "name" property. |
void |
removePropertyChangeListener(PropertyChangeListener pcl)
Stop a listener from receiving events whenever a property changes. |
void |
setName(String sName,
DataBasket db)
Set the Nameable's name. |
Field Detail |
public static final String NAME_PROPERTY
Method Detail |
public NameContext attach(NameContext nc)
No naming conventions are checked neither in the old nor in the new NameContext.
nc
- the new NameContext of this Nameable object.
public NameContext detachNC()
public void setName(String sName, DataBasket db) throws NameContextException
setName()
must implement the following protocol (Let nc
be the Nameable's
current NameContext):
if (nc != null) { synchronized (nc.getNCMonitor()) { nc.checkNameChange (db, getName(), sName); // set the internal name attribute(s), leaving old name in sOldName nc.nameHasChanged (db, sOldName, getName()); } } else { // set the internal name attribute(s) }
sName
- the new name of the objectdb
- the DataBasket relative to which the operation is to be performed.
NameContextException
- if the name change was not approved of by the NameContext.NameContext
public String getName()
public void addPropertyChangeListener(PropertyChangeListener pcl)
public void removePropertyChangeListener(PropertyChangeListener pcl)
public void addNameListener(PropertyChangeListener pcl)
public void removeNameListener(PropertyChangeListener pcl)
|
SalesPoint Framework v3.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |