Package com.volantis.mcs.eclipse.common.odom.xpath

Examples of com.volantis.mcs.eclipse.common.odom.xpath.ODOMXPath


    /**
     * Test the removal of an Element node.
     */
    public void testRemoveElement() throws Exception {
        ODOMXPath path = new ODOMXPath("cd");

        ODOMObservable removed = path.remove((ODOMObservable) root);

        assertNotNull("Removed element should exist", removed);
        assertTrue("Should be an Element", removed instanceof Element);
        Element element = (Element) removed;
        assertEquals("Name should match", "cd", element.getName());
View Full Code Here


                oldParent.getContent().add(indexOfSourceAsContentOfParent,
                                           this.getSource());
            }

            return new ODOMXPath(getSource());

        } else {
            ODOMElement newParent = (ODOMElement) this.getNewValue();
            if (this.getSource() instanceof Attribute) {
                newParent.getAttributes().remove(this.getSource());
View Full Code Here

                int index = indexOfSourceAsContentOfParent <= childCount ?
                        indexOfSourceAsContentOfParent : childCount;
                newParent.getContent().add(index, this.getSource());
            }

            return new ODOMXPath(getSource());
        }
    }
View Full Code Here

        } else { //assertion failed
            throw new UnsupportedOperationException("Unsupported ChangeQualifier " + //$NON-NLS-1$
                    changeQualifier);
        }
        //we never return null here but subclasses can
        return new ODOMXPath(source);
    }
View Full Code Here

        } else { //assertion failed
            throw new UnsupportedOperationException("Unsupported ChangeQualifier " + //$NON-NLS-1$
                    changeQualifier);
        }
        //we never return null here but subclasses can
        return new ODOMXPath(source);
    }
View Full Code Here

            // (absolute) path to the proxied element; otherwise, we just
            // append the name of the proxied element to the parent's xpath
            final XPath parentXPath = ((ProxyElement) parent).xpath;
            if (parentXPath == null) {
                if (ns != null) {
                    xpath = new ODOMXPath(new StringBuffer(ns.getPrefix()).
                            append(':').
                            append(details.getElementName()).
                            toString(),
                            namespaces);
                } else {
                    xpath = new ODOMXPath(details.getElementName(), namespaces);
                }
            } else {
                if (ns != null) {
                    xpath = new ODOMXPath(parentXPath,
                            new StringBuffer(ns.getPrefix()).
                            append(':').
                            append(details.getElementName()).
                            toString(),
                            namespaces);
                } else {
                    xpath = new ODOMXPath
                            (parentXPath, details.getElementName(), namespaces);
                }
            }
        } else {
            // Parent is a non-null non-ProxyElement
View Full Code Here

     * an ODOMAttribute) has any errors.
     */
    // rest of javadoc inherited
    public Image decorateImage(Image image, Object element) {
        checkObject(element);
        final XPath xPath = new ODOMXPath((ODOMObservable) element);
        Image decoratedImage = image;
        try {
            IMarker markers[] = problemMarkerFinder.findProblemMarkers(
                    resource, xPath);
           
View Full Code Here

        final String contextStr =
                p2s.getAttribute("context").getValue();
        final String xpathStr = p2s.getAttribute("xpath").getValue();

        // This is never allowed to be empty...
        final ODOMXPath xpath = new ODOMXPath(xpathStr);
        Assert.assertEquals("xpath len", true, xpathStr.length() > 0);

        // ...but context may be, in which case it is taken to be
        // the entire selection
        final ODOMElement context =
View Full Code Here

TOP

Related Classes of com.volantis.mcs.eclipse.common.odom.xpath.ODOMXPath

Copyright © 2018 www.massapicom. 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.