ilog.cpl.model
Class IlpRepresentationObjectSupport

java.lang.Object
  extended by ilog.cpl.model.IlpRepresentationObjectSupport
All Implemented Interfaces:
ilog.cpl.css.internal.IlpCSSObject, IlpAttributeValueHolder, IlpRepresentationObject

public class IlpRepresentationObjectSupport
extends Object
implements IlpRepresentationObject, ilog.cpl.css.internal.IlpCSSObject

This class provides basic support to IlpRepresentationObject instances for storing attributes, attribute values, and the IlpObject instance being represented.

Since:
JTGO 3.0

Field Summary
 
Fields inherited from interface ilog.cpl.model.IlpAttributeValueHolder
VALUE_NOT_SET
 
Constructor Summary
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.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlpRepresentationObjectSupport

public IlpRepresentationObjectSupport(IlpRepresentationObject source,
                                      IlpObject object)
Provides support to IlpRepresentationObject instances for storing the attribute model, attribute values, and the IlpObject that is being represented.

Parameters:
source - The IlpRepresentationObject instance that uses this support instance.
object - The IlpObject that is being represented by the IlpRepresentationObject.

IlpRepresentationObjectSupport

public 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.

Parameters:
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.
Throws:
IllegalArgumentException - If the extended model does not contain the attribute model of the IlpObject.

IlpRepresentationObjectSupport

public IlpRepresentationObjectSupport(IlpRepresentationObject source,
                                      IlpAttributeGroup model)
Provides support to IlpRepresentationObject instances for storing the attribute model and attribute values without an IlpObject.

Parameters:
source - The IlpRepresentationObject instance that uses this support instance.
model - The attribute model of the representation object.
Method Detail

createAttributeValueHolderSupport

protected IlpAttributeValueHolderSupport createAttributeValueHolderSupport(IlpRepresentationObject source,
                                                                           IlpAttributeGroup model)
To be overridden by subclasses which wish to have a different attributeHolder.

Internal method or field: do not use!

createAttributeValueHolderSupport

protected IlpAttributeValueHolderSupport createAttributeValueHolderSupport(IlpRepresentationObject source,
                                                                           IlpAttributeGroup model,
                                                                           IlpAttributeValueHolder defaultHolder)
To be overridden by subclasses which wish to have a different attributeHolder.

Internal method or field: do not use!

getIlpObject

public IlpObject getIlpObject()
Retrieves the IlpObject corresponding to this representation.

Specified by:
getIlpObject in interface IlpRepresentationObject
Returns:
The IlpObject corresponding to this representation.

getAttributeGroup

public IlpAttributeGroup getAttributeGroup()
Returns the model that defines which attributes are allowed in this instance.

Specified by:
getAttributeGroup in interface IlpAttributeValueHolder

getAttributeValue

public Object getAttributeValue(IlpAttribute a)
Retrieves the value of an attribute of this object.

Specified by:
getAttributeValue in interface IlpAttributeValueHolder
Parameters:
a - The attribute whose value is to be retrieved.
Returns:
The value of the attribute or VALUE_NOT_SET if no value has been set.

hasAttributeValue

public 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.

Specified by:
hasAttributeValue in interface IlpAttributeValueHolder

setAttributeValue

public void setAttributeValue(IlpAttribute a,
                              Object value)
Sets the value of an attribute of this object. To remove the value of an attribute, you can pass VALUE_NOT_SET for the value argument.

Specified by:
setAttributeValue in interface IlpAttributeValueHolder
Parameters:
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.
Throws:
IllegalArgumentException - If the value of the attribute cannot be modified.

getAttributeValue

public Object getAttributeValue(String attributeName)
Retrieves the value of an attribute of this object.

Specified by:
getAttributeValue in interface IlpAttributeValueHolder
Parameters:
attributeName - The name of the attribute whose value is to be retrieved.
Returns:
The value of the attribute or VALUE_NOT_SET if no value has been set.
Since:
JTGO 4.0

setAttributeValue

public void setAttributeValue(String attributeName,
                              Object value)
Sets the value of an attribute of this object. To remove the value of an attribute, you can pass 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);
 

Specified by:
setAttributeValue in interface IlpAttributeValueHolder
Parameters:
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.
Throws:
IllegalArgumentException - if the attribute cannot have its value modified.
Since:
JTGO 4.0

addAttributeValueListener

public void addAttributeValueListener(AttributeValueListener l)
Adds a listener to attribute value changes.

Specified by:
addAttributeValueListener in interface IlpAttributeValueHolder

removeAttributeValueListener

public void removeAttributeValueListener(AttributeValueListener l)
Removes the provided listener to the attribute value changes.

Specified by:
removeAttributeValueListener in interface IlpAttributeValueHolder

fireEvent

public void fireEvent(AttributeValueEvent ev)
Fires an event to the listeners.

Specified by:
fireEvent in interface IlpAttributeValueHolder

getMutableAttributeGroup

public IlpMutableAttributeGroup getMutableAttributeGroup()
Returns a mutable model that defines which attributes are allowed in this instance.


enableAttributeValueNotification

public void enableAttributeValueNotification()
Must be called when hasAttributeValueNotification() goes from false to true.

Since:
JViews 7.5
Internal method or field: do not use!

disableAttributeValueNotification

public void disableAttributeValueNotification()
Must be called when hasAttributeValueNotification() drops from true to false.

Since:
JViews 7.5
Internal method or field: do not use!

getEditor

public ilog.cpl.model.edit.IlpRepresentationObjectEditor getEditor()
Description copied from interface: IlpRepresentationObject
Get the editor for this object. Should never return null. When the representation object is being updated, it should delegate all calls to getAttributeValue to the editor. In this case it should also stop propagating attribute value change events received from the BO.

Specified by:
getEditor in interface IlpRepresentationObject
Internal method or field: do not use!

getCSSType

public String getCSSType()
Returns the type of the object.

Specified by:
getCSSType in interface ilog.cpl.css.internal.IlpCSSObject
Returns:
The string representing the type of the object in the model. Null is accepted.
Internal method or field: do not use!

getCSSID

public String getCSSID(IlpContext appc)
Returns the ID of the object.

Specified by:
getCSSID in interface ilog.cpl.css.internal.IlpCSSObject
Parameters:
appc - Application context
Returns:
The string representing the ID. null is accepted
Internal method or field: do not use!

getCSSClasses

public String getCSSClasses()
Returns the CSS classes of the object.

Specified by:
getCSSClasses in interface ilog.cpl.css.internal.IlpCSSObject
Returns:
The string representing the css classes, separated by ' '. Null is accepted.
Internal method or field: do not use!


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