public String getAttribute(Element element, String xmlname, XAttribute attr) { if (element == null || xmlname == null) return null; if (!element.hasAttribute(xmlname)) { String oldAttribute = xmlname; while (oldAttribute != null) { oldAttribute = oldAttributes.get(oldAttribute); if (oldAttribute != null && element.hasAttribute(oldAttribute)) { xmlname = oldAttribute; break; } } } return super.getAttribute(element, xmlname, attr); }
public void loadChildren(Element element, XModelObject o) { super.loadChildren(element, o); if (isFileSystems(element.getNodeName())) { Element e = XMLUtil.getUniqueChild(element, "web"); // $NON-NLS-1$ if (e == null) e = XMLUtil.getUniqueChild(element, "WEB"); // $NON-NLS-1$ XModelObject w = getWeb(o); if (w != null && e != null) load(e, w); } }
private void saveWorkspaceHomeAttr(Element element, XModelObject o) { Properties p = o.getModel().getProperties(); String project = p.getProperty(IModelNature.ECLIPSE_PROJECT); String workspace = p.getProperty(XModelConstants.WORKSPACE); if (project == null) return; String relative = workspace.startsWith(project + XModelObjectConstants.SEPARATOR) ? "." + workspace.substring(project.length()) : workspace; //$NON-NLS-1$ element.setAttribute("workspace-home", relative); // $NON-NLS-1$ }
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); XModelObject w = getWeb(o); if (w != null) save(element, w); } return b; }