/** * Creates a Java model exception for the given <code>CoreException</code>. * Equivalent to * <code>JavaModelException(exception,IJavaModelStatusConstants.CORE_EXCEPTION</code>. * * @param exception the <code>CoreException</code> */ public JavaModelException(CoreException exception) { super(exception.getStatus()); this.nestedCoreException = exception; } /**
/** * Creates a Java model exception for the given <code>CoreException</code>. * Equivalent to * <code>JavaModelException(exception,IJavaModelStatusConstants.CORE_EXCEPTION</code>. * * @param exception the <code>CoreException</code> */ public JavaModelException(CoreException exception) { super(exception.getStatus()); this.nestedCoreException = exception; } /**
@Override protected IStatus run(IProgressMonitor monitor) { try { convertClasspathToModulePath(monitor); } catch (CoreException e) { return e.getStatus(); } return Status.OK_STATUS; } }.schedule();
public static IStatus toStatus(InvocationTargetException e) { Throwable t = e.getCause(); if(t instanceof CoreException) { return ((CoreException) t).getStatus(); } return new Status(IStatus.ERROR, M2EUIPluginActivator.PLUGIN_ID, t.getMessage(), t); }
public IStructureCreator createStructureCreator() { try { return (IStructureCreator)fElement.createExecutableExtension(CLASS_ATTRIBUTE); } catch (CoreException ex) { CompareUIPlugin.log(ex.getStatus()); //ExceptionHandler.handle(ex, SearchMessages.getString("Search.Error.createSorter.title"), SearchMessages.getString("Search.Error.createSorter.message")); //$NON-NLS-2$ //$NON-NLS-1$ return null; } catch (ClassCastException ex) { //ExceptionHandler.displayMessageDialog(ex, SearchMessages.getString("Search.Error.createSorter.title"), SearchMessages.getString("Search.Error.createSorter.message")); //$NON-NLS-2$ //$NON-NLS-1$ return null; } }
public static void log(Throwable e) { if (e instanceof InvocationTargetException) e = ((InvocationTargetException) e).getTargetException(); IStatus status = null; if (e instanceof CoreException) { status = ((CoreException) e).getStatus(); } else if (e.getMessage() != null) { status = new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, e .getMessage(), e); } log(status); }
/** * Logs a CoreException */ private void log(CoreException e) { //create a new status to wrap the exception if there is no exception in the status IStatus status = e.getStatus(); if (status.getException() == null) status = new Status(IStatus.ERROR, ResourcesPlugin.PI_RESOURCES, IResourceStatus.FAILED_WRITE_METADATA, "Internal error in history store", e); //$NON-NLS-1$ Policy.log(status); }
/** * Log the given CoreException in a manner that will include the stacktrace of * the exception in the log. * @param e the exception */ public static void log(CoreException e) { log(e.getStatus().getSeverity(), e.getMessage(), e); }
/** * Defines the standard procedure to handle <code>CoreExceptions</code>. Exceptions * are written to the plug-in log. * * @param exception the exception to be logged */ protected void handleCoreException(CoreException exception) { ILog log= FileBuffersPlugin.getDefault().getLog(); log.log(exception.getStatus()); }
protected void showError(CoreException e, Shell shell, String title, String message) { IStatus status= e.getStatus(); if (status != null) { ErrorDialog.openError(shell, message, title, status); } else { MessageDialog.openError(shell, title, message); } }
/** * Show an error dialog on the given exception. * * @param exception the exception to show in the dialog */ protected void errorDialog(CoreException exception) { ErrorDialog.openError(getShell(), null, null, exception.getStatus()); }
@Override public boolean isNotSynchronizedException(Object element, CoreException ex) { IStatus status= ex.getStatus(); if (status == null || status instanceof MultiStatus) return false; if (status.getException() != null) return false; return status.getCode() == IResourceStatus.OUT_OF_SYNC_LOCAL; }
public IStatus runInWorkspace(IProgressMonitor monitor) { try { MavenPlugin.getProjectConfigurationManager().updateProjectConfiguration(project, monitor); } catch(CoreException ex) { return ex.getStatus(); } return Status.OK_STATUS; } };
protected boolean copyProperties(Resource target, Resource destination) { try { target.getPropertyManager().copy(target, destination, IResource.DEPTH_ZERO); return true; } catch (CoreException e) { status.add(e.getStatus()); return false; } }
@Override public void handleException(Throwable exception) { if (exception instanceof CoreException) errors.add(((CoreException) exception).getStatus()); else errors.add(new ResourceStatus(IResourceStatus.INTERNAL_ERROR, project.getFullPath(), NLS.bind(Messages.resources_errorNature, natureID), exception)); } };
private void registerContentType(IConfigurationElement contentTypeCE) { try { ContentType contentType = createContentType(contentTypeCE); catalog.addContentType(contentType); } catch (CoreException e) { // failed validation RuntimeLog.log(e.getStatus()); } }
public boolean performAction() { try { NewSearchUI.runQueryInBackground(newQuery()); } catch (CoreException e) { ErrorDialog.openError(getShell(), SearchMessages.TextSearchPage_replace_searchproblems_title, SearchMessages.TextSearchPage_replace_searchproblems_message, e.getStatus()); return false; } return true; }
protected void perform(CoreException e, Shell shell, String title, String message) { IStatus status= e.getStatus(); JDIDebugUIPlugin.log(e); if (status != null) { ErrorDialog.openError(shell, title, message, status); } else { displayMessageDialog(e.getMessage(), shell, title, message); } }
@Override protected void initializeFileBufferContent(IProgressMonitor monitor) throws CoreException { try { fDocument= fManager.createEmptyDocument(getLocationOrName(), LocationKind.LOCATION); cacheEncodingState(); setDocumentContent(fDocument, fFileStore, fEncoding, fHasBOM, monitor); } catch (CoreException x) { fDocument= fManager.createEmptyDocument(getLocationOrName(), LocationKind.LOCATION); fStatus= x.getStatus(); } }
protected void initializeFileBufferContent(IProgressMonitor monitor) throws CoreException { try { fDocument= fManager.createEmptyDocument(getLocationOrName(), LocationKind.LOCATION); cacheEncodingState(monitor); setDocumentContent(fDocument, fFileStore, fEncoding, fHasBOM, monitor); } catch (CoreException x) { fDocument= fManager.createEmptyDocument(getLocationOrName(), LocationKind.LOCATION); fStatus= x.getStatus(); } }