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.
-
LOAD
-
-
NEWFOLDER
-
-
SAVE
-
-
JDPFilePicker()
-
-
addFilter(String, String)
- Add a filename filter to the pulldown list of filename filters.
-
clear()
- Clear the pulldown list of filename filters.
-
clearFilter()
- Clear the pulldown list of filename filters.
-
createNewFolder(String)
- Create a new Folder/Directory on the server.
-
getAutoScroll()
- Get the autoscroll value for the Tree and the List.
-
getDirectoryPath(JDPTreeBranch)
- Get the full path of the selected directory given the branch from the folder tree.
-
getDragKey()
- Get the drag and drop key that allows list items to be dragged.
-
getDragPanel()
- Get the drag panel for dragging.
-
getDropMessage()
- Get the drag and drop message that allows list items to be dropped on.
-
getFileList()
- Get the handle to the list that implements the file list.
-
getFileName(JDPTreeBranch)
- Get the full path of the selected file given the branch from the file list.
-
getFilePath(JDPTreeBranch)
- Get the full path of the selected file given the branch from the file list.
-
getFiles()
- Get the a list of all the files from the file list.
-
getFilter()
- Get the current filename filter.
-
getFolderTree()
- Get the handle to the tree that implements the folder tree.
-
getSelectedDirectory()
- Get the selected directory.
-
getSelectedFile()
- Get the selected file.
-
getSelectedFullPath()
- Get the full path of the selected file.
-
getSelectedItem()
- Get the selected item from the file list.
-
getSelectedItems()
- Get the selected items from the file list.
-
getSeparator()
- Get the separator character used by the server.
-
handleEvent(Event)
-
-
InitClass(JDPUser, Panel, String)
- Creates a File Picker.
-
loadAllDrives()
- Load all the drives into the File Picker.
-
loadFiles(String, boolean)
- Load the directories or files for the selected path
-
loadFiles(String[], boolean)
- Load the directories or files for the selected path
-
reloadSelectedDirectory()
- Reload the selected directory.
-
run()
-
-
selectFilter(String)
- Set the filename filter pulldown.
-
setAutoScroll(boolean)
- Set the autoscroll for the Tree and the List.
-
setDragKey(String)
- Set the drag and drop key to allow list items to be dragged.
-
setDragPanel(JDPDragItem)
- Set the drag panel for dragging.
-
setDropMessage(String)
- Set the drag and drop message that allows list items to be dropped on.
-
setMode(int)
- Set the mode to save, load or create a new folder.
-
setMultipleSelections(boolean)
- Set the file picker to allow multiple selections (NOTE: Presently not functional).
-
setSelectedDirectory(String)
- Set the selected directory.
-
setSelectedFile(String)
- Set the selected file.
LOAD
public static final int LOAD
SAVE
public static final int SAVE
NEWFOLDER
public static final int NEWFOLDER
JDPFilePicker
public JDPFilePicker()
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
handleEvent
public boolean handleEvent(Event e)
- Overrides:
- handleEvent in class Component
run
public void run()
- Overrides:
- run in class JDPClassLayout
loadAllDrives
public void loadAllDrives()
- Load all the drives into the File Picker.
setMode
public void setMode(int mode)
- Set the mode to save, load or create a new folder.
- Parameters:
- mode - (SAVE, LOAD, NEWFOLDER).
clear
public void clear()
- Clear the pulldown list of filename filters.
clearFilter
public void clearFilter()
- Clear the pulldown list of filename filters.
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
selectFilter
public void selectFilter(String filterDescription)
- Set the filename filter pulldown.
- Parameters:
- filter - the filter to set the pulldown to.
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.
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.
getFilter
public String getFilter()
- Get the current filename filter.
- Returns:
- the current filename filter.
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.
getSelectedDirectory
public String getSelectedDirectory()
- Get the selected directory.
- Returns:
- the currently selected directory.
setSelectedDirectory
public void setSelectedDirectory(String dir)
- Set the selected directory. This will also load the directory subfolders.
- Parameters:
- selectedDirectory - the selected directory.
getSelectedFile
public String getSelectedFile()
- Get the selected file.
- Returns:
- the currently selected file.
setSelectedFile
public void setSelectedFile(String file)
- Set the selected file.
- Parameters:
- selectedFile - the selected file.
getSelectedFullPath
public String getSelectedFullPath()
- Get the full path of the selected file.
- Returns:
- the full path name of the selected file.
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.
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.
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.
getSeparator
public String getSeparator()
- Get the separator character used by the server.
- Parameters:
- separator - the separator character used by the server.
getSelectedItem
public String getSelectedItem()
- Get the selected item from the file list.
- Returns:
- the currently selected item in the file list.
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.
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.
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.
getAutoScroll
public boolean getAutoScroll()
- Get the autoscroll value for the Tree and the List.
- Parameters:
- the - autoscroll setting for the Tree and the List.
setDragPanel
public void setDragPanel(JDPDragItem drag)
- Set the drag panel for dragging.
- Parameters:
- the - drag panel for drag and drop handling.
getDragPanel
public JDPDragItem getDragPanel()
- Get the drag panel for dragging.
- Returns:
- the drag panel for drag and drop handling.
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.
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.
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.
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.
reloadSelectedDirectory
public void reloadSelectedDirectory()
- Reload the selected directory. This will remove the cached filenames for this
directory and reload them from the server.
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.
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.
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.