List of usage examples for org.eclipse.jdt.core WorkingCopyOwner getProblemRequestor
public IProblemRequestor getProblemRequestor(ICompilationUnit workingCopy)
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; }