/** * Logs the given status. The status is distributed to the log listeners * installed on this log and then to the log listeners installed on the platform. * * @see Plugin#getLog() */ public void log(final IStatus status) { // Log to the logger logger.log(PlatformLogWriter.getLog(status), PlatformLogWriter.getLevel(status), status.getMessage(), status.getException()); }
/** * Creates a new exception with the given status object. The message * of the given status is used as the exception message. * * @param status the status object to be associated with this exception */ public CoreException(IStatus status) { super(status.getMessage()); this.status = status; }
/** * Creates a new exception with the given status object. The message * of the given status is used as the exception message. * * @param status the status object to be associated with this exception */ public CoreException(IStatus status) { super(status.getMessage()); this.status = status; }
/** * Returns a message for the given status. * * @param status the status whose message is returned * @return a message for the given status */ protected String getStatusMessage(IStatus status) { return status.getMessage(); }
static public void printChildren(IStatus status, PrintStream output) { IStatus[] children = status.getChildren(); if (children == null || children.length == 0) return; for (int i = 0; i < children.length; i++) { output.println("Contains: " + children[i].getMessage()); //$NON-NLS-1$ Throwable exception = children[i].getException(); if (exception != null) exception.printStackTrace(output); printChildren(children[i], output); } }
@Override public void update(ViewerCell cell) { cell.setText(((IStatus) cell.getElement()).getMessage()); } };
/** * Creates a new exception with the given status object. The message of the * given status is used as the exception message. * * @param status * the status object to be associated with this exception */ public ECFRuntimeException(IStatus status) { super(status.getMessage()); initCause(status.getException()); this.status = status; }
protected void appendLeafs(IStatus status, StringBuilder result) { if (status.isOK()) { return; } result.append(status.getMessage()).append('\n'); IStatus[] children = status.getChildren(); for(IStatus child: children) { appendLeafs(child, result); } }
private void showUnexpectedError(CoreException e) { String message2= Messages.format(ActionMessages.CleanUpAction_UnexpectedErrorMessage, e.getStatus().getMessage()); IStatus status= new Status(IStatus.ERROR, JavaUI.ID_PLUGIN, IStatus.ERROR, message2, null); ErrorDialog.openError(getShell(), getActionName(), null, status); }
private void informUser(IStatus status) { JavaPlugin.log(status); String title= JavaTextMessages.CompletionProposalComputerRegistry_error_dialog_title; String message= status.getMessage(); MessageDialog.openError(JavaPlugin.getActiveWorkbenchShell(), title, message); } }
private void informUser(IStatus status) { JavaPlugin.log(status); String title= JavaTextMessages.CompletionProposalComputerRegistry_error_dialog_title; String message= status.getMessage(); MessageDialog.openError(JavaPlugin.getActiveWorkbenchShell(), title, message); }
public static void log(IStatus status) { FrameworkLog log = Activator.getFrameworkLog(); if (log != null) { log.log(getLog(status)); } else { System.out.println(status.getMessage()); if (status.getException() != null) status.getException().printStackTrace(); } }
private void notifyIfNeededModal(final IRefreshEvent event) { TeamUIPlugin.getStandardDisplay().asyncExec(() -> { String title = (event.getRefreshType() == IRefreshEvent.SCHEDULED_REFRESH ? NLS.bind(TeamUIMessages.RefreshCompleteDialog_4a, new String[] { Utils.getTypeName(participant) }) : NLS.bind(TeamUIMessages.RefreshCompleteDialog_4, new String[] { Utils.getTypeName(participant) })); MessageDialog.openInformation(Utils.getShell(null), title, event.getStatus().getMessage()); }); }
/** * Creates and returns a new Java model exception for this element with the given status. */ public JavaModelException newJavaModelException(IStatus status) { if (status instanceof IJavaModelStatus) return new JavaModelException((IJavaModelStatus) status); else return new JavaModelException(new JavaModelStatus(status.getSeverity(), status.getCode(), status.getMessage())); } /*
protected void assertMoveRequirements(IPath destination, int destinationType, int updateFlags) throws CoreException { IStatus status = checkMoveRequirements(destination, destinationType, updateFlags); if (!status.isOK()) { // this assert is ok because the error cases generated by the // check method above indicate assertion conditions. Assert.isTrue(false, status.getChildren()[0].getMessage()); } }
/** * Logs the given status. The status is distributed to the log listeners * installed on this log and then to the log listeners installed on the platform. * * @see Plugin#getLog() */ @Override public void log(final IStatus status) { // Log to the logger logger.log(PlatformLogWriter.getLog(status), PlatformLogWriter.getLevel(status), status.getMessage(), status.getException()); }
protected void assertMoveRequirements(IPath destination, int destinationType, int updateFlags) throws CoreException { IStatus status = checkMoveRequirements(destination, destinationType, updateFlags); if (!status.isOK()) { // this assert is ok because the error cases generated by the // check method above indicate assertion conditions. Assert.isTrue(false, status.getChildren()[0].getMessage()); } }
private RefactoringStatus checkNewPathValidity() { IContainer c= fType.getCompilationUnit().getResource().getParent(); String notRename= RefactoringCoreMessages.RenameTypeRefactoring_will_not_rename; IStatus status= c.getWorkspace().validateName(getNewElementName(), IResource.FILE); if (status.getSeverity() == IStatus.ERROR) return RefactoringStatus.createWarningStatus(status.getMessage() + ". " + notRename); //$NON-NLS-1$ status= c.getWorkspace().validatePath(createNewPath(getNewElementName()), IResource.FILE); if (status.getSeverity() == IStatus.ERROR) return RefactoringStatus.createWarningStatus(status.getMessage() + ". " + notRename); //$NON-NLS-1$ return new RefactoringStatus(); }
private RefactoringStatus checkNewPathValidity() { IContainer c= fType.getCompilationUnit().getResource().getParent(); String notRename= RefactoringCoreMessages.RenameTypeRefactoring_will_not_rename; IStatus status= c.getWorkspace().validateName(getNewElementName(), IResource.FILE); if (status.getSeverity() == IStatus.ERROR) return RefactoringStatus.createWarningStatus(status.getMessage() + ". " + notRename); //$NON-NLS-1$ status= c.getWorkspace().validatePath(createNewPath(getNewElementName()), IResource.FILE); if (status.getSeverity() == IStatus.ERROR) return RefactoringStatus.createWarningStatus(status.getMessage() + ". " + notRename); //$NON-NLS-1$ return new RefactoringStatus(); }
void logging(IStatus status) { Bundle b = getBundle(status); Logger equinoxLog = logService.getLogger(b, EQUINOX_LOGGER_NAME); equinoxLog.log(getLog(status), getLevel(status), status.getMessage(), status.getException()); }