/** * 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) { return open(id, parent, title, titleImage, message, dialogType, buttonLabels, defaultButtonIndex, CHECKBOX_TEXT); }
/** * 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) { return open(id, parent, title, titleImage, message, dialogType, buttonLabels, defaultButtonIndex, CHECKBOX_TEXT); }
public static void warnIfBinaryConstant(IJavaElement element, Shell shell) { if (isPrimitiveConstantOrString(element)) OptionalMessageDialog.open( BIN_PRIM_CONST_WARN_DIALOG_ID, shell, SearchMessages.Search_FindReferencesAction_BinPrimConstWarnDialog_title, null, SearchMessages.Search_FindReferencesAction_BinPrimConstWarnDialog_message, MessageDialog.INFORMATION, new String[] { IDialogConstants.OK_LABEL }, 0); }
@Override public int open() { if (isDialogEnabled(OPTIONAL_ID)) return super.open(); return Window.OK; }
public static void warnIfBinaryConstant(IJavaElement element, Shell shell) { if (isBinaryPrimitiveConstantOrString(element)) OptionalMessageDialog.open( BIN_PRIM_CONST_WARN_DIALOG_ID, shell, SearchMessages.Search_FindReferencesAction_BinPrimConstWarnDialog_title, null, SearchMessages.Search_FindReferencesAction_BinPrimConstWarnDialog_message, MessageDialog.INFORMATION, new String[] { IDialogConstants.OK_LABEL }, 0); }
@Override public int open() { if (isDialogEnabled(OPTIONAL_ID)) return super.open(); return Window.OK; }
public static void warnIfBinaryConstant(IJavaElement element, Shell shell) { if (isPrimitiveConstantOrString(element)) OptionalMessageDialog.open( BIN_PRIM_CONST_WARN_DIALOG_ID, shell, SearchMessages.Search_FindReferencesAction_BinPrimConstWarnDialog_title, null, SearchMessages.Search_FindReferencesAction_BinPrimConstWarnDialog_message, MessageDialog.INFORMATION, new String[] { IDialogConstants.OK_LABEL }, 0); }
public int open() { if (isDialogEnabled(OPTIONAL_ID)) { int res= super.open(); if (res != Window.OK) { setDialogEnabled(OPTIONAL_ID, true); // don't save state on cancel } return res; } return Window.OK; }
IDialogConstants.CANCEL_LABEL }; int result= OptionalMessageDialog.open( CONFIGURE_PROBLEM_SEVERITY_DIALOG_ID, shell, JavaHoverMessages.ProblemHover_chooseSettingsTypeDialog_title, null, message, MessageDialog.QUESTION, buttons, 0, JavaHoverMessages.ProblemHover_chooseSettingsTypeDialog_checkBox_dontShowAgain);
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); } }
OptionalMessageDialog.open(JAVADOC_ANT_INFORMATION_DIALOG, getShell(), JavadocExportMessages.JavadocWizard_antInformationDialog_title, null, JavadocExportMessages.JavadocWizard_antInformationDialog_message, MessageDialog.INFORMATION, new String[] { IDialogConstants.OK_LABEL }, 0); try { Element javadocXMLElement= fStore.createXML(checkedProjects);
OptionalMessageDialog.open(JAVADOC_ANT_INFORMATION_DIALOG, getShell(), JavadocExportMessages.JavadocWizard_antInformationDialog_title, null, JavadocExportMessages.JavadocWizard_antInformationDialog_message, MessageDialog.INFORMATION, new String[] { IDialogConstants.OK_LABEL }, 0); try { Element javadocXMLElement= fStore.createXML(checkedProjects);
OptionalMessageDialog.open(JAVADOC_ANT_INFORMATION_DIALOG, getShell(), JavadocExportMessages.JavadocWizard_antInformationDialog_title, null, JavadocExportMessages.JavadocWizard_antInformationDialog_message, MessageDialog.INFORMATION, new String[] { IDialogConstants.OK_LABEL }, 0); try { File file= fStore.createXML(checkedProjects);
public void run(IStructuredSelection selection) { ICompilationUnit[] cus= getCompilationUnits(selection); if (cus.length == 0) { MessageDialog.openInformation(getShell(), ActionMessages.FormatAllAction_EmptySelection_title, ActionMessages.FormatAllAction_EmptySelection_description); return; } try { if (cus.length == 1) { JavaUI.openInEditor(cus[0]); } else { int returnCode= OptionalMessageDialog.open("FormatAll", //$NON-NLS-1$ getShell(), ActionMessages.FormatAllAction_noundo_title, null, ActionMessages.FormatAllAction_noundo_message, MessageDialog.WARNING, new String[] {IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL}, 0); if (returnCode != OptionalMessageDialog.NOT_SHOWN && returnCode != Window.OK ) return; } } catch (CoreException e) { ExceptionHandler.handle(e, getShell(), ActionMessages.FormatAllAction_error_title, ActionMessages.FormatAllAction_error_message); } runOnMultiple(cus); }
private void run(Shell shell, ICompilationUnit cu, IEditorPart editor, boolean isNotSortFields) { if (containsRelevantMarkers(editor)) { int returnCode= OptionalMessageDialog.open(ID_OPTIONAL_DIALOG, getShell(), getDialogTitle(), null, ActionMessages.SortMembersAction_containsmarkers, MessageDialog.WARNING, new String[] {IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL}, 0); if (returnCode != OptionalMessageDialog.NOT_SHOWN && returnCode != Window.OK ) return; } SortMembersOperation op= new SortMembersOperation(cu, null, isNotSortFields); try { BusyIndicatorRunnableContext context= new BusyIndicatorRunnableContext(); PlatformUI.getWorkbench().getProgressService().runInUI(context, new WorkbenchRunnableAdapter(op, op.getScheduleRule()), op.getScheduleRule()); } catch (InvocationTargetException e) { ExceptionHandler.handle(e, shell, getDialogTitle(), null); } catch (InterruptedException e) { // Do nothing. Operation has been canceled by user. } }
private void run(Shell shell, ICompilationUnit cu, IEditorPart editor, boolean isNotSortFields) { if (containsRelevantMarkers(editor)) { int returnCode= OptionalMessageDialog.open(ID_OPTIONAL_DIALOG, getShell(), getDialogTitle(), null, ActionMessages.SortMembersAction_containsmarkers, MessageDialog.WARNING, new String[] {IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL}, 0); if (returnCode != OptionalMessageDialog.NOT_SHOWN && returnCode != Window.OK ) return; } SortMembersOperation op= new SortMembersOperation(cu, null, isNotSortFields); try { BusyIndicatorRunnableContext context= new BusyIndicatorRunnableContext(); PlatformUI.getWorkbench().getProgressService().runInUI(context, new WorkbenchRunnableAdapter(op, op.getScheduleRule()), op.getScheduleRule()); } catch (InvocationTargetException e) { ExceptionHandler.handle(e, shell, getDialogTitle(), null); } catch (InterruptedException e) { // Do nothing. Operation has been canceled by user. } }
private void run(Shell shell, ICompilationUnit cu, IEditorPart editor, boolean isNotSortFields) { if (containsRelevantMarkers(editor)) { int returnCode= OptionalMessageDialog.open(ID_OPTIONAL_DIALOG, getShell(), getDialogTitle(), null, ActionMessages.SortMembersAction_containsmarkers, MessageDialog.WARNING, new String[] {IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL}, 0); if (returnCode != OptionalMessageDialog.NOT_SHOWN && returnCode != Window.OK ) return; } SortMembersOperation op= new SortMembersOperation(cu, null, isNotSortFields); try { BusyIndicatorRunnableContext context= new BusyIndicatorRunnableContext(); PlatformUI.getWorkbench().getProgressService().runInUI(context, new WorkbenchRunnableAdapter(op, op.getScheduleRule()), op.getScheduleRule()); } catch (InvocationTargetException e) { ExceptionHandler.handle(e, shell, getDialogTitle(), null); } catch (InterruptedException e) { // Do nothing. Operation has been canceled by user. } }
int returnValue= dialog.open(); if (restoreId == returnValue || settingsId == returnValue) { if (restoreId == returnValue) {