ilog.cpl.model.container
Class IlpAbstractRepresentationNode

java.lang.Object
  extended by ilog.cpl.model.container.IlpAbstractRepresentationNode
All Implemented Interfaces:
ilog.cpl.css.internal.IlpCSSObject, IlpMutableRepresentationNode, IlpRepresentationNode, IlpAttributeValueHolder, IlpRepresentationObject
Direct Known Subclasses:
IlpAbstractRepresentationLink, IlpDefaultEquipmentNode, IlpDefaultNetworkNode

public abstract class IlpAbstractRepresentationNode
extends Object
implements IlpMutableRepresentationNode, ilog.cpl.css.internal.IlpCSSObject

This class is the abstract implementation of IlpRepresentationNode.

Since:
JTGO 4.0
See Also:
IlpDefaultNetworkNode, IlpDefaultEquipmentNode

Field Summary
 
Fields inherited from interface ilog.cpl.model.IlpAttributeValueHolder
VALUE_NOT_SET
 
Constructor Summary
protected IlpAbstractRepresentationNode(IlpAttributeGroup model, IlpExpansionStrategy strategy, Logger logger)
          Creates a new node.
protected IlpAbstractRepresentationNode(IlpObject object, IlpExtendedAttributeGroup model, IlpExpansionStrategy strategy, Logger logger)
          Creates a new node attached to a business object.
 
Method Summary
 void addAttributeValueListener(AttributeValueListener listener)
          Adds a listener to attribute value changes.
 void addChild(IlpRepresentationNode child)
          Inserts a child.
 void addChildren(IlpRepresentationNode[] children)
          Inserts a set of children.
 void addChildren(int[] indices, IlpRepresentationNode[] children)
          Inserts a set of children.
 void addRepresentationNodeListener(RepresentationNodeListener listener)
          Adds a listener that is notified each time a change to this container occurs.
 void addTreeAttributeValueListener(AttributeValueListener listener)
          Adds an attribute value listener.
 void fireEvent(AttributeValueEvent event)
          Fires an event to the registered attribute value listeners.
 void fireRepresentationNodeEvent(RepresentationNodeEvent event)
          Notifies the listeners of a container event.
 boolean getAllowsChildren()
          Returns true if this node allows children.
 IlpAttributeGroup getAttributeGroup()
          Returns the model that defines which attributes are allowed in this instance.
 Object getAttributeValue(IlpAttribute attribute)
          Returns the value of an attribute of this object.
 Object getAttributeValue(String name)
          Returns the value of an attribute of this object.
 List getChildren()
          Returns a list of the child objects of this object.
 String getCSSClasses()
          Returns the CSS classes of the object.
 String getCSSID(IlpContext context)
          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.
 IlpExpansionStrategy getExpansionStrategy()
          Returns the child object loader that was passed to this object at construction time.
 IlpObject getIlpObject()
          Retrieves the IlpObject of this representation.
protected  Logger getLogger()
          Returns the logger.
 IlpRepresentationNode getParent()
          Returns the parent object of this object.
 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.
 boolean isLeaf()
          Returns true if this object, by its nature, has no children.
 void removeAttributeValueListener(AttributeValueListener listener)
          Removes the given listener from the notifications of attribute value changes.
 void removeChild(IlpRepresentationNode child)
          Removes a child.
 void removeChildren(IlpRepresentationNode[] children)
          Removes a set of children.
 void removeChildren(int[] indices)
          Removes a set of children.
 void removeChildren(int[] indices, IlpRepresentationNode[] children)
          Removes a set of children.
 void removeRepresentationNodeListener(RepresentationNodeListener listener)
          Removes a listener previously added with addRepresentationNodeListener.
 void removeTreeAttributeValueListener(AttributeValueListener listener)
          Removes an attribute value listener.
 void setAttributeValue(IlpAttribute attribute, Object value)
          Sets the value of an attribute of this object.
 void setAttributeValue(String name, Object value)
          Sets the value of an attribute of this object.
 void setParent(IlpRepresentationNode parent)
          Only to be called immediately after construction.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IlpAbstractRepresentationNode

protected IlpAbstractRepresentationNode(IlpAttributeGroup model,
                                        IlpExpansionStrategy strategy,
                                        Logger logger)
Creates a new node.

Parameters:
model - The attribute group.
strategy - The child object loader, or null for a leaf node.
logger - The logger for handling log messages.

IlpAbstractRepresentationNode

protected IlpAbstractRepresentationNode(IlpObject object,
                                        IlpExtendedAttributeGroup model,
                                        IlpExpansionStrategy strategy,
                                        Logger logger)
Creates a new node attached to a business object.

Parameters:
object - The corresponding business object.
model - The attribute group.
strategy - The expansion strategy for this node.
logger - The logger for handling log messages.
Method Detail

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 attribute)
Returns the value of an attribute of this object.

Specified by:
getAttributeValue in interface IlpAttributeValueHolder
Parameters:
attribute - The name of the attribute.
Returns:
The value of the attribute.

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 attribute,
                              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:
attribute - The attribute for which the 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.

getAttributeValue

public Object getAttributeValue(String name)
Returns the value of an attribute of this object.

Specified by:
getAttributeValue in interface IlpAttributeValueHolder
Parameters:
name - The name of the attribute.
Returns:
The value of the attribute.

setAttributeValue

public void setAttributeValue(String name,
                              Object value)
Sets the value of an attribute of this object.

If the attribute does not exist, a default attribute with the given name is created and added to the local attribute model.

Specified by:
setAttributeValue in interface IlpAttributeValueHolder
Parameters:
name - The name of the attribute for which the value is to be changed.
value - The new value of the attribute.

addAttributeValueListener

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

Specified by:
addAttributeValueListener in interface IlpAttributeValueHolder

removeAttributeValueListener

public void removeAttributeValueListener(AttributeValueListener listener)
Removes the given listener from the notifications of attribute value changes.

Specified by:
removeAttributeValueListener in interface IlpAttributeValueHolder

fireEvent

public void fireEvent(AttributeValueEvent event)
Fires an event to the registered attribute value listeners.

Specified by:
fireEvent in interface IlpAttributeValueHolder

getIlpObject

public IlpObject getIlpObject()
Retrieves the IlpObject of this representation.

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

getLogger

protected Logger getLogger()
Returns the logger.

Returns:
Logger
Since:
JViews 7.5

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!

isLeaf

public boolean isLeaf()
Returns true if this object, by its nature, has no children. When this method returns false, there may or may not be some children attached to the object; children can be added or removed dynamically.

Specified by:
isLeaf in interface IlpRepresentationNode

getChildren

public List getChildren()
Returns a list of the child objects of this object.

Note: The order of the returned list is important:

This method forces the child objects to be loaded by calling the method loadChildren in the node expansion strategy.

Specified by:
getChildren in interface IlpRepresentationNode
Returns:
An unmodifiable list of IlpRepresentationNodes.
See Also:
IlpExpansionStrategy

addRepresentationNodeListener

public void addRepresentationNodeListener(RepresentationNodeListener listener)
Adds a listener that is notified each time a change to this container occurs.

Specified by:
addRepresentationNodeListener in interface IlpRepresentationNode

removeRepresentationNodeListener

public void removeRepresentationNodeListener(RepresentationNodeListener listener)
Removes a listener previously added with addRepresentationNodeListener.

Specified by:
removeRepresentationNodeListener in interface IlpRepresentationNode

getParent

public IlpRepresentationNode getParent()
Returns the parent object of this object.

Note: The result of this method must not change while this node is (directly or indirectly) accessible in an IlpGraphModel.

Specified by:
getParent in interface IlpRepresentationNode

getAllowsChildren

public boolean getAllowsChildren()
Returns true if this node allows children.

Specified by:
getAllowsChildren in interface IlpRepresentationNode

getExpansionStrategy

public IlpExpansionStrategy getExpansionStrategy()
Returns the child object loader that was passed to this object at construction time.

Specified by:
getExpansionStrategy in interface IlpRepresentationNode

addChild

public void addChild(IlpRepresentationNode child)
Inserts a child.

Specified by:
addChild in interface IlpMutableRepresentationNode
Parameters:
child - The child to insert.

addChildren

public void addChildren(int[] indices,
                        IlpRepresentationNode[] children)
Inserts a set of children.

Specified by:
addChildren in interface IlpMutableRepresentationNode
Parameters:
indices - The indices of the added children, after insertion, in ascending order.
children - The inserted children, in the same order as described in indices.

addChildren

public void addChildren(IlpRepresentationNode[] children)
Inserts a set of children.

Specified by:
addChildren in interface IlpMutableRepresentationNode

removeChildren

public void removeChildren(int[] indices,
                           IlpRepresentationNode[] children)
Removes a set of children.

Specified by:
removeChildren in interface IlpMutableRepresentationNode
Parameters:
indices - The indices of the removed children, before removal, in ascending order.
children - The removed children, in the same order as described in indices.

removeChildren

public void removeChildren(int[] indices)
Removes a set of children.

Specified by:
removeChildren in interface IlpMutableRepresentationNode
Parameters:
indices - The indices of the removed children, before removal, in ascending order.

removeChild

public void removeChild(IlpRepresentationNode child)
Removes a child.

Specified by:
removeChild in interface IlpMutableRepresentationNode
Parameters:
child - The child to be removed.

removeChildren

public void removeChildren(IlpRepresentationNode[] children)
Removes a set of children.

Specified by:
removeChildren in interface IlpMutableRepresentationNode

setParent

public void setParent(IlpRepresentationNode parent)
Only to be called immediately after construction. The caller must generate the RepresentationNodeEvent for the parent node.


toString

public String toString()
Overrides:
toString in class Object

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 object in the model. 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!

getCSSID

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

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

addTreeAttributeValueListener

public void addTreeAttributeValueListener(AttributeValueListener listener)
Adds an attribute value listener. It receives events when an attribute's value in this object or in one of the contained objects changes.

Internal method or field: do not use!

removeTreeAttributeValueListener

public void removeTreeAttributeValueListener(AttributeValueListener listener)
Removes an attribute value listener.

Internal method or field: do not use!

fireRepresentationNodeEvent

public void fireRepresentationNodeEvent(RepresentationNodeEvent event)
Notifies the listeners of a container event.



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