com.metamatrix.toolbox.ui.widget.property
Interface ObjectReferenceHandler


public interface ObjectReferenceHandler

An interface for classes that can supply ObjectReference type PropertyDefinition values to the PropertiedObjectPanel and it's ObjectReferencePropertyComponent.


Field Summary
static java.lang.Object NULL_OBJECT
          Defines a statically available "null" object that implementations should use to signal the framework that the user wishes to set the ObjectReference to null.
 
Method Summary
 boolean canNavigateTo(java.lang.Object objectReference)
          Determine if it is possible to navigate to the specified ObjectReference value.
 java.lang.Object getObjectReference(PropertiedObject object, PropertiedObjectEditor editor, PropertyDefinition def, java.lang.Object currentValue)
          Return a value for the specified ObjectReference type PropertyDefinition on the specified PropertiedObject.
 java.lang.Object[] getObjectReferences(PropertiedObject object, PropertiedObjectEditor editor, PropertyDefinition def, java.util.Collection currentValues)
          Return a Collection of values for the specified ObjectReference type PropertyDefinition on the specified PropertiedObject.
 void navigateTo(java.lang.Object objectReference)
          Navigate to the specified ObjectReference value.
 

Field Detail

NULL_OBJECT

static final java.lang.Object NULL_OBJECT
Defines a statically available "null" object that implementations should use to signal the framework that the user wishes to set the ObjectReference to null. The framework will test the reference returned by getObjectReference and getObjectReferences against this instance and, if they are ==, it will null out the property value on the object.

Method Detail

getObjectReference

java.lang.Object getObjectReference(PropertiedObject object,
                                    PropertiedObjectEditor editor,
                                    PropertyDefinition def,
                                    java.lang.Object currentValue)
Return a value for the specified ObjectReference type PropertyDefinition on the specified PropertiedObject. This method is called when the PropertyDefinition has max multiplicity = 1.

Parameters:
object - the PropertiedObject that is requesting a setValue
editor - the PropertiedObjectEditor for this transaction
def - the PropertyDefinition of type PropertyTypes.OBJECT_REFERENCE
currentValue - the current reference for this PropertyDefinition's value. May be null if no value has been set.
Returns:
the Object that should be set as the value of the specified PropertyDefinition, replacing the current value. Returning null is interpreted by the framework as a "cancel" request and the existing value will not be modified. Returning ObjectReferenceSupplier.NULL_OBJECT is interpreted by the framework as a request to null out the existing value.

getObjectReferences

java.lang.Object[] getObjectReferences(PropertiedObject object,
                                       PropertiedObjectEditor editor,
                                       PropertyDefinition def,
                                       java.util.Collection currentValues)
Return a Collection of values for the specified ObjectReference type PropertyDefinition on the specified PropertiedObject. This method is called when the PropertyDefinition has max multiplicity > 1.

Parameters:
object - the PropertiedObject that is requesting a setValue
editor - the PropertiedObjectEditor for this transaction
def - the PropertyDefinition of type PropertyTypes.OBJECT_REFERENCE
currentValues - an unmodifiable Collection of current references for this PropertyDefinition's value. If no value has been set, the Collection will be empty. Will never be null.
Returns:
an Object value that will be SET to value of the specified PropertyDefinition. Returning null is interpreted by the framework as a "cancel" request and the existing values will not be modified. Returning an empty Collection is interpreted by the framework as a request delete all the existing values.

canNavigateTo

boolean canNavigateTo(java.lang.Object objectReference)
Determine if it is possible to navigate to the specified ObjectReference value.

Parameters:
objectReference - a non-null reference value for a PropertyDefinition of type PropertyTypes.OBJECT_REFERENCE.
Returns:
true if this handler knows how to navigate to this object, false otherwise to disable the ObjectReferencePropertyComponent's navigate action.

navigateTo

void navigateTo(java.lang.Object objectReference)
Navigate to the specified ObjectReference value. Called when the user activates the ObjectReferencePropertyComponent's navigate action.

Parameters:
objectReference - a non-null reference value for a PropertyDefinition of type PropertyTypes.OBJECT_REFERENCE.


Copyright © 2009. All Rights Reserved.