public class IlvFacesGanttPropertyAccessor extends Object implements Serializable
IlvFacesGanttPropertyAccessor
class let the
IlvFacesGanttSelectionManager
access the properties of the selected objects for read or write operations.
Write operations are allowed only if the parent
IlvFacesHierarchyChartView
is editable.
Property values are marshalled/unmarshalled using
IlvConvert
. By default converters are registered to handle
types java.util.Date
, IlvDuration
and
IlvConstraintType
.
IlvFacesHierarchyChartView.setEditable(boolean)
,
Serialized FormConstructor and Description |
---|
IlvFacesGanttPropertyAccessor()
Creates an
IlvFacesGanttPropertyAccessor . |
Modifier and Type | Method and Description |
---|---|
protected boolean |
acceptGetProperty(IlvHierarchyChart view,
Object object,
String propertyName)
The default implementation calls
acceptProperty(IlvHierarchyChart, Object, String) . |
protected boolean |
acceptProperty(IlvHierarchyChart view,
Object object,
String propertyName)
Returns whether or not a given property can be read or written by the
client.
|
protected boolean |
acceptSetProperty(IlvHierarchyChart view,
Object object,
String propertyName,
Object propertyValue)
Returns whether a property can be set on an object.
|
Map<String,String> |
getProperties(IlvHierarchyChart view,
Object object)
Returns the properties of an object.
|
protected List<String> |
getPropertyNames(IlvHierarchyChart view,
Object object)
Returns the properties of an object, that will be exported for a hierarchy
chart.
|
protected String |
getStringFromValue(IlvHierarchyChart view,
Object object,
String propertyName,
Object propertyValue)
Marshalls a model object representation to a client-side suitable
String representation of a property value. |
protected Object |
getValueFromString(IlvHierarchyChart view,
Object object,
String propertyName,
String propertyValue)
Unmarshalls a client-side
String representation of a property
value to an object representation. |
void |
registerType(Class clazz,
String propertyName,
Class type)
Registers the expected object type for a property of an class.
|
Map |
setProperties(IlvHierarchyChart view,
Object object,
Map properties)
Set the properties of an object.
|
public IlvFacesGanttPropertyAccessor()
IlvFacesGanttPropertyAccessor
.public Map<String,String> getProperties(IlvHierarchyChart view, Object object)
Map
contains
properties names as keys and properties values as
values in the form of String
objects.view
- The IlvHierarchyChart
to which the object
belongs.object
- The chart Object
.Map
,
mapping property names to property values as String
.public Map setProperties(IlvHierarchyChart view, Object object, Map properties)
view
- The IlvHierarchyChart
to which the object
belongs.object
- The chart Object
for which to set
properties.properties
- The properties of the given object. This is a
Map
of property names to property values,
where the property values are String
objects.Map
containing the properties names as keys and
(@link ilog.views.faces.dhtml.component.IlvFacesPropertyAccessorError} objects
as values for the properties that couldn't be set either because not
accepted or because of conversion errors. This returned value might be
null
if no problem occurred.protected List<String> getPropertyNames(IlvHierarchyChart view, Object object)
view
- The IlvHierarchyChart
to which the object
belongs to.object
- The Gantt model Object
for which to return
property names.protected boolean acceptProperty(IlvHierarchyChart view, Object object, String propertyName)
true
, always -- that is: there is
no restriction.view
- The IlvHierarchyChart
to which the object
belongs.object
- The Gantt model Object
.propertyName
- The name of the property.true
when the property can be accessed.protected boolean acceptGetProperty(IlvHierarchyChart view, Object object, String propertyName)
acceptProperty(IlvHierarchyChart, Object, String)
.
Redefine this method to filter accepted properties for the get operations
only.view
- The IlvHierarchyChart
to which the object
belongs.object
- The Gantt model Object
.propertyName
- The name of the property.true
when the property can be accessed during a get
operation.protected boolean acceptSetProperty(IlvHierarchyChart view, Object object, String propertyName, Object propertyValue)
Predefined properties are settable as defined in the base interfaces for
Gantt model objects:
IlvActivity
,
IlvConstraint
,
IlvReservation
,
IlvResource
.
The default implementation allows to set any user property on an object
implementing IlvUserPropertyHolder
-- that is:
IlvGeneralActivity
, IlvGeneralConstraint
,
IlvGeneralReservation
, IlvGeneralResource
,
IlvTableActivity
, IlvTableConstraint
,
IlvTableReservation
, IlvTableResource
.
Any property value can be set.
Redefine this method to filter accepted properties and values for the set operations only.
view
- The IlvHierarchyChart
to which the
object belongs.object
- The Gantt model Object
.propertyName
- The name of the property.propertyValue
- The proposed value for the property.true
when the property can be accessed during a set
operation.protected Object getValueFromString(IlvHierarchyChart view, Object object, String propertyName, String propertyValue) throws IlvConvertException
String
representation of a property
value to an object representation. By default this is done using the
IlvConvert
utility to convert the String
to the given
type.
null
is always unmarshalled to null
.
view
- The IlvHierarchyChart
to which the
object belongs.object
- The Gantt model Object
.propertyName
- The name of the property.propertyValue
- The String
value for the property.IlvConvertException
- if the conversion failed.protected String getStringFromValue(IlvHierarchyChart view, Object object, String propertyName, Object propertyValue)
String
representation of a property value.
By default this is done using IlvConvert
utility to convert the
Object
to a String
.
For values of type IlvActivity
and IlvResource
the converted value is their ID
property value.
view
- The IlvHierarchyChart
to which the
object belongs.object
- The Gantt model Object
.propertyName
- The name of the property.propertyValue
- The object value for the property.String
representation suitable for the client-side.public final void registerType(Class clazz, String propertyName, Class type)
getValueFromString(IlvHierarchyChart, Object, String, String)
.
Use this method to register the type of user properties as defined in
IlvUserPropertyHolder
.clazz
- The class of the object. Must be one of:propertyName
- The property name.type
- The expected type for the property.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.