Package com.im.commons.ui
Class Dialogs
- java.lang.Object
- 
- com.im.commons.ui.Dialogs
 
- 
 public final class Dialogs extends java.lang.ObjectProvides utility methods for showing dialogs of various types.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static interfaceDialogs.ValidatingPaneDialog contents which is validated.
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.ObjectdisplayOkCancel(java.lang.Object innerPane, java.lang.String title)Displays a plain OK/Cancel dialog with the defaultNotifyDescriptor.OK_OPTIONbutton and no help context.static java.lang.ObjectdisplayOkCancel(java.lang.Object innerPane, java.lang.String title, int messageType)Displays OK/Cancel dialog with the defaultNotifyDescriptor.OK_OPTIONbutton and no help context.static java.lang.ObjectdisplayOkCancel(java.lang.Object innerPane, java.lang.String title, int messageType, org.openide.util.HelpCtx helpCtx)Displays OK/Cancel dialog with the defaultNotifyDescriptor.OK_OPTIONbutton.static java.lang.ObjectdisplayOkCancel(java.lang.Object innerPane, java.lang.String title, java.lang.Object okOption, int messageType, org.openide.util.HelpCtx helpCtx)Displays OK/Cancel dialog.static java.lang.ObjectdisplayOkCancel(java.lang.Object innerPane, java.lang.String title, java.lang.Object okOption, int messageType, org.openide.util.HelpCtx helpCtx, java.lang.String dimensionKey)Displays OK/Cancel dialog.static java.lang.ObjectdisplaySaveDontSaveCancel(Dialogs.ValidatingPane innerPane, java.lang.String title)Displays validating dialog with options "Save", "Don't Save" and "Cancel".static voidsetMinimumSize(javax.swing.JComponent comp, java.awt.Dimension size)Sets minimum dialog size to panel displayed usingDialogsstatic voidshowError(java.lang.String message)Show error dialog with the given message using NetBeans Dialogs API.static voidshowInfo(java.lang.String message)Show information dialog with the given message using NetBeans Dialogs API.static voidshowMessage(java.lang.String message, int messageType)Show dialog with the given message using NetBeans Dialogs API.static voidshowMessage(java.lang.String message, int messageType, java.lang.String title)Show dialog with the given message using NetBeans Dialogs API.static voidshowWarning(java.lang.String message)Show warning dialog with the given message using NetBeans Dialogs API.
 
- 
- 
- 
Method Detail- 
showMessagepublic static void showMessage(java.lang.String message, int messageType)Show dialog with the given message using NetBeans Dialogs API. Second parameter decides what type of dialog will be shown. Use constants fromNotifyDescriptorAPI, likeNotifyDescriptor.INFORMATION_MESSAGE.- Parameters:
- message- message to be shown
- messageType- type of the message - informational, waring, error, etc.
 
 - 
showMessagepublic static void showMessage(java.lang.String message, int messageType, java.lang.String title)Show dialog with the given message using NetBeans Dialogs API. Second parameter decides what type of dialog will be shown. Use constants fromNotifyDescriptorAPI, likeNotifyDescriptor.INFORMATION_MESSAGE.- Parameters:
- message- message to be shown
- messageType- type of the message - informational, waring, error, etc.
- title- title of the dialog
- Since:
- 22.6.0
 
 - 
showInfopublic static void showInfo(java.lang.String message) Show information dialog with the given message using NetBeans Dialogs API.- Parameters:
- message- message to be shown
 
 - 
showErrorpublic static void showError(java.lang.String message) Show error dialog with the given message using NetBeans Dialogs API.- Parameters:
- message- message to be shown
 
 - 
showWarningpublic static void showWarning(java.lang.String message) Show warning dialog with the given message using NetBeans Dialogs API.- Parameters:
- message- message to be shown
- Since:
- 22.6.0
 
 - 
displayOkCancelpublic static java.lang.Object displayOkCancel(java.lang.Object innerPane, java.lang.String title, java.lang.Object okOption, int messageType, org.openide.util.HelpCtx helpCtx)Displays OK/Cancel dialog. The supplied parameters control the dialog's contents, title, OK or approve button, etc. This method is a simplified version ofDialogDescriptorcalls.- Parameters:
- innerPane- contents of dialog
- title- title of dialog
- okOption- the OK button
- messageType- the type of the dialog, see- NotifyDescriptorconstants
- helpCtx- help context for the dialog, can be- nullfor no help
- Returns:
- Either okOptionorNotifyDescriptor.CANCEL_OPTIONdepending on what button a user hits.
- Since:
- 6.1
 
 - 
displayOkCancelpublic static java.lang.Object displayOkCancel(java.lang.Object innerPane, java.lang.String title, java.lang.Object okOption, int messageType, org.openide.util.HelpCtx helpCtx, java.lang.String dimensionKey)Displays OK/Cancel dialog. The supplied parameters control the dialog's contents, title, OK or approve button, etc. This method is a simplified version ofDialogDescriptorcalls.- Parameters:
- innerPane- contents of dialog
- title- title of dialog
- okOption- the OK button
- messageType- the type of the dialog, see- NotifyDescriptorconstants
- helpCtx- help context for the dialog, can be- nullfor no help
- dimensionKey- used for remembering bounds of shown dialog. When this method is called for the first time the size of a dialog at the point it was closed is remembered. Upon next invocation of this method with the same- dimensionKeydialog will be shown with the remembered bounds and new bounds will be remembered again. Bounds are remembered across JVM sessions.
- Returns:
- Either okOptionorNotifyDescriptor.CANCEL_OPTIONdepending on what button a user hits.
- Since:
- 6.2
 
 - 
displayOkCancelpublic static java.lang.Object displayOkCancel(java.lang.Object innerPane, java.lang.String title, int messageType, org.openide.util.HelpCtx helpCtx)Displays OK/Cancel dialog with the defaultNotifyDescriptor.OK_OPTIONbutton.- Parameters:
- innerPane- contents of dialog
- title- title of dialog
- messageType- the type of the dialog, see- NotifyDescriptorconstants
- helpCtx- help context for the dialog, can be- nullfor no help
- Returns:
- Either NotifyDescriptor.OK_OPTIONorNotifyDescriptor.CANCEL_OPTIONdepending on what button a user hits.
 
 - 
displayOkCancelpublic static java.lang.Object displayOkCancel(java.lang.Object innerPane, java.lang.String title, int messageType)Displays OK/Cancel dialog with the defaultNotifyDescriptor.OK_OPTIONbutton and no help context.- Parameters:
- innerPane- contents of dialog
- title- title of dialog
- messageType- the type of the dialog, see- NotifyDescriptorconstants
- Returns:
- Either NotifyDescriptor.OK_OPTIONorNotifyDescriptor.CANCEL_OPTIONdepending on what button a user hits.
 
 - 
displayOkCancelpublic static java.lang.Object displayOkCancel(java.lang.Object innerPane, java.lang.String title)Displays a plain OK/Cancel dialog with the defaultNotifyDescriptor.OK_OPTIONbutton and no help context.- Parameters:
- innerPane- contents of dialog
- title- title of dialog
- Returns:
- Either NotifyDescriptor.OK_OPTIONorNotifyDescriptor.CANCEL_OPTIONdepending on what button a user hits.
 
 - 
displaySaveDontSaveCancelpublic static java.lang.Object displaySaveDontSaveCancel(Dialogs.ValidatingPane innerPane, java.lang.String title) Displays validating dialog with options "Save", "Don't Save" and "Cancel".- Parameters:
- innerPane- contents of dialog
- title- title of dialog
- Returns:
- NotifyDescriptor.YES_OPTION,- NotifyDescriptor.NO_OPTIONor- NotifyDescriptor.CANCEL_OPTIONif user chooses Save, Don't Save or Cancel respectively.
 
 - 
setMinimumSizepublic static void setMinimumSize(javax.swing.JComponent comp, java.awt.Dimension size)Sets minimum dialog size to panel displayed usingDialogs- Parameters:
- comp-
- size-
 
 
- 
 
-