Package org.eclipse.jface.dialogs

Examples of org.eclipse.jface.dialogs.ErrorDialog


  private void handleOutOfMemoryError(final OutOfMemoryError error) {
    JobRunner.runInUIThread(null, new Runnable() {
      public void run() {
        try {
          ErrorDialog dialog = new ErrorDialog(OwlUI.getPrimaryShell(), Messages.DefaultStatusHandler_ERROR, Messages.DefaultStatusHandler_ERROR_OUT_OF_MEMORY, Activator.getDefault().createErrorStatus(error.getMessage()), IStatus.OK | IStatus.INFO | IStatus.WARNING | IStatus.ERROR) {
            @Override
            protected void createButtonsForButtonBar(Composite parent) {
              createButton(parent, IDialogConstants.OK_ID, IDialogConstants.YES_LABEL, true);
              createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.NO_LABEL, false);
            }
          };

          if (dialog.open() == IDialogConstants.OK_ID)
            emergencyClose();
        }

        /* Serious problem - emergency close */
        catch (Error err) {
View Full Code Here


        // Create the wizard and pre-validate
        final ResolveJob job = new ResolveJob(model);
        IStatus validation = job.validateBeforeRun();
        if (!validation.isOK()) {
            ErrorDialog errorDialog = new ErrorDialog(parentShell, "Validation Problem", null, validation, IStatus.ERROR | IStatus.WARNING) {
                @Override
                protected void createButtonsForButtonBar(Composite parent) {
                    // create OK, Cancel and Details buttons
                    createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, false);
                    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, true);
                    createDetailsButton(parent);
                }
            };
            int response = errorDialog.open();
            if (Window.CANCEL == response || validation.getSeverity() >= IStatus.ERROR)
                return;
        }

        // Add the operation to perform at the end of the resolution job (i.e.,
View Full Code Here

            multi.add(status);
        }

        PlatformGIS.syncInDisplayThread(new Runnable(){
            public void run() {
                Dialog dialog = new ErrorDialog(Display.getDefault().getActiveShell(), Messages.ErrorManager_very_informative_error,
                        m, multi, IStatus.ERROR);
                dialog.open();
            }
        });
    }
View Full Code Here

            multi.add(status);
        }
       
       PlatformGIS.syncInDisplayThread(new Runnable(){
            public void run() {
                Dialog dialog = new ErrorDialog(Display.getDefault().getActiveShell(), Messages.ExceptionDisplayer_very_informative_error, message, multi, IStatus.ERROR);
                dialog.open();
            }
        });
    }
View Full Code Here

    ToolRepositoryException reposEx = new ToolRepositoryException("BoB", "really long error message,\n" +
        "the quick brown fox jumps over the lazy dogs back\n" +
        "message with\n" +
        "multiple lines\n");
    IStatus status = new Status(IStatus.ERROR, ToolPlugin.PLUGIN_ID, "Status message", reposEx);
    ErrorDialog ed = new ErrorDialog(Display.getDefault().getActiveShell(), "Title for Error Dialog", "terse error message", status, 0);
    ed.open();
//    ErrorDialog.openError(Display.getDefault().getActiveShell(), "Title for Error Dialog", "terse error message", status);
  }
View Full Code Here

          new Status(IStatus.ERROR,
              DesignerPlugin.getDefault().toString(),
              IStatus.ERROR,
              "Parse error or internal Designer error.",
              rootCause);
      ErrorDialog dialog =
          new ErrorDialog(
              DesignerPlugin.getShell(),
              "Exception happened",
              "Designer error occurred.\nSelect Details>> for more information.\nSee the Error Log for more information.",
              status, IStatus.ERROR) {
            private Clipboard clipboard;

            @Override
            protected org.eclipse.swt.widgets.List createDropDownList(Composite parent) {
              final org.eclipse.swt.widgets.List list = super.createDropDownList(parent);
              list.removeAll();
              // populate list using custom PrintWriter
              list.add("Plug-in Provider: Google");
              list.add("Plug-in Name: " + BrandingUtils.getBranding().getProductName());
              list.add("Plug-in ID: org.eclipse");
              //list.add("Plug-in Version: " + String.valueOf(product.getVersion()));
              list.add("");
              final PrintWriter printWriter = new PrintWriter(new Writer() {
                @Override
                public void write(char[] cbuf, int off, int len) throws IOException {
                  if (len != 2 && !(cbuf[0] == '\r' || cbuf[0] == '\n')) {
                    list.add(StringUtils.replace(new String(cbuf, off, len), "\t", "    "));
                  }
                }

                @Override
                public void flush() throws IOException {
                }

                @Override
                public void close() throws IOException {
                }
              });
              if (rootCause != null) {
                rootCause.printStackTrace(printWriter);
                list.add("");
                list.add("Full stack trace (to see full context):");
              }
              exception.printStackTrace(printWriter);
              // print config
              list.add("");
              // install own context menu
              Menu menu = list.getMenu();
              menu.dispose();
              Menu copyMenu = new Menu(list);
              MenuItem copyItem = new MenuItem(copyMenu, SWT.NONE);
              copyItem.setText(JFaceResources.getString("copy")); //$NON-NLS-1$
              copyItem.addSelectionListener(new SelectionListener() {
                public void widgetSelected(SelectionEvent e) {
                  copyList(list);
                }

                public void widgetDefaultSelected(SelectionEvent e) {
                  copyList(list);
                }
              });
              list.setMenu(copyMenu);
              return list;
            }

            private void copyList(org.eclipse.swt.widgets.List list) {
              if (clipboard != null) {
                clipboard.dispose();
              }
              StringBuffer statusBuffer = new StringBuffer();
              for (int i = 0; i < list.getItemCount(); ++i) {
                statusBuffer.append(list.getItem(i));
                statusBuffer.append("\r\n");
              }
              clipboard = new Clipboard(list.getDisplay());
              clipboard.setContents(
                  new Object[]{statusBuffer.toString()},
                  new Transfer[]{TextTransfer.getInstance()});
            }

            @Override
            public boolean close() {
              if (clipboard != null) {
                clipboard.dispose();
              }
              return super.close();
            }
          };
      dialog.open();
    }
  }
View Full Code Here

  public void initializeFrom(ILaunchConfiguration configuration) {
    try {
      modelFileText.setText(configuration.getAttribute(ModelLaunchDelegate.VAR_ROOT_MODEL_PATH, ""));
      launchEverythingButton.setEnabled(configuration.getAttribute(ModelLaunchDelegate.VAR_ROOT_LAUNCH_EVERYTHING, true));
    } catch (CoreException e) {
      Dialog d = new ErrorDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell(),
          "Configuration Error", "Error while configuring launch.", new Status(IStatus.ERROR, "q_impress", e.getMessage(), e), 0);
      d.open();
   
   
    dialogChanged();
  }
View Full Code Here

            viewer.update(element, null);
        }
        catch (Exception e)
        {
            PortfolioPlugin.log(e);
            ErrorDialog dialog = new ErrorDialog(Display.getDefault().getActiveShell(), Messages.LabelError,
                            Messages.LabelInputValidationFailed, new Status(Status.ERROR, PortfolioPlugin.PLUGIN_ID,
                                            e.getMessage(), e), IStatus.ERROR);
            dialog.setBlockOnOpen(false);
            dialog.open();
        }
    }
View Full Code Here

      boolean useProjectJar =
          TestNGPlugin.getPluginPreferenceStore().getUseProjectJar(project.getProject().getName());
      String suggestion = useProjectJar
          ? "Uncheck the 'Use Project testng.jar' option from your Project properties and try again."
              : "Make sure you don't have an older version of testng.jar on your class path.";
      new ErrorDialog(m_counterComposite.getShell(), "Couldn't launch TestNG",
          "Couldn't contact the RemoteTestNG client. " + suggestion,
          new StatusInfo(IStatus.ERROR, "Timeout while trying to contact RemoteTestNG."),
          IStatus.ERROR).open();
    }
//    getViewSite().getActionBars().updateActionBars();
View Full Code Here

TOP

Related Classes of org.eclipse.jface.dialogs.ErrorDialog

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.