本文整理了Java中org.eclipse.jdt.core.WorkingCopyOwner.newWorkingCopy()
方法的一些代码示例,展示了WorkingCopyOwner.newWorkingCopy()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WorkingCopyOwner.newWorkingCopy()
方法的具体详情如下:
包路径:org.eclipse.jdt.core.WorkingCopyOwner
类名称:WorkingCopyOwner
方法名:newWorkingCopy
[英]Returns a new working copy with the given name using this working copy owner to create its buffer.
This working copy always belongs to the default package in a package fragment root that corresponds to its Java project, and this Java project never exists. However this Java project has the given classpath that is used when resolving names in this working copy.
If a DOM AST is created using this working copy, then given classpath will be used if bindings need to be resolved. Problems will be reported to the problem requestor of the current working copy owner problem if it is not null
.
Options used to create the DOM AST are got from JavaCore#getOptions()as it is not possible to set the options on a non-existing Java project.
When the working copy instance is created, an IJavaElementDelta#ADDED is reported on this working copy.
Once done with the working copy, users of this method must discard it using ICompilationUnit#discardWorkingCopy().
Note that when such working copy is committed, only its buffer is saved (see IBuffer#save(IProgressMonitor,boolean)) but no resource is created.
This method is not intended to be overriden by clients.
[中]使用此工作副本所有者创建其缓冲区,返回具有给定名称的新工作副本。
该工作副本始终属于对应于其Java项目的包片段根中的默认包,并且该Java项目从不存在。但是,这个Java项目具有给定的类路径,在解析这个工作副本中的名称时使用该类路径。
如果使用这个工作副本创建DOM AST,那么如果需要解析绑定,将使用给定的类路径。如果当前工作副本所有者问题不是[$0$],则问题将报告给问题请求者。
用于创建DOM AST的选项来自JavaCore#getOptions(),因为无法在不存在的Java项目上设置选项。
创建工作副本实例时,会在此工作副本上报告一个ijavalementDelta#ADDED。
使用工作副本后,此方法的用户必须使用ICompilationUnit#discardWorkingCopy()放弃它。
请注意,提交这样的工作副本时,只保存其缓冲区(请参阅IBuffer#save(IProgressMonitor,boolean))但不创建任何资源。
此方法不打算被客户端重写。
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui
cpEntries= new IClasspathEntry[] { JavaRuntime.getDefaultJREContainerEntry() };
final ICompilationUnit cu= woc.newWorkingCopy(storage.getName(), cpEntries, getProgressMonitor());
if (setContents) {
int READER_CHUNK_SIZE= 2048;
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
cpEntries= new IClasspathEntry[] { JavaRuntime.getDefaultJREContainerEntry() };
final ICompilationUnit cu= woc.newWorkingCopy(storage.getName(), cpEntries, getProgressMonitor());
if (setContents) {
int READER_CHUNK_SIZE= 2048;
代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui
cpEntries= new IClasspathEntry[] { JavaRuntime.getDefaultJREContainerEntry() };
final ICompilationUnit cu= woc.newWorkingCopy(storage.getName(), cpEntries, getProgressMonitor());
if (setContents) {
int READER_CHUNK_SIZE= 2048;
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui
cpEntries= new IClasspathEntry[] { JavaRuntime.getDefaultJREContainerEntry() };
final ICompilationUnit cu= woc.newWorkingCopy(fileStoreName, cpEntries, getProgressMonitor());
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
cpEntries= new IClasspathEntry[] { JavaRuntime.getDefaultJREContainerEntry() };
final ICompilationUnit cu= woc.newWorkingCopy(fileStoreName, cpEntries, getProgressMonitor());
代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui
cpEntries= new IClasspathEntry[] { JavaRuntime.getDefaultJREContainerEntry() };
final ICompilationUnit cu= woc.newWorkingCopy(fileStore.getName(), cpEntries, getProgressMonitor());
内容来源于网络,如有侵权,请联系作者删除!