Examples of JDOMFactory


Examples of org.jdom.input.JDOMFactory

     * @param element used to identify the device layout
     * @return an element equivalent to that given but this time in the clone.
     *         Will be null if the given element is not a format
     */
    public static Element cloneContainingDeviceLayout(Element element) {
        JDOMFactory factory = FormatPrototype.factory;
        Element equivalent = null;
        Element deviceLayout = getContainingDeviceLayout(element);

        if (deviceLayout != null) {
            Element layout = deviceLayout.getParent();
            Element newLayout = factory.element(layout.getName(),
                    layout.getNamespace());
            Element newDeviceLayout = (Element) deviceLayout.clone();

            // Put the new layout in a document to allow absolute XPaths
            // to operate correctly
            factory.document(newLayout);

            // Put the cloned device layout into the new layout
            newLayout.addContent(newDeviceLayout);

            // Locate the equivalent element in the clone to that
View Full Code Here

Examples of org.jdom.input.JDOMFactory

     * Test getSelection(). This test is a bit pointless but since we
     * already have this test class then we need at least one test.
     */
    public void testGetSelection() {

        JDOMFactory factory = new LPDMODOMFactory();
        ODOMElement el1 = (ODOMElement) factory.element("Element1");
        ODOMElement el2 = (ODOMElement) factory.element("Element2");
        ODOMElement el3 = (ODOMElement) factory.element("Element3");

        ODOMElement[] elements = new ODOMElement[]{el1, el2, el3};

        List expected = Arrays.asList(elements);

View Full Code Here

Examples of org.jdom.input.JDOMFactory

    /**
     * Ensure that the constructor only allows ODOMElements in the
     * selection.
     */
    public void testConstructorCreation() {
        JDOMFactory factory = new LPDMODOMFactory();
        ODOMElement e1 = (ODOMElement) factory.element("Element1");
        ODOMElement e2 = (ODOMElement) factory.element("Element2");
        ODOMElement e3 = (ODOMElement) factory.element("Element3");

        ArrayList elements = new ArrayList();
        elements.add(e1);
        elements.add(e2);
        elements.add(e3);
View Full Code Here

Examples of org.jdom.input.JDOMFactory

    /**
     * Test toList().
     */
    public void testToList() {
        JDOMFactory factory = new LPDMODOMFactory();
        ODOMElement el1 = (ODOMElement) factory.element("Element1");
        ODOMElement el2 = (ODOMElement) factory.element("Element2");
        ODOMElement el3 = (ODOMElement) factory.element("Element3");

        ODOMElement[] elements = new ODOMElement[]{el1, el2, el3};

        List expected = Arrays.asList(elements);

View Full Code Here

Examples of org.jdom.input.JDOMFactory

    /**
     * Test toArray()
     */
    public void testToArray() {
        JDOMFactory factory = new LPDMODOMFactory();
        ODOMElement el1 = (ODOMElement) factory.element("Element1");
        ODOMElement el2 = (ODOMElement) factory.element("Element2");
        ODOMElement el3 = (ODOMElement) factory.element("Element3");

        ODOMElement[] elements = new ODOMElement[]{el1, el2, el3};

        ODOMElementSelection selection = new ODOMElementSelection(
                Arrays.asList(elements));
View Full Code Here

Examples of org.jdom.input.JDOMFactory

    /**
     * Test toODOMElementArray()
     */
    public void testToODOMElementArray() {
        JDOMFactory factory = new LPDMODOMFactory();
        ODOMElement e1 = (ODOMElement) factory.element("Element1");
        ODOMElement e2 = (ODOMElement) factory.element("Element2");
        ODOMElement e3 = (ODOMElement) factory.element("Element3");

        ODOMElement[] elements = new ODOMElement[]{e1, e2, e3};

        ODOMElementSelection selection = new ODOMElementSelection(
                Arrays.asList(elements));
View Full Code Here

Examples of org.jdom.input.JDOMFactory

    /**
     * Test toODOMElementArray()
     */
    public void testGetFirstElement() {
        JDOMFactory factory = new LPDMODOMFactory();
        ODOMElement e1 = (ODOMElement) factory.element("Element1");
        ODOMElement e2 = (ODOMElement) factory.element("Element2");
        ODOMElement e3 = (ODOMElement) factory.element("Element3");

        ODOMElement[] elements = new ODOMElement[]{e1, e2, e3};

        ODOMElementSelection selection = new ODOMElementSelection(
                Arrays.asList(elements));
View Full Code Here

Examples of org.jdom.input.JDOMFactory

    /**
     * Test iterator().
     */
    public void testIterator() {
        JDOMFactory factory = new LPDMODOMFactory();
        ODOMElement e1 = (ODOMElement) factory.element("Element1");
        ODOMElement e2 = (ODOMElement) factory.element("Element2");
        ODOMElement e3 = (ODOMElement) factory.element("Element3");

        ODOMElement[] elements = new ODOMElement[]{e1, e2, e3};

        ODOMElementSelection selection = new ODOMElementSelection(
                Arrays.asList(elements));
View Full Code Here

Examples of org.jdom.input.JDOMFactory

    /**
     * Test size().
     */
    public void testSize() {
        JDOMFactory factory = new LPDMODOMFactory();
        ODOMElement e1 = (ODOMElement) factory.element("Element1");
        ODOMElement e2 = (ODOMElement) factory.element("Element2");
        ODOMElement e3 = (ODOMElement) factory.element("Element3");

        ODOMElement[] elements = new ODOMElement[]{e1, e2, e3};

        ODOMElementSelection selection = new ODOMElementSelection(
                Arrays.asList(elements));
View Full Code Here

Examples of org.jdom.input.JDOMFactory

    /**
     * Test isEmpty()
     */
    public void testIsEmpty() {
        JDOMFactory factory = new LPDMODOMFactory();
        ODOMElement e1 = (ODOMElement) factory.element("Element1");

        ODOMElement[] elements = new ODOMElement[]{e1};

        ODOMElementSelection selection = new ODOMElementSelection(
                Arrays.asList(elements));
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.