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


Java IClasspathContainer.K_APPLICATION属性代码示例

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


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

示例1: filterJREEntries

/**
 * Remove all JRE runtime entries from the given set
 *
 * @param scope
 *          set to filter
 * @return filtered set without JRE runtime entries
 */
public static Set<IPackageFragmentRoot> filterJREEntries(
    Collection<IPackageFragmentRoot> scope) throws JavaModelException {
  final Set<IPackageFragmentRoot> filtered = new HashSet<IPackageFragmentRoot>();
  for (final IPackageFragmentRoot root : scope) {
    final IClasspathEntry entry = root.getRawClasspathEntry();
    switch (entry.getEntryKind()) {
    case IClasspathEntry.CPE_SOURCE:
    case IClasspathEntry.CPE_LIBRARY:
    case IClasspathEntry.CPE_VARIABLE:
      filtered.add(root);
      break;
    case IClasspathEntry.CPE_CONTAINER:
      IClasspathContainer container = JavaCore.getClasspathContainer(
          entry.getPath(), root.getJavaProject());
      if (container != null
          && container.getKind() == IClasspathContainer.K_APPLICATION) {
        filtered.add(root);
      }
      break;
    }
  }
  return filtered;
}
 
开发者ID:eclipse,项目名称:eclemma,代码行数:30,代码来源:ScopeUtils.java

示例2: getKind

public int getKind() {
    int option = getOptionFromPath(path);
    
    // K_SYSTEM doesn't seem to need a custom IRuntimeClasspathEntryResolver
    // K_DEFAULT_SYSTEM is used by JREContainer, but requires a custom IRuntimeClasspathEntryResolver
    if (isSystemContainer(option))                    
        return IClasspathContainer.K_SYSTEM;
    
    return IClasspathContainer.K_APPLICATION;
}
 
开发者ID:JanKoehnlein,项目名称:XRobot,代码行数:10,代码来源:LeJOSEV3LibContainer.java

示例3: removeSystemContainers

private void removeSystemContainers(List<IClasspathEntry> resolvedClasspath) throws JavaModelException {
	IClasspathEntry[] rawClasspath = project.getRawClasspath();
	
	for (IClasspathEntry classpathEntry : rawClasspath) {
		if (classpathEntry.getEntryKind() == IClasspathEntry.CPE_CONTAINER) {
			IClasspathContainer container = JavaCore.getClasspathContainer(classpathEntry.getPath(), project);
			if (container.getKind() != IClasspathContainer.K_APPLICATION) {
				for (IClasspathEntry containerEntry : container.getClasspathEntries()) {
					resolvedClasspath.remove(containerEntry);
				}
			}
		}
	}
}
 
开发者ID:tsvetan-stoyanov,项目名称:launchpi,代码行数:14,代码来源:ClasspathResolver.java

示例4: getKind

@Override
public int getKind() {
   return IClasspathContainer.K_APPLICATION;
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:4,代码来源:GW4ELibrariesContainer.java

示例5: getKind

@Override
public int getKind() {
  return IClasspathContainer.K_APPLICATION;
}
 
开发者ID:x10-lang,项目名称:apgas,代码行数:4,代码来源:Initializer.java

示例6: addProjectEntries

protected void addProjectEntries(Set<IRuntimeClasspathEntry> resolved, IPath path, int scope, String classifier,
      ILaunchConfiguration launchConfiguration, final IProgressMonitor monitor) throws CoreException {
    IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
    IProject project = root.getProject(path.segment(0));

    IMavenProjectFacade projectFacade = projectManager.create(project, monitor);
    if(projectFacade == null) {
      return;
    }

    ResolverConfiguration configuration = projectFacade.getResolverConfiguration();
    if(configuration == null) {
      return;
    }

    IJavaProject javaProject = JavaCore.create(project);

    boolean projectResolved = false;

    for(IClasspathEntry entry : javaProject.getRawClasspath()) {
      IRuntimeClasspathEntry rce = null;
      switch(entry.getEntryKind()) {
        case IClasspathEntry.CPE_SOURCE:
          if(!projectResolved) {

            IMavenClassifierManager mavenClassifierManager = MavenJdtPlugin.getDefault().getMavenClassifierManager();
            IClassifierClasspathProvider classifierClasspathProvider = mavenClassifierManager
                .getClassifierClasspathProvider(projectFacade, classifier);

            if(IClasspathManager.CLASSPATH_TEST == scope) {
              classifierClasspathProvider.setTestClasspath(resolved, projectFacade, monitor);
            } else {
              classifierClasspathProvider.setRuntimeClasspath(resolved, projectFacade, monitor);
            }

            projectResolved = true;
          }
          break;
        case IClasspathEntry.CPE_CONTAINER:
          IClasspathContainer container = JavaCore.getClasspathContainer(entry.getPath(), javaProject);
          if(container != null && !MavenClasspathHelpers.isMaven2ClasspathContainer(entry.getPath())) {
            switch(container.getKind()) {
              case IClasspathContainer.K_APPLICATION:
                rce = JavaRuntime.newRuntimeContainerClasspathEntry(container.getPath(),
                    IRuntimeClasspathEntry.USER_CLASSES, javaProject);
                break;
//                case IClasspathContainer.K_DEFAULT_SYSTEM:
//                  unresolved.add(JavaRuntime.newRuntimeContainerClasspathEntry(container.getPath(), IRuntimeClasspathEntry.STANDARD_CLASSES, javaProject));
//                  break;
//                case IClasspathContainer.K_SYSTEM:
//                  unresolved.add(JavaRuntime.newRuntimeContainerClasspathEntry(container.getPath(), IRuntimeClasspathEntry.BOOTSTRAP_CLASSES, javaProject));
//                  break;
            }
          }
          break;
        case IClasspathEntry.CPE_LIBRARY:
          rce = JavaRuntime.newArchiveRuntimeClasspathEntry(entry.getPath());
          break;
        case IClasspathEntry.CPE_VARIABLE:
          if(!JavaRuntime.JRELIB_VARIABLE.equals(entry.getPath().segment(0))) {
            rce = JavaRuntime.newVariableRuntimeClasspathEntry(entry.getPath());
          }
          break;
        case IClasspathEntry.CPE_PROJECT:
          IProject res = root.getProject(entry.getPath().segment(0));
          if(res != null) {
            IJavaProject otherProject = JavaCore.create(res);
            if(otherProject != null) {
              rce = JavaRuntime.newDefaultProjectClasspathEntry(otherProject);
            }
          }
          break;
        default:
          break;
      }
      if(rce != null) {
        addStandardClasspathEntries(resolved, rce, launchConfiguration);
      }
    }
  }
 
开发者ID:fbricon,项目名称:wildfly-hive,代码行数:80,代码来源:MavenRuntimeClasspathProvider.java

示例7: getChildProjects

private void getChildProjects(IJavaProject jproject, Vector projects,
        boolean exportedOnly) {

    IClasspathEntry[] cpes = jproject.readRawClasspath();
    if (cpes != null) {
        for (int i = 0; i < cpes.length; i++) {
            IClasspathEntry cpe = JavaCore
                    .getResolvedClasspathEntry(cpes[i]);
            if (cpe == null) {
                System.err.println("Error: cpes[" + i + "]=" + cpes[i]
                        + " does not resolve");
                continue;
            }
            int kind = cpe.getEntryKind();
            String name = relPath(cpe.getPath());
            if (kind == IClasspathEntry.CPE_CONTAINER) {
                try {
                    IClasspathContainer container = JavaCore
                            .getClasspathContainer(cpe.getPath(), jproject);
                    if ((container.getKind() == IClasspathContainer.K_APPLICATION)
                            || (container.getKind() == IClasspathContainer.K_SYSTEM)) {
                        IClasspathEntry[] cpes2 = container
                                .getClasspathEntries();
                        for (int j = 0; j < cpes2.length; j++) {
                            IClasspathEntry cpe2 = cpes2[j];
                            int kind2 = cpe2.getEntryKind();
                            String name2 = relPath(cpe2.getPath());
                            if (name2 == null) {
                                System.err
                                        .println("invalid classpath entry: "
                                                + cpe2.toString());
                            } else {
                                if (kind2 == IClasspathEntry.CPE_PROJECT) {
                                    if (!exportedOnly || cpe2.isExported()) {
                                        if (!projects.contains(name2)) {
                                            IJavaProject jChildProject2 = jproject
                                                    .getJavaModel()
                                                    .getJavaProject(name2);
                                            projects.add(jChildProject2);
                                            getChildProjects(
                                                    jChildProject2,
                                                    projects, true);
                                        }
                                    }
                                }
                            }
                        }
                    }
                } catch (JavaModelException e) {
                }
            } else if (kind == IClasspathEntry.CPE_PROJECT) {
                if (name == null) {
                    System.err.println("invalid classpath entry: "
                            + cpe.toString());
                } else {
                    if (!exportedOnly || cpe.isExported()) {
                        if (!projects.contains(name)) {
                            IJavaProject jChildProject = jproject
                                    .getJavaModel().getJavaProject(name);
                            projects.add(jChildProject);
                            getChildProjects(jChildProject, projects, true);
                        }
                    }
                }
            }
        }
    }
}
 
开发者ID:thahn0720,项目名称:agui_eclipse_plugin,代码行数:68,代码来源:BuildFatJar.java

示例8: getChildProjects

public void getChildProjects(Vector projects, boolean exportedOnly) {

        IClasspathEntry[] cpes = this.getRawClasspathEntries();
        if (cpes != null) {
            for (int i = 0; i < cpes.length; i++) {
                IClasspathEntry cpe = JavaCore
                        .getResolvedClasspathEntry(cpes[i]);
                if (cpe == null) {
                    System.err.println("Error: cpes[" + i + "]=" + cpes[i]
                            + " does not resolve");
                    continue;
                }
                int kind = cpe.getEntryKind();
                String name = relPath(cpe.getPath());
                if (kind == IClasspathEntry.CPE_CONTAINER) {
                    try {
                        IClasspathContainer container = JavaCore
                                .getClasspathContainer(cpe.getPath(), jproject);
                        if ((container.getKind() == IClasspathContainer.K_APPLICATION)
                                || (container.getKind() == IClasspathContainer.K_SYSTEM)) {
                            IClasspathEntry[] cpes2 = container
                                    .getClasspathEntries();
                            for (int j = 0; j < cpes2.length; j++) {
                                IClasspathEntry cpe2 = cpes2[j];
                                int kind2 = cpe2.getEntryKind();
                                String name2 = relPath(cpe2.getPath());
                                if (name2 == null) {
                                    System.err
                                            .println("invalid classpath entry: "
                                                    + cpe2.toString());
                                } else {
                                    if (kind2 == IClasspathEntry.CPE_PROJECT) {
                                        if (!exportedOnly || cpe2.isExported()) {
                                            if (!projects.contains(name2)) {
                                                IJavaProject jChildProject2 = jproject
                                                        .getJavaModel()
                                                        .getJavaProject(name2);
                                                JProjectConfiguration jpcChild2 = new JProjectConfiguration(
                                                        jChildProject2, null);
                                                projects.add(jpcChild2);
                                                jpcChild2.getChildProjects(
                                                        projects, true);
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    } catch (JavaModelException e) {
                    }
                } else if (kind == IClasspathEntry.CPE_PROJECT) {
                    if (name == null) {
                        System.err.println("invalid classpath entry: "
                                + cpe.toString());
                    } else {
                        if (!exportedOnly || cpe.isExported()) {
                            if (!projects.contains(name)) {
                                IJavaProject jChildProject = jproject
                                        .getJavaModel().getJavaProject(name);
                                JProjectConfiguration jpcChild = new JProjectConfiguration(
                                        jChildProject, null);
                                projects.add(jpcChild);
                                jpcChild.getChildProjects(projects, true);
                            }
                        }
                    }
                }
            }
        }
    }
 
开发者ID:thahn0720,项目名称:agui_eclipse_plugin,代码行数:70,代码来源:JProjectConfiguration.java

示例9: getKind

public int getKind() {
	return IClasspathContainer.K_APPLICATION;
}
 
开发者ID:getgauge-contrib,项目名称:Gauge-Eclipse,代码行数:3,代码来源:GaugeJavaClasspathContainer.java

示例10: getKind

public int getKind() {
  return IClasspathContainer.K_APPLICATION;
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:3,代码来源:SdkClasspathContainer.java

示例11: getKind

public int getKind()
{
	return IClasspathContainer.K_APPLICATION;
}
 
开发者ID:tliron,项目名称:creel,代码行数:4,代码来源:Classpath.java

示例12: getKind

@Override
public int getKind() {
	return IClasspathContainer.K_APPLICATION;
}
 
开发者ID:EvoSuite,项目名称:evosuite,代码行数:4,代码来源:EvoSuiteClasspathContainer.java

示例13: getKind

public int getKind() {
	// return IClasspathContainer.K_SYSTEM; // originally, K_APPLICATION, but then it does not load EMF...
	return IClasspathContainer.K_APPLICATION;
}
 
开发者ID:jesusc,项目名称:eclectic,代码行数:4,代码来源:EclecticClasspathContainerInitializer.java


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