[jboss-cvs] jbosside/core/plugins/org.jboss.ide.eclipse.packages.core/src/main/org/jboss/ide/eclipse/packages/core ...
Marshall Culpepper
mculpepper at jboss.com
Fri Feb 16 19:02:45 EST 2007
User: mculpepper
Date: 07/02/16 19:02:45
Modified: core/plugins/org.jboss.ide.eclipse.packages.core/src/main/org/jboss/ide/eclipse/packages/core
PackagesCorePlugin.java
Log:
fixed a bug prohibiting a package being created with an external location (testing an IPath's "context" is working properly now). also fixed a small builder bug for packages outside of the workspace
Revision Changes Path
1.3 +41 -0 jbosside/core/plugins/org.jboss.ide.eclipse.packages.core/src/main/org/jboss/ide/eclipse/packages/core/PackagesCorePlugin.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: PackagesCorePlugin.java
===================================================================
RCS file: /cvsroot/jboss/jbosside/core/plugins/org.jboss.ide.eclipse.packages.core/src/main/org/jboss/ide/eclipse/packages/core/PackagesCorePlugin.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- PackagesCorePlugin.java 16 Feb 2007 19:38:54 -0000 1.2
+++ PackagesCorePlugin.java 17 Feb 2007 00:02:45 -0000 1.3
@@ -21,6 +21,10 @@
*/
package org.jboss.ide.eclipse.packages.core;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Plugin;
import org.jboss.ide.eclipse.packages.core.model.internal.xb.XMLBinding;
import org.osgi.framework.BundleContext;
@@ -63,6 +67,43 @@
super.stop(context);
}
+ public static boolean isFolderInWorkspace (IPath path)
+ {
+ boolean inWorkspace = false;
+ try {
+ IFolder folder = ResourcesPlugin.getWorkspace().getRoot().getFolder(path);
+
+ inWorkspace = (folder != null && folder.exists());
+ } catch (IllegalArgumentException e) {
+ // Swallow, we assume this isn't in the workspace if it's an invalid path
+ }
+
+ return inWorkspace;
+ }
+
+ public static boolean isFileInWorkspace (IPath path)
+ {
+ boolean inWorkspace = false;
+ try {
+ IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
+
+ inWorkspace = (file != null && file.exists());
+ } catch (IllegalArgumentException e) {
+ // Swallow, we assume this isn't in the workspace if it's an invalid path
+ }
+
+ return inWorkspace;
+ }
+ // protected void loadPackageTypes ()
+ // {
+ // IPackageType[] packageTypes = ExtensionManager.findPackageTypes();
+ //
+ // for (int i = 0; i < packageTypes.length; i++)
+ // {
+ // this.packageTypes.put(packageTypes[i].getId(), packageTypes[i]);
+ // }
+ // }
+
/**
* Returns the shared instance
*
More information about the jboss-cvs-commits
mailing list