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

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended byorg.globus.cog.gridface.impl.directorybrowser.DirectoryBrowserImpl
All Implemented Interfaces:
AccessClose, Accessible, DirectoryBrowser, GridFace, ImageObserver, MenuContainer, Serializable

public class DirectoryBrowserImpl
extends JPanel
implements DirectoryBrowser, AccessClose, Serializable

See Also:
Serialized Form

Nested Class Summary
protected  class DirectoryBrowserImpl.ButtonListener
           
protected  class DirectoryBrowserImpl.PopupListener
           
protected  class DirectoryBrowserImpl.TopKeyListener
           
protected  class DirectoryBrowserImpl.TreeListener
           
protected  class DirectoryBrowserImpl.TreeMouseListener
           
 
Nested classes inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected  JTree tree
           
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
DirectoryBrowserImpl()
           
DirectoryBrowserImpl(GridCommandManager gcm)
           
 
Method Summary
 boolean close()
           
protected  void createUsernameDialog()
          Create the dialog to be popped up asking the user for their username and password if they are not connecting to a gridftp server.
protected  void disconnectCompleted()
           
protected  void errorDelete()
           
protected  void errorGetCurrentDirectory(boolean isInConnectSequence)
           
protected  void errorList()
           
protected  void errorMimeType()
           
protected  void errorOpen()
           
protected  void errorSetCurrentDirectory(boolean isInConnectSequence)
           
protected  void fileTransferCompleted()
           
protected  void getCurrentDirectoryCompleted(boolean isInConnectSequence)
           
protected  FileTransferObject getFileTransferObject()
          Return the filetransferobject used by this directorybrowser.
 Dimension getMinimumSize()
          Return the Dimension of the top panel and the extra pixels on the side so the window only gets as small as the top panel.
 String getSelected()
          Get the name of the currently selected file
protected  URI getSelectedItemsDirURI()
          If the selected item is a directory, return its uri, otherwise return the uri of its parent.
protected  GridFile getSelectedItemsGridFile()
          Return the FileInfo object of the selected item.
protected  TreePath getSelectedItemsTreePath()
          Get the TreePath of the selected item.
protected  URI getSelectedItemsURI()
          Return the selected items uri
 URI getSelectedURI()
           
 URI getSelectedURIDir()
           
 URI getURI()
          Get the currently selected files URI
protected  DirectoryBrowserWorkerImpl getWorker()
           
 Date lastUpdateTime()
          Records the last time the GridFace was updated.
protected  void listingCompleted()
           
protected  void notifyUser(String message)
          Notify the user of something but do not indicate any waiting.
 void register(GridFace connection)
          Registers another GridFace to this GridFace.
 void setLabel(String label)
          sets a label for a GridFace.
 void setName(String name)
          sets the name for a GridFace.
 void setSelected(String filename)
          Select the file corresponding to the file name
 void setURI(URI uri)
          Set the URI
protected  void startWaiting()
          Execute the commands to notify the user that we are waiting for something.
protected  void startWaiting(String message, boolean canStop)
          Execute the commands to notify the user that we are waiting for something and display a message above the progress bar.
protected  void stopWaiting()
          Execute the commands to notify the user that we are done waiting.
 void update()
          updates the displaed gridface.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

tree

protected JTree tree
Constructor Detail

DirectoryBrowserImpl

public DirectoryBrowserImpl()
                     throws Exception

DirectoryBrowserImpl

public DirectoryBrowserImpl(GridCommandManager gcm)
Method Detail

startWaiting

protected void startWaiting()
Execute the commands to notify the user that we are waiting for something.


startWaiting

protected void startWaiting(String message,
                            boolean canStop)
Execute the commands to notify the user that we are waiting for something and display a message above the progress bar.

Parameters:
message - String to display above the message bar.

stopWaiting

protected void stopWaiting()
Execute the commands to notify the user that we are done waiting.


notifyUser

protected void notifyUser(String message)
Notify the user of something but do not indicate any waiting. Probably for a background process.

Parameters:
message -

getWorker

protected DirectoryBrowserWorkerImpl getWorker()

getSelectedItemsTreePath

protected TreePath getSelectedItemsTreePath()
Get the TreePath of the selected item.

Returns:

getSelectedItemsGridFile

protected GridFile getSelectedItemsGridFile()
Return the FileInfo object of the selected item.

Returns:

getSelectedItemsURI

protected URI getSelectedItemsURI()
Return the selected items uri

Returns:

getSelectedItemsDirURI

protected URI getSelectedItemsDirURI()
If the selected item is a directory, return its uri, otherwise return the uri of its parent.

Returns:

getFileTransferObject

protected FileTransferObject getFileTransferObject()
Return the filetransferobject used by this directorybrowser. This is for the copy commander

Returns:

createUsernameDialog

protected void createUsernameDialog()
Create the dialog to be popped up asking the user for their username and password if they are not connecting to a gridftp server.


listingCompleted

protected void listingCompleted()

disconnectCompleted

protected void disconnectCompleted()

getCurrentDirectoryCompleted

protected void getCurrentDirectoryCompleted(boolean isInConnectSequence)

fileTransferCompleted

protected void fileTransferCompleted()

errorOpen

protected void errorOpen()

errorSetCurrentDirectory

protected void errorSetCurrentDirectory(boolean isInConnectSequence)

errorGetCurrentDirectory

protected void errorGetCurrentDirectory(boolean isInConnectSequence)

errorList

protected void errorList()

errorMimeType

protected void errorMimeType()

errorDelete

protected void errorDelete()

getMinimumSize

public Dimension getMinimumSize()
Return the Dimension of the top panel and the extra pixels on the side so the window only gets as small as the top panel.

Returns:
Dimension Dimension of the top panel.

setURI

public void setURI(URI uri)
Description copied from interface: DirectoryBrowser
Set the URI

Specified by:
setURI in interface DirectoryBrowser

getURI

public URI getURI()
Description copied from interface: DirectoryBrowser
Get the currently selected files URI

Specified by:
getURI in interface DirectoryBrowser

getSelectedURI

public URI getSelectedURI()

getSelectedURIDir

public URI getSelectedURIDir()

setSelected

public void setSelected(String filename)
Description copied from interface: DirectoryBrowser
Select the file corresponding to the file name

Specified by:
setSelected in interface DirectoryBrowser

getSelected

public String getSelected()
Description copied from interface: DirectoryBrowser
Get the name of the currently selected file

Specified by:
getSelected in interface DirectoryBrowser

update

public void update()
Description copied from interface: GridFace
updates the displaed gridface.

Specified by:
update in interface GridFace

lastUpdateTime

public Date lastUpdateTime()
Description copied from interface: GridFace
Records the last time the GridFace was updated. The default value is the time of creation.

Specified by:
lastUpdateTime in interface GridFace
Returns:
Date, the last time when the GridFace was updated.

setName

public void setName(String name)
Description copied from interface: GridFace
sets the name for a GridFace. Names are useful to distinguish gridfaces from each other. A Name is supposed to be unique. Default is null.

Specified by:
setName in interface GridFace

setLabel

public void setLabel(String label)
Description copied from interface: GridFace
sets a label for a GridFace. Label are useful to create abbreviations for a GridFace for a graphical display. Labels are ofthe used as a title if applicable. Defaukt is null.

Specified by:
setLabel in interface GridFace
Parameters:
label - a String that returns the assigned label.

register

public void register(GridFace connection)
Description copied from interface: GridFace
Registers another GridFace to this GridFace. This will prevent that gridfaces are unnecesarily killed.

Specified by:
register in interface GridFace
Parameters:
connection - a GridFace value

close

public boolean close()
Specified by:
close in interface AccessClose