|
Gridarta Editor
|
Utility class for JFileChooser related functions. More...
Collaboration diagram for net.sf.gridarta.utils.FileChooserUtils:Static Public Member Functions | |
| static void | sanitizeCurrentDirectory (@NotNull final JFileChooser fileChooser) |
| Makes sure the current directory of a JFileChooser is valid. More... | |
| static void | setCurrentDirectory (@NotNull final JFileChooser fileChooser, @Nullable final File dir) |
| Calls JFileChooser#setCurrentDirectory(File). More... | |
Private Member Functions | |
| FileChooserUtils () | |
| Private constructor to prevent instantiation. More... | |
Static Private Member Functions | |
| static File | sanitize (@Nullable final File dir) |
| Performs sanity checks on the given directory. More... | |
Utility class for JFileChooser related functions.
Definition at line 31 of file FileChooserUtils.java.
|
private |
Private constructor to prevent instantiation.
Definition at line 36 of file FileChooserUtils.java.
|
staticprivate |
Performs sanity checks on the given directory.
Returns the given directory or one of its parent directories if it doesn't exist.
| dir | the directory to check |
Definition at line 67 of file FileChooserUtils.java.
References net.sf.gridarta.utils.ConfigFileUtils.getHomeDir().
Referenced by net.sf.gridarta.utils.FileChooserUtils.setCurrentDirectory().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Makes sure the current directory of a JFileChooser is valid.
| fileChooser | the file chooser to check |
Definition at line 56 of file FileChooserUtils.java.
References net.sf.gridarta.utils.FileChooserUtils.setCurrentDirectory().
Referenced by net.sf.gridarta.gui.dialog.browsearchetypes.BrowseArchetypesDialog< G, A, R >.browseArchetypesSave(), net.sf.gridarta.gui.map.renderer.ImageCreator2< G, A, R >.createImage(), net.sf.gridarta.textedit.scripteditor.ScriptEditControl.createOpenFileChooser(), net.sf.gridarta.gui.scripts.ImportPluginAction< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.importPlugin(), net.sf.gridarta.gui.map.maptilepane.TilePanel.mapTileChoose(), net.sf.gridarta.gui.misc.DefaultFileControl< G, A, R >.openFile(), and net.sf.gridarta.textedit.scripteditor.ScriptEditControl.openUser().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Calls JFileChooser#setCurrentDirectory(File).
Makes sure the passed directory exists to minimize the chance for NullPointerExceptions. See Bugreport 4869950.
| fileChooser | the file chooser to affect |
| dir | the directory to set; null |
Definition at line 48 of file FileChooserUtils.java.
References net.sf.gridarta.utils.FileChooserUtils.sanitize().
Referenced by net.sf.gridarta.gui.scripts.ScriptArchEditor< G, A, R >.addEventScript(), net.sf.gridarta.gui.misc.DefaultFileControl< G, A, R >.createFileChooser(), net.sf.gridarta.textedit.scripteditor.ScriptEditControl.createOpenFileChooser(), net.sf.gridarta.gui.spells.SpellsUtils.importSpells(), net.sf.gridarta.gui.map.maptilepane.TilePanel.mapTileChoose(), net.sf.gridarta.utils.FileChooserUtils.sanitizeCurrentDirectory(), net.sf.gridarta.gui.misc.DefaultFileControl< G, A, R >.saveMapAs(), and net.sf.gridarta.gui.dialog.plugin.PluginController<?, ?, ?>.savePluginAs().
Here is the call graph for this function:
Here is the caller graph for this function: