|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object swingwt.awt.Component swingwt.awt.Container swingwtx.swing.JComponent swingwtx.swing.JPanel swingwtx.swing.JFileChooser
JFileChooser is now a custom control (like Swing's), however if you only use the showXDialog() methods without calling setAccessory() or setExtensions(), you will get a native platform file chooser dialog instead. You can force native or non-native by creating an instance of JFileChooser and doing [instance].useNative = true/false This hopefully supplies the best of both worlds. FIXME: Does not support multiple file selection or directories in custom mode (works fine for platform native)
Nested Class Summary |
Nested classes inherited from class swingwtx.swing.JComponent |
JComponent.InternalFrameSelectionListener |
Field Summary | |
static java.lang.String |
ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY
|
static java.lang.String |
ACCESSORY_CHANGED_PROPERTY
|
protected swingwtx.swing.JFileChooser.FileFilterWrapper |
allFiles
|
static java.lang.String |
APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY
|
static java.lang.String |
APPROVE_BUTTON_TEXT_CHANGED_PROPERTY
|
static java.lang.String |
APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY
|
static int |
APPROVE_OPTION
|
protected JPanel |
buttonPanel
|
static int |
CANCEL_OPTION
|
static java.lang.String |
CANCEL_SELECTION
|
protected JPanel |
centralPanel
|
static java.lang.String |
CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY
|
static java.lang.String |
CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY
|
protected java.io.File |
curFile
|
protected java.io.File[] |
curFiles
|
protected java.io.File |
curPath
|
static int |
CUSTOM_DIALOG
|
protected swingwtx.swing.JFileChooser.FileChooserDialog |
customDialog
|
static java.lang.String |
DIALOG_TITLE_CHANGED_PROPERTY
|
static java.lang.String |
DIALOG_TYPE_CHANGED_PROPERTY
|
protected int |
dialogReturnValue
|
protected java.lang.String |
dialogTitle
|
protected int |
dialogType
|
static int |
DIRECTORIES_ONLY
|
static java.lang.String |
DIRECTORY_CHANGED_PROPERTY
|
static int |
ERROR_OPTION
|
protected JComponent |
fcAccessory
|
static java.lang.String |
FILE_FILTER_CHANGED_PROPERTY
|
static java.lang.String |
FILE_HIDING_CHANGED_PROPERTY
|
static java.lang.String |
FILE_SELECTION_MODE_CHANGED_PROPERTY
|
static java.lang.String |
FILE_SYSTEM_VIEW_CHANGED_PROPERTY
|
static java.lang.String |
FILE_VIEW_CHANGED_PROPERTY
|
protected java.util.Vector |
fileFilters
|
protected JList |
fileList
|
static int |
FILES_AND_DIRECTORIES
|
static int |
FILES_ONLY
|
protected int |
fileSelection
|
protected JComboBox |
filter
|
protected java.lang.String[] |
filterNames
|
protected java.lang.String[] |
filters
|
protected JTextField |
location
|
protected JLabel |
locationLabel
|
static java.lang.String |
MULTI_SELECTION_ENABLED_CHANGED_PROPERTY
|
protected boolean |
multiSelect
|
protected JButton |
okButton
|
static int |
OPEN_DIALOG
|
static int |
SAVE_DIALOG
|
static java.lang.String |
SELECTED_FILE_CHANGED_PROPERTY
|
static java.lang.String |
SELECTED_FILES_CHANGED_PROPERTY
|
boolean |
useNative
Whether or not to use native chooser - is set to false if setAccessory() or setExtensions() is called. |
Fields inherited from class swingwtx.swing.JPanel |
opaque, ppeer |
Fields inherited from class swingwtx.swing.JComponent |
accessibleContext, actionMap, ancestorInputMap, border, clientProperties, descendantHasPeer, focusInputMap, internalFrameAdapter, internalFrameParent, propertyChangeListeners, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW, windowInputMap |
Fields inherited from class swingwt.awt.Container |
composite, comps, containerListeners, layout, queuedValidateRequest |
Fields inherited from interface swingwt.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
JFileChooser()
Creates a new instance of JFileChooser |
|
JFileChooser(java.io.File currentDirectory)
|
|
JFileChooser(java.lang.String currentDirectoryPath)
|
Method Summary | |
void |
addChoosableFileFilter(FileFilter f)
|
void |
changeToParentDirectory()
|
protected void |
checkDriveEntry(java.lang.String path,
java.lang.String displayName,
JComboBox driveBox)
Checks if the specified file path exists and if it does, creates a DriveEntry object, wraps the path and description
up with it and loads it into the drives combo box for display. |
void |
ensureFileIsVisible(java.io.File f)
|
protected void |
firePropertyChangeEvent(java.lang.String propertyName,
java.lang.Object oldValue,
java.lang.Object newValue)
Sends property change event to all listeners |
protected void |
forceRelayout()
Lays out the whole thing - this is really for problems with accessories not resizing. |
JComponent |
getAccessory()
|
java.lang.String |
getApproveButtonText()
|
java.lang.String |
getApproveButtonToolTipText()
|
FileFilter[] |
getChoosableFileFilters()
|
boolean |
getControlButtonsAreShown()
|
java.io.File |
getCurrentDirectory()
|
int |
getDialogType()
|
FileFilter |
getFileFilter()
|
int |
getFileSelectionMode()
|
java.io.File |
getSelectedFile()
|
java.io.File[] |
getSelectedFiles()
|
java.lang.String |
getTitle()
|
boolean |
isAcceptAllFileFilterUsed()
|
boolean |
isDirectorySelectionEnabled()
|
boolean |
isFileHidingEnabled()
|
boolean |
isFileSelectionEnabled()
|
boolean |
isMultiSelectionEnabled()
|
protected void |
layoutComponent()
Lays out native widgets for this component. |
boolean |
removeChoosableFileFilter(FileFilter f)
|
void |
rescanCurrentDirectory()
Refreshes the on-screen list for the current location |
void |
resetChoosableFileFilters()
|
void |
scanDrives(JComboBox driveBox)
Scans "drives" according to platform. |
void |
setAcceptAllFileFilterUsed(boolean b)
|
void |
setAccessory(JComponent newAccessory)
|
void |
setApproveButtonMnemonic(char mnemonic)
|
void |
setApproveButtonMnemonic(int mnemonic)
|
void |
setApproveButtonText(java.lang.String approveButtonText)
|
void |
setApproveButtonToolTipText(java.lang.String toolTipText)
|
void |
setControlButtonsAreShown(boolean b)
|
void |
setCurrentDirectory(java.io.File dir)
|
void |
setDialogTitle(java.lang.String dialogTitle)
|
void |
setDialogType(int dialogType)
|
void |
setExtensionFilters(java.lang.String[] extensions,
java.lang.String[] names)
NOT A REAL SWING METHOD - THIS SETS FILTERS FOR THE PLATFORM DIALOGS INSTEAD OF OUR CUSTOM FILECHOOSER. |
void |
setFileFilter(FileFilter fileFilter)
|
void |
setFileHidingEnabled(boolean b)
|
void |
setFileSelectionMode(int mode)
|
void |
setMultiSelectionEnabled(boolean b)
|
void |
setSelectedFile(java.io.File file)
|
void |
setSelectedFiles(java.io.File[] selectedFiles)
|
void |
setTitle(java.lang.String title)
|
static void |
setUseLastDirectory(boolean b)
|
protected int |
showCustomOpenDialog(Component parent)
|
protected int |
showCustomSaveDialog(Component parent)
|
java.lang.String |
showDirectorySelectDialog(Component parent,
java.lang.String message)
This is a convenience method to the DirectoryDialog SWT class. |
protected int |
showNativeOpenDialog(Component parent)
|
protected int |
showNativeSaveDialog(Component parent)
|
int |
showOpenDialog(Component parent)
Wrapper routine - calls either showNativeOpenDialog or showCustomOpenDialog depending on options chosen |
int |
showSaveDialog(Component parent)
|
java.io.File[] |
sortFiles(java.io.File[] sort)
Sorts an array of Java File references
into alphabetical order. |
Methods inherited from class swingwtx.swing.JPanel |
calculatePreferredSize, getHeight, getSize, getWidth, setBorder, setSwingWTParent |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int OPEN_DIALOG
public static final int SAVE_DIALOG
public static final int CUSTOM_DIALOG
public static final int CANCEL_OPTION
public static final java.lang.String CANCEL_SELECTION
public static final int APPROVE_OPTION
public static final int ERROR_OPTION
public static final int FILES_ONLY
public static final int DIRECTORIES_ONLY
public static final int FILES_AND_DIRECTORIES
public static final java.lang.String ACCESSORY_CHANGED_PROPERTY
public static final java.lang.String ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY
public static final java.lang.String DIALOG_TITLE_CHANGED_PROPERTY
public static final java.lang.String DIALOG_TYPE_CHANGED_PROPERTY
public static final java.lang.String CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY
public static final java.lang.String FILE_VIEW_CHANGED_PROPERTY
public static final java.lang.String FILE_HIDING_CHANGED_PROPERTY
public static final java.lang.String FILE_FILTER_CHANGED_PROPERTY
public static final java.lang.String FILE_SELECTION_MODE_CHANGED_PROPERTY
public static final java.lang.String APPROVE_BUTTON_TEXT_CHANGED_PROPERTY
public static final java.lang.String APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY
public static final java.lang.String APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY
public static final java.lang.String CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY
public static final java.lang.String DIRECTORY_CHANGED_PROPERTY
public static final java.lang.String SELECTED_FILE_CHANGED_PROPERTY
public static final java.lang.String SELECTED_FILES_CHANGED_PROPERTY
public static final java.lang.String MULTI_SELECTION_ENABLED_CHANGED_PROPERTY
public static final java.lang.String FILE_SYSTEM_VIEW_CHANGED_PROPERTY
protected int dialogType
protected java.lang.String dialogTitle
protected int fileSelection
protected java.io.File curPath
protected java.io.File curFile
protected java.io.File[] curFiles
protected boolean multiSelect
protected java.lang.String[] filters
protected java.lang.String[] filterNames
protected java.util.Vector fileFilters
public boolean useNative
protected JTextField location
protected JComboBox filter
protected JPanel centralPanel
protected JList fileList
protected JPanel buttonPanel
protected JLabel locationLabel
protected JButton okButton
protected JComponent fcAccessory
protected swingwtx.swing.JFileChooser.FileChooserDialog customDialog
protected int dialogReturnValue
protected swingwtx.swing.JFileChooser.FileFilterWrapper allFiles
Constructor Detail |
public JFileChooser()
public JFileChooser(java.lang.String currentDirectoryPath)
public JFileChooser(java.io.File currentDirectory)
Method Detail |
public static void setUseLastDirectory(boolean b)
public java.io.File getSelectedFile()
public void setSelectedFile(java.io.File file)
public java.io.File[] getSelectedFiles()
public void setSelectedFiles(java.io.File[] selectedFiles)
public java.io.File getCurrentDirectory()
public void setCurrentDirectory(java.io.File dir)
public void changeToParentDirectory()
public void scanDrives(JComboBox driveBox)
protected void checkDriveEntry(java.lang.String path, java.lang.String displayName, JComboBox driveBox)
DriveEntry
object, wraps the path and description
up with it and loads it into the drives combo box for display.
public void rescanCurrentDirectory()
public void ensureFileIsVisible(java.io.File f)
public boolean getControlButtonsAreShown()
public void setControlButtonsAreShown(boolean b)
public int getDialogType()
public void setDialogType(int dialogType)
public void setDialogTitle(java.lang.String dialogTitle)
public void setApproveButtonToolTipText(java.lang.String toolTipText)
public java.lang.String getApproveButtonToolTipText()
public void setApproveButtonMnemonic(int mnemonic)
public void setApproveButtonMnemonic(char mnemonic)
public void setApproveButtonText(java.lang.String approveButtonText)
public java.lang.String getApproveButtonText()
public JComponent getAccessory()
public void setAccessory(JComponent newAccessory)
public void setFileSelectionMode(int mode)
public int getFileSelectionMode()
public boolean isFileSelectionEnabled()
public boolean isDirectorySelectionEnabled()
public void setMultiSelectionEnabled(boolean b)
public boolean isMultiSelectionEnabled()
public boolean isFileHidingEnabled()
public void setFileHidingEnabled(boolean b)
public void setExtensionFilters(java.lang.String[] extensions, java.lang.String[] names)
public void setFileFilter(FileFilter fileFilter)
public FileFilter getFileFilter()
public FileFilter[] getChoosableFileFilters()
public void addChoosableFileFilter(FileFilter f)
public boolean removeChoosableFileFilter(FileFilter f)
public void resetChoosableFileFilters()
public boolean isAcceptAllFileFilterUsed()
public void setAcceptAllFileFilterUsed(boolean b)
public int showOpenDialog(Component parent)
public java.lang.String showDirectorySelectDialog(Component parent, java.lang.String message)
parent
-
protected int showCustomOpenDialog(Component parent)
protected int showNativeOpenDialog(Component parent)
public int showSaveDialog(Component parent)
protected int showNativeSaveDialog(Component parent)
protected int showCustomSaveDialog(Component parent)
public java.lang.String getTitle()
public void setTitle(java.lang.String title)
public java.io.File[] sortFiles(java.io.File[] sort)
File
references
into alphabetical order.
protected void firePropertyChangeEvent(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
protected void forceRelayout()
protected void layoutComponent()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |