|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectComponent
Container
JComponent
JFileChooser
JFileDataStoreChooser
public class JFileDataStoreChooser
A file chooser dialog to get user choices for data stores.
Examples of use:
// prompt the user for a shapefile
File file = JFileDataStoreChooser.showOpenFile("shp", parentFrame);
if (file != null) {
...
}
// prompt the user for a given data format
modules/unsupported/swing (gt-swing.jar)
Nested Class Summary |
---|
Nested classes/interfaces inherited from class JFileChooser |
---|
JFileChooser.AccessibleJFileChooser |
Nested classes/interfaces inherited from class JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class Component |
---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary |
---|
Fields inherited from class JComponent |
---|
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
JFileDataStoreChooser(FileDataStoreFactorySpi format)
Creates a dialog that filters for files matching the specified data format. |
|
JFileDataStoreChooser(List<String> extensions)
Create a dialog that filters for files with the specified extensions. |
|
JFileDataStoreChooser(Map<String,String> fileAssociations)
Creates a dialog based on the given file associations. |
|
JFileDataStoreChooser(String extension)
Create a dialog that filters for files with the specified extension. |
|
JFileDataStoreChooser(String[] extensions)
Create a dialog that filters for files with the specified extensions. |
Method Summary | |
---|---|
static void |
main(String[] arg)
Deomonstrates the file data store dialog by prompting for a shapefile |
void |
setSaveFile(File file)
Consider the provided file as a candidate for a new filename. |
static File |
showOpenFile(FileDataStoreFactorySpi format,
Component parent)
Show a file open dialog that filters for files that match a given file data store format |
static File |
showOpenFile(String[] extensions,
Component parent)
Show a file open dialog that filters for files with the given extensions. |
static File |
showOpenFile(String extension,
Component parent)
Show a file open dialog that filters for files with the given extension. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public JFileDataStoreChooser(String extension)
extension
- the file extension, with or without the leading '.'public JFileDataStoreChooser(List<String> extensions)
extensions
- the file extensions, with or without the leading '.'public JFileDataStoreChooser(String[] extensions)
extensions
- the file extensions, with or without the leading '.'public JFileDataStoreChooser(Map<String,String> fileAssociations)
Map assoc = new HashMap();
assoc.put(".foo", "Foo data files (*.foo)");
assoc.put(".bar", "Bar data files (*.bar)");
JFileDataStoreChooser chooser = new JFileDataStoreChooser(assoc);
fileAssociations
- a Map
where keys are extensions (with or
wirhout the leading dot) and values are descriptions.public JFileDataStoreChooser(FileDataStoreFactorySpi format)
format
- data file formatMethod Detail |
---|
public static File showOpenFile(String extension, Component parent) throws HeadlessException
extension
- file extension, with or without leading '.'parent
- parent GUI component (may be null)
HeadlessException
- if run in an unsupported environmentpublic static File showOpenFile(String[] extensions, Component parent) throws HeadlessException
extensions
- array of file extension, with or without leading '.'parent
- parent GUI component (may be null)
HeadlessException
- if run in an unsupported environmentpublic static File showOpenFile(FileDataStoreFactorySpi format, Component parent) throws HeadlessException
format
- the file data store formatparent
- parent GUI component (may be null)
HeadlessException
- if run in an unsupported environmentpublic static void main(String[] arg)
arg
- ignoredpublic void setSaveFile(File file)
file
- the candidate file name
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |