Style Intelligence v12.0

inetsoft.sree.viewer
Class RepositoryTreeModel

java.lang.Object
  extended by inetsoft.sree.viewer.RepositoryTreeModel
All Implemented Interfaces:
TreeModel

public class RepositoryTreeModel
extends Object
implements TreeModel

Repository tree model is used as a tree model to show repository entries. It won't load all the entries but load entries on demand.


Nested Class Summary
protected  class RepositoryTreeModel.EntryCache
          Entry cache.
 
Field Summary
protected  RepositoryTreeModel.EntryCache cache
           
protected  RepletRepository engine
           
protected  Vector listeners
           
protected  Principal user
           
 
Constructor Summary
RepositoryTreeModel(RepletRepository engine, Principal user)
          Create a repository tree model.
 
Method Summary
 void addTreeModelListener(TreeModelListener listener)
          Add a tree model listener.
protected  RepositoryEntry[] createRepositoryEntries(RepletFolderEntry entry)
          Create the sub repository entries of a folder entry.
 boolean exists(TreePath path)
          Check if a tree path exists.
 Object getChild(Object parent, int index)
          Get the child node of a parent node at an index.
 int getChildCount(Object parent)
          Get the child node count of a parent node.
 int getIndexOfChild(Object parent, Object child)
          Get the index of a child node belongs to a parent node.
 Principal getPrincipal()
          Get the principal of the repository tree model.
protected  RepositoryEntry[] getRepositoryEntries(RepositoryEntry entry)
          Get the sub repository entries of a folder entry.
 Object getRoot()
          Get the root node of the tree.
 TreePath getTreePath(RepositoryEntry entry)
          Get the tree path of a repository entry.
 boolean isLeaf(Object node)
          Check a node if is a leaf node.
 void refresh()
          Refresh the repository tree model.
 void removeTreeModelListener(TreeModelListener listener)
          Remove a tree model listener.
 void setPrincipal(Principal user)
          Set the principal of the repository tree model.
 void valueForPathChanged(TreePath path, Object val)
          Notified when a node is changed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

engine

protected RepletRepository engine

user

protected Principal user

listeners

protected Vector listeners

cache

protected RepositoryTreeModel.EntryCache cache
Constructor Detail

RepositoryTreeModel

public RepositoryTreeModel(RepletRepository engine,
                           Principal user)
Create a repository tree model.

Method Detail

setPrincipal

public void setPrincipal(Principal user)
Set the principal of the repository tree model.


getPrincipal

public Principal getPrincipal()
Get the principal of the repository tree model.


getRoot

public Object getRoot()
Get the root node of the tree.

Specified by:
getRoot in interface TreeModel
Returns:
the root node of the tree.

getChild

public Object getChild(Object parent,
                       int index)
Get the child node of a parent node at an index.

Specified by:
getChild in interface TreeModel
Parameters:
parent - the specified parent node.
index - the specified index.
Returns:
the child node of the parent node at the index.

getChildCount

public int getChildCount(Object parent)
Get the child node count of a parent node.

Specified by:
getChildCount in interface TreeModel
Parameters:
parent - the specified parent node.
Returns:
the child node count of the parent node.

isLeaf

public boolean isLeaf(Object node)
Check a node if is a leaf node.

Specified by:
isLeaf in interface TreeModel
Parameters:
node - the specified node.
Returns:
true if is a leaf node, false otherwise.

valueForPathChanged

public void valueForPathChanged(TreePath path,
                                Object val)
Notified when a node is changed.

Specified by:
valueForPathChanged in interface TreeModel
Parameters:
path - the specified tree path identifies the node.
val - the specified new value.

getIndexOfChild

public int getIndexOfChild(Object parent,
                           Object child)
Get the index of a child node belongs to a parent node.

Specified by:
getIndexOfChild in interface TreeModel
Parameters:
parent - the specified parent node.
child - the specified child node.
Returns:
the index of the child node.

addTreeModelListener

public void addTreeModelListener(TreeModelListener listener)
Add a tree model listener.

Specified by:
addTreeModelListener in interface TreeModel
Parameters:
listener - the specified tree model listenr.

removeTreeModelListener

public void removeTreeModelListener(TreeModelListener listener)
Remove a tree model listener.

Specified by:
removeTreeModelListener in interface TreeModel
Parameters:
listener - the specified tree model listenr.

refresh

public void refresh()
Refresh the repository tree model.


getTreePath

public TreePath getTreePath(RepositoryEntry entry)
Get the tree path of a repository entry.

Parameters:
entry - the specified repository entry.
Returns:
the tree path of the repository entry.

exists

public boolean exists(TreePath path)
Check if a tree path exists.

Parameters:
path - the specified tree path.
Returns:
true if exists, false otherwise.

createRepositoryEntries

protected RepositoryEntry[] createRepositoryEntries(RepletFolderEntry entry)
                                             throws Exception
Create the sub repository entries of a folder entry.

Parameters:
entry - the specified folder entry.
Returns:
the sub repository entries of the folder entry.
Throws:
Exception

getRepositoryEntries

protected RepositoryEntry[] getRepositoryEntries(RepositoryEntry entry)
Get the sub repository entries of a folder entry.

Parameters:
entry - the specified folder entry.
Returns:
the sub repository entries of the folder entry.

Copyright © 1996-2014 InetSoft Technology Corp. All Rights Reserved.