|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectilog.cpl.tree.IlpDefaultTreeNode
public class IlpDefaultTreeNode
Default implementation of IlpTreeNode.
An expansion strategy is used to load the children of a node when it expands.
Depending on the implementation of the expansion strategy the children
may be loaded asynchronously or synchronously. There is no definitive way to
know when all the children are loaded. The following operations trigger the
loading of the children: getChildAt(int), getChildCount(),
children().
IlpExpansionStrategy| Field Summary |
|---|
| Fields inherited from interface ilog.cpl.model.IlpAttributeValueHolder |
|---|
VALUE_NOT_SET |
| Constructor Summary | |
|---|---|
IlpDefaultTreeNode(IlpAttributeGroup attributeGroup,
boolean allowsChildren,
IlpExpansionStrategy expansionStrategy)
Creates an IlpTreeNode object without an underlying
IlpObject object. |
|
IlpDefaultTreeNode(IlpObject object,
boolean allowsChildren,
IlpExpansionStrategy expansionStrategy)
Creates an IlpTreeNode object with an underlying
IlpObject object. |
|
IlpDefaultTreeNode(IlpObject object,
IlpExtendedAttributeGroup attributeGroup,
boolean allowsChildren,
IlpExpansionStrategy expansionStrategy)
Creates an IlpTreeNode object with an underlying
IlpObject object. |
|
| Method Summary | |
|---|---|
void |
addAttributeValueListener(AttributeValueListener l)
Adds a listener to attribute value changes. |
Enumeration |
children()
Returns the children of this node as an Enumeration. |
void |
fireEvent(AttributeValueEvent ev)
Fires an event to the listeners. |
boolean |
getAllowsChildren()
Returns true if this node allows children. |
IlpAttributeGroup |
getAttributeGroup()
Returns the attribute group 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 name)
Returns the value of an attribute of this object. |
TreeNode |
getChildAt(int childIndex)
Returns the child TreeNode at index
childIndex. |
int |
getChildCount()
Returns the number of child TreeNodes this node
contains. |
List |
getChildren()
Returns the children as an unmodifiable list. |
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. |
IlpExpansionStrategy |
getExpansionStrategy()
Returns the expansion strategy. |
IlpObject |
getIlpObject()
Retrieves the IlpObject of this representation. |
int |
getIndex(TreeNode node)
Returns the index of node in this node's child array. |
TreeNode |
getParent()
Returns the parent TreeNode of this node. |
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 |
insert(MutableTreeNode newChild,
int index)
Adds newChild to this node at index. |
boolean |
isExpanded()
Deprecated. Please use IlpExpansionStrategy.areChildrenLoaded instead. |
boolean |
isLeaf()
Returns true if this node is a leaf. |
void |
remove(int index)
Removes the child at index from this node. |
void |
remove(MutableTreeNode node)
Removes node from this node. |
void |
removeAttributeValueListener(AttributeValueListener l)
Removes the given listener from the attribute value changes notifications. |
void |
removeFromParent()
Removes this node from its parent. |
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 |
setChildren(List children)
Sets the children. |
void |
setParent(MutableTreeNode newParent)
Sets this node's parent to newParent but does not
change the parent's child array. |
void |
setUserObject(Object object)
Resets the user object of this node to object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public IlpDefaultTreeNode(IlpObject object,
IlpExtendedAttributeGroup attributeGroup,
boolean allowsChildren,
IlpExpansionStrategy expansionStrategy)
IlpTreeNode object with an underlying
IlpObject object.
object - The underlying IlpObject object.attributeGroup - The attribute group of the IlpTreeNode. It is
supposed to include the IlpClass of the object.allowsChildren - Indicates if this node may have children.expansionStrategy - The expansion strategy to be used when the node
expands or collapses.
public IlpDefaultTreeNode(IlpObject object,
boolean allowsChildren,
IlpExpansionStrategy expansionStrategy)
IlpTreeNode object with an underlying
IlpObject object.
The attribute model is the attribute model from the given
IlpObject.
object - The underlying IlpObject object.allowsChildren - Indicates if this node may have children.expansionStrategy - The expansion strategy to be used when the node
expands or collapses.
public IlpDefaultTreeNode(IlpAttributeGroup attributeGroup,
boolean allowsChildren,
IlpExpansionStrategy expansionStrategy)
IlpTreeNode object without an underlying
IlpObject object.
attributeGroup - The attribute group of the IlpTreeNode object.allowsChildren - Indicates if this node may have children.expansionStrategy - The expansion strategy to be used when the node
expands or collapses.| Method Detail |
|---|
public IlpObject getIlpObject()
IlpObject of this representation.
getIlpObject in interface IlpRepresentationObjectIlpObject of this representation.
It may be null.public IlpAttributeGroup getAttributeGroup()
getAttributeGroup in interface IlpAttributeValueHolderpublic Object getAttributeValue(IlpAttribute a)
getAttributeValue in interface IlpAttributeValueHoldera - 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 attribute,
Object value)
VALUE_NOT_SET for the value
argument.
setAttributeValue in interface IlpAttributeValueHolderattribute - 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 Object getAttributeValue(String name)
getAttributeValue in interface IlpAttributeValueHoldername - The name of the attribute.
public void setAttributeValue(String name,
Object value)
setAttributeValue in interface IlpAttributeValueHoldername - The name of the attribute.value - The new value of the attribute.public void addAttributeValueListener(AttributeValueListener l)
addAttributeValueListener in interface IlpAttributeValueHolderl - The listener to be added.public void removeAttributeValueListener(AttributeValueListener l)
removeAttributeValueListener in interface IlpAttributeValueHolderl - The listener to be removed.public void fireEvent(AttributeValueEvent ev)
fireEvent in interface IlpAttributeValueHolderev - The attribute value change event to fire.public TreeNode getChildAt(int childIndex)
TreeNode at index
childIndex.
Invoking this method will call loadChildren on the expansion
strategy, which will load this node's children.
getChildAt in interface TreeNodechildIndex - The index in the child array of the node.public int getChildCount()
TreeNodes this node
contains.
Invoking this method will call loadChildren on the expansion
strategy, which will load this node's children.
getChildCount in interface TreeNodepublic TreeNode getParent()
TreeNode of this node.
getParent in interface TreeNodepublic int getIndex(TreeNode node)
node in this node's child array.
If this node does not contain node, -1 will be
returned.
getIndex in interface TreeNodenode - The node whose index is required.public boolean getAllowsChildren()
true if this node allows children.
getAllowsChildren in interface TreeNodepublic boolean isLeaf()
true if this node is a leaf.
Invoking this method does not load this node's children.
isLeaf in interface TreeNodepublic Enumeration children()
Enumeration.
Invoking this method will call loadChildren on the expansion
strategy, which will load this node's children.
children in interface TreeNode
public void insert(MutableTreeNode newChild,
int index)
newChild to this node at index.
The setParent message is sent to newChild to
set this node as its parent.
insert in interface MutableTreeNodepublic void remove(int index)
index from this node.
remove in interface MutableTreeNodeindex - The index of the child to be removed.public void remove(MutableTreeNode node)
node from this node.
The setParent message is sent to node to
remove its parent.
remove in interface MutableTreeNodenode - The node to be removed.public void setUserObject(Object object)
object.
setUserObject in interface MutableTreeNodeUnsupportedOperationException - This operation is not supported.public void removeFromParent()
removeFromParent in interface MutableTreeNodepublic void setParent(MutableTreeNode newParent)
newParent but does not
change the parent's child array. This method is called from
insert() and remove() to
reassign a child's parent, it should not be called from anywhere
else.
setParent in interface MutableTreeNodenewParent - This node's new parent.public ilog.cpl.model.edit.IlpRepresentationObjectEditor getEditor()
IlpRepresentationObjectgetAttributeValue to the editor.
In this case it should also stop propagating attribute value
change events received from the BO.
getEditor in interface IlpRepresentationObjectpublic boolean isExpanded()
IlpExpansionStrategy.areChildrenLoaded instead.
true if the node has been expanded.
In the case of an expansion strategy implementing a load-on-demand
mechanism, isExpanded() returns true when the
node's children are loaded.
The default implementation calls areChildrenLoaded in the
node expansion strategy.
isExpanded in interface IlpTreeNodeHelperpublic IlpExpansionStrategy getExpansionStrategy()
getExpansionStrategy in interface IlpTreeNodeHelperpublic List getChildren()
getChildren in interface IlpTreeNodeHelperpublic void setChildren(List children)
setChildren in interface IlpTreeNodeHelperpublic String getCSSType()
getCSSType in interface ilog.cpl.css.internal.IlpCSSObjectpublic String getCSSID(IlpContext appc)
getCSSID in interface ilog.cpl.css.internal.IlpCSSObjectappc - The context
public String getCSSClasses()
getCSSClasses in interface ilog.cpl.css.internal.IlpCSSObject
|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||