com.miginfocom.util
Interface AdjustingPropertyConsumer

All Superinterfaces:
PropertyConsumer, PropertyProvider
All Known Subinterfaces:
Activity
All Known Implementing Classes:
AbstractActivity, Category, DefaultActivity, DemoDataBean

public interface AdjustingPropertyConsumer
extends PropertyConsumer

A special kind of PropertyConsumer that has support for the notion of "adjusting" properties. This can also be called transactions for a certain property since the concept of "endAdjusting" (commit) and "rollback" is added.

A property that is adjusting is in a tranision mode, such as for instance the DateRange for an activity that the user is dragging or resizing.

Since:
6.0

Method Summary
 java.lang.Object endAdjusting(PropertyKey key)
          Ends the adjusting mode for the key and removed any reference to the old value.
 boolean isAdjusting(PropertyKey key)
          Returns if the key is currently in "adjustment mode".
 java.lang.Object rollbackAdjusting(PropertyKey key)
          Rollbacks the value of the key to the value it has when the startAdjusting(com.miginfocom.util.PropertyKey) was called.
 boolean startAdjusting(PropertyKey key)
          Starts a transaction for the key.
 
Methods inherited from interface com.miginfocom.util.PropertyConsumer
removeProperty, removePropertySilent, setProperty, setPropertySilent
 
Methods inherited from interface com.miginfocom.util.PropertyProvider
containsProperty, getProperty
 

Method Detail

startAdjusting

boolean startAdjusting(PropertyKey key)
Starts a transaction for the key. The current value is saved and can be reset by a call to rollbackAdjusting(com.miginfocom.util.PropertyKey). The adjusting status end when calling either endAdjusting(PropertyKey) or rollbackAdjusting(com.miginfocom.util.PropertyKey). If the property is already in "adjustment" mode nothing is done since there is no support for hierarchical transactions.

Parameters:
key - The key that should be considered "adjusting". Not null.
Returns:
If the adjustment mode for this key got changed. false if it already was adjusting.
Since:
6.0

isAdjusting

boolean isAdjusting(PropertyKey key)
Returns if the key is currently in "adjustment mode".

Parameters:
key - The key to check. Not null.
Returns:
If the key is currently in "adjustment mode".

rollbackAdjusting

java.lang.Object rollbackAdjusting(PropertyKey key)
Rollbacks the value of the key to the value it has when the startAdjusting(com.miginfocom.util.PropertyKey) was called. If the key is not in "adjustment mode" nothing is done.

Parameters:
key - The key to rollback. Not null.
Returns:
The old value that was rolled back to. May be null.

endAdjusting

java.lang.Object endAdjusting(PropertyKey key)
Ends the adjusting mode for the key and removed any reference to the old value.

Parameters:
key - The key to end adjustment for.
Returns:
The old value.


Copyright © 2009 MiG InfoCom AB. All Rights Reserved.