woproject/projects/wolips/plugins/org.objectstyle.wolips/java/org/objectstyle/wolips/core/resources/internal/types/project ProjectAdapter.java,1.5,1.6
[email protected] Sat, 25 Mar 2006 03:32:04 -0800 (PST)
| Newsgroups | gmane.comp.web.webobjects.woproject.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/woproject/woproject/projects/wolips/plugins/org.objectstyle.wolips/java/org/objectstyle/wolips/core/resources/internal/types/project
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11894/java/org/objectstyle/wolips/core/resources/internal/types/project
Modified Files:
ProjectAdapter.java
Log Message:
Get rid of the .WOLips file.
Index: ProjectAdapter.java
===================================================================
RCS file: /cvsroot/woproject/woproject/projects/wolips/plugins/org.objectstyle.wolips/java/org/objectstyle/wolips/core/resources/internal/types/project/ProjectAdapter.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- ProjectAdapter.java 26 Sep 2005 05:30:10 -0000 1.5
+++ ProjectAdapter.java 25 Mar 2006 11:30:49 -0000 1.6
@@ -2,7 +2,7 @@
*
* The ObjectStyle Group Software License, Version 1.0
*
- * Copyright (c) 2005 The ObjectStyle Group,
+ * Copyright (c) 2005 - 2006 The ObjectStyle Group,
* and individual authors of the software. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -75,180 +75,187 @@
import org.objectstyle.wolips.core.CorePlugin;
import org.objectstyle.wolips.core.resources.internal.types.AbstractResourceAdapter;
import org.objectstyle.wolips.core.resources.types.IPBDotProjectOwner;
-import org.objectstyle.wolips.core.resources.types.file.IDotWOLipsAdapter;
import org.objectstyle.wolips.core.resources.types.file.IPBDotProjectAdapter;
import org.objectstyle.wolips.core.resources.types.folder.IBuildAdapter;
import org.objectstyle.wolips.core.resources.types.project.IProjectAdapter;
-public class ProjectAdapter extends AbstractResourceAdapter implements IProjectAdapter {
-
- private IProject underlyingProject;
+public class ProjectAdapter extends AbstractResourceAdapter implements
+ IProjectAdapter {
- private boolean isFramework;
+ private IProject underlyingProject;
- public ProjectAdapter(IProject project, boolean isFramework) {
- super(project);
- this.underlyingProject = project;
- this.isFramework = isFramework;
- }
+ private boolean isFramework;
- public IProject getUnderlyingProject() {
- return this.underlyingProject;
- }
+ public ProjectAdapter(IProject project, boolean isFramework) {
+ super(project);
+ this.underlyingProject = project;
+ this.isFramework = isFramework;
+ }
- public boolean isFramework() {
- return this.isFramework;
- }
+ public IProject getUnderlyingProject() {
+ return this.underlyingProject;
+ }
- public IDotWOLipsAdapter getDotWOLipsAdapter() {
- IResource resource = this.getUnderlyingProject().getFile(IDotWOLipsAdapter.FILE_NAME);
- return (IDotWOLipsAdapter) resource.getAdapter(IDotWOLipsAdapter.class);
- }
+ public boolean isFramework() {
+ return this.isFramework;
+ }
- public IPBDotProjectAdapter getPBDotProjectAdapter() {
- IContainer underlyingContainer = this.getUnderlyingProject();
- IResource pbDotProjectResource = underlyingContainer.getFile(new Path(IPBDotProjectAdapter.FILE_NAME));
- IPBDotProjectAdapter pbDotProjectAdapter = (IPBDotProjectAdapter) pbDotProjectResource.getAdapter(IPBDotProjectAdapter.class);
- return pbDotProjectAdapter;
- }
+ public IPBDotProjectAdapter getPBDotProjectAdapter() {
+ IContainer underlyingContainer = this.getUnderlyingProject();
+ IResource pbDotProjectResource = underlyingContainer.getFile(new Path(
+ IPBDotProjectAdapter.FILE_NAME));
+ IPBDotProjectAdapter pbDotProjectAdapter = (IPBDotProjectAdapter) pbDotProjectResource
+ .getAdapter(IPBDotProjectAdapter.class);
+ return pbDotProjectAdapter;
+ }
- public IPBDotProjectOwner getPBDotProjectOwner(IResource resource) {
- if (resource == this.getUnderlyingProject()) {
- return this;
- }
- return super.getPBDotProjectOwner(resource);
- }
+ public IPBDotProjectOwner getPBDotProjectOwner(IResource resource) {
+ if (resource == this.getUnderlyingProject()) {
+ return this;
+ }
+ return super.getPBDotProjectOwner(resource);
+ }
- public IPBDotProjectOwner getPBDotProjectOwner() {
- return this;
- }
+ public IPBDotProjectOwner getPBDotProjectOwner() {
+ return this;
+ }
- public boolean hasParentPBDotProjectAdapter() {
- return false;
- }
+ public boolean hasParentPBDotProjectAdapter() {
+ return false;
+ }
- public IBuildAdapter getBuildAdapter() {
- IResource resource = this.getUnderlyingProject().getFolder(IBuildAdapter.FILE_NAME);
- return (IBuildAdapter) resource.getAdapter(IBuildAdapter.class);
- }
+ public IBuildAdapter getBuildAdapter() {
+ IResource resource = this.getUnderlyingProject().getFolder(
+ IBuildAdapter.FILE_NAME);
+ return (IBuildAdapter) resource.getAdapter(IBuildAdapter.class);
+ }
- public List getFrameworkPaths() {
- ArrayList list = new ArrayList();
- IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
- for (int i = 0; i < projects.length; i++) {
- if (isFrameworkReference(projects[i])) {
- list.add(projects[i].getLocation());
- }
- }
- try {
- IJavaProject javaProject = JavaCore.create(this.getUnderlyingProject());
- list.addAll(toFrameworkPaths(javaProject.getResolvedClasspath(false)));
- }
- catch (JavaModelException e) {
- CorePlugin.getDefault().log(e);
- }
- return list;
- }
+ public List getFrameworkPaths() {
+ ArrayList list = new ArrayList();
+ IProject[] projects = ResourcesPlugin.getWorkspace().getRoot()
+ .getProjects();
+ for (int i = 0; i < projects.length; i++) {
+ if (isFrameworkReference(projects[i])) {
+ list.add(projects[i].getLocation());
+ }
+ }
+ try {
+ IJavaProject javaProject = JavaCore.create(this
+ .getUnderlyingProject());
+ list.addAll(toFrameworkPaths(javaProject
+ .getResolvedClasspath(false)));
+ } catch (JavaModelException e) {
+ CorePlugin.getDefault().log(e);
+ }
+ return list;
+ }
- public List getFrameworkNames() {
- Set frameworkNamesSet = new TreeSet();
- IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
- for (int i = 0; i < projects.length; i++) {
- if (isFrameworkReference(projects[i])) {
- frameworkNamesSet.add(projects[i].getName() + "." + "framework");
- }
- }
- try {
- IJavaProject javaProject = JavaCore.create(this.getUnderlyingProject());
- frameworkNamesSet.addAll(this.toFrameworkNames(javaProject.getResolvedClasspath(false)));
- }
- catch (JavaModelException e) {
- CorePlugin.getDefault().log(e);
- }
- return new LinkedList(frameworkNamesSet);
- }
+ public List getFrameworkNames() {
+ Set frameworkNamesSet = new TreeSet();
+ IProject[] projects = ResourcesPlugin.getWorkspace().getRoot()
+ .getProjects();
+ for (int i = 0; i < projects.length; i++) {
+ if (isFrameworkReference(projects[i])) {
+ frameworkNamesSet
+ .add(projects[i].getName() + "." + "framework");
+ }
+ }
+ try {
+ IJavaProject javaProject = JavaCore.create(this
+ .getUnderlyingProject());
+ frameworkNamesSet.addAll(this.toFrameworkNames(javaProject
+ .getResolvedClasspath(false)));
+ } catch (JavaModelException e) {
+ CorePlugin.getDefault().log(e);
+ }
+ return new LinkedList(frameworkNamesSet);
+ }
- public String getFrameworkName(IPath frameworkPath) {
- String frameworkName = null;
- if (ResourcesPlugin.getWorkspace().getRoot().getContainerForLocation(frameworkPath) instanceof IProject) {
- frameworkName = frameworkPath.lastSegment() + ".framework";
- }
- else {
- frameworkName = frameworkPath.lastSegment();
- }
- return frameworkName;
- }
+ public String getFrameworkName(IPath frameworkPath) {
+ String frameworkName = null;
+ if (ResourcesPlugin.getWorkspace().getRoot().getContainerForLocation(
+ frameworkPath) instanceof IProject) {
+ frameworkName = frameworkPath.lastSegment() + ".framework";
+ } else {
+ frameworkName = frameworkPath.lastSegment();
+ }
+ return frameworkName;
+ }
- private List toFrameworkPaths(IClasspathEntry[] classpathEntries) {
- ArrayList arrayList = new ArrayList();
- for (int i = 0; i < classpathEntries.length; i++) {
- IPath path = classpathEntries[i].getPath();
- IPath choppedFrameworkPath = null;
- int count = path.segmentCount();
- for (int pathElementNum = 0; pathElementNum < count && choppedFrameworkPath == null; pathElementNum++) {
- String segment = path.segment(pathElementNum);
- if (segment.endsWith("." + "framework")) {
- choppedFrameworkPath = path.removeLastSegments(count - pathElementNum - 1);
- }
- }
- if (choppedFrameworkPath != null && !choppedFrameworkPath.lastSegment().startsWith("JavaVM")) {
- arrayList.add(choppedFrameworkPath);
- }
- }
- return arrayList;
- }
+ private List toFrameworkPaths(IClasspathEntry[] classpathEntries) {
+ ArrayList arrayList = new ArrayList();
+ for (int i = 0; i < classpathEntries.length; i++) {
+ IPath path = classpathEntries[i].getPath();
+ IPath choppedFrameworkPath = null;
+ int count = path.segmentCount();
+ for (int pathElementNum = 0; pathElementNum < count
+ && choppedFrameworkPath == null; pathElementNum++) {
+ String segment = path.segment(pathElementNum);
+ if (segment.endsWith("." + "framework")) {
+ choppedFrameworkPath = path.removeLastSegments(count
+ - pathElementNum - 1);
+ }
+ }
+ if (choppedFrameworkPath != null
+ && !choppedFrameworkPath.lastSegment().startsWith("JavaVM")) {
+ arrayList.add(choppedFrameworkPath);
+ }
+ }
+ return arrayList;
+ }
- private List toFrameworkNames(IClasspathEntry[] classpathEntries) {
- List pathsList = toFrameworkPaths(classpathEntries);
- ArrayList namesList = new ArrayList(pathsList.size());
- Iterator pathsIter = pathsList.iterator();
- while (pathsIter.hasNext()) {
- IPath path = (IPath) pathsIter.next();
- String name = this.getFrameworkName(path);
- namesList.add(name);
- }
- return namesList;
- }
+ private List toFrameworkNames(IClasspathEntry[] classpathEntries) {
+ List pathsList = toFrameworkPaths(classpathEntries);
+ ArrayList namesList = new ArrayList(pathsList.size());
+ Iterator pathsIter = pathsList.iterator();
+ while (pathsIter.hasNext()) {
+ IPath path = (IPath) pathsIter.next();
+ String name = this.getFrameworkName(path);
+ namesList.add(name);
+ }
+ return namesList;
+ }
- /**
- * Method isTheLaunchAppOrFramework.
- *
- * @param iProject
- * @return boolean
- */
- public boolean isFrameworkReference(IProject iProject) {
- boolean isFrameworkReference;
- IJavaProject javaProject = null;
- try {
- javaProject = JavaCore.create(this.getUnderlyingProject());
- if (javaProject == null) {
- isFrameworkReference = false;
- }
- else {
- IProjectAdapter project = (IProjectAdapter) iProject.getAdapter(IProjectAdapter.class);
- isFrameworkReference = project != null && project.isFramework() && projectIsReferencedByProject(iProject, javaProject.getProject());
- }
- }
- catch (Exception e) {
- CorePlugin.getDefault().log(e);
- isFrameworkReference = false;
- }
- return isFrameworkReference;
- }
+ /**
+ * Method isTheLaunchAppOrFramework.
+ *
+ * @param iProject
+ * @return boolean
+ */
+ public boolean isFrameworkReference(IProject iProject) {
+ boolean isFrameworkReference;
+ IJavaProject javaProject = null;
+ try {
+ javaProject = JavaCore.create(this.getUnderlyingProject());
+ if (javaProject == null) {
+ isFrameworkReference = false;
+ } else {
+ IProjectAdapter project = (IProjectAdapter) iProject
+ .getAdapter(IProjectAdapter.class);
+ isFrameworkReference = project != null
+ && project.isFramework()
+ && projectIsReferencedByProject(iProject, javaProject
+ .getProject());
+ }
+ } catch (Exception e) {
+ CorePlugin.getDefault().log(e);
+ isFrameworkReference = false;
+ }
+ return isFrameworkReference;
+ }
- public boolean projectIsReferencedByProject(IProject child, IProject mother) {
- IProject[] projects = null;
- try {
- projects = mother.getReferencedProjects();
- }
- catch (Exception e) {
- CorePlugin.getDefault().log(e);
- return false;
- }
- for (int i = 0; i < projects.length; i++) {
- if (projects[i].equals(child))
- return true;
- }
- return false;
- }
+ public boolean projectIsReferencedByProject(IProject child, IProject mother) {
+ IProject[] projects = null;
+ try {
+ projects = mother.getReferencedProjects();
+ } catch (Exception e) {
+ CorePlugin.getDefault().log(e);
+ return false;
+ }
+ for (int i = 0; i < projects.length; i++) {
+ if (projects[i].equals(child))
+ return true;
+ }
+ return false;
+ }
}
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642