Package org.jdom

Examples of org.jdom.Element.indexOf()


        Element sibling = nodes.get(0);
        Element parent = sibling.getParentElement();
        node = (Element) sibling.clone();
        Attribute targetAttrLang = getLanguageAttr(node);
        targetAttrLang.setValue(locale.getLanguage());
        int indexOfElement = parent.indexOf(sibling);
        parent.addContent(indexOfElement+1, node);
        return node;
    }

    public void inject(Map<Locale,Properties> bundles) throws Exception {
View Full Code Here


        Element sibling = nodes.get(0);
        Element parent = sibling.getParentElement();
        node = (Element) sibling.clone();
        Attribute targetAttrLang = getLanguageAttr(node);
        targetAttrLang.setValue(locale.getLanguage());
        int indexOfElement = parent.indexOf(sibling);
        parent.addContent(indexOfElement+1, node);
        return node;
    }

    public void inject(Map<Locale,Properties> bundles) throws Exception {
View Full Code Here

        widget.setAttribute("id",  widgetModel.getIdentifier());
      }
      int idx = 0;
      tempElement = widget.getChild("icon", widget.getNamespace());
      if(tempElement != null){
        idx = widget.indexOf(tempElement);
        //remove original icon entries
        widget.removeChildren("icon", widget.getNamespace());
        // get the model icons
      }
      List<IIconEntity> generatedIcons = widgetModel.getIconsList();
View Full Code Here

              + attribute.getValue() + "\"";
        }
        replacement += "/>";

        Element parent = element.getParentElement();
        int index = parent.indexOf(element);
        parent.setContent(index, new Text(replacement));
      } else {
        // The element contains data
        String prepend = "<" + element.getName();
View Full Code Here

        prepend += ">";

        String postpend = "</" + element.getName() + ">";

        Element parent = element.getParentElement();
        int index = parent.indexOf(element);

        parent.addContent(index, new Text(postpend));
        parent.addContent(index, element.removeContent());
        parent.addContent(index, new Text(prepend));
        parent.removeContent(element);
View Full Code Here

      if (ob instanceof Element) {
        Element elem = (Element)ob;

         if (fragment.getName().equals(REPLACEMENT_GROUP)) {
           Element parent = elem.getParentElement();
           int insertionIndex = parent.indexOf(elem);
           @SuppressWarnings("unchecked")
                List<Element> children = fragment.getChildren();
          
           for (Element child: children) {
             //insert a copy of the referencing element
View Full Code Here

                            if (!action.equals(ACTION_DETACH) && show.equalsIgnoreCase(XLink.SHOW_REPLACE)) {
                                remoteFragment.setAttribute((Attribute)xlink.clone());
                                remoteFragment.setAttribute(new Attribute(XLink.SHOW, XLink.SHOW_REPLACE, XLink.NAMESPACE_XLINK));
                            }
                            Element parent = element.getParentElement();
                            int index = parent.indexOf(element);
                            parent.setContent(index,remoteFragment);
                        } else { // show = XLink.SHOW_EMBED
                            // replace children of this element with the fragment
                            element.removeContent();
                            element.addContent(remoteFragment);
View Full Code Here

        }
        Element withinFilter = findWithinFilter(regionEl);

        if(withinFilter!=null ){
            Element parentElement = withinFilter.getParentElement();
            int index = parentElement.indexOf(withinFilter);

            ArrayList<Element> ors = new ArrayList<Element>();
            ors.add(withinFilter);
            for (Geometry geometry : geoms) {
                Element newEl = (Element) withinFilter.clone();
View Full Code Here

     * Update the element with the gml encoded geometry
     */
    private void setGeom(Element element, Geometry fullGeom) throws IOException, JDOMException
    {
        Element parentElement = element.getParentElement();
        int index = parentElement.indexOf(element);

        ByteArrayOutputStream out = new ByteArrayOutputStream();
        Encoder encoder = new Encoder(_configuration);
        encoder.setOmitXMLDeclaration(true);
        encoder.setNamespaceAware(true);
View Full Code Here

        widget.setAttribute("id",  widgetModel.getIdentifier());
      }
      int idx = 0;
      tempElement = widget.getChild("icon", widget.getNamespace());
      if(tempElement != null){
        idx = widget.indexOf(tempElement);
        //remove original icon entries
        widget.removeChildren("icon", widget.getNamespace());
        // get the model icons
      }
      List<IIcon> generatedIcons = widgetModel.getIcons();
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.