List of usage examples for org.eclipse.jdt.core ICompilationUnit getWorkingCopy
ICompilationUnit getWorkingCopy(WorkingCopyOwner owner, IProblemRequestor problemRequestor,
IProgressMonitor monitor) throws JavaModelException;
From source file:org.eclipse.objectteams.otdt.tests.AbstractJavaModelTests.java
License:Open Source License
/** * This method is still necessary when we need to use an owner and a specific problem requestor * (typically while using primary owner). * @deprecated/*from w ww .java 2 s . c o m*/ */ public ICompilationUnit getWorkingCopy(String path, String source, WorkingCopyOwner owner, IProblemRequestor problemRequestor) throws JavaModelException { ICompilationUnit workingCopy = getCompilationUnit(path); if (owner != null) workingCopy = workingCopy.getWorkingCopy(owner, problemRequestor, null/*no progress monitor*/); else workingCopy.becomeWorkingCopy(problemRequestor, null/*no progress monitor*/); workingCopy.getBuffer().setContents(source); if (problemRequestor instanceof ProblemRequestor) ((ProblemRequestor) problemRequestor).initialize(source.toCharArray()); workingCopy.makeConsistent(null/*no progress monitor*/); return workingCopy; }