public final class ChooseURL extends Object
An application must register its URL chooser dialog box with this facility otherwise a standard JFileChooser is used. In the latter case, the user will not be able to specify URLs other than "file:" ones.
Modifier and Type | Class and Description |
---|---|
static interface |
ChooseURL.URLChooser
This interface must be implemented by the application if it has an URL
chooser dialog box.
|
static class |
ChooseURL.URLChooserImpl
Default implementation of
ChooseURL.URLChooser : uses the standard
JFileChooser. |
Modifier and Type | Field and Description |
---|---|
static ChooseURL.URLChooserImpl |
DEFAULT_CHOOSER
Ready-to-use instance of
ChooseURL.URLChooserImpl . |
Constructor and Description |
---|
ChooseURL() |
Modifier and Type | Method and Description |
---|---|
static URL |
chooseOpenDirectoryURL(Component parentComponent,
URL template,
ChooseFileOptions options)
Convenience method: equivalent to
getURLChooser().chooseOpenDirectoryURL(parentComponent, template,
options) . |
static URL |
chooseOpenFileURL(Component parentComponent,
URL template,
ChooseFileOptions options)
Convenience method: equivalent to
getURLChooser().chooseOpenFileURL(parentComponent, template, options) . |
static URL |
chooseSaveDirectoryURL(Component parentComponent,
URL template,
ChooseFileOptions options)
Convenience method: equivalent to
getURLChooser().chooseSaveDirectoryURL(parentComponent, template,
options) . |
static URL |
chooseSaveFileURL(Component parentComponent,
URL template,
ChooseFileOptions options)
Convenience method: equivalent to
getURLChooser().chooseSaveFileURL(parentComponent, template, options) . |
static URL |
chooseURL(Component parentComponent,
URL template,
boolean dirMode,
boolean saveMode,
ChooseFileOptions options)
Selects a "file:" URL according to specified arguments.
|
static ChooseURL.URLChooser |
getURLChooser()
Returns the object implementing an URL chooser dialog box
or
null if such object has not been specified. |
static void |
setURLChooser(ChooseURL.URLChooser urlChooser)
Specifies the object implementing an URL chooser dialog box.
|
public static final ChooseURL.URLChooserImpl DEFAULT_CHOOSER
ChooseURL.URLChooserImpl
.public static void setURLChooser(ChooseURL.URLChooser urlChooser)
public static ChooseURL.URLChooser getURLChooser()
null
if such object has not been specified.public static URL chooseOpenFileURL(Component parentComponent, URL template, ChooseFileOptions options)
getURLChooser().chooseOpenFileURL(parentComponent, template, options)
.public static URL chooseSaveFileURL(Component parentComponent, URL template, ChooseFileOptions options)
getURLChooser().chooseSaveFileURL(parentComponent, template, options)
.public static URL chooseOpenDirectoryURL(Component parentComponent, URL template, ChooseFileOptions options)
getURLChooser().chooseOpenDirectoryURL(parentComponent, template,
options)
.public static URL chooseSaveDirectoryURL(Component parentComponent, URL template, ChooseFileOptions options)
getURLChooser().chooseSaveDirectoryURL(parentComponent, template,
options)
.public static URL chooseURL(Component parentComponent, URL template, boolean dirMode, boolean saveMode, ChooseFileOptions options)
parentComponent
- used to find a parent for the dialog boxtemplate
- used as a template for URL to be selected.
May be null
.dirMode
- if true
, selected URL must be directorysaveMode
- if true
, returned URL must be a save fileoptions
- dialog box options. May be null
.null
if user has canceled
the selection.