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

/**
 * This method keeps the selection of the combobox in the search dialog (CSearchDlg), which stores
 * the information whether the user wanted to search for entries with a certain create-date, changed-date
 * or both.//ww w . j a v a2  s . co m
 *
 * @param value the index of the selected item.
 */
public void setSearchComboTime(int value) {
    Element el = settingsFile.getRootElement().getChild(SETTING_SEARCHCOMBOTIME);
    if (null == el) {
        el = new Element(SETTING_SEARCHCOMBOTIME);
        settingsFile.getRootElement().addContent(el);
    }
    el.setText(String.valueOf(value));
}

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

License:Open Source License

/**
 * When the user wants to search for entries with a certain creation or modified-date, this
 * setting stores the values from the last entered date-input from the user
 *
 * @param value a string value, comma separated, which holds to dates: the beginning and the end-date
 * of the period the user wanted to search for entries. these strings are taken from the formatted
 * textfields in the CSearchDlg./*from   w w  w .  j av a  2 s  . c o m*/
 */
public void setSearchDateTime(String value) {
    Element el = settingsFile.getRootElement().getChild(SETTING_SEARCHDATETIME);
    if (null == el) {
        el = new Element(SETTING_SEARCHDATETIME);
        settingsFile.getRootElement().addContent(el);
    }
    el.setText(value);
}

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

License:Open Source License

/**
 * //ww w .  j  av  a2  s  . c o m
 * @param value 
 */
public void setShowIcons(boolean value) {
    Element el = settingsFile.getRootElement().getChild(SETTING_SHOWICONS);
    if (null == el) {
        el = new Element(SETTING_SHOWICONS);
        settingsFile.getRootElement().addContent(el);
    }
    el.setText(value ? "1" : "0");
}

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

License:Open Source License

/**
 * //from   w  ww . ja v  a2 s .  co m
 * @param value 
 */
public void setShowAllIcons(boolean value) {
    Element el = settingsFile.getRootElement().getChild(SETTING_SHOWALLICONS);
    if (null == el) {
        el = new Element(SETTING_SHOWALLICONS);
        settingsFile.getRootElement().addContent(el);
    }
    el.setText(value ? "1" : "0");
}

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

License:Open Source License

/**
 * Sets the character-encoding of the currently attached bibtex-file.
 *
 * @param value set the last used bibtex-format, i.e. the format (encoding) of the currently
 * attached bibtex-file. following constants are used:<br>
 * 0: UTF-8 (Bibliographix)<br>//from  w ww. j a v  a2  s .  com
 * 1: UTF-8 (Citavi)<br>
 * 2: ISO8859_1 (Emacs with AucTex/RefTex)<br>
 * 3: UTF-8 (Endnote)<br>
 * 4: ISO8859_1 (JabRef)<br>
 * 5: UTF-8 (Refworks)
 */
public void setLastUsedBibtexFormat(int value) {
    Element el = settingsFile.getRootElement().getChild(SETTING_LASTUSEDBIBTEXFORMAT);
    if (null == el) {
        el = new Element(SETTING_LASTUSEDBIBTEXFORMAT);
        settingsFile.getRootElement().addContent(el);
    }
    el.setText(String.valueOf(value));
}

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

License:Open Source License

/**
 * Sets the display-option of the desktop window, i.e.
 * whether comments should be displayed in the desktop window or not,
 * or if only comments should be displayed.
 * // w  ww  . jav a 2s  .co m
 * @param value the display-option.
 * following constants are used:<br>
 * <ul>
 * <li>Constants.DESKTOP_WITH_COMMENTS</li>
 * <li>Constants.DESKTOP_WITHOUT_COMMENTS</li>
 * <li>Constants.DESKTOP_ONLY_COMMENTS</li>
 * </ul>
 */
public void setDesktopCommentDisplayOptions(int value) {
    Element el = settingsFile.getRootElement().getChild(SETTING_DESKTOPSHOWCOMMENTS);
    if (null == el) {
        el = new Element(SETTING_DESKTOPSHOWCOMMENTS);
        settingsFile.getRootElement().addContent(el);
    }
    el.setText(String.valueOf(value));
}

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

License:Open Source License

public void setShowUpdateHintVersion(String currentBuildNr) {
    Element el = settingsFile.getRootElement().getChild(SETTING_SHOWUPDATEHINTVERSION);
    if (null == el) {
        el = new Element(SETTING_SHOWUPDATEHINTVERSION);
        settingsFile.getRootElement().addContent(el);
    }/*w w w . java2 s . c  o m*/
    if (currentBuildNr != null && !currentBuildNr.isEmpty())
        el.setText(currentBuildNr);
    else
        el.setText("0");
}

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

License:Open Source License

/**
 * //w w  w .j  av a  2  s .  com
 * @param value 
 */
public void setUseXDGOpen(boolean value) {
    Element el = settingsFile.getRootElement().getChild(SETTING_USEXDGOPEN);
    if (null == el) {
        el = new Element(SETTING_USEXDGOPEN);
        settingsFile.getRootElement().addContent(el);
    }
    el.setText(value ? "1" : "0");
}

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

License:Open Source License

/**
 * /*from  ww  w. j  a v a 2s.  c  o m*/
 * @param what
 * @param value 
 */
public void setUseCustomCSS(int what, boolean value) {
    String ch;
    switch (what) {
    case CUSTOM_CSS_ENTRY:
        ch = SETTING_USECUSTOMCSSENTRY;
        break;
    case CUSTOM_CSS_DESKTOP:
        ch = SETTING_USECUSTOMCSSDESKTOP;
        break;
    default:
        ch = SETTING_USECUSTOMCSSENTRY;
        break;
    }
    Element el = settingsFile.getRootElement().getChild(ch);
    if (null == el) {
        el = new Element(ch);
        settingsFile.getRootElement().addContent(el);
    }
    el.setText(value ? "1" : "0");
}

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

License:Open Source License

/**
 *
 * @param value sets the currently used icon theme. following constants are used:<br>
 * 0: standard<br>/*from   w  w  w . j a v  a  2 s. c  o m*/
 * 1: Tango<br>
 */
public void setIconTheme(int value) {
    Element el = settingsFile.getRootElement().getChild(SETTING_ICONTHEME);
    if (null == el) {
        el = new Element(SETTING_ICONTHEME);
        settingsFile.getRootElement().addContent(el);
    }
    el.setText(String.valueOf(value));
}