Examples of ODOMAttribute


Examples of com.volantis.mcs.eclipse.common.odom.ODOMAttribute

        return result;
    }

    // javadoc inherited
    public Attribute getAttribute(String str) {
        ODOMAttribute attribute = (ODOMAttribute) super.getAttribute(str);
        if (attribute != null) {
            // TODO This should not return a new one every time (ideally)
            attribute = new ProxyAttribute(attribute, this);
        }
        return attribute;
View Full Code Here

Examples of com.volantis.mcs.eclipse.common.odom.ODOMAttribute

        return attribute;
    }

    // javadoc inherited
    public Attribute getAttribute(String str, Namespace namespace) {
        ODOMAttribute attribute =
                (ODOMAttribute) super.getAttribute(str, namespace);
        return new ProxyAttribute(attribute, this);
    }
View Full Code Here

Examples of com.volantis.mcs.eclipse.common.odom.ODOMAttribute

        final Element child = (Element)children.get(0);
        final String name = directive.getAttribute("name").getValue();
        final String value = directive.getAttribute("value").getValue();

        // Get the thing to operate on
        ODOMAttribute attribute = null;
        if (child.getName().equals("proxy")) {

            // It's a proxy element, so get it by name and lookup
            // the attribute
            final ODOMElement element = (ODOMElement)elementsMap.
                    get(child.getAttribute("name").getValue());
            attribute = (ODOMAttribute)element.getAttribute(name);

        } else if (child.getName().equals("pathToSelection")) {

            // It's an attribute within the selection, so first get
            // the context element
            final ODOMElement context = (ODOMElement)
                    getSingletonNode(
                            currentSelection,
                            child.getAttribute("context").getValue());

            // Use the context to get the attribute
            final String xpathStr = child.getAttribute("xpath").getValue();
            Assert.assertEquals("xpath len", true, xpathStr.length() > 0);
            attribute = (ODOMAttribute)getSingletonNode(context, xpathStr);

        } else {
            throw new IllegalStateException(
                    "Unknown child: " + child);
        }

        // This directive applies to EXTANT attributes only
        if (attribute == null) {
            throw new IllegalStateException("Could not find attrib");
        }

        // Now set the attribute
        Utils.print("\nBefore updateAttribValue:");
        Utils.print(attribute.getParent());
        attribute.setValue(value);
        Utils.print("\nAfter updateAttribValue:");
        Utils.print(attribute.getParent());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.