com.sas.swing.models.remotefileselector
Class CacheModel

com.sas.swing.models.remotefileselector.CacheModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.tree.TreeModel

public class CacheModel

CacheModel defines the model that communicates between the service model and the user interface.

Since:
3.1
See Also:
Serialized Form

Field Summary
static java.lang.String RB_KEY
          the resource bundle string
 
Constructor Summary
CacheModel(javax.swing.tree.TreeNode rootNode, boolean asksAllowsChildren, java.lang.Object parentClass, boolean showDirectoriesOnly)
          Constructs a cache model initialized with the supplied path.
 
Method Summary
 void addToCacheModel(java.util.List fileList, java.lang.String path)
          Adds the collection of files to the cache model.
 javax.swing.tree.DefaultMutableTreeNode findCurrentCacheNode(java.lang.String path)
          Returns the cache node based on a given file system path.
 javax.swing.tree.TreePath getCurrentTreePath()
          Returns the cache model tree path for the current file system path.
 void initialize(java.lang.String path)
          Initializes the cache model.
protected  java.util.List readFromCacheModel(java.lang.String path)
          Returns a collection of files from the cache model based on a given file system path.
 

Field Detail

RB_KEY

public static final java.lang.String RB_KEY
the resource bundle string

See Also:
Constant Field Values
Constructor Detail

CacheModel

public CacheModel(javax.swing.tree.TreeNode rootNode,
                  boolean asksAllowsChildren,
                  java.lang.Object parentClass,
                  boolean showDirectoriesOnly)
Constructs a cache model initialized with the supplied path.

Parameters:
rootNode - the root node of the tree
asksAllowsChildren - specifies how to test for leafiness
parentClass - the parent class
showDirectoriesOnly - specifies showDirectoriesOnly mode, if set to true only folder items will be added to the cache
Method Detail

initialize

public void initialize(java.lang.String path)
Initializes the cache model.

Parameters:
path - the file system path that initializes the cache

getCurrentTreePath

public javax.swing.tree.TreePath getCurrentTreePath()
Returns the cache model tree path for the current file system path.

Returns:
the tree path

addToCacheModel

public void addToCacheModel(java.util.List fileList,
                            java.lang.String path)
Adds the collection of files to the cache model.

Parameters:
fileList - the collection of files

readFromCacheModel

protected java.util.List readFromCacheModel(java.lang.String path)
Returns a collection of files from the cache model based on a given file system path.

Parameters:
path - the file system path
Returns:
the collection of files

findCurrentCacheNode

public javax.swing.tree.DefaultMutableTreeNode findCurrentCacheNode(java.lang.String path)
Returns the cache node based on a given file system path.

Parameters:
path - the file system path
Returns:
the cache node



Copyright © 2009 SAS Institute Inc. All Rights Reserved.