Codota Logo
OptionalMessageDialog.open
Code IndexAdd Codota to your IDE (free)

How to use
open
method
in
org.eclipse.jdt.internal.ui.dialogs.OptionalMessageDialog

Best Java code snippets using org.eclipse.jdt.internal.ui.dialogs.OptionalMessageDialog.open (Showing top 20 results out of 315)

  • Common ways to obtain OptionalMessageDialog
private void myMethod () {
OptionalMessageDialog o =
  • Codota IconComposite composite;Layout layout;composite.setLayout(layout)
  • Codota IconLink link;String string;link.setText(string)
  • Codota IconLink link;Object object;link.setLayoutData(object)
  • Smart code suggestions by Codota
}
origin: org.eclipse.jdt/org.eclipse.jdt.ui

/**
 * 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);
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

/**
 * 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);
}
origin: org.eclipse.jdt/org.eclipse.jdt.ui

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);
}
origin: org.eclipse.jdt/org.eclipse.jdt.ui

@Override
public int open() {
  if (isDialogEnabled(OPTIONAL_ID))
    return super.open();
  return Window.OK;
}
origin: org.eclipse/org.eclipse.jdt.ui

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);
}

origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

@Override
public int open() {
  if (isDialogEnabled(OPTIONAL_ID))
    return super.open();
  return Window.OK;
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

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);
}
origin: org.eclipse/org.eclipse.jdt.ui

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;
}

origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

    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);
origin: org.eclipse.jdt/org.eclipse.jdt.ui

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);
  }
}
origin: org.eclipse/org.eclipse.jdt.ui

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);
  }
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

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);
  }
}
origin: org.eclipse.jdt/org.eclipse.jdt.ui

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);
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

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);
origin: org.eclipse/org.eclipse.jdt.ui

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);
origin: org.eclipse/org.eclipse.jdt.ui

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);
}
origin: org.eclipse/org.eclipse.jdt.ui

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.
  }
}
origin: org.eclipse.jdt/org.eclipse.jdt.ui

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.
  }
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

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.
  }
}
origin: org.eclipse/org.eclipse.jdt.ui

int returnValue= dialog.open();
if (restoreId == returnValue || settingsId == returnValue) {
  if (restoreId == returnValue) {
org.eclipse.jdt.internal.ui.dialogsOptionalMessageDialogopen

Javadoc

Opens the dialog but only if the user hasn't chosen to hide it.

Popular methods of OptionalMessageDialog

  • isDialogEnabled
    Answers whether the optional dialog is enabled and should be shown.
  • <init>
  • applyDialogFont
  • clearAllRememberedStates
    Clears all remembered information about hidden dialogs
  • close
  • convertHorizontalDLUsToPixels
  • convertVerticalDLUsToPixels
  • createContents
  • createCustomArea
  • getDialogSettings
    Returns this dialog
  • setDialogEnabled
    Sets whether the optional dialog is enabled and should be shown.
  • getButtonLabels
  • setDialogEnabled,
  • getButtonLabels,
  • getReturnCode

Popular in Java

  • Finding current android device location
  • startActivity (Activity)
  • getApplicationContext (Context)
  • getSystemService (Context)
  • InputStreamReader (java.io)
    An InputStreamReader is a bridge from byte streams to character streams: It reads bytes and decodes
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate(i
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • SortedSet (java.util)
    A Set that further provides a total ordering on its elements. The elements are ordered using their C
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now