Package org.jdom

Examples of org.jdom.Element.detach()


                }

                // Detach the managed element from its parent.
                element.detach();
                // detach the standard element from the managed element
                standardElement.detach();

                // If restoreElement is null, this means that element was a brand
                // new element that did not previously exist. Therefore, since
                // element has just been detached above, there is no further work
                // to do. On the other hand, if restoreElement is non-null, then
View Full Code Here



    public void testUndoRedoReplaceElementWithFragmentContainingElement()
            throws Exception {
        Element elem02 = rootElement.getChild("elem02");
        elem02.detach();

        Element newElem02 = odomFactory.element("newElem02");
        newElem02.addContent(elem02);
        rootElement.getChildren().add(1, newElem02);
        assertNotNull("elem02 in new pos",
View Full Code Here

                    foreignParent = elementSource.getParent();
                    if(foreignParent!=null) {
                        //the removed node was attached to an unlistened foreign odom fragment
                        //then need to save info for redo
                        indexOfSourceInForeignParent = foreignParent.getContent().indexOf(elementSource);
                        elementSource.detach();
                    }
                }

                oldParent.getContent().add(indexOfSourceAsContentOfParent,
                                           this.getSource());
View Full Code Here

        if (currentType != policyType) {
            policyDefinition.removeChangeListener(odomChangeListener);
            try {
                // detatch type element from the policy definition element
                typeElement.detach();
                // add the new type element
                composition.addTypeElement(policyDefinition,
                                           policyType,
                                           context.getODOMFactory());
                // update the optional controls that may be required if the
View Full Code Here

        try {
            Element uaProfElement = getUAProfElement();
            if ((uaProfName == null) || (uaProfName.trim().length() == 0)) {
                if (uaProfElement != null) {
                    uaProfElement.detach();
                }
            } else {
                if (uaProfElement == null) {
                    // create a new element
                    uaProfElement = context.getODOMFactory().element(
View Full Code Here

        Element range = factory.element("range");
        type.addContent(range);
        assertFalse("Should not be able handle type with no name attribute",
                PolicyTypeComposition.STRUCTURE.canHandleType(type));

        range.detach();

        type.setAttribute(DeviceRepositorySchemaConstants.
                POLICY_DEFINITION_TYPE_NAME_ATTRIBUTE_NAME,
                DeviceRepositorySchemaConstants.
                POLICY_DEFINITION_EMULATE_EMPHASIS_TAG_NAME);
View Full Code Here

                {
                    // remove the hidden input where name="formname" since a new one will be generated again when the xhtml is rendered.
                    Element formName = (Element)XPath.selectSingleNode( e, "INPUT[@name='formname']" );
                    if( formName != null )
                    {
                        formName.detach();
                    }

                    String name = e.getAttributeValue( "name" );

                    m_out.print( "\n[{FormOpen" );
View Full Code Here

        final Document doc = constructDocumentFromXmlString(samlResponse);

        if (doc != null) {
            final Element signedElement = signSamlElement(doc.getRootElement(),
                privateKey, publicKey);
            doc.setRootElement((Element) signedElement.detach());
            return new XMLOutputter().outputString(doc);
        }
        throw new RuntimeException("Error signing SAML Response: Null document");
    }
View Full Code Here

  onlyDidReads = false;
  Table table = row.getTable();
  Column primaryKey = table.getPrimaryKey();

  Element element = (Element) row.getValue(primaryKey);
  element.detach();
  // TODO: deal with cascaded delete ramifications on the cache
    }

    public Collection select(Selector selector, Set extraRows) {
  Condition condition = selector.getCondition();
View Full Code Here

    static Entry readFeedEntry(String feedType, Reader reader) throws JDOMException, IOException, IllegalArgumentException,
        FeedException {
        SAXBuilder builder = new SAXBuilder();
        Document document = builder.build(reader);
        Element root = document.getRootElement();
        root.detach();
        Feed feed = new Feed();
        feed.setFeedType(feedType);
        WireFeedOutput wireFeedOutput = new WireFeedOutput();
        document = wireFeedOutput.outputJDom(feed);
        document.getRootElement().addContent(root);
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.