com.sas.swing.models.remotefileselector
Interface RemoteFileServerModelInterface

All Superinterfaces:
javax.swing.table.TableModel
All Known Implementing Classes:
RemoteFileServerModel

public interface RemoteFileServerModelInterface
extends javax.swing.table.TableModel

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

Since:
3.1

Method Summary
 void addToPasteBuffer(RemoteFileMetadataInterface node)
          Add the given metadata node to the paste buffer.
 void clearPasteBuffer()
          Clears the buffer of all metadata items.
 java.lang.String combineDirectoryPathAndFileName(java.lang.String path, java.lang.String name)
          Returns a concatenated file system path given an existing path and a folder/directory name.
 java.lang.String createPathFromArray(java.lang.Object[] namesArray)
          Given an array of folder names, this method returns a file system path.
 java.lang.String getBasePath()
          Returns the file system path used as the base for all navigation.
 CacheModel getCacheModel()
          Returns the cache model.
 java.lang.String[] getColumnNames()
          Returns the column names.
 RemoteFileServiceModelInterface getModel()
          Returns the model used to communicate with the file system.
 RemoteFileMetadataInterface getNodeAt(int rowIndex)
          Returns a RemoteFileMetadataInterface for specified index.
 java.util.List getPasteBuffer()
          Returns the contents of the paste buffer.
 int getPasteBufferCommandType()
          Returns the command type.
 java.lang.String getPath()
          Returns the file system path currently being viewed.
 java.lang.String getServerName()
          Returns the name of the file system top level.
 com.sas.util.transforms.TransformInterface[] getTransforms()
          Returns the transforms being used to get the metadata information.
 boolean isCacheEnabled()
          Returns the current status of cacheing.
 boolean isTableEditable()
          Determine if the table is editable.
 boolean isUpwardPathRestricted()
          Returns true if the model's current path is at the topmost path of the current server, false otherwise.
 java.util.List parseIntoPathElements(java.lang.String path)
          
 void refresh()
          Refreshes the currently viewed file system path.
 void setCacheEnabled(boolean enabled)
          Sets whether to allow cacheing of the file information.
 void setColumnName(java.lang.String columnName, int columnIndex)
          Sets the name of the column at columnIndex to columnName.
 void setColumnNames(java.lang.String[] columnNames)
          Sets the column names used in by the table.
 void setModel(RemoteFileServiceModelInterface newServiceModel)
          Allows setting of the model to be used to communicate with the file system.
 void setPasteBufferCommandType(int commandType)
          Sets the paste buffer command type so it know's if we are copying or cutting the items.
 void setPath(java.lang.String path)
          Sets the file system path to be viewed.
 void setPath(java.lang.String path, boolean search)
          Sets the file system path to be viewed.
 void setTableEditable(boolean editable)
          Set the table to state defined by editable.
 void setTransform(com.sas.util.transforms.TransformInterface transform, int columnIndex)
          Sets the transform class for a columnIndex.
 void setTransforms(com.sas.util.transforms.TransformInterface[] transforms)
          Sets the transforms used to retrieve the metadata information.
 java.lang.String[] splitDirectoryPathAndFileName(java.lang.String path)
          The first object of the returned Pair is a String representing the real name of the file (folder) at the supplied path.
 void updateFilteredValues(java.util.List newFilterValues)
          Method is run when the file type filter is changed.
 

Method Detail

setPath

void setPath(java.lang.String path)
             throws java.lang.IllegalArgumentException
Sets the file system path to be viewed.

Parameters:
path - the file system path
Throws:
java.lang.IllegalArgumentException
See Also:
getPath()

setPath

void setPath(java.lang.String path,
             boolean search)
             throws java.lang.IllegalArgumentException
Sets the file system path to be viewed.

Parameters:
path - the file system path
search - specifies if this is a call from the search model
Throws:
java.lang.IllegalArgumentException
See Also:
getPath()

isUpwardPathRestricted

boolean isUpwardPathRestricted()
Returns true if the model's current path is at the topmost path of the current server, false otherwise. Those consuming this model should call this method before moving upwards in the file system.

Returns:
returns true if the current path is the topmost path of the current server

getBasePath

java.lang.String getBasePath()
Returns the file system path used as the base for all navigation.

Returns:
the base file system path

getPath

java.lang.String getPath()
Returns the file system path currently being viewed.

Returns:
the file system path
See Also:
setPath(String)

combineDirectoryPathAndFileName

java.lang.String combineDirectoryPathAndFileName(java.lang.String path,
                                                 java.lang.String name)
Returns a concatenated file system path given an existing path and a folder/directory name.

Parameters:
path - the existing file system path
name - the folder/directory name
Returns:
the concatenated path
See Also:
splitDirectoryPathAndFileName(String)

splitDirectoryPathAndFileName

java.lang.String[] splitDirectoryPathAndFileName(java.lang.String path)
The first object of the returned Pair is a String representing the real name of the file (folder) at the supplied path. The term REAL here is used here to mean that any relevant file extensions are included. The second object is a String representing the path to the parent directory.

For example the following call would return a Pair whose first object is "DemoReport.xml" and whose second object is "Bip Tree/CitationWeb/Shared"
Pair pathFileNamePair = splitDirectoryPathAndFileName("Bip Tree/CitationWeb/Shared/DemoReport.xml");

Parameters:
path -
See Also:
combineDirectoryPathAndFileName(String, String)

getServerName

java.lang.String getServerName()
Returns the name of the file system top level.

Returns:
the name of the top level

setModel

void setModel(RemoteFileServiceModelInterface newServiceModel)
Allows setting of the model to be used to communicate with the file system. Also know as the "Service Model".

Parameters:
newServiceModel - the model that communicates with the file system.
See Also:
getModel()

getModel

RemoteFileServiceModelInterface getModel()
Returns the model used to communicate with the file system. Also know as the "Service Model".

Returns:
the model that communicates with the file system.
See Also:
setModel(RemoteFileServiceModelInterface)

parseIntoPathElements

java.util.List parseIntoPathElements(java.lang.String path)
This method will become protected or private once the cache model is further broken out... Takes a give file system path and breaks it into the component pieces.

Parameters:
path - the path
Returns:
the collection of pieces

createPathFromArray

java.lang.String createPathFromArray(java.lang.Object[] namesArray)
Given an array of folder names, this method returns a file system path.

Parameters:
namesArray - the array of folder names
Returns:
the file system path

updateFilteredValues

void updateFilteredValues(java.util.List newFilterValues)
Method is run when the file type filter is changed.

Parameters:
newFilterValues - the list of new filter type values

setCacheEnabled

void setCacheEnabled(boolean enabled)
Sets whether to allow cacheing of the file information. Cacheing helps speed performance of queries of items where the user has already visited. It is not automatically refreshed.

Parameters:
enabled - the status of cacheing, by default set to true = cache results, false = don't cache
See Also:
isCacheEnabled()

isCacheEnabled

boolean isCacheEnabled()
Returns the current status of cacheing.

Returns:
the current status
See Also:
setCacheEnabled(boolean)

refresh

void refresh()
Refreshes the currently viewed file system path.


getCacheModel

CacheModel getCacheModel()
Returns the cache model.

Returns:
the cache model

getNodeAt

RemoteFileMetadataInterface getNodeAt(int rowIndex)
Returns a RemoteFileMetadataInterface for specified index.

Parameters:
rowIndex - the specified table row
Returns:
the RemoteFileMetadataInterface

setColumnNames

void setColumnNames(java.lang.String[] columnNames)
Sets the column names used in by the table.

Parameters:
columnNames - the column names

getColumnNames

java.lang.String[] getColumnNames()
Returns the column names.

Returns:
the column names
See Also:
setColumnNames(String[])

setColumnName

void setColumnName(java.lang.String columnName,
                   int columnIndex)
Sets the name of the column at columnIndex to columnName. Note: this name does not need to be unique; two columns in a table can have the same name. If null is set as the column name, then the default column name will be used.

Parameters:
columnName - the new name of the column
columnIndex - the index of the column

setTransforms

void setTransforms(com.sas.util.transforms.TransformInterface[] transforms)
Sets the transforms used to retrieve the metadata information.

Parameters:
transforms - the transforms
See Also:
getTransforms()

getTransforms

com.sas.util.transforms.TransformInterface[] getTransforms()
Returns the transforms being used to get the metadata information.

Returns:
the transforms
See Also:
setTransforms(TransformInterface[])

setTransform

void setTransform(com.sas.util.transforms.TransformInterface transform,
                  int columnIndex)
Sets the transform class for a columnIndex.

Parameters:
transform - the transform class
columnIndex - the column to associate the transform

isTableEditable

boolean isTableEditable()
Determine if the table is editable. If the table is not editable, then none of the cells will be editable. This value is false by default.

Returns:
the table editable status
See Also:
setTableEditable(boolean)

setTableEditable

void setTableEditable(boolean editable)
Set the table to state defined by editable. Even though the table may be editable, the cell may not be editable.

Parameters:
editable - the editable status
See Also:
isTableEditable()

addToPasteBuffer

void addToPasteBuffer(RemoteFileMetadataInterface node)
Add the given metadata node to the paste buffer.

Parameters:
node - the node to be added.

clearPasteBuffer

void clearPasteBuffer()
Clears the buffer of all metadata items.


getPasteBuffer

java.util.List getPasteBuffer()
Returns the contents of the paste buffer.

Returns:
a list of RemoteFileMetadataInterface nodes

setPasteBufferCommandType

void setPasteBufferCommandType(int commandType)
Sets the paste buffer command type so it know's if we are copying or cutting the items.

Parameters:
commandType - the command type, copy = 0 and cut = 1
See Also:
getPasteBufferCommandType()

getPasteBufferCommandType

int getPasteBufferCommandType()
Returns the command type.

Returns:
the command type
See Also:
setPasteBufferCommandType(int)



Copyright © 2009 SAS Institute Inc. All Rights Reserved.