/** * Opens the dialog but only if the user hasn't chosen to hide it. * * @return the index of the pressed button or {@link SWT#DEFAULT} if the dialog got dismissed * without pressing a button (e.g. via Esc) or {{@link #NOT_SHOWN} if the dialog was not * shown */ public static int open(String id, Shell parent, String title, Image titleImage, String message, int dialogType, String[] buttonLabels, int defaultButtonIndex, String checkboxText) { if (!isDialogEnabled(id)) return OptionalMessageDialog.NOT_SHOWN; MessageDialog dialog= new OptionalMessageDialog(id, parent, title, titleImage, message, dialogType, buttonLabels, defaultButtonIndex, checkboxText); return dialog.open(); }
/** * Opens the dialog but only if the user hasn't choosen to hide it. * Returns <code>NOT_SHOWN</code> if the dialog was not shown. */ public static int open(String id, Shell parent, String title, Image titleImage, String message, int dialogType, String[] buttonLabels, int defaultButtonIndex) { if (!isDialogEnabled(id)) return OptionalMessageDialog.NOT_SHOWN; MessageDialog dialog= new OptionalMessageDialog(id, parent, title, titleImage, message, dialogType, buttonLabels, defaultButtonIndex); return dialog.open(); }
/** * Opens the dialog but only if the user hasn't chosen to hide it. * * @return the index of the pressed button or {@link SWT#DEFAULT} if the dialog got dismissed * without pressing a button (e.g. via Esc) or {{@link #NOT_SHOWN} if the dialog was not * shown */ public static int open(String id, Shell parent, String title, Image titleImage, String message, int dialogType, String[] buttonLabels, int defaultButtonIndex, String checkboxText) { if (!isDialogEnabled(id)) return OptionalMessageDialog.NOT_SHOWN; MessageDialog dialog= new OptionalMessageDialog(id, parent, title, titleImage, message, dialogType, buttonLabels, defaultButtonIndex, checkboxText); return dialog.open(); }
private void showSlowCleanUpDialog(final StringBuilder cleanUpNames) { if (OptionalMessageDialog.isDialogEnabled(SlowCleanUpWarningDialog.ID)) { Shell shell= PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); new SlowCleanUpWarningDialog(shell, FixMessages.CleanUpPostSaveListener_SlowCleanUpDialog_title, cleanUpNames.toString()).open(); } }
private void showSlowCleanUpDialog(final StringBuffer cleanUpNames) { if (OptionalMessageDialog.isDialogEnabled(SlowCleanUpWarningDialog.ID)) { Shell shell= PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); new SlowCleanUpWarningDialog(shell, FixMessages.CleanUpPostSaveListener_SlowCleanUpDialog_title, cleanUpNames.toString()).open(); } }
protected void warnAboutTypeCommentDeprecation() { String key= IUIConstants.DIALOGSTORE_TYPECOMMENT_DEPRECATED; if (OptionalMessageDialog.isDialogEnabled(key)) { TemplateStore templates= JavaPlugin.getDefault().getTemplateStore(); boolean isOldWorkspace= templates.findTemplate("filecomment") != null && templates.findTemplate("typecomment") != null; //$NON-NLS-1$ //$NON-NLS-2$ if (!isOldWorkspace) { OptionalMessageDialog.setDialogEnabled(key, false); } String title= NewWizardMessages.NewElementWizard_typecomment_deprecated_title; String message= NewWizardMessages.NewElementWizard_typecomment_deprecated_message; OptionalMessageDialog.open(key, getShell(), title, null, message, MessageDialog.INFORMATION, new String[] { IDialogConstants.OK_LABEL }, 0); } }
protected void warnAboutTypeCommentDeprecation() { String key= IUIConstants.DIALOGSTORE_TYPECOMMENT_DEPRECATED; if (OptionalMessageDialog.isDialogEnabled(key)) { TemplateStore templates= JavaPlugin.getDefault().getTemplateStore(); boolean isOldWorkspace= templates.findTemplate("filecomment") != null && templates.findTemplate("typecomment") != null; //$NON-NLS-1$ //$NON-NLS-2$ if (!isOldWorkspace) { OptionalMessageDialog.setDialogEnabled(key, false); } String title= NewWizardMessages.NewElementWizard_typecomment_deprecated_title; String message= NewWizardMessages.NewElementWizard_typecomment_deprecated_message; OptionalMessageDialog.open(key, getShell(), title, null, message, MessageDialog.INFORMATION, new String[] { IDialogConstants.OK_LABEL }, 0); } }
protected void warnAboutTypeCommentDeprecation() { String key= IUIConstants.DIALOGSTORE_TYPECOMMENT_DEPRECATED; if (OptionalMessageDialog.isDialogEnabled(key)) { TemplateStore templates= JavaPlugin.getDefault().getTemplateStore(); boolean isOldWorkspace= templates.findTemplate("filecomment") != null && templates.findTemplate("typecomment") != null; //$NON-NLS-1$ //$NON-NLS-2$ if (!isOldWorkspace) { OptionalMessageDialog.setDialogEnabled(key, false); } String title= NewWizardMessages.NewElementWizard_typecomment_deprecated_title; String message= NewWizardMessages.NewElementWizard_typecomment_deprecated_message; OptionalMessageDialog.open(key, getShell(), title, null, message, MessageDialog.INFORMATION, new String[] { IDialogConstants.OK_LABEL }, 0); } }
if (OptionalMessageDialog.isDialogEnabled(PREF_WARN_ABOUT_EMPTY_ASSIST_CATEGORY)) { final Shell shell= JavaPlugin.getActiveWorkbenchShell(); String title= JavaTextMessages.ContentAssistProcessor_all_disabled_title;
if (OptionalMessageDialog.isDialogEnabled(PREF_WARN_ABOUT_EMPTY_ASSIST_CATEGORY)) { final Shell shell= JavaPlugin.getActiveWorkbenchShell(); String title= JavaTextMessages.ContentAssistProcessor_all_disabled_title;
if (OptionalMessageDialog.isDialogEnabled(PREF_WARN_ABOUT_EMPTY_ASSIST_CATEGORY)) { final Shell shell= JavaPlugin.getActiveWorkbenchShell(); String title= JavaTextMessages.ContentAssistProcessor_all_disabled_title;
@Override public boolean performFinish() { LibraryHandler libraryHandler= fJarPackageWizardPage.getLibraryHandler(); fJarPackage.setJarBuilder(libraryHandler.getBuilder(fJarPackage)); MultiStatus status= new MultiStatus(JavaPlugin.getPluginId(), IStatus.OK, FatJarPackagerMessages.FatJarPackageWizard_JarExportProblems_message, null); Object[] elements= fJarPackageWizardPage.getSelectedElementsWithoutContainedChildren(status); fJarPackage.setElements(elements); if ((libraryHandler.isShowWarning()) && hasArchive(elements)) { if (OptionalMessageDialog.isDialogEnabled(IPIssueWarningDialog.ID)) { IPIssueWarningDialog dialog= new IPIssueWarningDialog(getShell(), FatJarPackagerMessages.FatJarPackageWizard_IPIssueDialog_title, FatJarPackagerMessages.FatJarPackageWizard_IPIssueDialog_message); if (dialog.open() != Window.OK) return false; } } fJarPackageWizardPage.exportAntScript(status); if (!executeExportOperation(fJarPackage.createJarExportRunnable(getShell()), status)) return false; // Save the dialog settings if (fHasNewDialogSettings) { IDialogSettings workbenchSettings= JavaPlugin.getDefault().getDialogSettings(); IDialogSettings section= workbenchSettings.getSection(DIALOG_SETTINGS_KEY); section= workbenchSettings.addNewSection(DIALOG_SETTINGS_KEY); setDialogSettings(section); } fJarPackageWizardPage.finish(); return true; }
@Override public boolean performFinish() { LibraryHandler libraryHandler= fJarPackageWizardPage.getLibraryHandler(); fJarPackage.setJarBuilder(libraryHandler.getBuilder(fJarPackage)); MultiStatus status= new MultiStatus(JavaPlugin.getPluginId(), IStatus.OK, FatJarPackagerMessages.FatJarPackageWizard_JarExportProblems_message, null); Object[] elements= fJarPackageWizardPage.getSelectedElementsWithoutContainedChildren(status); fJarPackage.setElements(elements); if ((libraryHandler.isShowWarning()) && hasArchive(elements)) { if (OptionalMessageDialog.isDialogEnabled(IPIssueWarningDialog.ID)) { IPIssueWarningDialog dialog= new IPIssueWarningDialog(getShell(), FatJarPackagerMessages.FatJarPackageWizard_IPIssueDialog_title, FatJarPackagerMessages.FatJarPackageWizard_IPIssueDialog_message); if (dialog.open() != Window.OK) return false; } } fJarPackageWizardPage.exportAntScript(status); if (!executeExportOperation(fJarPackage.createJarExportRunnable(getShell()), status)) return false; // Save the dialog settings if (fHasNewDialogSettings) { IDialogSettings workbenchSettings= JavaPlugin.getDefault().getDialogSettings(); IDialogSettings section= workbenchSettings.getSection(DIALOG_SETTINGS_KEY); section= workbenchSettings.addNewSection(DIALOG_SETTINGS_KEY); setDialogSettings(section); } fJarPackageWizardPage.finish(); return true; }
@Override public boolean performFinish() { LibraryHandler libraryHandler= fJarPackageWizardPage.getLibraryHandler(); fJarPackage.setJarBuilder(libraryHandler.getBuilder(fJarPackage)); MultiStatus status= new MultiStatus(JavaPlugin.getPluginId(), IStatus.OK, FatJarPackagerMessages.FatJarPackageWizard_JarExportProblems_message, null); Object[] elements= fJarPackageWizardPage.getSelectedElementsWithoutContainedChildren(status); fJarPackage.setElements(elements); if ((libraryHandler.isShowWarning()) && hasArchive(elements)) { if (OptionalMessageDialog.isDialogEnabled(IPIssueWarningDialog.ID)) { IPIssueWarningDialog dialog= new IPIssueWarningDialog(getShell(), FatJarPackagerMessages.FatJarPackageWizard_IPIssueDialog_title, FatJarPackagerMessages.FatJarPackageWizard_IPIssueDialog_message); if (dialog.open() != Window.OK) return false; } } fJarPackageWizardPage.exportAntScript(status); if (!executeExportOperation(fJarPackage.createJarExportRunnable(getShell()), status)) return false; // Save the dialog settings if (fHasNewDialogSettings) { IDialogSettings workbenchSettings= JavaPlugin.getDefault().getDialogSettings(); IDialogSettings section= workbenchSettings.getSection(DIALOG_SETTINGS_KEY); section= workbenchSettings.addNewSection(DIALOG_SETTINGS_KEY); setDialogSettings(section); } fJarPackageWizardPage.finish(); return true; }