Example usage for org.eclipse.jdt.internal.core.util Messages operation_cancelled

List of usage examples for org.eclipse.jdt.internal.core.util Messages operation_cancelled

Introduction

In this page you can find the example usage for org.eclipse.jdt.internal.core.util Messages operation_cancelled.

Prototype

String operation_cancelled

To view the source code for org.eclipse.jdt.internal.core.util Messages operation_cancelled.

Click Source Link

Usage

From source file:org.eclipse.ajdt.core.parserbridge.AJSourceElementParser2.java

License:Open Source License

public CompilationUnitDeclaration parseCompilationUnit(ICompilationUnit unit, boolean fullParse,
        IProgressMonitor pm) {//w w  w. ja v  a 2  s.co m

    boolean old = diet;
    CompilationUnitDeclaration parsedUnit = null;
    try {
        diet = true;
        this.reportReferenceInfo = fullParse;
        CompilationResult compilationUnitResult = new CompilationResult(unit, 0, 0,
                this.options.maxProblemsPerUnit);
        parsedUnit = parse(unit, compilationUnitResult);
        if (pm != null && pm.isCanceled())
            throw new OperationCanceledException(Messages.operation_cancelled);
        if (scanner.recordLineSeparator) {
            requestor.acceptLineSeparatorPositions(compilationUnitResult.getLineSeparatorPositions());
        }
        int initialStart = this.scanner.initialPosition;
        int initialEnd = this.scanner.eofPosition;
        if (this.reportLocalDeclarations || fullParse) {
            diet = false;
            this.getMethodBodies(parsedUnit);
        }
        this.scanner.resetTo(initialStart, initialEnd);
        this.notifier.notifySourceElementRequestor(parsedUnit, this.scanner.initialPosition,
                this.scanner.eofPosition, this.reportReferenceInfo, this.sourceEnds, this.nodesToCategories);
        return parsedUnit;
    } catch (AbortCompilation e) {
        // ignore this exception
    } finally {
        diet = old;
        reset();
    }
    return parsedUnit;
}