org.obolibrary.gui
Class SelectDialog

java.lang.Object
  extended by org.obolibrary.gui.SelectDialog

public abstract class SelectDialog
extends Object

Wrapper for the native FileDialog. Allow convenient use of the native Dialog. The wrapper sets also the system specific flags, for file and folder dialogs. Limitations:


Field Summary
static boolean LOAD
           
static boolean SAVE
           
 
Constructor Summary
SelectDialog()
           
 
Method Summary
static SelectDialog getFileSelector(Frame frame, boolean write, String defaultFolder, String title, String description, String[] extensions)
          Create a new dialog, which selects a file from the file system.
static SelectDialog getFolderSelector(Frame frame, String defaultFolder, String title)
          Create a new dialog, which selects a folder from the file system.
abstract  File getSelected()
          Retrieve the selected file/folder.
 String getSelectedCanonicalPath()
          Retrieve the canonical path of the selected folder.
abstract  void show()
          Show the dialog to the user for selection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOAD

public static final boolean LOAD
See Also:
Constant Field Values

SAVE

public static final boolean SAVE
See Also:
Constant Field Values
Constructor Detail

SelectDialog

public SelectDialog()
Method Detail

show

public abstract void show()
Show the dialog to the user for selection.


getSelected

public abstract File getSelected()
Retrieve the selected file/folder.

Returns:
selected file/folder or null (if not available).

getSelectedCanonicalPath

public String getSelectedCanonicalPath()
Retrieve the canonical path of the selected folder.

Returns:
canonical path of the selected file/folder or null (if not available)

getFileSelector

public static SelectDialog getFileSelector(Frame frame,
                                           boolean write,
                                           String defaultFolder,
                                           String title,
                                           String description,
                                           String[] extensions)
Create a new dialog, which selects a file from the file system.

Parameters:
frame - the owner frame used to configure the dialog
write - write mode, see LOAD and SAVE.
defaultFolder - default folder the dialog
title - title string for the dialog
description - filter description
extensions - suffixes for the filter, set to null to show all files
Returns:
dialog

getFolderSelector

public static SelectDialog getFolderSelector(Frame frame,
                                             String defaultFolder,
                                             String title)
Create a new dialog, which selects a folder from the file system.

Parameters:
frame - the frame used to center the dialog
defaultFolder - default folder for the dialog
title - title string for the dialog
Returns:
dialog


Copyright © 2010-2013. All Rights Reserved.