Author: scabanovich
Date: 2012-06-22 19:21:45 -0400 (Fri, 22 Jun 2012)
New Revision: 42185
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemsLoader.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ClassPathUpdate.java
Log:
JBIDE-12247
https://issues.jboss.org/browse/JBIDE-12247
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemsLoader.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemsLoader.java 2012-06-22
22:21:40 UTC (rev 42184)
+++
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemsLoader.java 2012-06-22
23:21:45 UTC (rev 42185)
@@ -130,6 +130,20 @@
protected String fileName(XModelObject object) {
return "workspace.pex"; //$NON-NLS-1$
}
+
+ public void saveTo(File f, XModelObject object) {
+ XModelObject o = object.copy(1);
+ XModelObject[] cs = o.getChildren();
+ for (XModelObject c: cs) {
+ if(c.getModelEntity().getName().equals("FileSystemJar")) { //$NON-NLS-1$
+ o.removeChild(c);
+ }
+
if(!c.getAttributeValue(XModelObjectConstants.ATTR_NAME_LOCATION).startsWith("%"))
{ //$NON-NLS-1$
+ o.removeChild(c);
+ }
+ }
+ util().save(f, o);
+ }
private boolean saveEclipse(XModelObject object) {
String f = getEclipseFileName(object, false);
@@ -264,6 +278,9 @@
}
public boolean saveChildren(Element element, XModelObject o) {
+ if("FileSystemJar".equals(o.getModelEntity().getName())) { //$NON-NLS-1$
+ return true;
+ }
boolean b = super.saveChildren(element, o);
if(b && isFileSystems(element.getNodeName())) {
saveWorkspaceHomeAttr(element, o);
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ClassPathUpdate.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ClassPathUpdate.java 2012-06-22
22:21:40 UTC (rev 42184)
+++
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ClassPathUpdate.java 2012-06-22
23:21:45 UTC (rev 42185)
@@ -137,7 +137,17 @@
}
}
}
-
+ children =
FileSystemsHelper.getFileSystems(model).getChildren("FileSystemFolder");
+ for (XModelObject c: children) {
+ String n = c.getAttributeValue(XModelObjectConstants.ATTR_NAME);
+ if("src".equals(n) || n.startsWith("src-")) {
+ String osPath = XModelObjectUtil.getExpandedValue(c,
XModelObjectConstants.ATTR_NAME_LOCATION, null);
+ if (osPath != null && !"".equals(osPath) &&
!set.contains(osPath)) { //$NON-NLS-1$
+ srcPaths.add(osPath);
+ set.add(osPath);
+ }
+ }
+ }
Iterator iterator = srcPaths.iterator();
while (iterator.hasNext()) {
IClasspathEntry entry = createNewClasspathEntry(iterator.next().toString(),
IClasspathEntry.CPE_SOURCE);