Class JDPFilePicker

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----JDPClassLayout
                                   |
                                   +----JDPFilePicker

public class JDPFilePicker
extends JDPClassLayout
implements Runnable
Class JDPFilePicker represents a simple file picker for choosing file names on the server not the client.


Variable Index

 o LOAD
 o NEWFOLDER
 o SAVE

Constructor Index

 o JDPFilePicker()

Method Index

 o addFilter(String, String)
Add a filename filter to the pulldown list of filename filters.
 o clear()
Clear the pulldown list of filename filters.
 o clearFilter()
Clear the pulldown list of filename filters.
 o createNewFolder(String)
Create a new Folder/Directory on the server.
 o getAutoScroll()
Get the autoscroll value for the Tree and the List.
 o getDirectoryPath(JDPTreeBranch)
Get the full path of the selected directory given the branch from the folder tree.
 o getDragKey()
Get the drag and drop key that allows list items to be dragged.
 o getDragPanel()
Get the drag panel for dragging.
 o getDropMessage()
Get the drag and drop message that allows list items to be dropped on.
 o getFileList()
Get the handle to the list that implements the file list.
 o getFileName(JDPTreeBranch)
Get the full path of the selected file given the branch from the file list.
 o getFilePath(JDPTreeBranch)
Get the full path of the selected file given the branch from the file list.
 o getFiles()
Get the a list of all the files from the file list.
 o getFilter()
Get the current filename filter.
 o getFolderTree()
Get the handle to the tree that implements the folder tree.
 o getSelectedDirectory()
Get the selected directory.
 o getSelectedFile()
Get the selected file.
 o getSelectedFullPath()
Get the full path of the selected file.
 o getSelectedItem()
Get the selected item from the file list.
 o getSelectedItems()
Get the selected items from the file list.
 o getSeparator()
Get the separator character used by the server.
 o handleEvent(Event)
 o InitClass(JDPUser, Panel, String)
Creates a File Picker.
 o loadAllDrives()
Load all the drives into the File Picker.
 o loadFiles(String, boolean)
Load the directories or files for the selected path
 o loadFiles(String[], boolean)
Load the directories or files for the selected path
 o reloadSelectedDirectory()
Reload the selected directory.
 o run()
 o selectFilter(String)
Set the filename filter pulldown.
 o setAutoScroll(boolean)
Set the autoscroll for the Tree and the List.
 o setDragKey(String)
Set the drag and drop key to allow list items to be dragged.
 o setDragPanel(JDPDragItem)
Set the drag panel for dragging.
 o setDropMessage(String)
Set the drag and drop message that allows list items to be dropped on.
 o setMode(int)
Set the mode to save, load or create a new folder.
 o setMultipleSelections(boolean)
Set the file picker to allow multiple selections (NOTE: Presently not functional).
 o setSelectedDirectory(String)
Set the selected directory.
 o setSelectedFile(String)
Set the selected file.

Variables

 o LOAD
 public static final int LOAD
 o SAVE
 public static final int SAVE
 o NEWFOLDER
 public static final int NEWFOLDER

Constructors

 o JDPFilePicker
 public JDPFilePicker()

Methods

 o InitClass
 public void InitClass(JDPUser user,
                       Panel targetPanel,
                       String moduleParameter)
Creates a File Picker.

Parameters:
JDPUser - the global user parameter used to pass handles in JDP.
targetPanel - the parent panel that this one will be added to.
moduleParameter - a generic parameter used for specific internal functions.
Overrides:
InitClass in class JDPClassLayout
 o handleEvent
 public boolean handleEvent(Event e)
Overrides:
handleEvent in class Component
 o run
 public void run()
Overrides:
run in class JDPClassLayout
 o loadAllDrives
 public void loadAllDrives()
Load all the drives into the File Picker.

 o setMode
 public void setMode(int mode)
Set the mode to save, load or create a new folder.

Parameters:
mode - (SAVE, LOAD, NEWFOLDER).
 o clear
 public void clear()
Clear the pulldown list of filename filters.

 o clearFilter
 public void clearFilter()
Clear the pulldown list of filename filters.

 o addFilter
 public void addFilter(String filterDescription,
                       String filter)
Add a filename filter to the pulldown list of filename filters.

Parameters:
filter - this is usually of the form *.sfx where you supply the suffix
 o selectFilter
 public void selectFilter(String filterDescription)
Set the filename filter pulldown.

Parameters:
filter - the filter to set the pulldown to.
 o getFolderTree
 public JDPTreePicker getFolderTree()
Get the handle to the tree that implements the folder tree.

Returns:
the handle to the tree that implements the folder tree.
 o getFileList
 public JDPTreePicker getFileList()
Get the handle to the list that implements the file list.

Returns:
the handle to the list that implements the file list.
 o getFilter
 public String getFilter()
Get the current filename filter.

Returns:
the current filename filter.
 o setMultipleSelections
 public void setMultipleSelections(boolean multiple)
Set the file picker to allow multiple selections (NOTE: Presently not functional).

Parameters:
multiple - the new state for multiple selections.
 o getSelectedDirectory
 public String getSelectedDirectory()
Get the selected directory.

Returns:
the currently selected directory.
 o setSelectedDirectory
 public void setSelectedDirectory(String dir)
Set the selected directory. This will also load the directory subfolders.

Parameters:
selectedDirectory - the selected directory.
 o getSelectedFile
 public String getSelectedFile()
Get the selected file.

Returns:
the currently selected file.
 o setSelectedFile
 public void setSelectedFile(String file)
Set the selected file.

Parameters:
selectedFile - the selected file.
 o getSelectedFullPath
 public String getSelectedFullPath()
Get the full path of the selected file.

Returns:
the full path name of the selected file.
 o getFileName
 public String getFileName(JDPTreeBranch thisBranch)
Get the full path of the selected file given the branch from the file list.

Returns:
the full path name of the file.
 o getFilePath
 public String getFilePath(JDPTreeBranch thisBranch)
Get the full path of the selected file given the branch from the file list.

Returns:
the full path name of the file.
 o getDirectoryPath
 public String getDirectoryPath(JDPTreeBranch thisBranch)
Get the full path of the selected directory given the branch from the folder tree.

Returns:
the full path name of the folder.
 o getSeparator
 public String getSeparator()
Get the separator character used by the server.

Parameters:
separator - the separator character used by the server.
 o getSelectedItem
 public String getSelectedItem()
Get the selected item from the file list.

Returns:
the currently selected item in the file list.
 o getSelectedItems
 public String[] getSelectedItems()
Get the selected items from the file list. (Presently this is not supported as multiple selections are not yet supported).

Returns:
the currently selected items in the file list.
 o getFiles
 public String[] getFiles()
Get the a list of all the files from the file list.

Returns:
the full list of file names in the file list.
 o setAutoScroll
 public void setAutoScroll(boolean scroll)
Set the autoscroll for the Tree and the List.

Parameters:
the - autoscroll setting for the Tree and the List.
 o getAutoScroll
 public boolean getAutoScroll()
Get the autoscroll value for the Tree and the List.

Parameters:
the - autoscroll setting for the Tree and the List.
 o setDragPanel
 public void setDragPanel(JDPDragItem drag)
Set the drag panel for dragging.

Parameters:
the - drag panel for drag and drop handling.
 o getDragPanel
 public JDPDragItem getDragPanel()
Get the drag panel for dragging.

Returns:
the drag panel for drag and drop handling.
 o setDragKey
 public void setDragKey(String key)
Set the drag and drop key to allow list items to be dragged.

Parameters:
the - key to the drag item to match with the drop key of another component.
 o getDragKey
 public String getDragKey()
Get the drag and drop key that allows list items to be dragged.

Returns:
the key to the drag item to match with the drop key of another component.
 o setDropMessage
 public void setDropMessage(String message)
Set the drag and drop message that allows list items to be dropped on.

Parameters:
the - message to the drop item that allows list items to be dropped on.
 o getDropMessage
 public String getDropMessage()
Get the drag and drop message that allows list items to be dropped on.

Returns:
the message to the drop item that allows list items to be dropped on.
 o reloadSelectedDirectory
 public void reloadSelectedDirectory()
Reload the selected directory. This will remove the cached filenames for this directory and reload them from the server.

 o createNewFolder
 public void createNewFolder(String folderPath)
Create a new Folder/Directory on the server. This will create all necessary parent directories also.

Parameters:
folderPath - the full path name of the folder/directory.
 o loadFiles
 public void loadFiles(String filePath,
                       boolean dirOnly)
Load the directories or files for the selected path

Parameters:
filePath - the full path name of the folder/directory.
dirOnly - true is you only want to load the subfolders, false if you also want to laod the files.
 o loadFiles
 public void loadFiles(String dirPath[],
                       boolean dirOnly)
Load the directories or files for the selected path

Parameters:
dirPath - a string array contain the folder/directory names.
dirOnly - true is you only want to load the subfolders, false if you also want to laod the files.