|
SalesPoint Framework v3.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object data.AbstractNameable
Convenience class implementing the Nameable interface.
You should derive all your Nameable classes from this class, as it provides a
complete implementation of the Nameable
interface. However, there is no
obligation to derive from this class, as long as your class implements Nameable and
sticks to the contract defined in that interface.
Field Summary | |
protected NameContext |
m_ncContext
The current name context. |
protected PropertyChangeSupport |
m_pcsPropertyListeners
Used to fire PropertyChangeEvents . |
Fields inherited from interface data.Nameable |
NAME_PROPERTY |
Constructor Summary | |
AbstractNameable()
Initialize a new AbstractNameable object with a null name. |
|
AbstractNameable(String sName)
Initialize a new AbstractNameable object with the given name. |
Method Summary | |
void |
addNameListener(PropertyChangeListener pcl)
Add a PropertyChangeListener that will receive events whenever the "name" property changes. |
void |
addPropertyChangeListener(PropertyChangeListener pcl)
Add a PropertyChangeListener that will receive events whenever a bound property 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 the object. |
void |
removeNameListener(PropertyChangeListener pcl)
Remove a PropertyChangeListener for the "name" property. |
void |
removePropertyChangeListener(PropertyChangeListener pcl)
Remove a PropertyChangeListener. |
void |
setName(String sName,
DataBasket db)
Set the Nameable's name, using help by the NameContext. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected PropertyChangeSupport m_pcsPropertyListeners
PropertyChangeEvents
.
protected NameContext m_ncContext
Constructor Detail |
public AbstractNameable()
null
name.
public AbstractNameable(String sName)
null
.
sName
- the AbstractNameable's name.Method Detail |
public NameContext attach(NameContext nc)
No naming conventions are checked neither in the old nor in the new NameContext.
All access to the NameContext is synchronized for thread-safety.
attach
in interface Nameable
nc
- the new NameContext of this Nameable object.
public NameContext detachNC()
All access to the NameContext is synchronized for thread-safety.
detachNC
in interface Nameable
public void setName(String sName, DataBasket db) throws NameContextException
All access to the NameContext is synchronized for thread-safety.
setName
in interface Nameable
sName
- the new name of the objectdb
- the DataBasket relative to which the name change is to take place.
NameContextException
- if the name change was not approved of by the
NameContext.NameContext
public String getName()
getName
in interface Nameable
public void addPropertyChangeListener(PropertyChangeListener pcl)
addPropertyChangeListener
in interface Nameable
public void removePropertyChangeListener(PropertyChangeListener pcl)
removePropertyChangeListener
in interface Nameable
public void addNameListener(PropertyChangeListener pcl)
addNameListener
in interface Nameable
public void removeNameListener(PropertyChangeListener pcl)
removeNameListener
in interface Nameable
|
SalesPoint Framework v3.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |