congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
OptionalMessageDialog.open
Code IndexAdd Tabnine 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)

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

  • Start an intent from android
  • runOnUiThread (Activity)
  • requestLocationUpdates (LocationManager)
  • getExternalFilesDir (Context)
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • Sublime Text for Python
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now