Package org.jdom2

Examples of org.jdom2.Element.removeContent()


      // get the teams object
      Element eTeams = worldConfig.getChild("teams");
      if (eTeams == null) worldConfig.addContent(eTeams = new Element("team"));

      // reset the teams to whatever has been saved
      eTeams.removeContent();
      for (AutoRefTeam team : teams)
        eTeams.addContent(team.toElement());

      // get the regions object
      Element eRegions = worldConfig.getChild("regions");
View Full Code Here


      // get the regions object
      Element eRegions = worldConfig.getChild("regions");
      if (eRegions == null) worldConfig.addContent(eRegions = new Element("regions"));

      // reset the regions to whatever has been saved
      eRegions.removeContent();
      for (AutoRefRegion reg : this.getRegions())
        eRegions.addContent(reg.toElement());

      // get startregion object
      Element eStartRegions = worldConfig.getChild("startregion");
View Full Code Here

        LocationUtil.toBlockCoordsWithYaw(getWorldSpawn()));

      if (specSpawn != null) eStartRegions.setAttribute("spec",
        LocationUtil.toBlockCoordsWithYaw(specSpawn.getCenter()));

      eStartRegions.removeContent();
      for (AutoRefRegion reg : this.getStartRegions())
        eStartRegions.addContent(reg.toElement());

      // get the protections object
      Element eProtect = worldConfig.getChild("protect");
View Full Code Here

      // get the protections object
      Element eProtect = worldConfig.getChild("protect");
      if (eProtect == null) worldConfig.addContent(eProtect = new Element("protect"));

      // reset the protections to whatever has been saved
      eProtect.removeContent();
      for (UUID uid : protectedEntities)
        eProtect.addContent(new Element("entity").setText(uid.toString()));

      // get the goals object
      Element eGoals = worldConfig.getChild("goals");
View Full Code Here

      // get the goals object
      Element eGoals = worldConfig.getChild("goals");
      if (eGoals == null) worldConfig.addContent(eGoals = new Element("goals"));

      // reset the goals to whatever has been saved
      eGoals.removeContent();
      for (AutoRefTeam team : this.getTeams())
      {
        Element tgoals = new Element("teamgoals")
          .setAttribute("team", team.getDefaultName());
        eGoals.addContent(tgoals);
View Full Code Here

      // get the mechanisms object
      Element eMechanisms = worldConfig.getChild("mechanisms");
      if (eMechanisms == null) worldConfig.addContent(eMechanisms = new Element("mechanisms"));

      // reset the mechanisms to whatever has been saved
      eMechanisms.removeContent();
      for (StartMechanism mech : this.startMechanisms)
        eMechanisms.addContent(mech.toElement());

      Element eGameplay = worldConfig.getChild("gameplay");
      if (eGameplay == null) worldConfig.addContent(eGameplay = new Element("gameplay"));
View Full Code Here

      if (this.prohibitCraft.size() > 0)
      {
        Element eNoCraft = eGameplay.getChild("nocraft");
        if (eNoCraft == null) eGameplay.addContent(eNoCraft = new Element("nocraft"));

        eNoCraft.removeContent();
        for (BlockData bd : prohibitCraft)
        {
          Element nocraft = new Element("item").setText(bd.getName());
          eNoCraft.addContent(nocraft.setAttribute("id", bd.serialize()));
        }
View Full Code Here

            Iterator elems = (Iterator) foreignMarkup.iterator();
            while (elems.hasNext()) {
                Element elem = (Element) elems.next();
                Parent parent = elem.getParent();
                if (parent != null) {
                    parent.removeContent(elem);
                }
                e.addContent(elem);
            }
        }
    }
View Full Code Here

    protected void generateForeignMarkup(final Element element, final List<Element> foreignElements) {
        if (foreignElements != null) {
            for (final Element foreignElement : foreignElements) {
                final Parent parent = foreignElement.getParent();
                if (parent != null) {
                    parent.removeContent(foreignElement);
                }
                element.addContent(foreignElement);
            }
        }
    }
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.