本文整理汇总了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;
}
示例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;
}
示例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);
}
}
}
}
}
示例4: getKind
@Override
public int getKind() {
return IClasspathContainer.K_APPLICATION;
}
示例5: getKind
@Override
public int getKind() {
return IClasspathContainer.K_APPLICATION;
}
示例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);
}
}
}
示例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);
}
}
}
}
}
}
}
示例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);
}
}
}
}
}
}
}
示例9: getKind
public int getKind() {
return IClasspathContainer.K_APPLICATION;
}
示例10: getKind
public int getKind() {
return IClasspathContainer.K_APPLICATION;
}
示例11: getKind
public int getKind()
{
return IClasspathContainer.K_APPLICATION;
}
示例12: getKind
@Override
public int getKind() {
return IClasspathContainer.K_APPLICATION;
}
示例13: getKind
public int getKind() {
// return IClasspathContainer.K_SYSTEM; // originally, K_APPLICATION, but then it does not load EMF...
return IClasspathContainer.K_APPLICATION;
}