Example usage for org.eclipse.jdt.core WorkingCopyOwner getProblemRequestor

List of usage examples for org.eclipse.jdt.core WorkingCopyOwner getProblemRequestor

Introduction

In this page you can find the example usage for org.eclipse.jdt.core WorkingCopyOwner getProblemRequestor.

Prototype

public IProblemRequestor getProblemRequestor(ICompilationUnit workingCopy) 

Source Link

Document

Returns the problem requestor used by a working copy of this working copy owner.

Usage

From source file:org.eclipse.objectteams.otdt.tests.AbstractJavaModelTests.java

License:Open Source License

public ICompilationUnit getWorkingCopy(String path, String source, WorkingCopyOwner owner)
        throws JavaModelException {
    ICompilationUnit workingCopy = getCompilationUnit(path);
    if (owner != null)
        workingCopy = workingCopy.getWorkingCopy(owner, null/*no progress monitor*/);
    else//from   w w w.  j  a v a2s.  c  om
        workingCopy.becomeWorkingCopy(null/*no progress monitor*/);
    workingCopy.getBuffer().setContents(source);
    if (owner != null) {
        IProblemRequestor problemRequestor = owner.getProblemRequestor(workingCopy);
        if (problemRequestor instanceof ProblemRequestor) {
            ((ProblemRequestor) problemRequestor).initialize(source.toCharArray());
        }
    }
    workingCopy.makeConsistent(null/*no progress monitor*/);
    return workingCopy;
}