JBoss Tools SVN: r31536 - trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/webprj/model/helpers/adopt.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-05-26 19:14:16 -0400 (Thu, 26 May 2011)
New Revision: 31536
Modified:
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/webprj/model/helpers/adopt/AdoptProjectFinisher.java
Log:
JBIDE-9005
https://issues.jboss.org/browse/JBIDE-9005
Modified: trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/webprj/model/helpers/adopt/AdoptProjectFinisher.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/webprj/model/helpers/adopt/AdoptProjectFinisher.java 2011-05-26 23:13:22 UTC (rev 31535)
+++ trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/webprj/model/helpers/adopt/AdoptProjectFinisher.java 2011-05-26 23:14:16 UTC (rev 31536)
@@ -19,6 +19,7 @@
import org.jboss.tools.common.model.XModelConstants;
import org.jboss.tools.common.model.XModelException;
import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.filesystems.impl.Libs;
import org.jboss.tools.common.util.FileUtil;
import org.jboss.tools.jst.web.context.IImportWebProjectContext;
import org.jboss.tools.jst.web.project.WebModuleConstants;
@@ -208,7 +209,7 @@
});
if(jars != null) for (int i = 0; i < jars.length; i++) {
String n = jars[i].getName();
- getOrCreateFileSystem("lib-" + n, loc + "/" + n, "hidden=yes", true, true);
+ getOrCreateFileSystem(Libs.LIB_PREFIX + n, loc + "/" + n, "hidden=yes", true, true);
}
}
13 years, 8 months
JBoss Tools SVN: r31535 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-05-26 19:13:22 -0400 (Thu, 26 May 2011)
New Revision: 31535
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/ClassPath.java
Log:
JBIDE-9005
https://issues.jboss.org/browse/JBIDE-9005
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/ClassPath.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/ClassPath.java 2011-05-26 23:12:50 UTC (rev 31534)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/ClassPath.java 2011-05-26 23:13:22 UTC (rev 31535)
@@ -27,6 +27,8 @@
import org.jboss.tools.common.model.XJob;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.XJob.XRunnable;
+import org.jboss.tools.common.model.filesystems.FileSystemsHelper;
+import org.jboss.tools.common.model.filesystems.impl.Libs;
import org.jboss.tools.common.model.filesystems.impl.LibsListener;
import org.jboss.tools.common.model.project.ext.AbstractClassPathMonitor;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
@@ -81,8 +83,8 @@
String fileName = new File(p).getName();
if(EclipseResourceUtil.SYSTEM_JAR_SET.contains(fileName)) continue;
- String jsname = "lib-" + fileName; //$NON-NLS-1$
- XModelObject o = model.getByPath("FileSystems").getChildByPath(jsname); //$NON-NLS-1$
+
+ XModelObject o = FileSystemsHelper.getLibs(model).getLibrary(p);
if(o == null) continue;
LoadedDeclarations c = null;
@@ -96,9 +98,7 @@
if(c == null) {
c = new LoadedDeclarations();
}
- if(c != null) {
- componentsLoaded(c, new Path(p));
- }
+ componentsLoaded(c, new Path(p));
}
validateProjectDependencies();
13 years, 8 months
JBoss Tools SVN: r31534 - in trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui: navigator and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-05-26 19:12:50 -0400 (Thu, 26 May 2011)
New Revision: 31534
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/action/adf/AddADFSupportHelper.java
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/navigator/WebProjectsLabelProvider.java
Log:
JBIDE-9005
https://issues.jboss.org/browse/JBIDE-9005
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/action/adf/AddADFSupportHelper.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/action/adf/AddADFSupportHelper.java 2011-05-26 23:11:27 UTC (rev 31533)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/action/adf/AddADFSupportHelper.java 2011-05-26 23:12:50 UTC (rev 31534)
@@ -22,6 +22,7 @@
import org.jboss.tools.common.meta.action.impl.handlers.DefaultCreateHandler;
import org.jboss.tools.common.model.*;
import org.jboss.tools.common.model.filesystems.FileSystemsHelper;
+import org.jboss.tools.common.model.filesystems.impl.Libs;
import org.jboss.tools.common.model.plugin.ModelPlugin;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.model.util.XModelObjectLoaderUtil;
@@ -53,16 +54,19 @@
public boolean isEnabled() {
if(object == null) return false;
XModel model = object.getModel();
- XModelObject fss = FileSystemsHelper.getFileSystems(model);
- if(fss == null) return false;
File adfLibFile = new File(adfLibPath);
- if(!adfLibFile.isDirectory()) return false;
- File[] fs = adfLibFile.listFiles();
- if(fs == null || fs.length == 0) return false;
- for (int i = 0; i < fs.length; i++) {
- String n = fs[i].getName();
- if(!n.endsWith(".jar")) continue; //$NON-NLS-1$
- if(fss.getChildByPath("lib-" + n) == null) return true; //$NON-NLS-1$
+ if(adfLibFile.isDirectory()) {
+ File[] fs = adfLibFile.listFiles();
+ if(fs != null && fs.length > 0) {
+ Libs libs = FileSystemsHelper.getLibs(model);
+ if(libs != null) {
+ for (int i = 0; i < fs.length; i++) {
+ if(libs.getLibrary(fs[i]) != null) {
+ return true;
+ }
+ }
+ }
+ }
}
return false;
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/navigator/WebProjectsLabelProvider.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/navigator/WebProjectsLabelProvider.java 2011-05-26 23:11:27 UTC (rev 31533)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/navigator/WebProjectsLabelProvider.java 2011-05-26 23:12:50 UTC (rev 31534)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.jst.web.ui.navigator;
+import org.jboss.tools.common.model.filesystems.impl.Libs;
import org.jboss.tools.common.model.ui.navigator.NavigatorLabelProvider;
import org.jboss.tools.common.model.ui.navigator.decorator.DecoratorManager;
import org.jboss.tools.common.model.ui.navigator.decorator.XModelObjectDecorator;
@@ -54,7 +55,7 @@
while(p != null && p.getFileType() != XModelObject.SYSTEM) p = p.getParent();
if(p != null && p.getModelEntity().getName().equals("FileSystemJar")) {
String n = p.getAttributeValue("name");
- if(n != null && n.startsWith("lib-")) n = n.substring(4);
+ if(n != null && n.startsWith(Libs.LIB_PREFIX)) n = n.substring(4);
String addition = (n != null) ? " - " + n : "";
return super.getText(element) + addition;
}
13 years, 8 months
JBoss Tools SVN: r31533 - trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-05-26 19:11:27 -0400 (Thu, 26 May 2011)
New Revision: 31533
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/ClassPathMonitor.java
Log:
JBIDE-9005
https://issues.jboss.org/browse/JBIDE-9005
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/ClassPathMonitor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/ClassPathMonitor.java 2011-05-26 23:11:10 UTC (rev 31532)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/ClassPathMonitor.java 2011-05-26 23:11:27 UTC (rev 31533)
@@ -28,6 +28,7 @@
import org.jboss.tools.common.model.XJob;
import org.jboss.tools.common.model.XJob.XRunnable;
import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.filesystems.FileSystemsHelper;
import org.jboss.tools.common.model.plugin.ModelPlugin;
import org.jboss.tools.common.model.project.ext.AbstractClassPathMonitor;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
@@ -84,8 +85,8 @@
String fileName = new File(p).getName();
if(EclipseResourceUtil.SYSTEM_JAR_SET.contains(fileName)) continue;
- String jsname = "lib-" + fileName; //$NON-NLS-1$
- XModelObject o = model.getByPath("FileSystems").getChildByPath(jsname); //$NON-NLS-1$
+
+ XModelObject o = FileSystemsHelper.getLibs(model).getLibrary(p);
if(o == null) continue;
LoadedDeclarations c = null;
@@ -99,9 +100,7 @@
if(c == null) {
c = new LoadedDeclarations();
}
- if(c != null) {
- componentsLoaded(c, new Path(p));
- }
+ componentsLoaded(c, new Path(p));
}
validateProjectDependencies();
13 years, 8 months
JBoss Tools SVN: r31532 - in trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web: tld and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-05-26 19:11:10 -0400 (Thu, 26 May 2011)
New Revision: 31532
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/project/helpers/NewWebProjectHelper.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tld/TaglibMapping.java
Log:
JBIDE-9005
https://issues.jboss.org/browse/JBIDE-9005
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/project/helpers/NewWebProjectHelper.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/project/helpers/NewWebProjectHelper.java 2011-05-26 23:10:04 UTC (rev 31531)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/project/helpers/NewWebProjectHelper.java 2011-05-26 23:11:10 UTC (rev 31532)
@@ -35,6 +35,7 @@
import org.jboss.tools.common.model.XModelException;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.filesystems.impl.FileSystemsImpl;
+import org.jboss.tools.common.model.filesystems.impl.Libs;
import org.jboss.tools.common.model.impl.XModelImpl;
import org.jboss.tools.common.model.util.XMLUtil;
import org.jboss.tools.common.model.util.XModelObjectLoaderUtil;
@@ -97,7 +98,7 @@
for (int i = 0; i < jars.length; i++) {
String jarName = jars[i].getName();
Properties fsProp = new Properties();
- fsProp.setProperty("name", "lib-"+jarName); //$NON-NLS-1$ //$NON-NLS-2$
+ fsProp.setProperty("name", Libs.LIB_PREFIX + jarName); //$NON-NLS-1$
fsProp.setProperty("location", libName+jarName); //$NON-NLS-1$
fsProp.setProperty("info", "hidden=yes"); //$NON-NLS-1$ //$NON-NLS-2$
XModelObject fsJar = XModelObjectLoaderUtil.createValidObject(model, "FileSystemJar", fsProp); //$NON-NLS-1$
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tld/TaglibMapping.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tld/TaglibMapping.java 2011-05-26 23:10:04 UTC (rev 31531)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tld/TaglibMapping.java 2011-05-26 23:11:10 UTC (rev 31532)
@@ -25,6 +25,7 @@
import org.jboss.tools.common.model.filesystems.impl.FileAnyImpl;
import org.jboss.tools.common.model.filesystems.impl.FolderImpl;
import org.jboss.tools.common.model.filesystems.impl.JarSystemImpl;
+import org.jboss.tools.common.model.filesystems.impl.Libs;
import org.jboss.tools.common.model.impl.XModelImpl;
import org.jboss.tools.common.model.util.XModelObjectUtil;
import org.jboss.tools.jst.web.WebModelPlugin;
@@ -205,7 +206,7 @@
XModelObject[] fs = fss.getChildren("FileSystemJar"); //$NON-NLS-1$
for (int i = 0; i < fs.length; i++) {
String n = fs[i].getAttributeValue("name"); //$NON-NLS-1$
- if(n.startsWith("lib-")) findTldsInJar(fs[i]); //$NON-NLS-1$
+ if(n.startsWith(Libs.LIB_PREFIX)) findTldsInJar(fs[i]);
}
}
13 years, 8 months
JBoss Tools SVN: r31531 - in trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf: project/capabilities and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-05-26 19:10:04 -0400 (Thu, 26 May 2011)
New Revision: 31531
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/pv/JSFProjectTagLibs.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/project/capabilities/LibrariesPerformer.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/helpers/context/AdoptJSFProjectFinisher.java
Log:
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/pv/JSFProjectTagLibs.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/pv/JSFProjectTagLibs.java 2011-05-26 23:08:10 UTC (rev 31530)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/pv/JSFProjectTagLibs.java 2011-05-26 23:10:04 UTC (rev 31531)
@@ -15,6 +15,7 @@
import org.eclipse.core.resources.IResource;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.filesystems.FileSystemsHelper;
+import org.jboss.tools.common.model.filesystems.impl.Libs;
import org.jboss.tools.jst.web.model.helpers.WebAppHelper;
import org.jboss.tools.jst.web.tld.model.TLDUtil;
@@ -29,7 +30,7 @@
if(fss == null) return list.iterator();
XModelObject[] fs = fss.getChildren("FileSystemJar");
for (int i = 0; i < fs.length; i++) {
- if(!fs[i].getAttributeValue("name").startsWith("lib-")) continue;
+ if(!fs[i].getAttributeValue("name").startsWith(Libs.LIB_PREFIX)) continue;
r = fs[i].getChildByPath("META-INF");
if(r != null) list.add(r);
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/project/capabilities/LibrariesPerformer.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/project/capabilities/LibrariesPerformer.java 2011-05-26 23:08:10 UTC (rev 31530)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/project/capabilities/LibrariesPerformer.java 2011-05-26 23:10:04 UTC (rev 31531)
@@ -22,6 +22,7 @@
import org.jboss.tools.common.meta.action.impl.handlers.DefaultCreateHandler;
import org.jboss.tools.common.model.*;
import org.jboss.tools.common.model.filesystems.FileSystemsHelper;
+import org.jboss.tools.common.model.filesystems.impl.Libs;
import org.jboss.tools.common.model.plugin.ModelPlugin;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.model.util.XModelObjectLoaderUtil;
@@ -198,7 +199,7 @@
}
FileUtil.copyFile(source, target, true);
changed = true;
- String fsName = "lib-" + n;
+ String fsName = Libs.LIB_PREFIX + n;
if(fss.getChildByPath(fsName) == null) {
Properties fsProp = new Properties();
fsProp.setProperty("name", fsName);
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/helpers/context/AdoptJSFProjectFinisher.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/helpers/context/AdoptJSFProjectFinisher.java 2011-05-26 23:08:10 UTC (rev 31530)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/helpers/context/AdoptJSFProjectFinisher.java 2011-05-26 23:10:04 UTC (rev 31531)
@@ -26,6 +26,7 @@
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.filesystems.FileSystemsHelper;
import org.jboss.tools.common.model.filesystems.impl.FileAnyImpl;
+import org.jboss.tools.common.model.filesystems.impl.Libs;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.model.util.XModelObjectLoaderUtil;
import org.jboss.tools.common.util.FileUtil;
@@ -192,7 +193,7 @@
if (jars != null)
for (int i = 0; i < jars.length; i++) {
String n = jars[i].getName();
- getOrCreateFileSystem("lib-" + n, loc + "/" + n, "hidden=yes",
+ getOrCreateFileSystem(Libs.LIB_PREFIX + n, loc + "/" + n, "hidden=yes",
true, true);
}
}
13 years, 8 months
JBoss Tools SVN: r31530 - trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-05-26 19:08:10 -0400 (Thu, 26 May 2011)
New Revision: 31530
Modified:
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/ESBResourceTree.java
Log:
JBIDE-9005
https://issues.jboss.org/browse/JBIDE-9005
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/ESBResourceTree.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/ESBResourceTree.java 2011-05-26 23:07:43 UTC (rev 31529)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/ESBResourceTree.java 2011-05-26 23:08:10 UTC (rev 31530)
@@ -9,6 +9,7 @@
import org.jboss.tools.common.model.filesystems.FileSystemsHelper;
import org.jboss.tools.common.model.filesystems.XFileObject;
import org.jboss.tools.common.model.filesystems.impl.FileSystemsImpl;
+import org.jboss.tools.common.model.filesystems.impl.Libs;
import org.jboss.tools.common.model.impl.trees.FileSystemResourceTree;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.model.util.XModelObjectLoaderUtil;
@@ -39,7 +40,7 @@
}
for (int i = 0; i < os.length; i++) {
String name = os[i].getAttributeValue(XModelObjectConstants.ATTR_NAME);
- if(name.startsWith("lib-")) {
+ if(name.startsWith(Libs.LIB_PREFIX)) {
list.add(os[i]);
}
}
13 years, 8 months
JBoss Tools SVN: r31529 - trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/lib.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-05-26 19:07:43 -0400 (Thu, 26 May 2011)
New Revision: 31529
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/lib/ClassPathMonitor.java
Log:
JBIDE-9005
https://issues.jboss.org/browse/JBIDE-9005
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/lib/ClassPathMonitor.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/lib/ClassPathMonitor.java 2011-05-26 23:07:05 UTC (rev 31528)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/lib/ClassPathMonitor.java 2011-05-26 23:07:43 UTC (rev 31529)
@@ -31,6 +31,7 @@
import org.jboss.tools.cdi.core.CDICoreNature;
import org.jboss.tools.cdi.core.CDICorePlugin;
import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.filesystems.FileSystemsHelper;
import org.jboss.tools.common.model.filesystems.impl.FileAnyImpl;
import org.jboss.tools.common.model.project.ext.AbstractClassPathMonitor;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
@@ -59,8 +60,8 @@
String fileName = new File(p).getName();
if(EclipseResourceUtil.SYSTEM_JAR_SET.contains(fileName)) continue;
- String jsname = "lib-" + fileName; //$NON-NLS-1$
- XModelObject o = model.getByPath("FileSystems").getChildByPath(jsname); //$NON-NLS-1$
+
+ XModelObject o = FileSystemsHelper.getLibs(model).getLibrary(p);
if(o == null) continue;
//Load cdi extensions. Do we need beans.xml to look for extensions?
13 years, 8 months
JBoss Tools SVN: r31528 - in trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model: util and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-05-26 19:07:05 -0400 (Thu, 26 May 2011)
New Revision: 31528
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/Libs.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EclipseResourceUtil.java
Log:
JBIDE-9005
https://issues.jboss.org/browse/JBIDE-9005
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/Libs.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/Libs.java 2011-05-26 19:43:02 UTC (rev 31527)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/Libs.java 2011-05-26 23:07:05 UTC (rev 31528)
@@ -45,6 +45,8 @@
protected List<String> paths = null;
Map<IPath, String> paths2 = new HashMap<IPath, String>();
+ LibraryNames libraryNames = new LibraryNames();
+
List<LibsListener> listeners = new ArrayList<LibsListener>();
public Libs(FileSystemsImpl object) {
@@ -64,6 +66,24 @@
return EclipseResourceUtil.getProject(object);
}
+ public XModelObject getLibrary(String path) {
+ String libName = libraryNames.getName(path);
+ if(libName == null) {
+ //compatibility to old code.
+ libName = LIB_PREFIX + new File(path).getName();
+ }
+ return object.getChildByPath(libName);
+ }
+
+ public XModelObject getLibrary(File f) {
+ XModelObject result = null;
+ if(f.exists()) {
+ String path = f.getAbsolutePath().replace('\\', '/');
+ result = getLibrary(path);
+ }
+ return result;
+ }
+
public boolean update() {
boolean result = updatePaths();
if(result) fire();
@@ -103,12 +123,25 @@
return true;
}
- static String LIB_PREFIX = "lib-"; //$NON-NLS-1$
+ public static String LIB_PREFIX = "lib-"; //$NON-NLS-1$
void updateFileSystems(List<String> paths) {
if(fsVersion >= pathsVersion) {
return;
}
+
+ Set<String> oldPaths = libraryNames.getPaths();
+ for (String p: oldPaths) {
+ if(!paths.contains(p)) {
+ String n = libraryNames.getName(p);
+ XModelObject o = object.getChildByPath(n);
+ if(o != null) {
+ o.removeFromParent();
+ }
+ libraryNames.removePath(p);
+ }
+ }
+
XModelObject[] fs = object.getChildren();
Set<XModelObject> fss = new HashSet<XModelObject>();
for (int i = 0; i < fs.length; i++) {
@@ -123,7 +156,14 @@
String libEntity = isJar ? "FileSystemJar" : "FileSystemFolder"; //$NON-NLS-1$ //$NON-NLS-2$
String fileName = new File(path).getName();
if(isJar && EclipseResourceUtil.SYSTEM_JAR_SET.contains(fileName)) continue;
- String jsname = LIB_PREFIX + fileName;
+ String jsname = libraryNames.getName(path);
+ if(jsname == null) {
+ jsname = LIB_PREFIX + fileName;
+ int q = 0;
+ while(libraryNames.hasName(jsname)) {
+ jsname = LIB_PREFIX + fileName + "-" + (++q); //$NON-NLS-1$
+ }
+ }
XModelObject o = object.getChildByPath(jsname);
if(o != null) {
fss.remove(o);
@@ -134,7 +174,8 @@
o.set(FileSystemsLoader.IS_ADDED_TO_CLASSPATH, XModelObjectConstants.TRUE);
object.addChild(o);
// object.setModified(true);
- }
+ }
+ libraryNames.put(path, jsname);
}
for (XModelObject o: fss) {
@@ -220,3 +261,36 @@
}
}
+
+class LibraryNames {
+ private Map<String, String> pathToName = new HashMap<String, String>();
+ private Map<String, String> nameToPath = new HashMap<String, String>();
+
+ public void put(String path, String name) {
+ pathToName.put(path, name);
+ nameToPath.put(name, path);
+ }
+
+ public void removePath(String path) {
+ String name = pathToName.remove(path);
+ if(name != null) {
+ nameToPath.remove(name);
+ }
+ }
+
+ public String getName(String path) {
+ return pathToName.get(path);
+ }
+
+ public String getPath(String name) {
+ return nameToPath.get(name);
+ }
+
+ public boolean hasName(String name) {
+ return nameToPath.containsKey(name);
+ }
+
+ public Set<String> getPaths() {
+ return new HashSet<String>(pathToName.keySet());
+ }
+}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EclipseResourceUtil.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EclipseResourceUtil.java 2011-05-26 19:43:02 UTC (rev 31527)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EclipseResourceUtil.java 2011-05-26 23:07:05 UTC (rev 31528)
@@ -63,6 +63,7 @@
import org.jboss.tools.common.model.filesystems.impl.FileSystemImpl;
import org.jboss.tools.common.model.filesystems.impl.FileSystemsImpl;
import org.jboss.tools.common.model.filesystems.impl.JarSystemImpl;
+import org.jboss.tools.common.model.filesystems.impl.Libs;
import org.jboss.tools.common.model.icons.impl.XModelObjectIcon;
import org.jboss.tools.common.model.impl.XModelObjectImpl;
import org.jboss.tools.common.model.plugin.ModelPlugin;
@@ -459,7 +460,7 @@
private static void validateJarSystem(XModelObject fs, IResource resource) {
if(fs == null || !isJar(resource)) return;
- String jsname = "lib-" + resource.getName().toLowerCase(); //$NON-NLS-1$
+ String jsname = Libs.LIB_PREFIX + resource.getName().toLowerCase(); //$NON-NLS-1$
String location = resource.getLocation().toString().replace('\\', '/');
if(fs.getChildByPath(jsname) == null) {
XModelObject q = fs.getModel().createModelObject("FileSystemJar", null); //$NON-NLS-1$
13 years, 8 months
JBoss Tools SVN: r31527 - in trunk: cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/META-INF and 7 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-05-26 15:43:02 -0400 (Thu, 26 May 2011)
New Revision: 31527
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/META-INF/MANIFEST.MF
trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/.project
trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/src/org/jboss/tools/cdi/seam/faces/core/test/SeamFacesTestSetup.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/src/org/jboss/tools/cdi/seam/faces/core/test/SeamFacesValidationTest.java
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java
trunk/common/plugins/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/contentassist/CATestUtil.java
trunk/jst/plugins/org.jboss.tools.jst.jsp.base.test/META-INF/MANIFEST.MF
trunk/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/TestUtil.java
trunk/struts/tests/org.jboss.tools.struts.text.ext.test/src/org/jboss/tools/struts/text/tests/hyperlink/StrutsJbide1762Test.java
Log:
https://issues.jboss.org/browse/JBIDE-8576
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2011-05-26 19:00:45 UTC (rev 31526)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2011-05-26 19:43:02 UTC (rev 31527)
@@ -10,7 +10,6 @@
******************************************************************************/
package org.jboss.tools.cdi.internal.core.validation;
-
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Collections;
@@ -188,6 +187,9 @@
CDICoreNature nature = CDICorePlugin.getCDI(projectSet.getRootProject(), false);
if(nature!=null) {
cdiProject = nature.getDelegate();
+ if(cdiProject==null) {
+ CDICorePlugin.getDefault().logError("Trying to validate " + rootProject + " but CDI Tools model for the project is not buit.");
+ }
}
projectName = projectSet.getRootProject().getName();
sourceFolders = null;
@@ -280,7 +282,6 @@
}
}
if(!dependentFiles.isEmpty()) {
- System.out.println("Dependencies=" + dependentFiles.size());
filesToValidate.addAll(dependentFiles);
}
Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/META-INF/MANIFEST.MF 2011-05-26 19:00:45 UTC (rev 31526)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/META-INF/MANIFEST.MF 2011-05-26 19:43:02 UTC (rev 31527)
@@ -11,4 +11,5 @@
org.eclipse.core.resources;bundle-version="3.7.100",
org.jboss.tools.tests,
org.eclipse.core.runtime;bundle-version="3.7.0",
- org.jboss.tools.cdi.core
+ org.jboss.tools.cdi.core,
+ org.jboss.tools.jst.jsp.base.test
Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/.project
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/.project 2011-05-26 19:00:45 UTC (rev 31526)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/.project 2011-05-26 19:43:02 UTC (rev 31527)
@@ -6,22 +6,22 @@
</projects>
<buildSpec>
<buildCommand>
- <name>org.eclipse.wst.validation.validationbuilder</name>
+ <name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
+ <name>org.jboss.tools.jst.web.kb.kbbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
- <name>org.jboss.tools.jst.web.kb.kbbuilder</name>
+ <name>org.jboss.tools.cdi.core.cdibuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
- <name>org.jboss.tools.cdi.core.cdibuilder</name>
+ <name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/src/org/jboss/tools/cdi/seam/faces/core/test/SeamFacesTestSetup.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/src/org/jboss/tools/cdi/seam/faces/core/test/SeamFacesTestSetup.java 2011-05-26 19:00:45 UTC (rev 31526)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/src/org/jboss/tools/cdi/seam/faces/core/test/SeamFacesTestSetup.java 2011-05-26 19:43:02 UTC (rev 31527)
@@ -36,7 +36,7 @@
@Override
protected void setUp() throws Exception {
project = ResourcesPlugin.getWorkspace().getRoot().getProject(PROJECT_NAME);
- if(project == null || !project.exists()) {
+ if(!project.exists()) {
project = ResourcesUtils.importProject(PLUGIN_ID, PROJECT_PATH);
}
}
Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/src/org/jboss/tools/cdi/seam/faces/core/test/SeamFacesValidationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/src/org/jboss/tools/cdi/seam/faces/core/test/SeamFacesValidationTest.java 2011-05-26 19:00:45 UTC (rev 31526)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/src/org/jboss/tools/cdi/seam/faces/core/test/SeamFacesValidationTest.java 2011-05-26 19:43:02 UTC (rev 31527)
@@ -10,12 +10,22 @@
******************************************************************************/
package org.jboss.tools.cdi.seam.faces.core.test;
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+
import junit.framework.TestCase;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
import org.jboss.tools.cdi.internal.core.validation.CDIValidationMessages;
+import org.jboss.tools.jst.jsp.test.TestUtil;
+import org.jboss.tools.jst.web.kb.internal.validation.ValidatorManager;
+import org.jboss.tools.test.util.JobUtils;
+import org.jboss.tools.test.util.ResourcesUtils;
import org.jboss.tools.tests.AbstractResourceMarkerTest;
/**
@@ -25,9 +35,14 @@
protected IProject project;
- public IProject getTestProject() {
+ public IProject getTestProject() throws IOException, CoreException, InvocationTargetException, InterruptedException {
if(project==null) {
+ ValidatorManager.setStatus("INIT");
project = ResourcesPlugin.getWorkspace().getRoot().getProject(SeamFacesTestSetup.PROJECT_NAME);
+ if(!project.exists()) {
+ project = ResourcesUtils.importProject(SeamFacesTestSetup.PLUGIN_ID, SeamFacesTestSetup.PROJECT_PATH);
+ }
+ TestUtil.waitForValidation(project);
}
return project;
}
Modified: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java 2011-05-26 19:00:45 UTC (rev 31526)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java 2011-05-26 19:43:02 UTC (rev 31527)
@@ -34,8 +34,8 @@
import org.jboss.tools.cdi.ui.marker.MakeMethodPublicMarkerResolution;
import org.jboss.tools.cdi.ui.marker.TestableResolutionWithRefactoringProcessor;
import org.jboss.tools.common.util.FileUtil;
+import org.jboss.tools.jst.jsp.test.TestUtil;
import org.jboss.tools.jst.web.kb.internal.validation.ValidatorManager;
-import org.jboss.tools.test.util.JobUtils;
/**
* @author Daniel Azarov
@@ -55,7 +55,7 @@
ValidatorManager.setStatus("TESTING");
copyFiles(project, fileNames);
- waitForIdle(project);
+ TestUtil.waitForValidation(project);
try{
file = project.getFile(fileNames[0]);
@@ -104,7 +104,7 @@
resolution.run(marker);
}
- waitForIdle(project);
+ TestUtil.waitForValidation(project);
file = project.getFile(fileNames[0]);
IMarker[] newMarkers = file.findMarkers(markerType, true, IResource.DEPTH_INFINITE);
@@ -123,21 +123,10 @@
fail("Problem marker with id: "+id+" not found");
}finally{
restoreFiles(project, fileNames);
- waitForIdle(project);
+ TestUtil.waitForValidation(project);
}
}
- private void waitForIdle(IProject project) throws CoreException{
- JobUtils.waitForIdle();
- for (int i = 0; i < 50; i++) {
- if(ValidatorManager.getStatus().equals(ValidatorManager.SLEEPING)) {
- break;
- }
- JobUtils.delay(100);
- JobUtils.waitForIdle();
- }
- }
-
private void copyFiles(IProject project, String[] fileNames) throws CoreException{
for(String fileName : fileNames){
IFile file = project.getFile(fileName);
Modified: trunk/common/plugins/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/contentassist/CATestUtil.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/contentassist/CATestUtil.java 2011-05-26 19:00:45 UTC (rev 31526)
+++ trunk/common/plugins/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/contentassist/CATestUtil.java 2011-05-26 19:43:02 UTC (rev 31527)
@@ -29,7 +29,6 @@
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.texteditor.AbstractTextEditor;
import org.eclipse.ui.texteditor.ITextEditor;
import org.jboss.tools.common.text.xml.contentassist.ProposalSorter;
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp.base.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp.base.test/META-INF/MANIFEST.MF 2011-05-26 19:00:45 UTC (rev 31526)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp.base.test/META-INF/MANIFEST.MF 2011-05-26 19:43:02 UTC (rev 31527)
@@ -17,7 +17,8 @@
org.junit;bundle-version="3.8.2",
org.jboss.tools.jst.web;bundle-version="3.2.0",
org.eclipse.ui.ide;bundle-version="3.7.0",
- org.jboss.tools.common.model.ui
+ org.jboss.tools.common.model.ui,
+ org.jboss.tools.jst.web.kb
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Export-Package: org.jboss.tools.jst.jsp.test,
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/TestUtil.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/TestUtil.java 2011-05-26 19:00:45 UTC (rev 31526)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/TestUtil.java 2011-05-26 19:43:02 UTC (rev 31527)
@@ -1,7 +1,20 @@
package org.jboss.tools.jst.jsp.test;
-import org.jboss.tools.common.base.test.contentassist.CATestUtil;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.jboss.tools.jst.web.kb.internal.validation.ValidatorManager;
+import org.jboss.tools.test.util.JobUtils;
-public class TestUtil extends CATestUtil {
+public class TestUtil {
-}
+ public static void waitForValidation(IProject project) throws CoreException{
+ JobUtils.waitForIdle();
+ for (int i = 0; i < 50; i++) {
+ if(ValidatorManager.getStatus().equals(ValidatorManager.SLEEPING)) {
+ break;
+ }
+ JobUtils.delay(100);
+ JobUtils.waitForIdle();
+ }
+ }
+}
\ No newline at end of file
Modified: trunk/struts/tests/org.jboss.tools.struts.text.ext.test/src/org/jboss/tools/struts/text/tests/hyperlink/StrutsJbide1762Test.java
===================================================================
--- trunk/struts/tests/org.jboss.tools.struts.text.ext.test/src/org/jboss/tools/struts/text/tests/hyperlink/StrutsJbide1762Test.java 2011-05-26 19:00:45 UTC (rev 31526)
+++ trunk/struts/tests/org.jboss.tools.struts.text.ext.test/src/org/jboss/tools/struts/text/tests/hyperlink/StrutsJbide1762Test.java 2011-05-26 19:43:02 UTC (rev 31527)
@@ -22,9 +22,9 @@
import org.eclipse.ui.part.FileEditorInput;
import org.eclipse.ui.texteditor.ITextEditor;
import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
+import org.jboss.tools.common.base.test.contentassist.CATestUtil;
import org.jboss.tools.common.model.ui.editor.EditorPartWrapper;
import org.jboss.tools.common.model.ui.texteditors.XMLTextEditorComponent;
-import org.jboss.tools.jst.jsp.test.TestUtil;
import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.test.util.TestProjectProvider;
@@ -98,7 +98,7 @@
e.printStackTrace();
assertTrue("Waiting for the jobs to complete has failed.", false);
}
- TestUtil.delay(3000);
+ CATestUtil.delay(3000);
// ITextEditor textEditor = TestUtil.getActiveTextEditor(wrapperEditor);
ITextEditor textEditor = getTextEditor(wrapperEditor);
@@ -112,7 +112,7 @@
// wrapperEditor.getJspEditor();
StructuredTextViewer viewer = xmlTextEditor.getTextViewer();
IDocument document = viewer.getDocument();
- SourceViewerConfiguration config = TestUtil.getSourceViewerConfiguration(xmlTextEditor);
+ SourceViewerConfiguration config = CATestUtil.getSourceViewerConfiguration(xmlTextEditor);
IHyperlinkDetector[] hyperlinkDetectors = (config == null ? null : config.getHyperlinkDetectors(viewer));
assertTrue("Cannot get the Hyperlink Detectors for the editor for page \"" + WEB_XML_NAME + "\"", (hyperlinkDetectors != null));
@@ -179,16 +179,14 @@
index = startNodeIndex;
continue;
}
-
+
// System.out.println("Posting the Test Regions: " + documentContent.substring(startNodeIndex, endNodeIndex));
for (int j = startNodeIndex; j < endNodeIndex; j++) {
regions.add(new Region(j, 0));
}
index = documentContent.indexOf(">", endNodeIndex);
}
-
+
return regions;
}
-
-
-}
+}
\ No newline at end of file
13 years, 8 months