From d3bb2ce174df058542068ce6bd1fe6c22f4ea59e Mon Sep 17 00:00:00 2001 From: Martin Oberhuber < martin.oberhuber@windriver.com> Date: Wed, 4 Apr 2007 10:54:08 +0000 Subject: [PATCH] [180562][api] dont implement ISystemUDAConstants --- .../ui/uda/SystemUDBaseManager.java | 21 +++++++------- .../ui/uda/SystemXMLElementWrapper.java | 28 ++++++++++--------- 2 files changed, 26 insertions(+), 23 deletions(-) diff --git a/rse/plugins/org.eclipse.rse.useractions/src/org/eclipse/rse/useractions/ui/uda/SystemUDBaseManager.java b/rse/plugins/org.eclipse.rse.useractions/src/org/eclipse/rse/useractions/ui/uda/SystemUDBaseManager.java index e2b98291706..55d031ebfe4 100644 --- a/rse/plugins/org.eclipse.rse.useractions/src/org/eclipse/rse/useractions/ui/uda/SystemUDBaseManager.java +++ b/rse/plugins/org.eclipse.rse.useractions/src/org/eclipse/rse/useractions/ui/uda/SystemUDBaseManager.java @@ -7,6 +7,7 @@ * * Contributors: * IBM Corporation - initial API and implementation + * Martin Oberhuber (Wind River) - [180562][api] dont implement ISystemUDAConstants *******************************************************************************/ package org.eclipse.rse.useractions.ui.uda; @@ -84,7 +85,7 @@ import org.xml.sax.SAXParseException; * Architecturally, this class and the SystemXMLElementWrapper class * encapsulate all knowledge of the fact the underlying store is a xml document. */ -public abstract class SystemUDBaseManager implements ErrorHandler, IResourceChangeListener, ISystemXMLElementWrapperFactory, ITreeContentProvider, ISystemUDAConstants { +public abstract class SystemUDBaseManager implements ErrorHandler, IResourceChangeListener, ISystemXMLElementWrapperFactory, ITreeContentProvider { // state protected SystemUDActionSubsystem _udas; protected IFolder importCaseFolder; // Only set during Import processing @@ -325,7 +326,7 @@ public abstract class SystemUDBaseManager implements ErrorHandler, IResourceChan // create root element. Eg or Element root = doc.createElement(getDocumentRootTagName()); // set current release as an attribute - root.setAttribute(RELEASE_ATTR, CURRENT_RELEASE_NAME); + root.setAttribute(ISystemUDAConstants.RELEASE_ATTR, CURRENT_RELEASE_NAME); // assign root doc.appendChild(root); // Add Root to Document } @@ -609,7 +610,7 @@ public abstract class SystemUDBaseManager implements ErrorHandler, IResourceChan public String getDocumentRelease(ISystemProfile profile) { Document doc = getDocument(profile); Element root = doc.getDocumentElement(); - String rel = root.getAttribute(RELEASE_ATTR); + String rel = root.getAttribute(ISystemUDAConstants.RELEASE_ATTR); if (rel == null) return "4.0"; //$NON-NLS-1$ else @@ -627,12 +628,12 @@ public abstract class SystemUDBaseManager implements ErrorHandler, IResourceChan // document is good. Now, check the release date stamped on it. // if not the current release, then we must consider migration... Element docroot = doc.getDocumentElement(); - String docRelease = docroot.getAttribute(RELEASE_ATTR); + String docRelease = docroot.getAttribute(ISystemUDAConstants.RELEASE_ATTR); if ((docRelease == null) || (docRelease.length() == 0)) docRelease = "4.0"; //$NON-NLS-1$ if (!docRelease.equals(CURRENT_RELEASE_NAME)) { //System.out.println("Doing migration from "+docRelease+" to " + ISystemConstants.CURRENT_RELEASE_NAME + "..."); boolean migrationDone = doMigration(profile, docRelease); - docroot.setAttribute(RELEASE_ATTR, RSECorePlugin.CURRENT_RELEASE_NAME); + docroot.setAttribute(ISystemUDAConstants.RELEASE_ATTR, RSECorePlugin.CURRENT_RELEASE_NAME); if (migrationDone) { setChanged(profile); // is this the right thing to do? saveUserData(profile); @@ -1353,10 +1354,10 @@ public abstract class SystemUDBaseManager implements ErrorHandler, IResourceChan * @param domain - the integer representation of the domain, used to get its name and translated name */ protected Element createDomainElement(Document xdoc, int domain) { - Element element = xdoc.createElement(XE_DOMAIN); + Element element = xdoc.createElement(ISystemUDAConstants.XE_DOMAIN); xdoc.getDocumentElement().appendChild(element); - element.setAttribute(XE_DOMTYPE, getActionSubSystem().mapDomainName(domain)); - element.setAttribute(XE_DOMNAME, getActionSubSystem().mapDomainXlatedName(domain)); + element.setAttribute(ISystemUDAConstants.XE_DOMTYPE, getActionSubSystem().mapDomainName(domain)); + element.setAttribute(ISystemUDAConstants.XE_DOMNAME, getActionSubSystem().mapDomainXlatedName(domain)); return element; } @@ -1368,7 +1369,7 @@ public abstract class SystemUDBaseManager implements ErrorHandler, IResourceChan * element. That is, if its tag name is "Domain" */ public static boolean isDomainElement(Element element) { - return (element.getTagName().equals(XE_DOMAIN)); + return (element.getTagName().equals(ISystemUDAConstants.XE_DOMAIN)); } /** @@ -1384,7 +1385,7 @@ public abstract class SystemUDBaseManager implements ErrorHandler, IResourceChan * the given untranslated domain name */ public static boolean domainTypeEquals(Element element, String domainName) { - return (element.getAttribute(XE_DOMTYPE).equals(domainName)); + return (element.getAttribute(ISystemUDAConstants.XE_DOMTYPE).equals(domainName)); } /** diff --git a/rse/plugins/org.eclipse.rse.useractions/src/org/eclipse/rse/useractions/ui/uda/SystemXMLElementWrapper.java b/rse/plugins/org.eclipse.rse.useractions/src/org/eclipse/rse/useractions/ui/uda/SystemXMLElementWrapper.java index a8b29da43e3..704bbe1bb26 100644 --- a/rse/plugins/org.eclipse.rse.useractions/src/org/eclipse/rse/useractions/ui/uda/SystemXMLElementWrapper.java +++ b/rse/plugins/org.eclipse.rse.useractions/src/org/eclipse/rse/useractions/ui/uda/SystemXMLElementWrapper.java @@ -1,5 +1,3 @@ -package org.eclipse.rse.useractions.ui.uda; - /******************************************************************************* * Copyright (c) 2002, 2007 IBM Corporation and others. * All rights reserved. This program and the accompanying materials @@ -9,7 +7,11 @@ package org.eclipse.rse.useractions.ui.uda; * * Contributors: * IBM Corporation - initial API and implementation + * Martin Oberhuber (Wind River) - [180562][api] dont implement ISystemUDAConstants *******************************************************************************/ + +package org.eclipse.rse.useractions.ui.uda; + import java.util.Vector; import org.eclipse.core.runtime.IAdaptable; @@ -27,7 +29,7 @@ import org.w3c.dom.Text; * Eg, there are child classes to represent action xml elements, and * type xml elements. */ -public abstract class SystemXMLElementWrapper implements IAdaptable, ISystemUDAConstants { +public abstract class SystemXMLElementWrapper implements IAdaptable { //parameters protected Element elm; private boolean isDomainElement; @@ -54,7 +56,7 @@ public abstract class SystemXMLElementWrapper implements IAdaptable, ISystemUDAC /** * The value we place in the Vendor attribute for IBM-supplied actions/types */ - private static final String VENDOR_IBM = "IBM"; + private static final String VENDOR_IBM = "IBM"; //$NON-NLS-1$ /** * Constructor @@ -66,7 +68,7 @@ public abstract class SystemXMLElementWrapper implements IAdaptable, ISystemUDAC public SystemXMLElementWrapper(Element elm, SystemUDBaseManager mgr, ISystemProfile profile, int domainType) { super(); this.elm = elm; - this.isDomainElement = elm.getTagName().equals(XE_DOMAIN); + this.isDomainElement = elm.getTagName().equals(ISystemUDAConstants.XE_DOMAIN); this.domainType = domainType; database = mgr; this.profile = profile; @@ -134,7 +136,7 @@ public abstract class SystemXMLElementWrapper implements IAdaptable, ISystemUDAC */ public Element getParentDomainElement() { Element parent = getParentElement(); - if ((parent != null) && parent.getTagName().equals(XE_DOMAIN)) + if ((parent != null) && parent.getTagName().equals(ISystemUDAConstants.XE_DOMAIN)) return parent; else return null; @@ -172,7 +174,7 @@ public abstract class SystemXMLElementWrapper implements IAdaptable, ISystemUDAC * Return the value of this node's "Name" attribute */ public String getName() { - return elm.getAttribute(NAME_ATTR); + return elm.getAttribute(ISystemUDAConstants.NAME_ATTR); } /** @@ -182,13 +184,13 @@ public abstract class SystemXMLElementWrapper implements IAdaptable, ISystemUDAC */ public void setName(String s) { if (isIBM()) { - String orgName = elm.getAttribute(ORIGINAL_NAME_ATTR); + String orgName = elm.getAttribute(ISystemUDAConstants.ORIGINAL_NAME_ATTR); if ((orgName != null) && (orgName.length() > 0)) { // no need to do anything, as its already set. } else - elm.setAttribute(ORIGINAL_NAME_ATTR, getName()); + elm.setAttribute(ISystemUDAConstants.ORIGINAL_NAME_ATTR, getName()); } - setAttribute(NAME_ATTR, s); + setAttribute(ISystemUDAConstants.NAME_ATTR, s); setUserChanged(true); } @@ -196,7 +198,7 @@ public abstract class SystemXMLElementWrapper implements IAdaptable, ISystemUDAC * For IBM-supplied elements that have been edited, returns the original IBM-supplied name */ public String getOriginalName() { - String s = elm.getAttribute(ORIGINAL_NAME_ATTR); + String s = elm.getAttribute(ISystemUDAConstants.ORIGINAL_NAME_ATTR); if ((s == null) || (s.length() == 0)) return getName(); else @@ -439,7 +441,7 @@ public abstract class SystemXMLElementWrapper implements IAdaptable, ISystemUDAC if (sn instanceof Element) { se = (Element) sn; if (se.getTagName().equals(tagName)) { - nameList.add(se.getAttribute(NAME_ATTR)); + nameList.add(se.getAttribute(ISystemUDAConstants.NAME_ATTR)); } } } // end for all subnodes @@ -514,7 +516,7 @@ public abstract class SystemXMLElementWrapper implements IAdaptable, ISystemUDAC Node sn = subList.item(idx); if (sn instanceof Element) { if (((Element) sn).getTagName().equals(tagName)) { - if (((Element) sn).getAttribute(NAME_ATTR).equals(searchName)) match = (Element) sn; + if (((Element) sn).getAttribute(ISystemUDAConstants.NAME_ATTR).equals(searchName)) match = (Element) sn; } } } // end for all subnodes