Example usage for org.jdom2 Element setText

List of usage examples for org.jdom2 Element setText

Introduction

In this page you can find the example usage for org.jdom2 Element setText.

Prototype

public Element setText(final String text) 

Source Link

Document

Sets the content of the element to be the text given.

Usage

From source file:de.danielluedecke.zettelkasten.database.Settings.java

License:Open Source License

/**
 * Changes settings for the mainfont (the font used for the main-entry-textfield).
 * @param value (the new value for the font-characteristic)
 * @param what (indicates, which font-characteristic we want to have. use following constants:<br>
 * - FONTNAME<br>/* w w w.  j  a  v  a 2s .  c om*/
 * - FONTSIZE<br>
 * - FONTCOLOR<br>
 * - FONTSTYLE<br>
 * - FONTWEIGHT<br>
 */
public void setCodeFont(String value, int what) {
    Element el = settingsFile.getRootElement().getChild(SETTING_CODEFONT);
    if (null == el) {
        el = new Element(SETTING_CODEFONT);
        settingsFile.getRootElement().addContent(el);
    }
    switch (what) {
    case FONTNAME:
        el.setText(value);
        break;
    case FONTSIZE:
        el.setAttribute("size", value);
        break;
    case FONTCOLOR:
        el.setAttribute("color", value);
        break;
    case FONTSTYLE:
        el.setAttribute("style", value);
        break;
    case FONTWEIGHT:
        el.setAttribute("weight", value);
        break;
    }
}

From source file:de.danielluedecke.zettelkasten.database.Settings.java

License:Open Source License

/**
 * Changes settings for the mainfont (the font used for the main-entry-textfield).
 * @param value (the new value for the font-characteristic)
 * @param what (indicates, which font-characteristic we want to have. use following constants:<br>
 * - FONTNAME<br>/*from  w w  w  .j av  a 2 s  .com*/
 * - FONTSIZE<br>
 * - FONTCOLOR<br>
 * - FONTSTYLE<br>
 * - FONTWEIGHT<br>
 */
public void setRemarksFont(String value, int what) {
    Element el = settingsFile.getRootElement().getChild(SETTING_REMARKSFONT);
    if (null == el) {
        el = new Element(SETTING_REMARKSFONT);
        settingsFile.getRootElement().addContent(el);
    }
    switch (what) {
    case FONTNAME:
        el.setText(value);
        break;
    case FONTSIZE:
        el.setAttribute("size", value);
        break;
    case FONTCOLOR:
        el.setAttribute("color", value);
        break;
    case FONTSTYLE:
        el.setAttribute("style", value);
        break;
    case FONTWEIGHT:
        el.setAttribute("weight", value);
        break;
    }
}

From source file:de.danielluedecke.zettelkasten.database.Settings.java

License:Open Source License

/**
 * Changes settings for the desktop-window's main header font.
 * @param value (the new value for the font-characteristic)
 * @param what (indicates, which font-characteristic we want to have. use following constants:<br>
 * - FONTNAME<br>/* ww w  . j  a  v a2s  . c  o m*/
 * - FONTSIZE<br>
 * - FONTCOLOR<br>
 * - FONTSTYLE<br>
 * - FONTWEIGHT<br>
 */
public void setDesktopHeaderfont(String value, int what) {
    Element el = settingsFile.getRootElement().getChild(SETTING_DESKTOPHEADERFONT);
    if (null == el) {
        el = new Element(SETTING_DESKTOPHEADERFONT);
        settingsFile.getRootElement().addContent(el);
    }
    switch (what) {
    case FONTNAME:
        el.setText(value);
        break;
    case FONTSIZE:
        el.setAttribute("size", value);
        break;
    case FONTCOLOR:
        el.setAttribute("color", value);
        break;
    case FONTSTYLE:
        el.setAttribute("style", value);
        break;
    case FONTWEIGHT:
        el.setAttribute("weight", value);
        break;
    }
}

From source file:de.danielluedecke.zettelkasten.database.Settings.java

License:Open Source License

/**
 * Changes settings for the desktop-window's item header font (additional display items).
 * @param value (the new value for the font-characteristic)
 * @param what (indicates, which font-characteristic we want to have. use following constants:<br>
 * - FONTNAME<br>//from   w  ww .  j ava  2 s . c  om
 * - FONTSIZE<br>
 * - FONTCOLOR<br>
 * - FONTSTYLE<br>
 * - FONTWEIGHT<br>
 */
public void setDesktopItemHeaderfont(String value, int what) {
    Element el = settingsFile.getRootElement().getChild(SETTING_DESKTOPITEMHEADERFONT);
    if (null == el) {
        el = new Element(SETTING_DESKTOPITEMHEADERFONT);
        settingsFile.getRootElement().addContent(el);
    }
    switch (what) {
    case FONTNAME:
        el.setText(value);
        break;
    case FONTSIZE:
        el.setAttribute("size", value);
        break;
    case FONTCOLOR:
        el.setAttribute("color", value);
        break;
    case FONTSTYLE:
        el.setAttribute("style", value);
        break;
    case FONTWEIGHT:
        el.setAttribute("weight", value);
        break;
    }
}

From source file:de.danielluedecke.zettelkasten.database.Settings.java

License:Open Source License

/**
 * Changes settings for the desktop-window's item font (additional display items).
 * @param value (the new value for the font-characteristic)
 * @param what (indicates, which font-characteristic we want to have. use following constants:<br>
 * - FONTNAME<br>/*from w ww  .  j av a2s .  c o  m*/
 * - FONTSIZE<br>
 * - FONTCOLOR<br>
 * - FONTSTYLE<br>
 * - FONTWEIGHT<br>
 */
public void setDesktopItemfont(String value, int what) {
    Element el = settingsFile.getRootElement().getChild(SETTING_DESKTOPITEMFONT);
    if (null == el) {
        el = new Element(SETTING_DESKTOPITEMFONT);
        settingsFile.getRootElement().addContent(el);
    }
    switch (what) {
    case FONTNAME:
        el.setText(value);
        break;
    case FONTSIZE:
        el.setAttribute("size", value);
        break;
    case FONTCOLOR:
        el.setAttribute("color", value);
        break;
    case FONTSTYLE:
        el.setAttribute("style", value);
        break;
    case FONTWEIGHT:
        el.setAttribute("weight", value);
        break;
    }
}

From source file:de.danielluedecke.zettelkasten.database.Settings.java

License:Open Source License

/**
 * Changes settings for the desktop-window's commentfont.
 * @param value (the new value for the font-characteristic)
 * @param what (indicates, which font-characteristic we want to have. use following constants:<br>
 * - FONTNAME<br>//  ww w .java2s.c om
 * - FONTSIZE<br>
 * - FONTCOLOR<br>
 * - FONTSTYLE<br>
 * - FONTWEIGHT<br>
 */
public void setDesktopCommentfont(String value, int what) {
    Element el = settingsFile.getRootElement().getChild(SETTING_DESKTOPCOMMENTFONT);
    if (null == el) {
        el = new Element(SETTING_DESKTOPCOMMENTFONT);
        settingsFile.getRootElement().addContent(el);
    }
    switch (what) {
    case FONTNAME:
        el.setText(value);
        break;
    case FONTSIZE:
        el.setAttribute("size", value);
        break;
    case FONTCOLOR:
        el.setAttribute("color", value);
        break;
    case FONTSTYLE:
        el.setAttribute("style", value);
        break;
    case FONTWEIGHT:
        el.setAttribute("weight", value);
        break;
    }
}

From source file:de.danielluedecke.zettelkasten.database.Settings.java

License:Open Source License

/**
 * Changes settings for the titlefont (the font used for the main-entry's title).
 * @param value (the new value for the font-characteristic)
 * @param what (indicates, which font-characteristic we want to have. use following constants:<br>
 * - FONTNAME<br>/*from   ww  w  .  j  a  v  a2 s. com*/
 * - FONTSIZE<br>
 * - FONTCOLOR<br>
 * - FONTSTYLE<br>
 * - FONTWEIGHT<br>
 */
public void setTitleFont(String value, int what) {
    Element el = settingsFile.getRootElement().getChild(SETTING_TITLEFONT);
    if (null == el) {
        el = new Element(SETTING_TITLEFONT);
        settingsFile.getRootElement().addContent(el);
    }
    switch (what) {
    case FONTNAME:
        el.setText(value);
        break;
    case FONTSIZE:
        el.setAttribute("size", value);
        break;
    case FONTCOLOR:
        el.setAttribute("color", value);
        break;
    case FONTSTYLE:
        el.setAttribute("style", value);
        break;
    case FONTWEIGHT:
        el.setAttribute("weight", value);
        break;
    }
}

From source file:de.danielluedecke.zettelkasten.database.Settings.java

License:Open Source License

/**
 * Changes settings for the titlefont (the font used for the main-entry's title).
 * @param value (the new value for the font-characteristic)
 * @param what (indicates, which font-characteristic we want to have. use following constants:<br>
 * - FONTNAME<br>//w  w  w  .  jav a2s. com
 * - FONTSIZE<br>
 * - FONTCOLOR<br>
 * - FONTSTYLE<br>
 * - FONTWEIGHT<br>
 */
public void setAppendixHeaderFont(String value, int what) {
    Element el = settingsFile.getRootElement().getChild(SETTING_APPENDIXHEADERFONT);
    if (null == el) {
        el = new Element(SETTING_APPENDIXHEADERFONT);
        settingsFile.getRootElement().addContent(el);
    }
    switch (what) {
    case FONTNAME:
        el.setText(value);
        break;
    case FONTSIZE:
        el.setAttribute("size", value);
        break;
    case FONTCOLOR:
        el.setAttribute("color", value);
        break;
    case FONTSTYLE:
        el.setAttribute("style", value);
        break;
    case FONTWEIGHT:
        el.setAttribute("weight", value);
        break;
    }
}

From source file:de.danielluedecke.zettelkasten.database.Settings.java

License:Open Source License

/**
 * Changes settings for the header-1-font (the font used for the main-entry's 1st heading-tags).
 * @param what (indicates, which font-characteristic we want to have. use following constants:<br>
 * @param value (the new value for the font-characteristic)
 * - FONTNAME<br>// www .  ja va  2s. c  o  m
 * - FONTSIZE<br>
 * - FONTCOLOR<br>
 * - FONTSTYLE<br>
 * - FONTWEIGHT<br>
 */
public void setHeaderfont1(String value, int what) {
    Element el = settingsFile.getRootElement().getChild(SETTING_HEADERFONT1);
    if (null == el) {
        el = new Element(SETTING_HEADERFONT1);
        settingsFile.getRootElement().addContent(el);
    }
    switch (what) {
    case FONTNAME:
        el.setText(value);
        break;
    case FONTSIZE:
        el.setAttribute("size", value);
        break;
    case FONTCOLOR:
        el.setAttribute("color", value);
        break;
    case FONTSTYLE:
        el.setAttribute("style", value);
        break;
    case FONTWEIGHT:
        el.setAttribute("weight", value);
        break;
    }
}

From source file:de.danielluedecke.zettelkasten.database.Settings.java

License:Open Source License

/**
 * Changes settings for the header-2-font (the font used for the main-entry's 2nd heading-tags).
 * @param value (the new value for the font-characteristic)
 * @param what (indicates, which font-characteristic we want to have. use following constants:<br>
 * - FONTNAME<br>/* www  .j a  v a  2s .  c  om*/
 * - FONTSIZE<br>
 * - FONTCOLOR<br>
 * - FONTSTYLE<br>
 * - FONTWEIGHT<br>
 */
public void setHeaderfont2(String value, int what) {
    Element el = settingsFile.getRootElement().getChild(SETTING_HEADERFONT2);
    if (null == el) {
        el = new Element(SETTING_HEADERFONT2);
        settingsFile.getRootElement().addContent(el);
    }
    switch (what) {
    case FONTNAME:
        el.setText(value);
        break;
    case FONTSIZE:
        el.setAttribute("size", value);
        break;
    case FONTCOLOR:
        el.setAttribute("color", value);
        break;
    case FONTSTYLE:
        el.setAttribute("style", value);
        break;
    case FONTWEIGHT:
        el.setAttribute("weight", value);
        break;
    }
}