public class DefaultThreadSafeDialogsManager extends Object implements ThreadSafeDialogsManager
| Constructor and Description |
|---|
DefaultThreadSafeDialogsManager() |
DefaultThreadSafeDialogsManager(Component rootComponent) |
| Modifier and Type | Method and Description |
|---|---|
int |
confirmDialog(String message,
String title,
int optionType,
int messageType)
Show a JOptionPane confirm dialog.
|
Component |
createComponent(Class<? extends Component> theClass,
Object... parameters)
Creates an return a new instance of the component specified
This method ensure that the component is created in the event dispatch thread of swing.
|
Component |
createComponentWithParams(Class<? extends Component> theClass,
Object[] parameters)
Creates an return a new instance of the component specified
This method ensure that the component is created in the event dispatch thread of swing.
|
protected Component |
getRootComponent() |
String |
inputDialog(String message,
String title)
Show a JOptionPane input dialog.
|
String |
inputDialog(String message,
String title,
int messageType,
String initialValue)
Show a JOptionPane input dialog.
|
void |
messageDialog(String message,
String[] messageArgs,
String title,
int messageType)
Create a message dialog with ok button.
|
void |
messageDialog(String message,
String title,
int messageType)
Create a message dialog with an ok button.
|
File[] |
showChooserDialog(String title,
int type,
int selectionMode,
boolean multiselection,
File initialPath,
FileFilter filter,
boolean fileHidingEnabled)
Creates and show a JFileChooser dialog.
|
File[] |
showOpenDirectoryDialog(String title,
File initialPath)
Creates and show a JFileChooser dialog for folder selection.
|
File[] |
showOpenFileDialog(String title,
File initialPath)
Creates and show a JFileChooser dialog for selection a file for open.
|
File[] |
showSaveFileDialog(String title,
File initialPath)
Creates and show a JFileChooser dialog for selection a file for save.
|
public DefaultThreadSafeDialogsManager()
public DefaultThreadSafeDialogsManager(Component rootComponent)
protected Component getRootComponent()
public int confirmDialog(String message, String title, int optionType, int messageType)
ThreadSafeDialogsManagerconfirmDialog in interface ThreadSafeDialogsManagerJOptionPane.showConfirmDialog(Component, Object, String, int, int)public String inputDialog(String message, String title, int messageType, String initialValue)
ThreadSafeDialogsManagerinputDialog in interface ThreadSafeDialogsManagermessageType - an integer designating the kind of message this is;
primarily used to determine the icon from the pluggable
Look and Feel: ERROR_MESSAGE, INFORMATION_MESSAGE,
WARNING_MESSAGE, QUESTION_MESSAGE, or PLAIN_MESSAGEJOptionPane.showInputDialog(Component, Object, String, int)public String inputDialog(String message, String title)
ThreadSafeDialogsManagerinputDialog in interface ThreadSafeDialogsManagerJOptionPane.showInputDialog(Component, Object, String, int)public void messageDialog(String message, String title, int messageType)
ThreadSafeDialogsManagermessageDialog in interface ThreadSafeDialogsManagermessage - to present in the dialogtitle - title of the dialogmessageType - type of icon to use.JOptionPane.showMessageDialog(Component, Object, String, int)public void messageDialog(String message, String[] messageArgs, String title, int messageType)
ThreadSafeDialogsManagermessageDialog in interface ThreadSafeDialogsManagermessage - to present in the dialogmessageArgs - string array of arguments used to format the messagetitle - title of the dialogmessageType - type of icon to use.JOptionPane.showMessageDialog(Component, Object, String, int)public Component createComponent(Class<? extends Component> theClass, Object... parameters)
ThreadSafeDialogsManagercreateComponent in interface ThreadSafeDialogsManagertheClass - of component to be createdparameters - passed to the constructor of the componentpublic Component createComponentWithParams(Class<? extends Component> theClass, Object[] parameters)
ThreadSafeDialogsManagercreateComponentWithParams in interface ThreadSafeDialogsManagertheClass - of component to be createdparameters - passed to the constructor of the componentpublic File[] showChooserDialog(String title, int type, int selectionMode, boolean multiselection, File initialPath, FileFilter filter, boolean fileHidingEnabled)
ThreadSafeDialogsManagershowChooserDialog in interface ThreadSafeDialogsManagertype - of the dialog, JFileChooser.SAVE_DIALOG or JFileChooser.OPEN_DIALOGselectionMode - of the dialog, values are: JFileChooser.FILES_ONLY, JFileChooser.DIRECTORIES_ONLY, JFileChooser.FILES_AND_DIRECTORIESfilter - used to filter the files show in the dialog.public File[] showOpenDirectoryDialog(String title, File initialPath)
ThreadSafeDialogsManagershowOpenDirectoryDialog in interface ThreadSafeDialogsManagerThreadSafeDialogsManager.showChooserDialog(String, int, int, boolean, File, FileFilter, boolean)public File[] showOpenFileDialog(String title, File initialPath)
ThreadSafeDialogsManagerThreadSafeDialogsManager.showChooserDialog(String, int, int, boolean, File, FileFilter, boolean) call.showOpenFileDialog in interface ThreadSafeDialogsManagerThreadSafeDialogsManager.showChooserDialog(String, int, int, boolean, File, FileFilter, boolean)public File[] showSaveFileDialog(String title, File initialPath)
ThreadSafeDialogsManagerThreadSafeDialogsManager.showChooserDialog(String, int, int, boolean, File, FileFilter, boolean) call.showSaveFileDialog in interface ThreadSafeDialogsManagerThreadSafeDialogsManager.showChooserDialog(String, int, int, boolean, File, FileFilter, boolean)