Author: scabanovich
Date: 2007-12-17 11:06:08 -0500 (Mon, 17 Dec 2007)
New Revision: 5337
Modified:
trunk/common/plugins/org.jboss.tools.common.model/resources/meta/filesystems.meta
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/OpenWithHelper.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemsImpl.java
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/JarSystemImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/MountFileSystemHandler.java
Log:
JBIDE-1498
Modified:
trunk/common/plugins/org.jboss.tools.common.model/resources/meta/filesystems.meta
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model/resources/meta/filesystems.meta 2007-12-17
14:56:24 UTC (rev 5336)
+++
trunk/common/plugins/org.jboss.tools.common.model/resources/meta/filesystems.meta 2007-12-17
16:06:08 UTC (rev 5337)
@@ -357,7 +357,7 @@
<XModelEntity
ImplementationLoadingClass="org.jboss.tools.common.model.filesystems.impl.FileSystemFolderLoader"
ImplementingClass="org.jboss.tools.common.model.filesystems.impl.FileSystemImpl"
- XMLSUBPATH="FILESYSTEM" name="FileSystemFolder">
+ XMLSUBPATH="file-system" name="FileSystemFolder">
<XChildrenEntities>
<XChildEntity name="FileFolder"/>
<XChildEntity name="FileAny"/>
@@ -374,7 +374,7 @@
<Editor name="Uneditable"/>
</XModelAttribute>
<XModelAttribute name="name" xmlname="NAME"/>
- <XModelAttribute name="location" xmlname="LOCATION">
+ <XModelAttribute name="location" xmlname="location">
<Constraint loader="FileFilter">
<value name="allFiles=false"/>
<value name="description=Folder"/>
@@ -485,7 +485,7 @@
<XModelEntity
ImplementationLoadingClass="org.jboss.tools.common.model.filesystems.impl.FileSystemFolderLoader"
ImplementingClass="org.jboss.tools.common.model.filesystems.impl.JarSystemImpl"
- XMLSUBPATH="FILESYSTEM" name="FileSystemJar">
+ XMLSUBPATH="file-system" name="FileSystemJar">
<XChildrenEntities>
<XChildEntity name="JarFolder"/>
<XChildEntity name="FileAny"/>
@@ -502,7 +502,7 @@
<Editor name="Uneditable"/>
</XModelAttribute>
<XModelAttribute name="name" xmlname="NAME"/>
- <XModelAttribute name="location" xmlname="LOCATION">
+ <XModelAttribute name="location" xmlname="location">
<Constraint loader="FileFilter">
<value name="allFiles=false"/>
<value name="description=Files jar,ear,war,rar,zip"/>
@@ -546,7 +546,7 @@
<XModelEntity
ImplementationLoadingClass="org.jboss.tools.common.model.filesystems.impl.FileSystemsLoader"
ImplementingClass="org.jboss.tools.common.model.filesystems.impl.FileSystemsImpl"
- XMLSUBPATH="FILESYSTEMS" name="FileSystems">
+ XMLSUBPATH="file-systems" name="FileSystems">
<XChildrenEntities>
<XChildEntity name="FileSystemFolder"/>
<XChildEntity name="FileSystemJar"/>
@@ -564,7 +564,7 @@
<XModelAttribute default="FileSystems" name="name"
visibility="false" xmlname="NAME">
<Editor name="Uneditable"/>
</XModelAttribute>
- <XModelAttribute name="application name"
xmlname="APPLICATION_NAME"/>
+ <XModelAttribute name="application name"
xmlname="application-name"/>
<XModelAttribute name="quick start class" visibility="false"
xmlname="QUICK_START_CLASS"/>
<XModelAttribute name="version" visibility="false"
xmlname="VERSION">
<Editor name="Uneditable"/>
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/OpenWithHelper.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/OpenWithHelper.java 2007-12-17
14:56:24 UTC (rev 5336)
+++
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/OpenWithHelper.java 2007-12-17
16:06:08 UTC (rev 5337)
@@ -30,7 +30,7 @@
if(i == XFileObject.FILE) l.add(FileAnyImpl.toFileName(o));
else if(i == XFileObject.FOLDER) l.add(o.get("NAME"));
else {
- l.add(XModelObjectUtil.expand((String)o.get("LOCATION"),
o.getModel(), null));
+ l.add(XModelObjectUtil.expand((String)o.get("location"),
o.getModel(), null));
break;
}
o = o.getParent();
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemImpl.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemImpl.java 2007-12-17
14:56:24 UTC (rev 5336)
+++
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemImpl.java 2007-12-17
16:06:08 UTC (rev 5337)
@@ -116,7 +116,7 @@
}
protected String getAbsolutePath() {
- return "" + get("LOCATION");
+ return "" + get("location");
}
public FileSystemPeer getPeer() {
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemsImpl.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemsImpl.java 2007-12-17
14:56:24 UTC (rev 5336)
+++
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemsImpl.java 2007-12-17
16:06:08 UTC (rev 5337)
@@ -180,7 +180,7 @@
}
public String get(String name) {
- if("APPLICATION_NAME".equals(name)) {
+ if("APPLICATION_NAME".equals(name) ||
"application-name".equals(name)) {
String s = super.get(name);
if(s == null || s.length() == 0) {
s = "";
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 2007-12-17
14:56:24 UTC (rev 5336)
+++
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemsLoader.java 2007-12-17
16:06:08 UTC (rev 5337)
@@ -250,10 +250,14 @@
}
class FileSystemsLoaderUtil extends XModelObjectLoaderUtil {
+
+ boolean isFileSystems(String nodeName) {
+ return "FILESYSTEMS".equals(nodeName) ||
"file-systems".equals(nodeName);
+ }
protected Set<String> getAllowedChildren(XModelEntity entity) {
Set<String> children = super.getAllowedChildren(entity);
- if("FILESYSTEMS".equals(entity.getXMLSubPath())) {
+ if(isFileSystems(entity.getXMLSubPath())) {
children.add("WEB");
}
return children;
@@ -261,7 +265,7 @@
protected Set<String> getAllowedAttributes(XModelEntity entity) {
Set<String> attributes = super.getAllowedAttributes(entity);
- if("FILESYSTEMS".equals(entity.getXMLSubPath())) {
+ if(isFileSystems(entity.getXMLSubPath())) {
attributes.add("WORKSPACE_HOME");
}
return attributes;
@@ -269,7 +273,7 @@
public boolean saveChildren(Element element, XModelObject o) {
boolean b = super.saveChildren(element, o);
- if(b && "FILESYSTEMS".equals(element.getNodeName())) {
+ if(b && isFileSystems(element.getNodeName())) {
saveWorkspaceHomeAttr(element, o);
XModelObject w = getWeb(o);
if(w != null) save(element, w);
@@ -279,7 +283,7 @@
public void loadChildren(Element element, XModelObject o) {
super.loadChildren(element, o);
- if("FILESYSTEMS".equals(element.getNodeName())) {
+ if(isFileSystems(element.getNodeName())) {
Element e = XMLUtil.getUniqueChild(element, "WEB");
XModelObject w = getWeb(o);
if(w != null && e != null) load(e, w);
@@ -305,6 +309,26 @@
"." + workspace.substring(project.length()) : workspace;
element.setAttribute("WORKSPACE_HOME", relative);
}
+
+ static Map<String,String> oldAttributes = new HashMap<String, String>();
+
+ static {
+ oldAttributes.put("application-name", "APPLICATION_NAME");
+ oldAttributes.put("workspace-home", "WORKSPACE_HOME");
+ oldAttributes.put("info", "INFO");
+ oldAttributes.put("location", "LOCATION");
+ }
+ public String getAttribute(Element element, String xmlname) {
+ if(element == null || xmlname == null) return null;
+ if(!element.hasAttribute(xmlname)) {
+ String oldAttribute = oldAttributes.get(xmlname);
+ if(oldAttribute != null && element.hasAttribute(oldAttribute)) {
+ xmlname = oldAttribute;
+ }
+ }
+ return super.getAttribute(element, xmlname);
+ }
+
}
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/JarSystemImpl.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/JarSystemImpl.java 2007-12-17
14:56:24 UTC (rev 5336)
+++
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/JarSystemImpl.java 2007-12-17
16:06:08 UTC (rev 5337)
@@ -52,13 +52,13 @@
}
public String getLocation() {
- return Paths.expand(get("LOCATION"), getModel().getProperties());
+ return Paths.expand(get("location"), getModel().getProperties());
}
public String getTempLocation() {
if(!jar.isLoaded()) loadChildren();
String s = jar.getTempLocation();
- return (s == null) ? get("LOCATION") : s;
+ return (s == null) ? get("location") : s;
}
public LFileObject getFileObject(String relpath) {
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/MountFileSystemHandler.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/MountFileSystemHandler.java 2007-12-17
14:56:24 UTC (rev 5336)
+++
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/MountFileSystemHandler.java 2007-12-17
16:06:08 UTC (rev 5337)
@@ -50,7 +50,7 @@
location += "/";
XModelObject[] cs = object.getChildren(entity);
for (int i = 0; i < cs.length; i++) {
- String loc = canonize(cs[i].get("LOCATION"), cs[i].getModel()) +
"/";
+ String loc = canonize(cs[i].get("location"), cs[i].getModel()) +
"/";
if(!loc.startsWith(location) && !location.startsWith(loc)) continue;
String mes = "File system " + p.get("name") + " will
share files with file system " + cs[i].getAttributeValue("name");
ServiceDialog d = object.getModel().getService();