use of org.eclipse.core.runtime.MultiStatus in project xtext-eclipse by eclipse.
the class CompositeSearchQuery method run.
@Override
public IStatus run(IProgressMonitor monitor) throws OperationCanceledException {
SubMonitor progress = SubMonitor.convert(monitor, children.size());
MultiStatus multiStatus = new MultiStatus(getPluginId(), IStatus.OK, "Composite search state", null);
for (ISearchQuery child : children) {
IStatus status = child.run(progress.newChild(1));
multiStatus.add(status);
if (progress.isCanceled()) {
return Status.CANCEL_STATUS;
}
}
return multiStatus;
}
use of org.eclipse.core.runtime.MultiStatus in project eclipse.platform.text by eclipse.
the class EditorsPlugin method logErrorStatus.
public static void logErrorStatus(String message, IStatus status) {
if (status == null) {
logErrorMessage(message);
return;
}
MultiStatus multi = new MultiStatus(EditorsUI.PLUGIN_ID, IEditorsStatusConstants.INTERNAL_ERROR, message, null);
multi.add(status);
log(multi);
}
use of org.eclipse.core.runtime.MultiStatus in project eclipse.platform.text by eclipse.
the class FileDocumentProvider method doValidateState.
@Override
protected void doValidateState(Object element, Object computationContext) throws CoreException {
if (element instanceof IFileEditorInput) {
IFileEditorInput input = (IFileEditorInput) element;
FileInfo info = (FileInfo) getElementInfo(input);
if (info != null) {
IFile file = input.getFile();
if (file.isReadOnly()) {
// do not use cached state here
IWorkspace workspace = file.getWorkspace();
info.fStatus = workspace.validateEdit(new IFile[] { file }, computationContext);
}
if (isDerived(file)) {
IStatus status = new Status(IStatus.WARNING, EditorsUI.PLUGIN_ID, EditorsUI.DERIVED_FILE, TextEditorMessages.FileDocumentProvider_warning_fileIsDerived, null);
if (info.fStatus == null || info.fStatus.isOK())
info.fStatus = status;
else
info.fStatus = new MultiStatus(EditorsUI.PLUGIN_ID, EditorsUI.STATE_VALIDATION_FAILED, new IStatus[] { info.fStatus, status }, TextEditorMessages.FileDocumentProvider_stateValidationFailed, null);
}
}
}
super.doValidateState(element, computationContext);
}
use of org.eclipse.core.runtime.MultiStatus in project linuxtools by eclipse.
the class MassifLaunchDelegate method abort.
/**
* Throws a core exception with an error status object built from the given
* message, lower level exception, and error code.
*
* @param message
* the status message
* @param exception
* lower level exception associated with the error, or
* <code>null</code> if none
* @param code
* error code
*/
private void abort(String message, Throwable exception, int code) throws CoreException {
IStatus status;
if (exception != null) {
MultiStatus multiStatus = new MultiStatus(MassifPlugin.PLUGIN_ID, code, message, exception);
multiStatus.add(new Status(IStatus.ERROR, MassifPlugin.PLUGIN_ID, code, exception.getLocalizedMessage(), exception));
status = multiStatus;
} else {
status = new Status(IStatus.ERROR, MassifPlugin.PLUGIN_ID, code, message, null);
}
throw new CoreException(status);
}
use of org.eclipse.core.runtime.MultiStatus in project linuxtools by eclipse.
the class CachegrindLaunchDelegate method abort.
/**
* Throws a core exception with an error status object built from the given
* message, lower level exception, and error code.
*
* @param message
* the status message
* @param exception
* lower level exception associated with the error, or
* <code>null</code> if none
* @param code
* error code
*/
private void abort(String message, Throwable exception, int code) throws CoreException {
IStatus status;
if (exception != null) {
MultiStatus multiStatus = new MultiStatus(CachegrindPlugin.PLUGIN_ID, code, message, exception);
multiStatus.add(new Status(IStatus.ERROR, CachegrindPlugin.PLUGIN_ID, code, exception.getLocalizedMessage(), exception));
status = multiStatus;
} else {
status = new Status(IStatus.ERROR, CachegrindPlugin.PLUGIN_ID, code, message, null);
}
throw new CoreException(status);
}
Aggregations