org.eclipse.jface.dialogs.ErrorDialog.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(7.8k)|赞(0)|评价(0)|浏览(135)

本文整理了Java中org.eclipse.jface.dialogs.ErrorDialog.<init>()方法的一些代码示例,展示了ErrorDialog.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ErrorDialog.<init>()方法的具体详情如下:
包路径:org.eclipse.jface.dialogs.ErrorDialog
类名称:ErrorDialog
方法名:<init>

ErrorDialog.<init>介绍

[英]Creates an error dialog. Note that the dialog will have no visual representation (no widgets) until it is told to open.

Normally one should use openError to create and open one of these. This constructor is useful only if the error object being displayed contains child items and you need to specify a mask which will be used to filter the displaying of these children. The error dialog will only be displayed if there is at least one child status matching the mask.
[中]创建一个错误对话框。请注意,对话框在被告知打开之前将没有可视表示(没有小部件)。
通常应使用openError创建并打开其中一个。仅当显示的错误对象包含子项并且需要指定用于筛选这些子项显示的掩码时,此构造函数才有用。仅当至少有一个子状态与掩码匹配时,才会显示错误对话框。

代码示例

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.jface

ErrorDialog dialog = new ErrorDialog(parentShell, title, message,
    status, displayMask);
return dialog.open();

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface

ErrorDialog dialog = new ErrorDialog(parentShell, title, message,
    status, displayMask);
return dialog.open();

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface

ErrorDialog dialog = new ErrorDialog(parentShell, title, message,
    status, displayMask);
return dialog.open();

代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui

private void handleFinishedDropMove(DragSourceEvent event) {
    MultiStatus status= new MultiStatus(
      JavaPlugin.getPluginId(), 
      IJavaStatusConstants.INTERNAL_ERROR, 
      JavaUIMessages.ResourceTransferDragAdapter_cannot_delete_resource,  
      null);
    List resources= convertSelection();
    for (Iterator iter= resources.iterator(); iter.hasNext();) {
      IResource resource= (IResource) iter.next();
      try {
        resource.delete(true, null);
      } catch (CoreException e) {
        status.add(e.getStatus());
      }
    }
    if (status.getChildren().length > 0) {
      Shell parent= SWTUtil.getShell(event.widget);
      ErrorDialog error= new ErrorDialog(parent, 
        JavaUIMessages.ResourceTransferDragAdapter_moving_resource,  
        JavaUIMessages.ResourceTransferDragAdapter_cannot_delete_files,  
        status, IStatus.ERROR);
      error.open();
    }
  }
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui

private void handleFinishedDropMove(DragSourceEvent event) {
    MultiStatus status= new MultiStatus(
      JavaPlugin.getPluginId(),
      IJavaStatusConstants.INTERNAL_ERROR,
      JavaUIMessages.ResourceTransferDragAdapter_cannot_delete_resource,
      null);
    List<IResource> resources= convertSelection();
    for (Iterator<IResource> iter= resources.iterator(); iter.hasNext();) {
      IResource resource= iter.next();
      try {
        resource.delete(true, null);
      } catch (CoreException e) {
        status.add(e.getStatus());
      }
    }
    int childrenCount= status.getChildren().length;
    if (childrenCount > 0) {
      Shell parent= SWTUtil.getShell(event.widget);
      ErrorDialog error= new ErrorDialog(parent,
          JavaUIMessages.ResourceTransferDragAdapter_moving_resource,
          childrenCount == 1 ? JavaUIMessages.ResourceTransferDragAdapter_cannot_delete_files_singular : Messages.format(
              JavaUIMessages.ResourceTransferDragAdapter_cannot_delete_files_plural, String.valueOf(childrenCount)), status, IStatus.ERROR);
      error.open();
    }
  }
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

private void handleFinishedDropMove(DragSourceEvent event) {
    MultiStatus status= new MultiStatus(
      JavaPlugin.getPluginId(),
      IJavaStatusConstants.INTERNAL_ERROR,
      JavaUIMessages.ResourceTransferDragAdapter_cannot_delete_resource,
      null);
    List<IResource> resources= convertSelection();
    for (Iterator<IResource> iter= resources.iterator(); iter.hasNext();) {
      IResource resource= iter.next();
      try {
        resource.delete(true, null);
      } catch (CoreException e) {
        status.add(e.getStatus());
      }
    }
    int childrenCount= status.getChildren().length;
    if (childrenCount > 0) {
      Shell parent= SWTUtil.getShell(event.widget);
      ErrorDialog error= new ErrorDialog(parent,
          JavaUIMessages.ResourceTransferDragAdapter_moving_resource,
          childrenCount == 1 ? JavaUIMessages.ResourceTransferDragAdapter_cannot_delete_files_singular : Messages.format(
              JavaUIMessages.ResourceTransferDragAdapter_cannot_delete_files_plural, String.valueOf(childrenCount)), status, IStatus.ERROR);
      error.open();
    }
  }
}

代码示例来源:origin: org.eclipse/org.eclipse.jdt.debug.ui

/**
   * @see IStatusHandler#handleStatus(IStatus, Object)
   */
  public Object handleStatus(IStatus status, Object source) throws CoreException {
    IJavaThread thread= (IJavaThread) source;
    final ErrorDialog dialog= new ErrorDialog(JDIDebugUIPlugin.getActiveWorkbenchShell(), DebugUIMessages.SuspendTimeoutHandler_suspend, MessageFormat.format(DebugUIMessages.SuspendTimeoutHandler_timeout_occurred, new String[] {thread.getName()}), status, IStatus.WARNING | IStatus.ERROR | IStatus.INFO); // 
    Display display= JDIDebugUIPlugin.getStandardDisplay();
    display.syncExec(new Runnable() {
      public void run() {
        dialog.open();
      }
    });
    return null;
  }
}

代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui

private void handle(Change change, IStatus status) {
  if (change instanceof CompositeChange) {
    Change undo= ((CompositeChange)change).getUndoUntilException();
    if (undo != null) {
      JavaPlugin.log(status);
      final ErrorDialog dialog= new RefactorErrorDialog(fParent,
        RefactoringMessages.ChangeExceptionHandler_dialog_title, 
        Messages.format(RefactoringMessages.ChangeExceptionHandler_dialog_message, fName), 
        status, IStatus.OK | IStatus.INFO | IStatus.WARNING | IStatus.ERROR); 
      int result= dialog.open();
      if (result == IDialogConstants.OK_ID) {
        performUndo(undo);
      }
      return;
    }
  }
  ErrorDialog dialog= new ErrorDialog(fParent,
    RefactoringMessages.ChangeExceptionHandler_dialog_title, 
    Messages.format(RefactoringMessages.ChangeExceptionHandler_dialog_message, fName), 
    status, IStatus.OK | IStatus.INFO | IStatus.WARNING | IStatus.ERROR); 
  dialog.open();
}

代码示例来源:origin: org.eclipse/org.eclipse.ltk.ui.refactoring

private void handle(Change change, IStatus status) {
  if (change instanceof CompositeChange) {
    Change undo= ((CompositeChange)change).getUndoUntilException();
    if (undo != null) {
      RefactoringUIPlugin.log(status);
      final ErrorDialog dialog= new RefactorErrorDialog(fParent,
        RefactoringUIMessages.ChangeExceptionHandler_refactoring, 
        Messages.format(RefactoringUIMessages.ChangeExceptionHandler_unexpected_exception, fName), 
        status, IStatus.OK | IStatus.INFO | IStatus.WARNING | IStatus.ERROR); 
      int result= dialog.open();
      if (result == IDialogConstants.OK_ID) {
        performUndo(undo);
      }
      return;
    }
  }
  ErrorDialog dialog= new ErrorDialog(fParent,
    RefactoringUIMessages.ChangeExceptionHandler_refactoring, 
    Messages.format(RefactoringUIMessages.ChangeExceptionHandler_unexpected_exception, fName), 
    status, IStatus.OK | IStatus.INFO | IStatus.WARNING | IStatus.ERROR); 
  dialog.open();
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

private void handle(Change change, IStatus status) {
  if (change instanceof CompositeChange) {
    Change undo= ((CompositeChange)change).getUndoUntilException();
    if (undo != null) {
      JavaPlugin.log(status);
      final ErrorDialog dialog= new RefactorErrorDialog(fParent,
          change.getName(),
          Messages.format(RefactoringMessages.ChangeExceptionHandler_dialog_message, fName),
          status, IStatus.OK | IStatus.INFO | IStatus.WARNING | IStatus.ERROR);
      int result= dialog.open();
      if (result == IDialogConstants.OK_ID) {
        performUndo(undo);
      }
      return;
    }
  }
  ErrorDialog dialog= new ErrorDialog(fParent,
      change.getName(),
      Messages.format(RefactoringMessages.ChangeExceptionHandler_dialog_message, fName),
      status, IStatus.OK | IStatus.INFO | IStatus.WARNING | IStatus.ERROR);
  dialog.open();
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui

private void handle(Change change, IStatus status) {
  if (change instanceof CompositeChange) {
    Change undo= ((CompositeChange)change).getUndoUntilException();
    if (undo != null) {
      JavaPlugin.log(status);
      final ErrorDialog dialog= new RefactorErrorDialog(fParent,
          change.getName(),
          Messages.format(RefactoringMessages.ChangeExceptionHandler_dialog_message, fName),
          status, IStatus.OK | IStatus.INFO | IStatus.WARNING | IStatus.ERROR);
      int result= dialog.open();
      if (result == IDialogConstants.OK_ID) {
        performUndo(undo);
      }
      return;
    }
  }
  ErrorDialog dialog= new ErrorDialog(fParent,
      change.getName(),
      Messages.format(RefactoringMessages.ChangeExceptionHandler_dialog_message, fName),
      status, IStatus.OK | IStatus.INFO | IStatus.WARNING | IStatus.ERROR);
  dialog.open();
}

相关文章