org.eclipse.jdt.core.WorkingCopyOwner类的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(8.1k)|赞(0)|评价(0)|浏览(73)

本文整理了Java中org.eclipse.jdt.core.WorkingCopyOwner类的一些代码示例,展示了WorkingCopyOwner类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WorkingCopyOwner类的具体详情如下:
包路径:org.eclipse.jdt.core.WorkingCopyOwner
类名称:WorkingCopyOwner

WorkingCopyOwner介绍

[英]The owner of an ICompilationUnit handle in working copy mode. An owner is used to identify a working copy and to create its buffer.

Clients should subclass this class to instantiate a working copy owner that is specific to their need and that they can pass in to various APIs (e.g. IType#resolveType(String,WorkingCopyOwner). Clients can also override the default implementation of #createBuffer(ICompilationUnit).

Note: even though this class has no abstract method, which means that it provides functional default behavior, it is still an abstract class, as clients are intended to own their owner implementation.
[中]工作复制模式下ICompilationUnit句柄的所有者。所有者用于标识工作副本并创建其缓冲区。
客户机应该将这个类子类化,以实例化一个工作副本所有者,该所有者是特定于他们的需求的,并且他们可以传递到各种API(例如IType#resolveType(String,WorkingCopyOwner))。客户端还可以覆盖#createBuffer(ICompilationUnit)的默认实现。
注意:尽管这个类没有抽象方法,这意味着它提供了功能默认行为,但它仍然是一个抽象类,因为客户机打算拥有自己的所有者实现。

代码示例

代码示例来源:origin: org.eclipse.tycho/org.eclipse.jdt.core

public IBuffer createBuffer(ICompilationUnit workingCopy) {
  if (this.primaryBufferProvider != null) return this.primaryBufferProvider.createBuffer(workingCopy);
  return super.createBuffer(workingCopy);
}
public String toString() {

代码示例来源:origin: org.eclipse.tycho/org.eclipse.jdt.core

public IProblemRequestor getProblemRequestor() {
  if (this.problemRequestor == null && this.workingCopy.owner != null) {
    return this.workingCopy.owner.getProblemRequestor(this.workingCopy);
  }
  return this.problemRequestor;
}
public ICompilationUnit getWorkingCopy() {

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core

/**
 * @see org.eclipse.jdt.internal.compiler.env.INameEnvironment#isPackage(char[][], char[])
 */
public boolean isPackage(char[][] parentPackageName, char[] subPackageName) {
  String[] pkgName;
  if (parentPackageName == null)
    pkgName = new String[] {new String(subPackageName)};
  else {
    int length = parentPackageName.length;
    pkgName = new String[length+1];
    for (int i = 0; i < length; i++)
      pkgName[i] = new String(parentPackageName[i]);
    pkgName[length] = new String(subPackageName);
  }
  return 
    (this.owner != null && this.owner.isPackage(pkgName))
    || this.nameLookup.isPackage(pkgName);
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core

packageName = IPackageFragment.DEFAULT_PACKAGE_NAME;
if (this.owner != null) {
  String source = this.owner.findSource(typeName, packageName);
  if (source != null) {
    IJavaElement moduleElement = (moduleContext != null && moduleContext.length > 0) ? moduleContext[0] : null;

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

fDebugRegistration= context.registerService(DebugOptionsListener.class, this, properties);
WorkingCopyOwner.setPrimaryBufferProvider(new WorkingCopyOwner() {
  @Override
  public IBuffer createBuffer(ICompilationUnit workingCopy) {

代码示例来源: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.tycho/org.eclipse.jdt.core

packageName = IPackageFragment.DEFAULT_PACKAGE_NAME;
if (this.owner != null) {
  String source = this.owner.findSource(typeName, packageName);
  if (source != null) {
    IJavaElement moduleElement = (moduleContext != null && moduleContext.length > 0) ? moduleContext[0] : null;

代码示例来源:origin: eclipse/eclipse.jdt.ls

public void connectClient(JavaLanguageClient client) {
  this.client = new JavaClientConnection(client);
  progressReporterManager = new ProgressReporterManager(client, preferenceManager);
  Job.getJobManager().setProgressProvider(progressReporterManager);
  this.workingCopyOwner = new LanguageServerWorkingCopyOwner(this.client);
  pm.setConnection(client);
  WorkingCopyOwner.setPrimaryBufferProvider(this.workingCopyOwner);
  this.documentLifeCycleHandler = new DocumentLifeCycleHandler(this.client, preferenceManager, pm, true);
}

代码示例来源: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.scout.sdk.deps/org.eclipse.jdt.core

public IProblemRequestor getProblemRequestor() {
  if (this.problemRequestor == null && this.workingCopy.owner != null) {
    return this.workingCopy.owner.getProblemRequestor(this.workingCopy);
  }
  return this.problemRequestor;
}
public ICompilationUnit getWorkingCopy() {

代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.jdt.core

public IBuffer createBuffer(ICompilationUnit workingCopy) {
  if (this.primaryBufferProvider != null) return this.primaryBufferProvider.createBuffer(workingCopy);
  return super.createBuffer(workingCopy);
}
public String toString() {

代码示例来源:origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core

/**
 * @see org.eclipse.jdt.internal.compiler.env.INameEnvironment#isPackage(char[][], char[])
 */
public boolean isPackage(char[][] parentPackageName, char[] subPackageName) {
  String[] pkgName;
  if (parentPackageName == null)
    pkgName = new String[] {new String(subPackageName)};
  else {
    int length = parentPackageName.length;
    pkgName = new String[length+1];
    for (int i = 0; i < length; i++)
      pkgName[i] = new String(parentPackageName[i]);
    pkgName[length] = new String(subPackageName);
  }
  return 
    (this.owner != null && this.owner.isPackage(pkgName))
    || this.nameLookup.isPackage(pkgName);
}

代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.jdt.core

packageName = IPackageFragment.DEFAULT_PACKAGE_NAME;
if (this.owner != null) {
  String source = this.owner.findSource(typeName, packageName);
  if (source != null) {
    ICompilationUnit cu = new BasicCompilationUnit(source.toCharArray(), CharOperation.splitOn('.', packageName.toCharArray()), typeName + Util.defaultJavaExtension());

代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui

public void start(BundleContext context) throws Exception {
  super.start(context);
  WorkingCopyOwner.setPrimaryBufferProvider(new WorkingCopyOwner() {
    public IBuffer createBuffer(ICompilationUnit workingCopy) {
      ICompilationUnit original= workingCopy.getPrimary();

代码示例来源: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.jdt/org.eclipse.jdt.core

public IProblemRequestor getProblemRequestor() {
  if (this.problemRequestor == null && this.workingCopy.owner != null) {
    return this.workingCopy.owner.getProblemRequestor(this.workingCopy);
  }
  return this.problemRequestor;
}
public ICompilationUnit getWorkingCopy() {

代码示例来源:origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core

public IBuffer createBuffer(ICompilationUnit workingCopy) {
  if (this.primaryBufferProvider != null) return this.primaryBufferProvider.createBuffer(workingCopy);
  return super.createBuffer(workingCopy);
}
public String toString() {

代码示例来源:origin: trylimits/Eclipse-Postfix-Code-Completion

/**
 * @see org.eclipse.jdt.internal.compiler.env.INameEnvironment#isPackage(char[][], char[])
 */
public boolean isPackage(char[][] parentPackageName, char[] subPackageName) {
  String[] pkgName;
  if (parentPackageName == null)
    pkgName = new String[] {new String(subPackageName)};
  else {
    int length = parentPackageName.length;
    pkgName = new String[length+1];
    for (int i = 0; i < length; i++)
      pkgName[i] = new String(parentPackageName[i]);
    pkgName[length] = new String(subPackageName);
  }
  return 
    (this.owner != null && this.owner.isPackage(pkgName))
    || this.nameLookup.isPackage(pkgName);
}

代码示例来源:origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core

packageName = IPackageFragment.DEFAULT_PACKAGE_NAME;
if (this.owner != null) {
  String source = this.owner.findSource(typeName, packageName);
  if (source != null) {
    ICompilationUnit cu = new BasicCompilationUnit(source.toCharArray(), CharOperation.splitOn('.', packageName.toCharArray()), typeName + Util.defaultJavaExtension());

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui

fDebugRegistration= context.registerService(DebugOptionsListener.class, this, properties);
WorkingCopyOwner.setPrimaryBufferProvider(new WorkingCopyOwner() {
  @Override
  public IBuffer createBuffer(ICompilationUnit workingCopy) {

相关文章