|
SalesPoint v3.3 API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Nameable
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 |
---|
static final String NAME_PROPERTY
Method Detail |
---|
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.
NameContext detachNC()
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
String getName()
void addPropertyChangeListener(PropertyChangeListener pcl)
void removePropertyChangeListener(PropertyChangeListener pcl)
void addNameListener(PropertyChangeListener pcl)
void removeNameListener(PropertyChangeListener pcl)
|
SalesPoint v3.3 API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |