org.globus.cog.gridface.impl.directorybrowser
Class DirectoryBrowserWorkerImpl

java.lang.Object
  extended byorg.globus.cog.gridface.impl.directorybrowser.DirectoryBrowserWorkerImpl
All Implemented Interfaces:
StatusListener

public class DirectoryBrowserWorkerImpl
extends Object
implements StatusListener


Constructor Summary
DirectoryBrowserWorkerImpl(DirectoryBrowserImpl dbgui, GridCommandManager gcm)
           
 
Method Summary
protected  void addCommand(GridCommand command, Object obj)
           
protected  void deleteItem(TreePath path)
          Called when the user asks to delete an item.
protected  void disconnectButtonPushed()
          Disconnect when the button is pushed.
protected  URI getDirectoryPathFromTreePath(TreePath treePath)
          Returns the uri of the treepath if the last node in the path is a directory.
protected  FileTransferObject getFileTransferObject()
           
protected  GridFile getGridFileFromTreePath(TreePath path)
          Return the GridFile object of the selected item.
protected  URI getPathFromTreePath(TreePath treePath)
          Given a selected item's TreePath construct and return its relative path as a string.
protected  String getStringOfTreePath(TreePath path)
          Returns the string representation of the last item in the tree path.
protected  DefaultTreeModel getTreeDataModel()
          Return the datamodel of the tree...used in JTree creation.
protected  void goButtonPushed()
          The method performed when the go button is pushed.
protected  void goInto(TreePath path)
          Called when the user asks to 'go into' a directory rather than just expanding it.
protected  void makeDirectory(String newDirName)
           
protected  void makeDirectory(TreePath path, String newDirName)
          Called when the user asks to create a new directory.
protected  URI processURIForTopPanel(URI uri)
           
protected  URI processURIFromTopPanel(URI uri)
           
protected  void refresh()
           
protected  void refresh(TreePath path)
          Called when the user asks to refresh an already open folder.
protected  void setPassword(String password)
           
protected  void setUsername(String username)
           
 void statusChanged(StatusEvent event)
          This is the status changed listener that is called whenever a command completes, fails, etc.
protected  void stopButtonPushed()
           
protected  void treeWillCollapse(TreePath path)
          When a tree is collapsed all the subnodes are cleared since we're refetching them anyway.
protected  void treeWillExpand(TreePath path)
          A tree is expanded so all data for the corresponding directory is fetched.
protected  void upDirectory()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DirectoryBrowserWorkerImpl

public DirectoryBrowserWorkerImpl(DirectoryBrowserImpl dbgui,
                                  GridCommandManager gcm)
Method Detail

getFileTransferObject

protected FileTransferObject getFileTransferObject()

getGridFileFromTreePath

protected GridFile getGridFileFromTreePath(TreePath path)
Return the GridFile object of the selected item.

Returns:

processURIFromTopPanel

protected URI processURIFromTopPanel(URI uri)

processURIForTopPanel

protected URI processURIForTopPanel(URI uri)

getPathFromTreePath

protected URI getPathFromTreePath(TreePath treePath)
Given a selected item's TreePath construct and return its relative path as a string.

Parameters:
treePath - The TreePath of the selected item.
Returns:
The path of the item in string form

getDirectoryPathFromTreePath

protected URI getDirectoryPathFromTreePath(TreePath treePath)
Returns the uri of the treepath if the last node in the path is a directory. Otherwise the uri of the parent of the last node is returned. Only a directory uri is returned.

Parameters:
treePath -
Returns:

getStringOfTreePath

protected String getStringOfTreePath(TreePath path)
Returns the string representation of the last item in the tree path.

Parameters:
path -
Returns:

getTreeDataModel

protected DefaultTreeModel getTreeDataModel()
Return the datamodel of the tree...used in JTree creation.

Returns:
data model for directory tree

deleteItem

protected void deleteItem(TreePath path)
Called when the user asks to delete an item.

Parameters:
path - TreePath of item to delete.

upDirectory

protected void upDirectory()

makeDirectory

protected void makeDirectory(String newDirName)

makeDirectory

protected void makeDirectory(TreePath path,
                             String newDirName)
Called when the user asks to create a new directory.

Parameters:
path - TreePath of selection. (ie) where to put the directory.
newDirName - The name of the new directory

goInto

protected void goInto(TreePath path)
Called when the user asks to 'go into' a directory rather than just expanding it.

Parameters:
path - TreePath of selected item.

refresh

protected void refresh()

refresh

protected void refresh(TreePath path)
Called when the user asks to refresh an already open folder.

Parameters:
path - TreePath of selected item.

treeWillExpand

protected void treeWillExpand(TreePath path)
A tree is expanded so all data for the corresponding directory is fetched.

Parameters:
path - TreePath of the node being expanded.

treeWillCollapse

protected void treeWillCollapse(TreePath path)
When a tree is collapsed all the subnodes are cleared since we're refetching them anyway. This keeps the user from briefly seeing the old nodes.

Parameters:
path - TreePath of the node being collapsed.

setUsername

protected void setUsername(String username)

setPassword

protected void setPassword(String password)

goButtonPushed

protected void goButtonPushed()
The method performed when the go button is pushed. This sets up the first directory, making it visible if its the first location that has been loaded.


disconnectButtonPushed

protected void disconnectButtonPushed()
Disconnect when the button is pushed. Called by an actionlistener. Also clear out all the old stuff in the window.


stopButtonPushed

protected void stopButtonPushed()

addCommand

protected void addCommand(GridCommand command,
                          Object obj)

statusChanged

public void statusChanged(StatusEvent event)
This is the status changed listener that is called whenever a command completes, fails, etc. Much of the work is done here, but beware, this does not always run in the event queue thread.

Specified by:
statusChanged in interface StatusListener