当前位置: 首页>>代码示例>>Java>>正文


Java IRuntimeClasspathEntry.getType方法代码示例

本文整理汇总了Java中org.eclipse.jdt.launching.IRuntimeClasspathEntry.getType方法的典型用法代码示例。如果您正苦于以下问题:Java IRuntimeClasspathEntry.getType方法的具体用法?Java IRuntimeClasspathEntry.getType怎么用?Java IRuntimeClasspathEntry.getType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.jdt.launching.IRuntimeClasspathEntry的用法示例。


在下文中一共展示了IRuntimeClasspathEntry.getType方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getProjectClassPath

import org.eclipse.jdt.launching.IRuntimeClasspathEntry; //导入方法依赖的package包/类
public static void getProjectClassPath(IJavaProject project, List<File> dst) throws Exception {
	IRuntimeClasspathEntry [] rentries = JavaRuntime.computeUnresolvedRuntimeClasspath(project);
	for (IRuntimeClasspathEntry entry : rentries) {
		switch (entry.getType()) {
		case IClasspathEntry.CPE_SOURCE: 
			break;
		case IClasspathEntry.CPE_PROJECT:
			break;
		case IClasspathEntry.CPE_LIBRARY:
			break;
		case IClasspathEntry.CPE_VARIABLE:
			// JRE like entries
			IRuntimeClasspathEntry [] variableEntries  = JavaRuntime.resolveRuntimeClasspathEntry(entry, project);
			break;
		case IClasspathEntry.CPE_CONTAINER:
			IRuntimeClasspathEntry [] containerEntries  = JavaRuntime.resolveRuntimeClasspathEntry(entry, project);
			for (IRuntimeClasspathEntry containerentry : containerEntries) {
				dst.add(new File (containerentry.getLocation()));
			}
			break;
		default:
			throw new Exception("unsupported classpath entry "+entry);
		}
	}
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:26,代码来源:TestResourceGeneration.java

示例2: resolveClasspath0

import org.eclipse.jdt.launching.IRuntimeClasspathEntry; //导入方法依赖的package包/类
IRuntimeClasspathEntry[] resolveClasspath0(IRuntimeClasspathEntry[] entries, ILaunchConfiguration configuration,
    IProgressMonitor monitor) throws CoreException {
  int scope = getArtifactScope(configuration);
  Set<IRuntimeClasspathEntry> all = new LinkedHashSet<>(entries.length);
  for(IRuntimeClasspathEntry entry : entries) {
    if(entry.getType() == IRuntimeClasspathEntry.CONTAINER
        && MavenClasspathHelpers.isMaven2ClasspathContainer(entry.getPath())) {
      addMavenClasspathEntries(all, entry, configuration, scope, monitor);
    } else if(entry.getType() == IRuntimeClasspathEntry.PROJECT) {
      IJavaProject javaProject = JavaRuntime.getJavaProject(configuration);
      if(javaProject.getPath().equals(entry.getPath())) {
        addProjectEntries(all, entry.getPath(), scope, THIS_PROJECT_CLASSIFIER, configuration, monitor);
      } else {
        addStandardClasspathEntries(all, entry, configuration);
      }
    } else {
      addStandardClasspathEntries(all, entry, configuration);
    }
  }
  return all.toArray(new IRuntimeClasspathEntry[all.size()]);
}
 
开发者ID:fbricon,项目名称:wildfly-hive,代码行数:22,代码来源:MavenRuntimeClasspathProvider.java

示例3: collectReferencedElements

import org.eclipse.jdt.launching.IRuntimeClasspathEntry; //导入方法依赖的package包/类
private void collectReferencedElements(IJavaProject project, HashSet<JavadocLinkRef> result) throws CoreException {
	IRuntimeClasspathEntry[] unresolved = JavaRuntime.computeUnresolvedRuntimeClasspath(project);
	for (int i= 0; i < unresolved.length; i++) {
		IRuntimeClasspathEntry curr= unresolved[i];
		if (curr.getType() == IRuntimeClasspathEntry.PROJECT) {
			result.add(new JavadocLinkRef(JavaCore.create((IProject) curr.getResource())));
		} else {
			IRuntimeClasspathEntry[] entries= JavaRuntime.resolveRuntimeClasspathEntry(curr, project);
			for (int k = 0; k < entries.length; k++) {
				IRuntimeClasspathEntry entry= entries[k];
				if (entry.getType() == IRuntimeClasspathEntry.PROJECT) {
					result.add(new JavadocLinkRef(JavaCore.create((IProject) entry.getResource())));
				} else if (entry.getType() == IRuntimeClasspathEntry.ARCHIVE) {
					IClasspathEntry classpathEntry= entry.getClasspathEntry();
					if (classpathEntry != null) {
						IPath containerPath= null;
						if (curr.getType() == IRuntimeClasspathEntry.CONTAINER) {
							containerPath= curr.getPath();
						}
						result.add(new JavadocLinkRef(containerPath, classpathEntry, project));
					}
				}
			}
		}
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:27,代码来源:JavadocStandardWizardPage.java

示例4: resolveRuntimeClasspathEntry

import org.eclipse.jdt.launching.IRuntimeClasspathEntry; //导入方法依赖的package包/类
public IRuntimeClasspathEntry[] resolveRuntimeClasspathEntry(IRuntimeClasspathEntry entry,
        IJavaProject project) throws CoreException {
    if (!(entry instanceof IRuntimeClasspathEntry2)) {
        if (entry.getType() == IRuntimeClasspathEntry.CONTAINER) {
            return computeDefaultContainerEntries(entry, project);
        }
        return new IRuntimeClasspathEntry[] {entry};
    }

    IRuntimeClasspathEntry[] entries = ((IRuntimeClasspathEntry2) entry).getRuntimeClasspathEntries(null);
    List<IRuntimeClasspathEntry> resolved = new ArrayList<>();
    for (IRuntimeClasspathEntry ent : entries) {
        IRuntimeClasspathEntry[] temp = JavaRuntime.resolveRuntimeClasspathEntry(ent, project);
        Collections.addAll(resolved, temp);
    }
    return resolved.toArray(new IRuntimeClasspathEntry[resolved.size()]);
}
 
开发者ID:apache,项目名称:ant-ivyde,代码行数:18,代码来源:IvyDERuntimeClasspathEntryResolver.java

示例5: findGWTSdk

import org.eclipse.jdt.launching.IRuntimeClasspathEntry; //导入方法依赖的package包/类
private GwtSdk findGWTSdk(IRuntimeClasspathEntry entry) {
  GwtSdk gwtSdk = GWTPreferences.getSdkManager().findSdkForPath(entry.getPath());

  if (gwtSdk != null) {
    return gwtSdk;
  }

  /*
   * If the project for which we're trying to resolve these entries is a GWT runtime project, and
   * the entry that we're trying to resolve is actually the the GWT Runtime project itself, then
   * we'll synthesize a contributor SDK and return that.
   */
  if (entry.getType() != IRuntimeClasspathEntry.PROJECT) {
    return null;
  }

  String entryProjectName = entry.getPath().lastSegment();
  IJavaProject entryJavaProject = JavaProjectUtilities.findJavaProject(entryProjectName);

  if (entryJavaProject != null && GWTProjectsRuntime.isGWTRuntimeProject(entryJavaProject)) {
    gwtSdk = GWTProjectsRuntime.syntheziseContributorRuntime();

    if (gwtSdk.validate().isOK()) {
      return gwtSdk;
    }
  }

  return null;
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:30,代码来源:RuntimeClasspathEntryResolver.java


注:本文中的org.eclipse.jdt.launching.IRuntimeClasspathEntry.getType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。