public class DefaultMDIDialogBuilder extends java.lang.Object implements MDIDialogBuilder
Modifier and Type | Class and Description |
---|---|
class |
DefaultMDIDialogBuilder.DefaultDialogPart
Represents a dialog part.
|
static interface |
DefaultMDIDialogBuilder.DialogListener
Listens to apply or cancel on the dialog.
|
MDIDialogBuilder.DialogPart
CUSTOM_DIALOG, ERROR_MESSAGE, INFORMATION_MESSAGE, OK_DIALOG, OK_PRINT_DIALOG, PLAIN_MESSAGE, QUESTION_MESSAGE, WARNING_MESSAGE, YES_CANCEL_DIALOG
Constructor and Description |
---|
DefaultMDIDialogBuilder() |
DefaultMDIDialogBuilder(java.lang.String title)
Constructor.
|
DefaultMDIDialogBuilder(java.lang.String title,
short dialogType,
int messageType)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
DefaultMDIDialogBuilder.DefaultDialogPart |
addHorizontalDialogPart()
Add a dialog part where the components are layout horizontally.
|
DefaultMDIDialogBuilder.DefaultDialogPart |
addHorizontalDialogPart(javax.swing.JComponent... content)
Add a dialog part where the components are layout horizontally.
|
DefaultMDIDialogBuilder.DefaultDialogPart |
addHorizontalDialogPart(java.lang.String id)
Add a dialog part where the components are layout horizontally.
|
DefaultMDIDialogBuilder.DefaultDialogPart |
addHorizontalDialogPart(java.lang.String title,
javax.swing.JComponent... content)
Add a dialog part where the components are layout horizontally.
|
DefaultMDIDialogBuilder.DefaultDialogPart |
addHorizontalDialogPart(java.lang.String id,
java.lang.String title,
javax.swing.JComponent... content)
Add a dialog part where the components are layout horizontally.
|
DefaultMDIDialogBuilder.DefaultDialogPart |
addVerticalDialogPart()
Add a dialog part where the components are layout vertically.
|
DefaultMDIDialogBuilder.DefaultDialogPart |
addVerticalDialogPart(javax.swing.JComponent... content)
Add a dialog part where the components are layout vertically.
|
DefaultMDIDialogBuilder.DefaultDialogPart |
addVerticalDialogPart(java.lang.String id)
Add a dialog part where the components are layout vertically.
|
DefaultMDIDialogBuilder.DefaultDialogPart |
addVerticalDialogPart(java.lang.String title,
javax.swing.JComponent... content)
Add a dialog part where the components are layout vertically.
|
DefaultMDIDialogBuilder.DefaultDialogPart |
addVerticalDialogPart(java.lang.String id,
java.lang.String title,
javax.swing.JComponent... content)
Add a dialog part where the components are layout vertically.
|
void |
apply()
Fired if the user validates the dialog, which is:
Click on "Yes", for a
MDIDialogBuilder.YES_CANCEL_DIALOG
Click on "OK", for a MDIDialogBuilder.OK_DIALOG
|
void |
cancel()
Fired if the user cancels the dialog, which is:
Click on "Cancel", for a
MDIDialogBuilder.YES_CANCEL_DIALOG
|
javax.swing.JPanel |
createApplyPanel()
Creates the Apply panel, in the
MDIDialogBuilder.CUSTOM_DIALOG type. |
javax.swing.JPanel |
createDialogContent()
Create the dialog main panel or component.
|
java.lang.String |
getCancelLabel()
Return the label for the "Cancel" button, in a
MDIDialogBuilder.YES_CANCEL_DIALOG . |
java.util.Map<java.lang.String,MDIDialogBuilder.DialogPart> |
getDialogPartsByID()
Return the dialog parts by ID.
|
java.lang.String |
getDialogTitle()
Return the dialog title.
|
short |
getDialogType()
Return the dialog type.
|
int |
getHorizontalMenusSeparation()
Return the horizontal menus separation.
|
java.lang.String |
getID()
Return the ID of the Dialog.By default the ID is "MDIDialogBuilder".
|
javax.swing.JMenuBar |
getJMenuBar()
Return the dialog menu bar.
|
javax.swing.JToolBar |
getJToolBar()
Return the dialog toolbar.
|
MDIBuilderDialog |
getMDIBuilderDialog()
Return the MDIBuilderDialog.
|
int |
getMessageType()
Return the message type, specifyng the type of icon which will be presented in the dialog.
|
java.lang.String |
getPrintFileExtension()
Return the print file extension.
|
java.lang.String |
getPrintLabel()
Return the label for the "Print" button, in a
MDIDialogBuilder.OK_PRINT_DIALOG . |
java.awt.Dimension |
getSize()
Return the dimension of the dialog.
|
int |
getVerticalMenusSeparation()
Return the vertical menus separation.
|
java.lang.String |
getYesLabel()
Return the label for the "Yes" button, in a
MDIDialogBuilder.YES_CANCEL_DIALOG , or the "OK" button in the MDIDialogBuilder.OK_DIALOG . |
boolean |
isModal()
Return true if the dialog window is modal.
|
boolean |
isResizable()
Return true if the dialog window is resizable.
|
void |
print(java.io.File file)
Fired if the user prints the dialog content, which is:
Click on "Print", for a
MDIDialogBuilder.OK_PRINT_DIALOG
|
void |
setApplyPanel(javax.swing.JPanel applyPanel)
Set the Apply panel
|
void |
setCancelLabel(java.lang.String label)
Set the label for the "Cancel" button, used in a
MDIDialogBuilder.YES_CANCEL_DIALOG . |
void |
setDialogTitle(java.lang.String title)
Set the dialog title.
|
void |
setDialogType(short dialogType)
Set the dialog type.
|
void |
setHorizontalMenusSeparation(int horizontalSeparation)
Set the horizontal menus separation.
|
void |
setID(java.lang.String dialogID)
Set the dialog ID.
|
void |
setJMenuBar(javax.swing.JMenuBar menubar)
Set the dialog menu bar.
|
void |
setJToolBar(javax.swing.JToolBar toolbar)
Set the dialog toolbar.
|
void |
setListener(DefaultMDIDialogBuilder.DialogListener listener)
Set the listener which will listen to the Yes / OK / Cancel user action.
|
void |
setMDIBuilderDialog(MDIBuilderDialog mdiDialog)
Set the MDIBuilderDialog.
|
void |
setMessageType(int messageType)
Set the message type.
|
void |
setModal(boolean isModal)
Set if the dialog window is modal.
|
void |
setPrintFileExtension(java.lang.String extension)
Set the File extension for the "Print" button, used in a
MDIDialogBuilder.OK_PRINT_DIALOG . |
void |
setPrintLabel(java.lang.String label)
Set the label for the "Print" button, used in a
MDIDialogBuilder.OK_PRINT_DIALOG . |
void |
setResizable(boolean isResizable)
Set if the dialog window is resizable.
|
void |
setSize(java.awt.Dimension size)
Set the dimension of the dialog.
|
void |
setVerticalMenusSeparation(int verticalSeparation)
Set the vertical menus separation.
|
void |
setYesLabel(java.lang.String label)
Set the label for the "Yes" button, used in a
MDIDialogBuilder.YES_CANCEL_DIALOG , or the "OK" button in the MDIDialogBuilder.OK_DIALOG . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getContentBorder
public DefaultMDIDialogBuilder()
public DefaultMDIDialogBuilder(java.lang.String title)
title
- the titlepublic DefaultMDIDialogBuilder(java.lang.String title, short dialogType, int messageType)
title
- the titledialogType
- the dialog typemessageType
- the message typepublic void setListener(DefaultMDIDialogBuilder.DialogListener listener)
listener
- the listenerpublic void setHorizontalMenusSeparation(int horizontalSeparation)
horizontalSeparation
- the horizontal menus separationpublic int getHorizontalMenusSeparation()
public void setVerticalMenusSeparation(int verticalSeparation)
verticalSeparation
- the vertical menus separationpublic int getVerticalMenusSeparation()
public javax.swing.JPanel createDialogContent()
createDialogContent
in interface MDIDialogBuilder
public java.util.Map<java.lang.String,MDIDialogBuilder.DialogPart> getDialogPartsByID()
getDialogPartsByID
in interface MDIDialogBuilder
public void setModal(boolean isModal)
isModal
- true if the dialog window is modalpublic boolean isModal()
isModal
in interface MDIDialogBuilder
public void setResizable(boolean isResizable)
isResizable
- true if the dialog window is resizablepublic boolean isResizable()
isResizable
in interface MDIDialogBuilder
public void setSize(java.awt.Dimension size)
size
- the dimension of the dialogpublic java.awt.Dimension getSize()
getSize
in interface MDIDialogBuilder
public void setDialogType(short dialogType)
MDIDialogBuilder.OK_DIALOG
for an OK DialogMDIDialogBuilder.YES_CANCEL_DIALOG
for an Yes / Cancel DialogMDIDialogBuilder.CUSTOM_DIALOG
for a custom DialogdialogType
- the dialog typepublic short getDialogType()
MDIDialogBuilder.OK_DIALOG
by default.getDialogType
in interface MDIDialogBuilder
public void setMessageType(int messageType)
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 iconmessageType
- the message typepublic int getMessageType()
MDIDialogBuilder.PLAIN_MESSAGE
by default, which means that
there will be no icon.getMessageType
in interface MDIDialogBuilder
public void setDialogTitle(java.lang.String title)
title
- the dialog titlepublic java.lang.String getDialogTitle()
getDialogTitle
in interface MDIDialogBuilder
public void setYesLabel(java.lang.String label)
MDIDialogBuilder.YES_CANCEL_DIALOG
, or the "OK" button in the MDIDialogBuilder.OK_DIALOG
.label
- the labelpublic java.lang.String getYesLabel()
MDIDialogBuilder.YES_CANCEL_DIALOG
, or the "OK" button in the MDIDialogBuilder.OK_DIALOG
.
Return "Yes" by default, for a MDIDialogBuilder.YES_CANCEL_DIALOG
or "OK", for a MDIDialogBuilder.OK_DIALOG
.getYesLabel
in interface MDIDialogBuilder
public void setCancelLabel(java.lang.String label)
MDIDialogBuilder.YES_CANCEL_DIALOG
.label
- the labelpublic java.lang.String getCancelLabel()
MDIDialogBuilder.YES_CANCEL_DIALOG
.
Return "Cancel" by default, for a MDIDialogBuilder.OK_DIALOG
.getCancelLabel
in interface MDIDialogBuilder
public void setPrintLabel(java.lang.String label)
MDIDialogBuilder.OK_PRINT_DIALOG
.label
- the labelpublic void setPrintFileExtension(java.lang.String extension)
MDIDialogBuilder.OK_PRINT_DIALOG
.extension
- the extensionpublic java.lang.String getPrintFileExtension()
getPrintFileExtension
in interface MDIDialogBuilder
public java.lang.String getPrintLabel()
MDIDialogBuilder.OK_PRINT_DIALOG
.
Return "Print" by default, for a MDIDialogBuilder.OK_PRINT_DIALOG
.getPrintLabel
in interface MDIDialogBuilder
public void setJMenuBar(javax.swing.JMenuBar menubar)
menubar
- the menu barpublic javax.swing.JMenuBar getJMenuBar()
getJMenuBar
in interface MDIDialogBuilder
public void setJToolBar(javax.swing.JToolBar toolbar)
toolbar
- the toolbarpublic javax.swing.JToolBar getJToolBar()
getJToolBar
in interface MDIDialogBuilder
public void setApplyPanel(javax.swing.JPanel applyPanel)
applyPanel
- the panelpublic javax.swing.JPanel createApplyPanel()
MDIDialogBuilder.CUSTOM_DIALOG
type. By dfualt retuens an empty panel.createApplyPanel
in interface MDIDialogBuilder
public void apply()
MDIDialogBuilder.YES_CANCEL_DIALOG
MDIDialogBuilder.OK_DIALOG
apply
in interface MDIDialogBuilder
public void cancel()
MDIDialogBuilder.YES_CANCEL_DIALOG
cancel
in interface MDIDialogBuilder
public void print(java.io.File file)
MDIDialogBuilder.OK_PRINT_DIALOG
print
in interface MDIDialogBuilder
file
- the File to print onpublic void setID(java.lang.String dialogID)
dialogID
- the dialog IDpublic java.lang.String getID()
MDIDialogType.UNIQUE_INSTANCE
option.getID
in interface MDIDialogBuilder
public void setMDIBuilderDialog(MDIBuilderDialog mdiDialog)
setMDIBuilderDialog
in interface MDIDialogBuilder
mdiDialog
- the MDIBuilderDialogpublic MDIBuilderDialog getMDIBuilderDialog()
getMDIBuilderDialog
in interface MDIDialogBuilder
public DefaultMDIDialogBuilder.DefaultDialogPart addHorizontalDialogPart(java.lang.String title, javax.swing.JComponent... content)
content
- the dialog part contenttitle
- the dialog part titlepublic DefaultMDIDialogBuilder.DefaultDialogPart addHorizontalDialogPart(java.lang.String id, java.lang.String title, javax.swing.JComponent... content)
id
- the dialog part idcontent
- the dialog part contenttitle
- the dialog part titlepublic DefaultMDIDialogBuilder.DefaultDialogPart addVerticalDialogPart(java.lang.String title, javax.swing.JComponent... content)
content
- the dialog part contenttitle
- the dialog part titlepublic DefaultMDIDialogBuilder.DefaultDialogPart addVerticalDialogPart(java.lang.String id, java.lang.String title, javax.swing.JComponent... content)
id
- the dialog part id (can be null)content
- the dialog part contenttitle
- the dialog part title (can be null)public DefaultMDIDialogBuilder.DefaultDialogPart addVerticalDialogPart(javax.swing.JComponent... content)
content
- the dialog part content componentspublic DefaultMDIDialogBuilder.DefaultDialogPart addHorizontalDialogPart(javax.swing.JComponent... content)
content
- the dialog part contentpublic DefaultMDIDialogBuilder.DefaultDialogPart addVerticalDialogPart()
public DefaultMDIDialogBuilder.DefaultDialogPart addVerticalDialogPart(java.lang.String id)
id
- the dialog part idpublic DefaultMDIDialogBuilder.DefaultDialogPart addHorizontalDialogPart()
public DefaultMDIDialogBuilder.DefaultDialogPart addHorizontalDialogPart(java.lang.String id)
id
- the id of the dialog part