|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.harvard.mgh.purcell.gCLINE.general.GCFileChooser
public class GCFileChooser
This class launches dailogs that allow the user to pick files on either a remote or local computer. This file name selection then launches an event (defined as a subclass) that can then be passed to the appropreate object.
Nested Class Summary | |
---|---|
class |
GCFileChooser.FileChoosenEvent
Create an EventObject to notify the selection of a file. |
static interface |
GCFileChooser.FileChoosenListener
Create an EventListener for our internally defined event. |
Field Summary | |
---|---|
private java.util.Vector<GCFileChooser.FileChoosenListener> |
allListeners
Keep a vector of the listeners |
private SshClient |
conn
|
private java.lang.String |
currentDir
|
private boolean |
dirSelected
|
private javax.swing.DefaultListModel |
editableList
|
private javax.swing.JList |
fileList
|
java.lang.String |
fileName
The file name that is selected |
private javax.swing.JFileChooser |
localPicker
A dialog that allows hte user to select a local file. |
private static org.apache.log4j.Logger |
logger
Log comments and errors |
private boolean |
onlyDir
|
private boolean |
onlyLocal
Flag file we are looking for as local or remote. |
private javax.swing.JFrame |
parent
Attached the dialogs to our main window and access the record through |
private javax.swing.JDialog |
parent2
|
private javax.swing.JDialog |
remotePicker
A dialog that alows the user to select a remote file. |
private javax.swing.JTextField |
remotePicks
|
Constructor Summary | |
---|---|
GCFileChooser(javax.swing.JDialog p,
javax.swing.filechooser.FileFilter f,
boolean pickLocal,
boolean pickDirectory,
SshClient c,
java.lang.String startDir)
Create an instance of our custom file chooser. |
|
GCFileChooser(javax.swing.JFrame p,
javax.swing.filechooser.FileFilter f,
boolean pickLocal,
boolean pickDirectory,
SshClient c,
java.lang.String startDir)
Create an instance of our custom file chooser. |
Method Summary | |
---|---|
void |
addFileChoosenListener(GCFileChooser.FileChoosenListener listener)
Add a listener to the list. |
private javax.swing.JPanel |
createButton()
Create a button panel for the remote dialog. |
private void |
createContent(javax.swing.DefaultListModel editableList)
|
private javax.swing.JScrollPane |
createFileList()
|
private void |
initalize(javax.swing.filechooser.FileFilter f)
|
void |
removeFileChoosenListener(GCFileChooser.FileChoosenListener listener)
Remove a listener from the list. |
void |
showChooser()
Show the file chooser. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static org.apache.log4j.Logger logger
private javax.swing.JFrame parent
private javax.swing.JDialog parent2
public java.lang.String fileName
private javax.swing.JDialog remotePicker
private javax.swing.JFileChooser localPicker
private java.util.Vector<GCFileChooser.FileChoosenListener> allListeners
private boolean onlyLocal
private boolean onlyDir
private SshClient conn
private java.lang.String currentDir
private javax.swing.JList fileList
private javax.swing.JTextField remotePicks
private boolean dirSelected
private javax.swing.DefaultListModel editableList
Constructor Detail |
---|
public GCFileChooser(javax.swing.JFrame p, javax.swing.filechooser.FileFilter f, boolean pickLocal, boolean pickDirectory, SshClient c, java.lang.String startDir)
p
- JFrame that we attach the file picking
dialogs too and access the Recordf
- FileFilter that filters the files.pickLocal
- A boolean that flags if the
chooser is local or remote.public GCFileChooser(javax.swing.JDialog p, javax.swing.filechooser.FileFilter f, boolean pickLocal, boolean pickDirectory, SshClient c, java.lang.String startDir)
p
- JDialog that we attach the file picking
dialogs too and access the Recordf
- FileFilter that filters the files.pickLocal
- A boolean that flags if the
chooser is local or remote.pickDirectory
- A boolean that flags if
directory are valid selectionsc
- The SshClient that used to connect to a remote
serverstartDir
- A String that is the defines the directory
to start looking for files in.Method Detail |
---|
private void initalize(javax.swing.filechooser.FileFilter f)
public void showChooser()
private void createContent(javax.swing.DefaultListModel editableList)
private javax.swing.JScrollPane createFileList()
private javax.swing.JPanel createButton()
public void addFileChoosenListener(GCFileChooser.FileChoosenListener listener)
listener
- FileChooserListener that we want to
add to the listpublic void removeFileChoosenListener(GCFileChooser.FileChoosenListener listener)
listener
- FileChooserListner that we want to remove
from the list. If it's not in the list then we don't
do anytking.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |