本文整理了Java中org.eclipse.jface.dialogs.ErrorDialog
类的一些代码示例,展示了ErrorDialog
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ErrorDialog
类的具体详情如下:
包路径:org.eclipse.jface.dialogs.ErrorDialog
类名称:ErrorDialog
[英]A dialog to display one or more errors to the user, as contained in an IStatus
object. If an error contains additional detailed information then a Details button is automatically supplied, which shows or hides an error details viewer when pressed by the user.
This dialog should be considered being a "local" way of error handling. It cannot be changed or replaced by "global" error handling facility ( org.eclipse.ui.statushandler.StatusManager
). If product defines its own way of handling errors, this error dialog may cause UI inconsistency, so until it is absolutely necessary, StatusManager
should be used.
[中]一个对话框,用于向用户显示IStatus
对象中包含的一个或多个错误。如果错误包含其他详细信息,则会自动提供详细信息按钮,当用户按下该按钮时,该按钮会显示或隐藏错误详细信息查看器。
此对话框应被视为错误处理的“本地”方式。它不能被“全局”错误处理工具(org.eclipse.ui.statushandler.StatusManager
更改或替换。如果产品定义了自己处理错误的方式,此错误对话框可能会导致UI不一致,因此在绝对必要之前,应使用StatusManager
。
代码示例来源:origin: net.officefloor.eclipse/net.officefloor.ui
@Override
public void messageStatus(IStatus status, String title) {
ErrorDialog.openError(this.shell, title, null, status);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface
ErrorDialog dialog = new ErrorDialog(parentShell, title, message,
status, displayMask);
return dialog.open();
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface
createMessageArea(composite);
createSupportArea(parent);
GridLayout layout = new GridLayout();
layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
layout.numColumns = 2;
composite.setLayout(layout);
代码示例来源:origin: org.eclipse/org.eclipse.jdt.debug.ui
public void run() {
dialog.open();
}
});
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
@Override
protected Control createMessageArea (Composite parent) {
Control result= super.createMessageArea(parent);
new Label(parent, SWT.NONE); // filler
Label label= new Label(parent, SWT.NONE);
label.setText(RefactoringMessages.ChangeExceptionHandler_message);
label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
applyDialogFont(result);
return result;
}
}
代码示例来源: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.team.ui
public void run() {
ErrorDialog dialog = new ErrorDialog(getShell(), TeamUIMessages.ModelMergeOperation_0, TeamUIMessages.ModelMergeOperation_1, status, IStatus.ERROR | IStatus.WARNING | IStatus.INFO) {
protected void createButtonsForButtonBar(Composite parent) {
createButton(parent, IDialogConstants.YES_ID, IDialogConstants.YES_LABEL,
false);
createButton(parent, IDialogConstants.NO_ID, IDialogConstants.NO_LABEL,
true);
createDetailsButton(parent);
}
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.ErrorDialog#buttonPressed(int)
*/
protected void buttonPressed(int id) {
if (id == IDialogConstants.YES_ID)
super.buttonPressed(IDialogConstants.OK_ID);
else if (id == IDialogConstants.NO_ID)
super.buttonPressed(IDialogConstants.CANCEL_ID);
super.buttonPressed(id);
}
};
int code = dialog.open();
result[0] = code == 0;
}
};
代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui
protected Control createMessageArea (Composite parent) {
Control result= super.createMessageArea(parent);
new Label(parent, SWT.NONE); // filler
Label label= new Label(parent, SWT.NONE);
label.setText(RefactoringMessages.ChangeExceptionHandler_message);
label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
applyDialogFont(result);
return result;
}
}
代码示例来源:origin: org.eclipse/org.eclipse.wst.server.ui
/**
* Open a dialog window.
*
* @param shell a shell
* @param message a message
* @param status a status
*/
public static void openError(Shell shell, String message, IStatus status) {
ErrorDialog.openError(shell, Messages.errorDialogTitle, message, status);
}
代码示例来源: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.team.ui
int code = dialog.open();
result[0] = code == 0;
};
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface
createMessageArea(composite);
createSupportArea(parent);
GridLayout layout = new GridLayout();
layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
layout.numColumns = 2;
composite.setLayout(layout);
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui
@Override
protected Control createMessageArea (Composite parent) {
Control result= super.createMessageArea(parent);
new Label(parent, SWT.NONE); // filler
Label label= new Label(parent, SWT.NONE);
label.setText(RefactoringMessages.ChangeExceptionHandler_message);
label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
applyDialogFont(result);
return result;
}
}
代码示例来源:origin: org.eclipse/org.eclipse.wst.server.ui
protected static boolean validateEdit(Shell shell, IStatus status) {
if (status != null && status.getSeverity() == IStatus.ERROR) {
// inform user
String message = Messages.editorValidateEditFailureMessage;
ErrorDialog.openError(shell, Messages.errorDialogTitle, message, status);
// do not execute command
return false;
}
return true;
}
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface
ErrorDialog dialog = new ErrorDialog(parentShell, title, message,
status, displayMask);
return dialog.open();
代码示例来源:origin: org.eclipse.platform/org.eclipse.team.ui
int code = dialog.open();
result[0] = code == 0;
};
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.jface
createMessageArea(composite);
createSupportArea(parent);
GridLayout layout = new GridLayout();
layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
layout.numColumns = 2;
composite.setLayout(layout);
代码示例来源:origin: org.eclipse/org.eclipse.ltk.ui.refactoring
protected Control createMessageArea (Composite parent) {
Control result= super.createMessageArea(parent);
new Label(parent, SWT.NONE); // filler
Label label= new Label(parent, SWT.NONE);
label.setText(RefactoringUIMessages.ChangeExceptionHandler_button_explanation);
label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
applyDialogFont(result);
return result;
}
}
代码示例来源:origin: net.sourceforge.eclipsejaas/net.sourceforge.eclipsejaas
private void reportStatus(Display display, IStatus status)
{
String title = (status.getSeverity() >= IStatus.ERROR) ? "Error" : "Warning";
ErrorDialog.openError(null, title, null, status);
}
代码示例来源: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();
}
内容来源于网络,如有侵权,请联系作者删除!