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

/**
 * Sets the setting whether a table of contents should be created when exporting desktop data.
 * @param val {@code true} if a table of contents should be created when exporting desktop data.
 *///from  w w w .  j av  a2s .  com
public void setTOCForDesktopExport(boolean val) {
    Element el = settingsFile.getRootElement().getChild(SETTING_TOCFORDESKTOPEXPORT);
    if (null == el) {
        el = new Element(SETTING_TOCFORDESKTOPEXPORT);
        settingsFile.getRootElement().addContent(el);
    }
    el.setText((val) ? "1" : "0");
}

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

License:Open Source License

/**
 * Sets the setting whether multiple lines in the output file of the desktop data should be
 * removed or not./*from   w  ww.j  a  va  2 s  . com*/
 * @param val {@code true} if multiple lines in the output file of the desktop data should be
 * removed
 */
public void setRemoveLinesForDesktopExport(boolean val) {
    Element el = settingsFile.getRootElement().getChild(SETTING_REMOVELINESFORDESKTOPEXPORT);
    if (null == el) {
        el = new Element(SETTING_REMOVELINESFORDESKTOPEXPORT);
        settingsFile.getRootElement().addContent(el);
    }
    el.setText((val) ? "1" : "0");
}

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

License:Open Source License

/**
 * Sets the setting for the autobackup-option
 * @param val true if the autobackup should be activated
 *//*from www.  j  av a  2  s.c  om*/
public void setAutoNightlyUpdate(boolean val) {
    Element el = settingsFile.getRootElement().getChild(SETTING_AUTONIGHTLYUPDATE);
    if (null == el) {
        el = new Element(SETTING_AUTONIGHTLYUPDATE);
        settingsFile.getRootElement().addContent(el);
    }
    el.setText((val) ? "1" : "0");
}

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

License:Open Source License

/**
 * Sets the setting for the autobackup-option
 * @param val true if the autobackup should be activated
 *//*from  ww w  . ja  v a 2s .  c om*/
public void setShowIconText(boolean val) {
    Element el = settingsFile.getRootElement().getChild(SETTING_SHOWICONTEXT);
    if (null == el) {
        el = new Element(SETTING_SHOWICONTEXT);
        settingsFile.getRootElement().addContent(el);
    }
    el.setText((val) ? "1" : "0");
}

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

License:Open Source License

public void setAutoCompleteTags(boolean val) {
    Element el = settingsFile.getRootElement().getChild(SETTING_AUTOCOMPLETETAGS);
    if (null == el) {
        el = new Element(SETTING_AUTOCOMPLETETAGS);
        settingsFile.getRootElement().addContent(el);
    }//  w ww .j  av a  2s. c om
    el.setText((val) ? "1" : "0");
}

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

License:Open Source License

public void setUseMacBackgroundColor(boolean val) {
    Element el = settingsFile.getRootElement().getChild(SETTING_USEMACBACKGROUNDCOLOR);
    if (null == el) {
        el = new Element(SETTING_USEMACBACKGROUNDCOLOR);
        settingsFile.getRootElement().addContent(el);
    }//from   w  w w . j a va2  s.  co  m
    el.setText((val) ? "1" : "0");
}

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

License:Open Source License

public void setMarkdownActivated(boolean val) {
    Element el = settingsFile.getRootElement().getChild(SETTING_MARKDOWNACTIVATED);
    if (null == el) {
        el = new Element(SETTING_MARKDOWNACTIVATED);
        settingsFile.getRootElement().addContent(el);
    }// w  w w.  java2 s .  co  m
    el.setText((val) ? "1" : "0");
}

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

License:Open Source License

/**
 * Sets the setting for the autobackup-option
 * @param val true if the autobackup should be activated
 *//*from   w w  w . j a  va  2  s. c  o m*/
public void setExtraBackup(boolean val) {
    Element el = settingsFile.getRootElement().getChild(SETTING_EXTRABACKUP);
    if (null == el) {
        el = new Element(SETTING_EXTRABACKUP);
        settingsFile.getRootElement().addContent(el);
    }
    el.setText((val) ? "1" : "0");
}

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

License:Open Source License

public void setCustomCSS(int what, String css) {
    String ch;/*from ww w. j  a  v  a 2  s.c  om*/
    switch (what) {
    case CUSTOM_CSS_ENTRY:
        ch = SETTING_CUSTOMCSSENTRY;
        break;
    case CUSTOM_CSS_DESKTOP:
        ch = SETTING_CUSTOMCSSDESKTOP;
        break;
    default:
        ch = SETTING_CUSTOMCSSENTRY;
        break;
    }
    Element el = settingsFile.getRootElement().getChild(ch);
    if (null == el) {
        el = new Element(ch);
        settingsFile.getRootElement().addContent(el);
    }
    el.setText(css);
}

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

License:Open Source License

/**
 * Sets the default language/*w  w  w.  ja  v  a  2  s  .  com*/
 * @param lang a string with a lowercase-2-letter-country-code for the default languags
 */
public void setLanguage(String lang) {
    Element el = settingsFile.getRootElement().getChild(SETTING_LOCALE);
    if (null == el) {
        el = new Element(SETTING_LOCALE);
        settingsFile.getRootElement().addContent(el);
    }
    el.setText(lang.toLowerCase());
}