Search in sources :

Example 6 with Status

use of org.eclipse.core.runtime.Status in project che by eclipse.

the class MultiStateUndoChange method isValid.

/**
	 * {@inheritDoc}
	 */
public RefactoringStatus isValid(IProgressMonitor pm) throws CoreException {
    if (pm == null)
        pm = new NullProgressMonitor();
    //$NON-NLS-1$
    pm.beginTask("", 1);
    try {
        if (fValidationState == null)
            //$NON-NLS-1$
            throw new CoreException(new Status(IStatus.ERROR, RefactoringCorePlugin.getPluginId(), "MultiStateUndoChange has not been initialialized"));
        ITextFileBuffer buffer = FileBuffers.getTextFileBufferManager().getTextFileBuffer(fFile.getFullPath(), LocationKind.IFILE);
        fDirty = buffer != null && buffer.isDirty();
        return fValidationState.isValid(needsSaving(), true);
    } finally {
        pm.done();
    }
}
Also used : Status(org.eclipse.core.runtime.Status) IStatus(org.eclipse.core.runtime.IStatus) RefactoringStatus(org.eclipse.ltk.core.refactoring.RefactoringStatus) NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) CoreException(org.eclipse.core.runtime.CoreException) ITextFileBuffer(org.eclipse.core.filebuffers.ITextFileBuffer)

Example 7 with Status

use of org.eclipse.core.runtime.Status in project che by eclipse.

the class RefactoringCorePlugin method logRemovedListener.

public static void logRemovedListener(Throwable t) {
    IStatus status = new Status(IStatus.ERROR, getPluginId(), IRefactoringCoreStatusCodes.INTERNAL_ERROR, RefactoringCoreMessages.RefactoringCorePlugin_listener_removed, t);
    log(status);
}
Also used : Status(org.eclipse.core.runtime.Status) IStatus(org.eclipse.core.runtime.IStatus) IStatus(org.eclipse.core.runtime.IStatus)

Example 8 with Status

use of org.eclipse.core.runtime.Status in project che by eclipse.

the class RefactoringCorePlugin method logRemovedParticipant.

public static void logRemovedParticipant(ParticipantDescriptor descriptor, Throwable t) {
    IStatus status = new Status(IStatus.ERROR, getPluginId(), IRefactoringCoreStatusCodes.PARTICIPANT_DISABLED, Messages.format(RefactoringCoreMessages.RefactoringCorePlugin_participant_removed, descriptor.getId()), t);
    log(status);
}
Also used : Status(org.eclipse.core.runtime.Status) IStatus(org.eclipse.core.runtime.IStatus) IStatus(org.eclipse.core.runtime.IStatus)

Example 9 with Status

use of org.eclipse.core.runtime.Status in project che by eclipse.

the class UndoManager2 method performRedo.

public void performRedo(IValidationCheckResultQuery query, IProgressMonitor pm) throws CoreException {
    IUndoableOperation redo = fOperationHistory.getRedoOperation(RefactoringCorePlugin.getUndoContext());
    UndoableOperation2ChangeAdapter changeOperation = getUnwrappedOperation(redo);
    if (changeOperation == null)
        throw new CoreException(new Status(IStatus.ERROR, RefactoringCorePlugin.getPluginId(), IStatus.ERROR, RefactoringCoreMessages.UndoManager2_no_change, null));
    if (query == null)
        query = new NullQuery();
    try {
        fOperationHistory.redoOperation(redo, pm, new QueryAdapter(query));
    } catch (ExecutionException e) {
        handleException(e);
    }
}
Also used : Status(org.eclipse.core.runtime.Status) IStatus(org.eclipse.core.runtime.IStatus) RefactoringStatus(org.eclipse.ltk.core.refactoring.RefactoringStatus) CoreException(org.eclipse.core.runtime.CoreException) IUndoableOperation(org.eclipse.core.commands.operations.IUndoableOperation) ExecutionException(org.eclipse.core.commands.ExecutionException)

Example 10 with Status

use of org.eclipse.core.runtime.Status in project che by eclipse.

the class UndoManager2 method performUndo.

public void performUndo(IValidationCheckResultQuery query, IProgressMonitor pm) throws CoreException {
    IUndoableOperation undo = fOperationHistory.getUndoOperation(RefactoringCorePlugin.getUndoContext());
    UndoableOperation2ChangeAdapter changeOperation = getUnwrappedOperation(undo);
    if (changeOperation == null)
        throw new CoreException(new Status(IStatus.ERROR, RefactoringCorePlugin.getPluginId(), IStatus.ERROR, RefactoringCoreMessages.UndoManager2_no_change, null));
    if (query == null)
        query = new NullQuery();
    try {
        fOperationHistory.undoOperation(undo, pm, new QueryAdapter(query));
    } catch (ExecutionException e) {
        handleException(e);
    }
}
Also used : Status(org.eclipse.core.runtime.Status) IStatus(org.eclipse.core.runtime.IStatus) RefactoringStatus(org.eclipse.ltk.core.refactoring.RefactoringStatus) CoreException(org.eclipse.core.runtime.CoreException) IUndoableOperation(org.eclipse.core.commands.operations.IUndoableOperation) ExecutionException(org.eclipse.core.commands.ExecutionException)

Aggregations

Status (org.eclipse.core.runtime.Status)305 IStatus (org.eclipse.core.runtime.IStatus)282 CoreException (org.eclipse.core.runtime.CoreException)132 IOException (java.io.IOException)66 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)64 InvocationTargetException (java.lang.reflect.InvocationTargetException)40 File (java.io.File)38 ArrayList (java.util.ArrayList)37 IFile (org.eclipse.core.resources.IFile)37 MultiStatus (org.eclipse.core.runtime.MultiStatus)30 IResource (org.eclipse.core.resources.IResource)27 IRunnableWithProgress (org.eclipse.jface.operation.IRunnableWithProgress)26 IProject (org.eclipse.core.resources.IProject)24 IPath (org.eclipse.core.runtime.IPath)24 ITask (com.cubrid.common.core.task.ITask)23 PartInitException (org.eclipse.ui.PartInitException)23 InputStream (java.io.InputStream)18 GridData (org.eclipse.swt.layout.GridData)17 GridLayout (org.eclipse.swt.layout.GridLayout)17 Composite (org.eclipse.swt.widgets.Composite)16