ilog.server.jsds.tree
Class IlsTreeDataSource

java.lang.Object
  |
  +--ilog.server.jsds.IlsDataSource
        |
        +--ilog.server.jsds.tree.IlsTreeDataSource
All Implemented Interfaces:
IlDataSource, IlDataSourceEditor, IlsDSConnection, IlTreeDataSource, IlTreeDataSourceEditor

public class IlsTreeDataSource
extends IlsDataSource
implements IlTreeDataSource, IlTreeDataSourceEditor

Tree data source. How to define a dynamic view specification in order to open a tree data source :

  view DomainsTreeView (any containerIndex=0, string containerClass="tree.DomainsTreeFrame"):
        represent IlsDSRepresentation repres:
                any    containerIndex = view.containerIndex;
 		string containerClass = view.containerClass;
 		string title          = "A network tree view";
 
  subscribe Node:
         represent IlsRpTreeItem node:
                 # Predefined attribute "parent" for the item parent
                 mandatory ref<IlsRpTreeItem> parent = domain->domain;
                 # Property
                 string label = name;
 
  subscribe Domain:
         represent IlsRpTreeItem domain:
                 # Predefined attribute "parent" for the item parent
                 mandatory ref<IlsRpTreeItem> parent = network->root;
                 # Specifie that the item can have childrens
 		  boolean allowChildren = true;
                 # Property
                 href    label         = {DomainTableView, name};
                 
 	propagate nodes when (rpStatus == 2);
 
  subscribe origin Network:
       # The origin data source object representation
 	represent IlsRpTree tree:
               # The predefined "root" attribute for the tree root
 		ref<IlsRpRootItem> root             = view.origin->root;
               # Property
 		string             label            = identifier;
               # Predefined attribute to expand and collapse.
 		boolean            expandOnDemand   = true;
 		boolean            collapseOnDemand = false;
       
       # The root object representation
 	represent IlsRpRootItem root:
               # The predefined attribute "tree" for the root owner
 		mandatory ref<IlsRpTree> tree = view.origin->tree;
               # Specifie that the root can have childrens
 		boolean allowChildren = true;
               # Property
               href    label         = {MultipleView, identifier};
 		
       propagate domains;
 


Fields inherited from class ilog.server.jsds.IlsDataSource
_properties, _propertyChangeListeners
 
Constructor Summary
IlsTreeDataSource()
          Instantiate a new IlsTableDataSource
 
Method Summary
 void addTreeDSListener(TreeDSListener l)
          Adds a listener for all tree events
 void dataSourceConnected(IlsDSMainObject dso)
          Implements DSConnectionListener.dataSourceConnected(ilog.server.jsds.DSConnectionEvent).
 void dataSourceDisconnected()
          Implements DSConnectionListener.dataSourceDisconnected(ilog.server.jsds.DSConnectionEvent).
 java.lang.Object dsAddItem(java.lang.Object parent, java.util.Map properties)
          Creates a new item in the tree
 void dsCollapseItem(java.lang.Object item)
          Collapses an item
 void dsExpandItem(java.lang.Object item)
          Expands an item Its children have to be loaded
 void dsMoveItem(java.lang.Object item, java.lang.Object newParent)
          Moves an existing item to a new position in the tree.
 void dsRemoveItem(java.lang.Object item)
          Removes an item from the tree
 void dsUpdateItem(java.lang.Object item, java.lang.String propertyName, java.lang.Object propertyValue)
          Updates a property of an item
 IlsDSMainObject getDSMainObject()
           
 boolean isItemEditable(java.lang.Object item)
          Returns false if the item is a read only.
 boolean isItemPropertyEditable(java.lang.Object item, java.lang.String propertyName)
           
 boolean isItemPropertyHRef(java.lang.Object item, java.lang.String propertyName)
           
 void removeTreeDSListener(TreeDSListener l)
          Removes a listener for all tree events
 
Methods inherited from class ilog.server.jsds.IlsDataSource
addBatchListener, addDataSourceListener, addDSConnectionListener, addPropertyChangeListener, addPropertyChangeListener, dataSourceChange, dsClose, dsDereference, dsDereference, dsEndBatch, dsExecCallback, dsExecDuplexCallback, dsExecDuplexCallback, dsExecDuplexCallback, dsStartBatch, dsUpdateProperty, endBatch, getDataSourceContainer, getDSBatchLevel, getDSComponent, getDSProperties, getDSProperty, getDSRepresentation, getLabel, getViewName, isDSObjectPropertyEditable, isDSObjectPropertyHRef, isEditable, isInEdition, removeBatchListener, removeDataSourceListener, removeDSConnectionListener, removePropertyChangeListener, removePropertyChangeListener, setDataSourceContainer, setLabel, setRpStatus, setViewName, startBatch
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ilog.ds.IlDataSource
addBatchListener, addDataSourceListener, getDSProperties, getDSProperty, removeBatchListener, removeDataSourceListener
 
Methods inherited from interface ilog.ds.IlDataSourceEditor
dsEndBatch, dsStartBatch, dsUpdateProperty, getDSBatchLevel, isEditable
 

Constructor Detail

IlsTreeDataSource

public IlsTreeDataSource()
Instantiate a new IlsTableDataSource
Method Detail

addTreeDSListener

public void addTreeDSListener(TreeDSListener l)
Adds a listener for all tree events
Specified by:
addTreeDSListener in interface IlTreeDataSource
Parameters:
l - the listener

removeTreeDSListener

public void removeTreeDSListener(TreeDSListener l)
Removes a listener for all tree events
Specified by:
removeTreeDSListener in interface IlTreeDataSource
Parameters:
l - the listener

dataSourceConnected

public void dataSourceConnected(IlsDSMainObject dso)
Implements DSConnectionListener.dataSourceConnected(ilog.server.jsds.DSConnectionEvent).
Overrides:
dataSourceConnected in class IlsDataSource
Following copied from class: ilog.server.jsds.IlsDataSource
See Also:
DSConnectionListener

dataSourceDisconnected

public void dataSourceDisconnected()
Implements DSConnectionListener.dataSourceDisconnected(ilog.server.jsds.DSConnectionEvent).
Overrides:
dataSourceDisconnected in class IlsDataSource
Following copied from class: ilog.server.jsds.IlsDataSource
See Also:
DSConnectionListener

dsAddItem

public java.lang.Object dsAddItem(java.lang.Object parent,
                                  java.util.Map properties)
Creates a new item in the tree
Specified by:
dsAddItem in interface IlTreeDataSourceEditor
Parameters:
parent - item. The owner of the new item. It can be null for the root item.
properties - properties of the node to create
Returns:
the created item (to be used only as a key). Note that null may be returned if the item takes a long time to be created.

dsRemoveItem

public void dsRemoveItem(java.lang.Object item)
Removes an item from the tree
Specified by:
dsRemoveItem in interface IlTreeDataSourceEditor
Parameters:
item - item to be removed

dsMoveItem

public void dsMoveItem(java.lang.Object item,
                       java.lang.Object newParent)
Moves an existing item to a new position in the tree.
Specified by:
dsMoveItem in interface IlTreeDataSourceEditor
Parameters:
item - the item to move
newParent - the new parent item. It can not be null

dsUpdateItem

public void dsUpdateItem(java.lang.Object item,
                         java.lang.String propertyName,
                         java.lang.Object propertyValue)
Updates a property of an item
Specified by:
dsUpdateItem in interface IlTreeDataSourceEditor
Parameters:
item - the item to update
propertyName - name of the property to be updated
propertyValue - new value of the property

dsCollapseItem

public void dsCollapseItem(java.lang.Object item)
Collapses an item
Specified by:
dsCollapseItem in interface IlTreeDataSource
Following copied from interface: ilog.ds.IlTreeDataSource
Parameters:
item - The item whose children can be unloaded

dsExpandItem

public void dsExpandItem(java.lang.Object item)
Expands an item Its children have to be loaded
Specified by:
dsExpandItem in interface IlTreeDataSource
Parameters:
item - item which children have to be loaded

getDSMainObject

public IlsDSMainObject getDSMainObject()
Overrides:
getDSMainObject in class IlsDataSource
Following copied from class: ilog.server.jsds.IlsDataSource
Returns:
the origin representation object associated to the data source.

isItemEditable

public boolean isItemEditable(java.lang.Object item)
Returns false if the item is a read only.
Specified by:
isItemEditable in interface IlTreeDataSourceEditor
Parameters:
obj - - The object to test.

isItemPropertyEditable

public boolean isItemPropertyEditable(java.lang.Object item,
                                      java.lang.String propertyName)
Returns:
true if the item property is editable.

isItemPropertyHRef

public boolean isItemPropertyHRef(java.lang.Object item,
                                  java.lang.String propertyName)
Returns:
true if the item is a hyper reference.