Example usage for org.jdom2 Element getText

List of usage examples for org.jdom2 Element getText

Introduction

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

Prototype

public String getText() 

Source Link

Document

Returns the textual content directly held under this element as a string.

Usage

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

License:Open Source License

/**
 * Retrieves 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>
 * - FONTNAME<br>/*from  ww w . ja  va2 s . c  o  m*/
 * - FONTSIZE<br>
 * - FONTCOLOR<br>
 * - FONTSTYLE<br>
 * - FONTWEIGHT<br>
 * @return the related font-information as string.
 */
public String getHeaderfont1(int what) {
    Element el = settingsFile.getRootElement().getChild(SETTING_HEADERFONT1);
    String retval = "";
    if (el != null) {
        switch (what) {
        case FONTNAME:
            retval = el.getText();
            break;
        case FONTSIZE:
            retval = el.getAttributeValue("size");
            break;
        case FONTCOLOR:
            retval = el.getAttributeValue("color");
            break;
        case FONTSTYLE:
            retval = el.getAttributeValue("style");
            break;
        case FONTWEIGHT:
            retval = el.getAttributeValue("weight");
            break;
        }
    }
    return retval;
}

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

License:Open Source License

/**
 * Retrieves settings for the header-2-font (the font used for the main-entry's 2nd heading-tags).
 * @param what (indicates, which font-characteristic we want to have. use following constants:<br>
 * - FONTNAME<br>/*from   w  ww  . jav a 2s .  c o  m*/
 * - FONTSIZE<br>
 * - FONTCOLOR<br>
 * - FONTSTYLE<br>
 * - FONTWEIGHT<br>
 * @return the related font-information as string.
 */
public String getHeaderfont2(int what) {
    Element el = settingsFile.getRootElement().getChild(SETTING_HEADERFONT2);
    String retval = "";
    if (el != null) {
        switch (what) {
        case FONTNAME:
            retval = el.getText();
            break;
        case FONTSIZE:
            retval = el.getAttributeValue("size");
            break;
        case FONTCOLOR:
            retval = el.getAttributeValue("color");
            break;
        case FONTSTYLE:
            retval = el.getAttributeValue("style");
            break;
        case FONTWEIGHT:
            retval = el.getAttributeValue("weight");
            break;
        }
    }
    return retval;
}

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

License:Open Source License

/**
 * Retrieves settings for the header-2-font (the font used for the main-entry's 2nd heading-tags).
 * @param what (indicates, which font-characteristic we want to have. use following constants:<br>
 * - FONTNAME<br>/*from  ww w. j ava 2 s . c  o m*/
 * - FONTSIZE<br>
 * - FONTCOLOR<br>
 * - FONTSTYLE<br>
 * - FONTWEIGHT<br>
 * @return the related font-information as string.
 */
public String getQuoteFont(int what) {
    Element el = settingsFile.getRootElement().getChild(SETTING_QUOTEFONT);
    String retval = "";
    if (el != null) {
        switch (what) {
        case FONTNAME:
            retval = el.getText();
            break;
        case FONTSIZE:
            retval = el.getAttributeValue("size");
            break;
        case FONTCOLOR:
            retval = el.getAttributeValue("color");
            break;
        }
    }
    return retval;
}

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

License:Open Source License

/**
 * Retrieves settings for the header-2-font (the font used for the main-entry's 2nd heading-tags).
 * @param what (indicates, which font-characteristic we want to have. use following constants:<br>
 * - FONTNAME<br>//from w ww.  j a  va  2 s .  com
 * - FONTSIZE<br>
 * - FONTCOLOR<br>
 * - FONTSTYLE<br>
 * - FONTWEIGHT<br>
 * @return the related font-information as string.
 */
public String getEntryHeaderFont(int what) {
    Element el = settingsFile.getRootElement().getChild(SETTING_ENTRYHEADERFONT);
    String retval = "";
    if (el != null) {
        switch (what) {
        case FONTNAME:
            retval = el.getText();
            break;
        case FONTSIZE:
            retval = el.getAttributeValue("size");
            break;
        case FONTCOLOR:
            retval = el.getAttributeValue("color");
            break;
        }
    }
    return retval;
}

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

License:Open Source License

public String getManlinkColor() {
    Element el = settingsFile.getRootElement().getChild(SETTING_MANLINKCOLOR);
    String retval = "0033cc";
    if (el != null)
        retval = el.getText();
    return retval;
}

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

License:Open Source License

public String getFootnoteLinkColor() {
    Element el = settingsFile.getRootElement().getChild(SETTING_FNLINKCOLOR);
    String retval = "0033cc";
    if (el != null)
        retval = el.getText();
    return retval;
}

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

License:Open Source License

public String getLinkColor() {
    Element el = settingsFile.getRootElement().getChild(SETTING_LINKCOLOR);
    String retval = "003399";
    if (el != null)
        retval = el.getText();
    return retval;
}

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

License:Open Source License

public String getEntryHeadingBackgroundColor() {
    Element el = settingsFile.getRootElement().getChild(SETTING_ENTRYHEADERBACKGROUNDCOLOR);
    String retval = "f2f2f2";
    if (el != null)
        retval = el.getText();
    return retval;
}

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

License:Open Source License

public String getQuoteBackgroundColor() {
    Element el = settingsFile.getRootElement().getChild(SETTING_QUOTEBACKGROUNDCOLOR);
    String retval = "f2f2f2";
    if (el != null)
        retval = el.getText();
    return retval;
}

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

License:Open Source License

public String getMainBackgroundColor() {
    Element el = settingsFile.getRootElement().getChild(SETTING_MAINBACKGROUNDCOLOR);
    String retval = "ffffff";
    if (el != null)
        retval = el.getText();
    return retval;
}