public class IlpRepresentationObjectSupport extends Object implements IlpRepresentationObject, ilog.cpl.css.internal.IlpCSSObject
IlpRepresentationObject
instances
for storing attributes, attribute values, and the IlpObject
instance being
represented.VALUE_NOT_SET
Constructor and Description |
---|
IlpRepresentationObjectSupport(IlpRepresentationObject source,
IlpAttributeGroup model)
Provides support to
IlpRepresentationObject instances for storing
the attribute model and attribute values without an IlpObject . |
IlpRepresentationObjectSupport(IlpRepresentationObject source,
IlpExtendedAttributeGroup model,
IlpObject object)
Provides support to
IlpRepresentationObject instances for storing
the attribute model, attribute values, and the IlpObject that is being
represented. |
IlpRepresentationObjectSupport(IlpRepresentationObject source,
IlpObject object)
Provides support to
IlpRepresentationObject instances for storing
the attribute model, attribute values, and the IlpObject that is being
represented. |
Modifier and Type | Method and Description |
---|---|
void |
addAttributeValueListener(AttributeValueListener l)
Adds a listener to attribute value changes.
|
protected IlpAttributeValueHolderSupport |
createAttributeValueHolderSupport(IlpRepresentationObject source,
IlpAttributeGroup model)
To be overridden by subclasses which wish to have a different attributeHolder.
|
protected IlpAttributeValueHolderSupport |
createAttributeValueHolderSupport(IlpRepresentationObject source,
IlpAttributeGroup model,
IlpAttributeValueHolder defaultHolder)
To be overridden by subclasses which wish to have a different attributeHolder.
|
void |
disableAttributeValueNotification()
Must be called when
hasAttributeValueNotification()
drops from true to false . |
void |
enableAttributeValueNotification()
Must be called when
hasAttributeValueNotification()
goes from false to true . |
void |
fireEvent(AttributeValueEvent ev)
Fires an event to the listeners.
|
IlpAttributeGroup |
getAttributeGroup()
Returns the model that defines which attributes are allowed
in this instance.
|
Object |
getAttributeValue(IlpAttribute a)
Retrieves the value of an attribute of this object.
|
Object |
getAttributeValue(String attributeName)
Retrieves the value of an attribute of this object.
|
String |
getCSSClasses()
Returns the CSS classes of the object.
|
String |
getCSSID(IlpContext appc)
Returns the ID of the object.
|
String |
getCSSType()
Returns the type of the object.
|
ilog.cpl.model.edit.IlpRepresentationObjectEditor |
getEditor()
Get the editor for this object.
|
IlpObject |
getIlpObject()
Retrieves the
IlpObject corresponding to this representation. |
IlpMutableAttributeGroup |
getMutableAttributeGroup()
Returns a mutable model that defines which attributes are allowed
in this instance.
|
boolean |
hasAttributeValue(IlpAttribute a)
Returns
true if the requested attribute is part of the
attribute group of this instance and if a value has been set for this
attribute. |
void |
removeAttributeValueListener(AttributeValueListener l)
Removes the provided listener to the attribute value changes.
|
void |
setAttributeValue(IlpAttribute a,
Object value)
Sets the value of an attribute of this object.
|
void |
setAttributeValue(String attributeName,
Object value)
Sets the value of an attribute of this object.
|
public IlpRepresentationObjectSupport(IlpRepresentationObject source, IlpObject object)
IlpRepresentationObject
instances for storing
the attribute model, attribute values, and the IlpObject
that is being
represented.source
- The IlpRepresentationObject
instance that uses
this support instance.object
- The IlpObject
that is being represented by the
IlpRepresentationObject
.public IlpRepresentationObjectSupport(IlpRepresentationObject source, IlpExtendedAttributeGroup model, IlpObject object)
IlpRepresentationObject
instances for storing
the attribute model, attribute values, and the IlpObject
that is being
represented.source
- The IlpRepresentationObject
instance that uses
this support instance.model
- The attribute model used by this representation object.object
- The IlpObject
that is being represented by the
IlpRepresentationObject
.IllegalArgumentException
- If the extended model does not contain
the attribute model of the IlpObject
.public IlpRepresentationObjectSupport(IlpRepresentationObject source, IlpAttributeGroup model)
IlpRepresentationObject
instances for storing
the attribute model and attribute values without an IlpObject
.source
- The IlpRepresentationObject
instance that uses
this support instance.model
- The attribute model of the representation object.protected IlpAttributeValueHolderSupport createAttributeValueHolderSupport(IlpRepresentationObject source, IlpAttributeGroup model)
protected IlpAttributeValueHolderSupport createAttributeValueHolderSupport(IlpRepresentationObject source, IlpAttributeGroup model, IlpAttributeValueHolder defaultHolder)
public IlpObject getIlpObject()
IlpObject
corresponding to this representation.getIlpObject
in interface IlpRepresentationObject
IlpObject
corresponding to this representation.public IlpAttributeGroup getAttributeGroup()
getAttributeGroup
in interface IlpAttributeValueHolder
public Object getAttributeValue(IlpAttribute a)
getAttributeValue
in interface IlpAttributeValueHolder
a
- The attribute whose value is to be retrieved.VALUE_NOT_SET
if no
value has been set.public boolean hasAttributeValue(IlpAttribute a)
true
if the requested attribute is part of the
attribute group of this instance and if a value has been set for this
attribute.hasAttributeValue
in interface IlpAttributeValueHolder
public void setAttributeValue(IlpAttribute a, Object value)
VALUE_NOT_SET
for the value
argument.setAttributeValue
in interface IlpAttributeValueHolder
a
- The attribute whose value is set.value
- The new value of the attribute or VALUE_NOT_SET
to remove the value of the attribute.IllegalArgumentException
- If the value of the attribute cannot be
modified.public Object getAttributeValue(String attributeName)
getAttributeValue
in interface IlpAttributeValueHolder
attributeName
- The name of the attribute whose value is to be retrieved.VALUE_NOT_SET
if no
value has been set.public void setAttributeValue(String attributeName, Object value)
VALUE_NOT_SET
for the value
argument.Note: For the new value to be taken into account an object different from the initial object must be set.
Object value = o.getAttributeValue(name); // Incorrect: the value is stored in the same object. The change is not // taken into account. value.modify(); o.setAttributeValue(name,value); // Correct: the new value is stored in a new object. The change is taken // into account. value = value.clone(); // Returns a new object value.modify(); o.setAttributeValue(name,value);
setAttributeValue
in interface IlpAttributeValueHolder
attributeName
- The name of the attribute whose value is set.value
- The new value of the attribute or VALUE_NOT_SET
to remove the value of the attribute.IllegalArgumentException
- if the attribute cannot have
its value modified.public void addAttributeValueListener(AttributeValueListener l)
addAttributeValueListener
in interface IlpAttributeValueHolder
public void removeAttributeValueListener(AttributeValueListener l)
removeAttributeValueListener
in interface IlpAttributeValueHolder
public void fireEvent(AttributeValueEvent ev)
fireEvent
in interface IlpAttributeValueHolder
public IlpMutableAttributeGroup getMutableAttributeGroup()
public void enableAttributeValueNotification()
hasAttributeValueNotification()
goes from false
to true
.public void disableAttributeValueNotification()
hasAttributeValueNotification()
drops from true
to false
.public ilog.cpl.model.edit.IlpRepresentationObjectEditor getEditor()
IlpRepresentationObject
getAttributeValue
to the editor.
In this case it should also stop propagating attribute value
change events received from the BO.getEditor
in interface IlpRepresentationObject
public String getCSSType()
getCSSType
in interface ilog.cpl.css.internal.IlpCSSObject
public String getCSSID(IlpContext appc)
getCSSID
in interface ilog.cpl.css.internal.IlpCSSObject
appc
- Application contextpublic String getCSSClasses()
getCSSClasses
in interface ilog.cpl.css.internal.IlpCSSObject
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.