ilog.views.diagrammer.faces.dhtml.component
Class IlvFacesDiagrammerPropertyAccessor

java.lang.Object
  extended by ilog.views.diagrammer.faces.dhtml.component.IlvFacesDiagrammerPropertyAccessor

public class IlvFacesDiagrammerPropertyAccessor
extends Object

IlvFacesDiagrammerPropertyAccessor lets the IlvFacesDiagrammerSelectionManager access the properties of the selected objects for read or write operations.

Write operations are only allowed if the parent IlvFacesDiagrammerView object is editable.

Since:
JViews 8.0
See Also:
IlvFacesDiagrammerView.setEditable(boolean)

Constructor Summary
IlvFacesDiagrammerPropertyAccessor()
          Creates a new IlvFacesDiagrammerPropertyAccessor instance.
 
Method Summary
protected  boolean acceptGetProperty(IlvDiagrammer diagrammer, Object object, String propertyName)
          This default implementation calls acceptProperty(IlvDiagrammer, Object, String).
protected  boolean acceptProperty(IlvDiagrammer diagrammer, Object object, String propertyName)
          Returns whether or not a given property can be a get and/or a set property going to or from the client.
protected  boolean acceptSetProperty(IlvDiagrammer diagrammer, Object object, String propertyName, Object propertyValue)
          This default implementation calls acceptProperty(IlvDiagrammer, Object, String).
 Map getProperties(IlvDiagrammer diagrammer, Object object)
          Returns the properties of the given object.
protected  List getPropertyNames(IlvDiagrammer diagrammer, Object object)
          Returns the properties that will be exported for a given Object and IlvDiagrammer instance.
protected  String getStringFromValue(IlvDiagrammer diagrammer, Object object, String propertyName, Object propertyValue)
          Marshalls a diagrammer model object representation into a suitable client-side String representation of a property value.
protected  Object getValueFromString(IlvDiagrammer diagrammer, Object object, String propertyName, String propertyValue)
          Unmarshalls the client-side String representation of a property value into an object representation.
 void registerType(String tag, String propertyName, Class type)
          Registers the expected object type for a give tag and propertyName.
 Map setProperties(IlvDiagrammer diagrammer, Object object, Map properties)
          Sets the properties of the given object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlvFacesDiagrammerPropertyAccessor

public IlvFacesDiagrammerPropertyAccessor()
Creates a new IlvFacesDiagrammerPropertyAccessor instance.

Method Detail

getProperties

public Map getProperties(IlvDiagrammer diagrammer,
                         Object object)
Returns the properties of the given object. The Map returned contains property names as keys and property values as String value objects.

Parameters:
diagrammer - The IlvDiagrammer instance that object belongs to.
object - The diagrammer Object for which properties need to be returned.
Returns:
The properties of object.

setProperties

public Map setProperties(IlvDiagrammer diagrammer,
                         Object object,
                         Map properties)
Sets the properties of the given object. The properties parameter must contain the property names as keys and property values as values in the form of String objects for the properties that have to be set.

Parameters:
diagrammer - The IlvDiagrammer instance that object belongs to.
object - The Diagrammer Object for which properties need to be returned.
properties - The properties of the given object.
Returns:
A Map instance containing the property names as keys and (@link ilog.views.faces.dhtml.component.IlvFacesPropertyAccessorError} objects as values for the properties that could not be set. Properties cannot be set for for the following reasons:
  • they were not accepted
  • there were conversion errors
If no problem occurred, this returned value can be null.

getPropertyNames

protected List getPropertyNames(IlvDiagrammer diagrammer,
                                Object object)
Returns the properties that will be exported for a given Object and IlvDiagrammer instance. Redefining this method provides filtering abilities.

Parameters:
diagrammer - The IlvDiagrammer this object belongs to.
object - The diagrammer Object for which properties need to be returned.
Returns:
The property names.

acceptProperty

protected boolean acceptProperty(IlvDiagrammer diagrammer,
                                 Object object,
                                 String propertyName)
Returns whether or not a given property can be a get and/or a set property going to or from the client.

Parameters:
diagrammer - The IlvDiagrammer instance that object belongs to.
object - The diagrammer Object for which properties need to be returned.
propertyName - The name of the property.
Returns:
If the property can be accessed, true is returned.

acceptGetProperty

protected boolean acceptGetProperty(IlvDiagrammer diagrammer,
                                    Object object,
                                    String propertyName)
This default implementation calls acceptProperty(IlvDiagrammer, Object, String). This can be redefined to filter the property to accepted get operations only.

Parameters:
diagrammer - The IlvDiagrammer instance that object belongs to.
object - The diagrammer Object for which properties need to be returned.
propertyName - The name of the property.
Returns:
If the property can be accessed as a get operation, true is returned.

acceptSetProperty

protected boolean acceptSetProperty(IlvDiagrammer diagrammer,
                                    Object object,
                                    String propertyName,
                                    Object propertyValue)
This default implementation calls acceptProperty(IlvDiagrammer, Object, String). This can be redefined to filter the property and values to accepted set operations only.

Parameters:
diagrammer - The IlvDiagrammer that object belongs to.
object - The diagrammer Object for which properties need to be returned.
propertyName - The name of the property.
propertyValue - The proposed value for the property.
Returns:
If the property can be accessed as a set operation, true is returned.

getValueFromString

protected Object getValueFromString(IlvDiagrammer diagrammer,
                                    Object object,
                                    String propertyName,
                                    String propertyValue)
                             throws IlvConvertException
Unmarshalls the client-side String representation of a property value into an object representation. By default, information set using registerType(String, String, Class) is used. The IlvConvert utility is called to convert the String to the given type.

Parameters:
diagrammer - The IlvDiagrammer instance object belongs to.
object - The diagrammer Object for which properties need to be returned.
propertyName - The name of the property.
propertyValue - The String value of the property.
Returns:
The object representation suitable for the diagrammer model.
Throws:
IlvConvertException - if the conversion failed.

getStringFromValue

protected String getStringFromValue(IlvDiagrammer diagrammer,
                                    Object object,
                                    String propertyName,
                                    Object propertyValue)
Marshalls a diagrammer model object representation into a suitable client-side String representation of a property value. By default the IlvConvert utility is used to convert object to a String.

Parameters:
diagrammer - The IlvDiagrammer instance that object belongs to.
object - The diagrammer Object for which properties need to be returned.
propertyName - The name of the property.
propertyValue - The object value for the property.
Returns:
A String representation suitable for the client-side.

registerType

public final void registerType(String tag,
                               String propertyName,
                               Class type)
Registers the expected object type for a give tag and propertyName. This information will be used in getValueFromString(IlvDiagrammer, Object, String, String).

Parameters:
tag - The object tag.
propertyName - The property name.
type - The expected type.


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.