List of usage examples for org.eclipse.jdt.core WorkingCopyOwner newWorkingCopy
public final ICompilationUnit newWorkingCopy(String name, IClasspathEntry[] classpath, IProgressMonitor monitor) throws JavaModelException
From source file:org.eclipse.objectteams.otdt.tests.AbstractJavaModelTests.java
License:Open Source License
protected ICompilationUnit newExternalWorkingCopy(String name, IClasspathEntry[] classpath, final IProblemRequestor problemRequestor, final String contents) throws JavaModelException { WorkingCopyOwner owner = new WorkingCopyOwner() { public IBuffer createBuffer(ICompilationUnit wc) { IBuffer buffer = super.createBuffer(wc); buffer.setContents(contents); return buffer; }// w ww .j av a 2 s. com public IProblemRequestor getProblemRequestor(ICompilationUnit workingCopy) { return problemRequestor; } }; return owner.newWorkingCopy(name, classpath, null/*no progress monitor*/); }