|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.cosylab.gui.util.UserSettingsProtection
public final class UserSettingsProtection
This class implements pattern, which protects Java bean properties from undesigred changes. For example user setting are protected from data source characteristics override.
Setting properties to bean with this class should have minimum performance overhead if bean is not protected.
Warning! This class is not synchronized. It expects tht only one thread will access GUI Java Beans at a time. Otherwise precations must be taken.
Method Summary | |
---|---|
void |
clearProtections()
|
void |
propertyChange(java.beans.PropertyChangeEvent evt)
|
static void |
setProtection(javax.swing.JComponent bean,
java.lang.String[] properties,
boolean protection)
Sets up or down property protection for provided JavaBean and properties. |
void |
setProtection(java.lang.String[] properties,
boolean protection)
|
static boolean |
setUnprotected(javax.swing.JComponent bean,
java.lang.String property,
java.lang.Object value)
Sets to a bean a Java Bean property with new value only if property is not protected. |
boolean |
setUnprotected(java.lang.String property,
java.lang.Object value)
Sets to a bean a Java Bean property with new value only if property is not protected. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void setProtection(javax.swing.JComponent bean, java.lang.String[] properties, boolean protection)
bean
- Java Beanproperties
- the properties to be protectedprotection
- if true
properties are proteccted, othervise protection is removedpublic void clearProtections()
public void setProtection(java.lang.String[] properties, boolean protection)
public static boolean setUnprotected(javax.swing.JComponent bean, java.lang.String property, java.lang.Object value) throws java.lang.NoSuchMethodException, java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException
bean
- a bean on which property is to be setproperty
- a property namevalue
- new property value to be set
true
if value was set, otherwise false
(property was protected)
java.lang.NoSuchMethodException
java.lang.reflect.InvocationTargetException
java.lang.IllegalAccessException
public boolean setUnprotected(java.lang.String property, java.lang.Object value) throws java.lang.NoSuchMethodException, java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException
property
- a property namevalue
- new property value to be set
true
if value was set, otherwise false
(property was protected)
java.lang.NoSuchMethodException
java.lang.reflect.InvocationTargetException
java.lang.IllegalAccessException
public void propertyChange(java.beans.PropertyChangeEvent evt)
propertyChange
in interface java.beans.PropertyChangeListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |