|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.progeeks.meta.util.PropertyLink
public class PropertyLink
Synchronizes a property on one object with a property on another. Objects are denoted as primary and secondary but the link works in both directions. The primary designation is used to define the initial value that should be pushed to the secondary. The secondary object is passive during initialization.
This object supports linking both meta-objects and beans. It will also auto-create links to beans created by a BeanConfigurator if the secondary of the link is a BeanConfigurator.
One example use for this class would be linking a user preferences object to factory created user interface components. In that case, the primary object would be the preferences object (potentially persisted or backed by Java preferences) and would be automatically linked to the UI beans created by the BeanConfigurator set as the secondary object.
Constructor Summary | |
---|---|
PropertyLink()
|
Method Summary | |
---|---|
protected void |
addListeners(java.lang.Object obj,
java.lang.String propertyName)
Adds the appropriate listeners to the object depending on its type. |
java.lang.Object |
getPrimaryObject()
|
java.lang.String |
getPrimaryProperty()
|
java.lang.Object |
getSecondaryObject()
|
java.lang.String |
getSecondaryProperty()
|
protected void |
refreshSecondary(java.lang.Object skip)
Pushes the primary's property value to any existing secondary objects. |
protected void |
removeListeners(java.lang.Object obj,
java.lang.String propertyName)
Removes the appropriate listeners from the object depending on its type. |
void |
setPrimaryObject(java.lang.Object primary)
|
void |
setPrimaryProperty(java.lang.String name)
|
void |
setSecondaryObject(java.lang.Object secondary)
|
void |
setSecondaryProperty(java.lang.String name)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PropertyLink()
Method Detail |
---|
public void setPrimaryObject(java.lang.Object primary)
public java.lang.Object getPrimaryObject()
public void setPrimaryProperty(java.lang.String name)
public java.lang.String getPrimaryProperty()
public void setSecondaryObject(java.lang.Object secondary)
public java.lang.Object getSecondaryObject()
public void setSecondaryProperty(java.lang.String name)
public java.lang.String getSecondaryProperty()
protected void refreshSecondary(java.lang.Object skip)
protected void addListeners(java.lang.Object obj, java.lang.String propertyName)
protected void removeListeners(java.lang.Object obj, java.lang.String propertyName)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |