Package org.freeplane.n3.nanoxml

Examples of org.freeplane.n3.nanoxml.XMLElement


    }
    return xmlElement;
  }

  private XMLElement firstCharsToXml() {
    final XMLElement xmlElement = new XMLElement(ELEM_CHECKFIRSTCHAR);
    if (checkFirstChars)
      xmlElement.setAttribute(ATTRIB_CHARS, firstChars);
    else
      xmlElement.setAttribute(ATTRIB_DISABLED, "true");
    return xmlElement;
  }
View Full Code Here


    final EdgeStyle styleObj = forceFormatting ? ec.getStyle(node) : model.getStyle();
    final String style = EdgeStyle.toString(styleObj);
    final Color color = forceFormatting ? ec.getColor(node) : model.getColor();
    final int width = forceFormatting ? ec.getWidth(node) : model.getWidth();
    if (forceFormatting || style != null || color != null || width != EdgeModel.DEFAULT_WIDTH) {
      final XMLElement edge = new XMLElement();
      edge.setName("edge");
      boolean relevant = false;
      if (style != null) {
        if (style.equals(EdgeStyle.EDGESTYLE_HIDDEN)) {
          edge.setAttribute("HIDE", "true");
          relevant = true;
        }
        edge.setAttribute("STYLE", style);
        relevant = true;
      }
      if (color != null) {
        edge.setAttribute("COLOR", ColorUtils.colorToString(color));
        relevant = true;
      }
      if (width != EdgeModel.WIDTH_PARENT) {
        if (width == EdgeModel.WIDTH_THIN) {
          edge.setAttribute("WIDTH", EdgeModel.EDGEWIDTH_THIN);
        }
        else {
          edge.setAttribute("WIDTH", Integer.toString(width));
        }
        relevant = true;
      }
      if (relevant) {
        writer.addElement(model, edge);
View Full Code Here

      super("option_panel_window_configuration_storage");
    }

  public static OptionPanelWindowConfigurationStorage decorateDialog(final String marshalled, final JDialog dialog) {
    final OptionPanelWindowConfigurationStorage storage = new OptionPanelWindowConfigurationStorage();
    final XMLElement xml = storage.unmarschall(marshalled, dialog);
    if (xml != null) {
      storage.panel = xml.getAttribute("panel", null);
      return storage;
    }
    return null;
  }
View Full Code Here

  //     }
  //   }
  // }
  // writer.close()
  public XMLElement toXml() {
    final XMLElement addonElement = new XMLElement("addon");
    addonElement.setAttribute("name", name);
    addonElement.setAttribute("version", version);
    addonElement.setAttribute("latestVersion", latestVersion == null ? "" : latestVersion);
    addonElement.setAttribute("freeplaneVersionFrom", freeplaneVersionFrom.toString());
    if (freeplaneVersionTo != null)
      addonElement.setAttribute("freeplaneVersionTo", freeplaneVersionTo.toString());
    if (homepage != null)
      addonElement.setAttribute("homepage", homepage.toString());
    if (updateUrl != null)
      addonElement.setAttribute("updateUrl", updateUrl.toString());
    if (author != null)
      addonElement.setAttribute("author", author);
    addonElement.setAttribute("active", Boolean.toString(active));
    addAsChildWithContent(addonElement, "description", description);
    addAsChildWithContent(addonElement, "license", license);
    addAsChildWithContent(addonElement, "preferences.xml", preferencesXml);
    addTranslationsAsChild(addonElement);
    addDefaultPropertiesAsChild(addonElement);
View Full Code Here

    addDeinstallationRulesAsChild(addonElement);
    return addonElement;
  }

  private void addAsChildWithContent(XMLElement parent, String name, String content) {
    final XMLElement xmlElement = new XMLElement(name);
    xmlElement.setContent(content);
    parent.addChild(xmlElement);
  }
View Full Code Here

    xmlElement.setContent(content);
    parent.addChild(xmlElement);
  }

  private void addTranslationsAsChild(XMLElement parent) {
    final XMLElement translationsElement = new XMLElement("translations");
    for (Entry<String, Map<String, String>> localeEntry : translations.entrySet()) {
      final XMLElement localeElement = new XMLElement("locale");
      localeElement.setAttribute("name", localeEntry.getKey());
      for (Entry<String, String> translationEntry : localeEntry.getValue().entrySet()) {
        final XMLElement translationElement = new XMLElement("entry");
        translationElement.setAttribute("key", translationEntry.getKey());
        translationElement.setContent(StringEscapeUtils.escapeJava(translationEntry.getValue()));
        localeElement.addChild(translationElement);
      }
      translationsElement.addChild(localeElement);
    }
    parent.addChild(translationsElement);
View Full Code Here

    }
    parent.addChild(translationsElement);
  }

  private void addDefaultPropertiesAsChild(XMLElement parent) {
    final XMLElement xmlElement = new XMLElement("default.properties");
    for (Entry<String, String> entry : defaultProperties.entrySet()) {
      xmlElement.setAttribute(entry.getKey(), entry.getValue());
    }
    parent.addChild(xmlElement);
  }
View Full Code Here

    }
    parent.addChild(xmlElement);
  }

    private void addImagesAsChild(XMLElement parent) {
        final XMLElement xmlElement = new XMLElement("images");
        if (images != null) {
            for (String image : images) {
                final XMLElement imageElement = new XMLElement("image");
                imageElement.setAttribute("name", image);
                xmlElement.addChild(imageElement);
            }
        }
        parent.addChild(xmlElement);
    }
View Full Code Here

        }
        parent.addChild(xmlElement);
    }

  private void addDeinstallationRulesAsChild(XMLElement parent) {
      final XMLElement xmlElement = new XMLElement("deinstall");
      for (String[] rule : deinstallationRules) {
          final XMLElement ruleElement = new XMLElement(rule[0]);
          ruleElement.setContent(rule[1]);
          xmlElement.addChild(ruleElement);
      }
      parent.addChild(xmlElement);
  }
View Full Code Here

          return isLast;
        }
   
    public void toXml(XMLElement conditionalStylesRoot)
    {
      final XMLElement itemElement = conditionalStylesRoot.createElement("conditional_style");
      conditionalStylesRoot.addChild(itemElement);
      itemElement.setAttribute("ACTIVE", Boolean.toString(isActive()));
      final IStyle style = getStyle();
      if (style instanceof StyleNamedObject) {
        final String referencedStyle = ((StyleNamedObject)style).getObject().toString();
        itemElement.setAttribute("LOCALIZED_STYLE_REF", referencedStyle);
      }
      else {
        final String referencedStyle = style.toString();
        itemElement.setAttribute("STYLE_REF", referencedStyle);
      }
      itemElement.setAttribute("LAST", Boolean.toString(isLast()));
      if(condition != null)
        condition.toXml(itemElement);

    }
View Full Code Here

TOP

Related Classes of org.freeplane.n3.nanoxml.XMLElement

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.