public class DefaultMDIDialogHelper extends java.lang.Object implements MDIDialogHelper
Modifier and Type | Field and Description |
---|---|
protected GUIApplication |
gui
The GUI application.
|
Constructor and Description |
---|
DefaultMDIDialogHelper(GUIApplication gui)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
applyDialog(MDIDialog dialog)
Apply a dialog.
|
void |
cancelDialog(MDIDialog dialog)
Cancel a dialog.
|
MDIDialogType |
getDefaultDialogOpenType()
Return the default dialog opening type.
|
boolean |
isDialogOpened(MDIDialog dialog)
Return true if a dialog is currently opened.
|
protected void |
removeOpenedDialog(MDIDialog dialog)
Remove an opened dialog from the list of dialog previously opened.
|
void |
setDefaultDialogOpenType(MDIDialogType openType)
Set the default dialog opening type.
|
int |
showDialog(MDIDialog dialog)
Show a dialog with the default dialog opening type.
|
int |
showDialog(MDIDialog dialog,
javax.swing.AbstractAction action)
Show a dialog with the default dialog opening type.
|
int |
showDialog(MDIDialog dialog,
javax.swing.AbstractAction action,
MDIDialogType openType)
Show a dialog.
|
int |
showDialog(MDIDialogBuilder builder)
Show a dialog with the default dialog opening type.
|
int |
showDialog(MDIDialogBuilder builder,
MDIDialogType openType)
Show a dialog.
|
int |
showDialog(MDIDialog dialog,
MDIDialogType openType)
Show a dialog.
|
protected int |
showDialogImpl(MDIDialog dialog,
boolean isModal)
Called when a dialog is called.
|
int |
showMessageDialog(java.lang.String title,
int messageType,
boolean isModal,
boolean isResizable,
java.lang.String... messages)
Show a message dialog, with an OK button.
|
protected GUIApplication gui
public DefaultMDIDialogHelper(GUIApplication gui)
gui
- the GUIpublic void setDefaultDialogOpenType(MDIDialogType openType)
setDefaultDialogOpenType
in interface MDIDialogHelper
openType
- the default dialog opening typepublic MDIDialogType getDefaultDialogOpenType()
getDefaultDialogOpenType
in interface MDIDialogHelper
public int showDialog(MDIDialog dialog)
showDialog
in interface MDIDialogHelper
dialog
- the dialogJFileChooser.APPROVE_OPTION
, or JFileChooser.CANCEL_OPTION
public int showDialog(MDIDialog dialog, javax.swing.AbstractAction action)
showDialog
in interface MDIDialogHelper
dialog
- the dialogaction
- the associated ActionJFileChooser.APPROVE_OPTION
, or JFileChooser.CANCEL_OPTION
public int showDialog(MDIDialog dialog, MDIDialogType openType)
showDialog
in interface MDIDialogHelper
dialog
- the dialogopenType
- the opening type of the dialogJFileChooser.APPROVE_OPTION
, or JFileChooser.CANCEL_OPTION
public void cancelDialog(MDIDialog dialog)
removeOpenedDialog(org.mdi.bootstrap.swing.MDIDialog)
by default.cancelDialog
in interface MDIDialogHelper
dialog
- the dialogpublic void applyDialog(MDIDialog dialog)
removeOpenedDialog(org.mdi.bootstrap.swing.MDIDialog)
by default.applyDialog
in interface MDIDialogHelper
dialog
- the dialogprotected final void removeOpenedDialog(MDIDialog dialog)
dialog
- the dialogprotected int showDialogImpl(MDIDialog dialog, boolean isModal)
dialog
- the dialogisModal
- true for a modal dialogJFileChooser.APPROVE_OPTION
, or JFileChooser.CANCEL_OPTION
public int showDialog(MDIDialog dialog, javax.swing.AbstractAction action, MDIDialogType openType)
showDialog
in interface MDIDialogHelper
dialog
- the dialogaction
- the associated ActionopenType
- the opening type of the dialogJFileChooser.APPROVE_OPTION
, or JFileChooser.CANCEL_OPTION
MDIDialogType
public int showDialog(MDIDialogBuilder builder, MDIDialogType openType)
showDialog
in interface MDIDialogHelper
builder
- the dialog builderopenType
- the opening type of the dialogJFileChooser.APPROVE_OPTION
, or JFileChooser.CANCEL_OPTION
public int showDialog(MDIDialogBuilder builder)
showDialog
in interface MDIDialogHelper
builder
- the dialog builderJFileChooser.APPROVE_OPTION
, or JFileChooser.CANCEL_OPTION
public int showMessageDialog(java.lang.String title, int messageType, boolean isModal, boolean isResizable, java.lang.String... messages)
showMessageDialog
in interface MDIDialogHelper
title
- the dialog titleisModal
- true if the dialog is modalisResizable
- true if the dialog is resizablemessages
- the list of messages, which will be shown in a vertical gridmessageType
- the message type. It can be:
MDIDialogBuilder.PLAIN_MESSAGE
for a default dialog without any iconMDIDialogBuilder.ERROR_MESSAGE
for a dialog with an error iconMDIDialogBuilder.INFORMATION_MESSAGE
for a dialog with an information iconMDIDialogBuilder.QUESTION_MESSAGE
for a dialog with a question iconJFileChooser.APPROVE_OPTION
public boolean isDialogOpened(MDIDialog dialog)
isDialogOpened
in interface MDIDialogHelper
dialog
- the dialog