Package net.sf.jaxodraw.gui.panel
Class JaxoChooseFile
java.lang.Object
net.sf.jaxodraw.gui.panel.JaxoChooseFile
Opens a file chooser dialog that is used for opening, saving and exporting
files.
- Since:
- 2.0
-
Constructor Summary
ConstructorsConstructorDescriptionJaxoChooseFile
(Component parentc) Constructor.JaxoChooseFile
(Component parentc, String text) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionfinal String
chooseFile
(String[] allowedExtensions, String description, String selectedFile) Brings up a file chooser dialog.final String
Text for the JFileChooser approve button.final Component
Parent component for the dialog.final String
Title to be used for dialogs.void
setApproveText
(String value) The text for the approve button.void
setComponentParent
(Component value) Sets the parent component.void
setDialogTitle
(String value) Sets the dialog title.
-
Constructor Details
-
JaxoChooseFile
Constructor.- Parameters:
parentc
- The parent component.
-
JaxoChooseFile
Constructor.- Parameters:
parentc
- The parent component.text
- The text to use as a dialog title.
-
-
Method Details
-
getComponentParent
Parent component for the dialog.- Returns:
- The parent component.
-
setComponentParent
Sets the parent component.- Parameters:
value
- The parent component.
-
getApproveText
Text for the JFileChooser approve button. Must be set.- Returns:
- The approve button text.
-
setApproveText
The text for the approve button.- Parameters:
value
- The approve button text.
-
getDialogTitle
Title to be used for dialogs. If 'null' (the default), a default will be created using the approve text, but this is typically inferior to setting a custom one.- Returns:
- The dialog title.
-
setDialogTitle
Sets the dialog title.- Parameters:
value
- The dialog title.
-
chooseFile
Brings up a file chooser dialog.- Parameters:
allowedExtensions
- Files with these extensions (and directories) will be shown. May be 'null' indication no filtering.description
- A description of this dialog.selectedFile
- A file that should be marked as pre-selected.- Returns:
- A string with the absolute path of the chosen file, or an empty string, if no file was selected.
-