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.IlvFacesDiagrammerView.setEditable(boolean)
Constructor and Description |
---|
IlvFacesDiagrammerPropertyAccessor()
Creates a new
IlvFacesDiagrammerPropertyAccessor instance. |
Modifier and Type | Method and Description |
---|---|
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.
|
public IlvFacesDiagrammerPropertyAccessor()
IlvFacesDiagrammerPropertyAccessor
instance.public Map getProperties(IlvDiagrammer diagrammer, Object object)
Map
returned contains property names as keys and property values as
String
value objects.diagrammer
- The IlvDiagrammer
instance that
object
belongs to.object
- The diagrammer Object
for which properties need
to be returned.object
.public Map setProperties(IlvDiagrammer diagrammer, Object object, Map properties)
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.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.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:
null
.protected List getPropertyNames(IlvDiagrammer diagrammer, Object object)
Object
and IlvDiagrammer
instance.
Redefining this method provides filtering abilities.diagrammer
- The IlvDiagrammer
this object
belongs to.object
- The diagrammer Object
for which properties need
to be returned.protected boolean acceptProperty(IlvDiagrammer diagrammer, Object object, String propertyName)
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.true
is returned.protected boolean acceptGetProperty(IlvDiagrammer diagrammer, Object object, String propertyName)
acceptProperty(IlvDiagrammer, Object, String)
.
This can be redefined to filter the property to accepted
get operations only.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.true
is returned.protected boolean acceptSetProperty(IlvDiagrammer diagrammer, Object object, String propertyName, Object propertyValue)
acceptProperty(IlvDiagrammer, Object, String)
.
This can be redefined to filter the property and values to accepted set
operations only.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.true
is returned.protected Object getValueFromString(IlvDiagrammer diagrammer, Object object, String propertyName, String propertyValue) throws IlvConvertException
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.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.IlvConvertException
- if the conversion failed.protected String getStringFromValue(IlvDiagrammer diagrammer, Object object, String propertyName, Object propertyValue)
String
representation of a property value.
By default the IlvConvert
utility is used to convert
object
to a String
.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.String
representation suitable for the
client-side.public final void registerType(String tag, String propertyName, Class type)
tag
and propertyName
. This information will be used
in getValueFromString(IlvDiagrammer, Object, String, String)
.tag
- The object tag.propertyName
- The property name.type
- The expected type.© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.