Example usage for org.jdom2 Element setAttribute

List of usage examples for org.jdom2 Element setAttribute

Introduction

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

Prototype

public Element setAttribute(final String name, final String value) 

Source Link

Document

This sets an attribute value for this element.

Usage

From source file:de.bund.bfr.knime.pmm.common.MatrixXml.java

License:Open Source License

@Override
public Element toXmlElement() {
    Element ret = new Element(ELEMENT_MATRIX);

    ret.setAttribute(ATT_ID, XmlHelper.getNonNull(id));
    ret.setAttribute(ATT_NAME, XmlHelper.getNonNull(name));
    ret.setAttribute(ATT_DETAIL, XmlHelper.getNonNull(detail));
    ret.setAttribute(ATT_DBUUID, XmlHelper.getNonNull(dbuuid));

    return ret;/*from   ww w .  j a  va2 s  .c o m*/
}

From source file:de.bund.bfr.knime.pmm.common.MdInfoXml.java

License:Open Source License

@Override
public Element toXmlElement() {
    Element modelElement = new Element(ELEMENT_MDINFO);

    modelElement.setAttribute(ATT_ID, XmlHelper.getNonNull(id));
    modelElement.setAttribute(ATT_NAME, XmlHelper.getNonNull(name));
    modelElement.setAttribute(ATT_COMMENT, XmlHelper.getNonNull(comment));
    modelElement.setAttribute(ATT_QUALITYSCORE, XmlHelper.getNonNull(qualityScore));
    modelElement.setAttribute(ATT_CHECKED, XmlHelper.getNonNull(checked));

    return modelElement;
}

From source file:de.bund.bfr.knime.pmm.common.MiscXml.java

License:Open Source License

@Override
public Element toXmlElement() {
    Element ret = new Element(ELEMENT_MISC);

    ret.setAttribute(ATT_ID, XmlHelper.getNonNull(id));
    ret.setAttribute(ATT_NAME, XmlHelper.getNonNull(name));
    ret.setAttribute(ATT_DESCRIPTION, XmlHelper.getNonNull(description));
    ret.setAttribute(ATT_VALUE, XmlHelper.getNonNull(value));
    ret.setAttribute(ATT_UNIT, XmlHelper.getNonNull(unit));
    ret.setAttribute(ATT_ORIGUNIT, XmlHelper.getNonNull(origUnit));
    ret.setAttribute(ATT_DBUUID, XmlHelper.getNonNull(dbuuid));

    if (categories != null) {
        for (int i = 0; i < categories.size(); i++) {
            ret.setAttribute(ATT_CATEGORY + i, XmlHelper.getNonNull(categories.get(i)));
        }//w w w  .j  a v a2 s .  com
    }

    return ret;
}

From source file:de.bund.bfr.knime.pmm.common.ParametricModel.java

License:Open Source License

@Override
public Element toXmlElement() {
    Element modelElement = new Element(ELEMENT_PARAMETRICMODEL);
    modelElement.setAttribute(ATT_MDBUUID, m_dbuuid == null ? "" : m_dbuuid);
    modelElement.setAttribute(ATT_EMDBUUID, em_dbuuid == null ? "" : em_dbuuid);
    modelElement.setAttribute(ATT_MODELNAME, modelName);
    modelElement.setAttribute(ATT_MODELCLASS, XmlHelper.getNonNull(modelClass));
    modelElement.setAttribute("FittedModelName", fittedModelName == null ? "" : fittedModelName);
    modelElement.setAttribute(ATT_LEVEL, String.valueOf(level));
    modelElement.setAttribute(ATT_MODELID, String.valueOf(modelId));
    modelElement.setAttribute(ATT_ESTMODELID, String.valueOf(estModelId));
    modelElement.setAttribute(ATT_GLOBALMODELID, String.valueOf(globalModelId));
    modelElement.setAttribute(ATT_CONDID, String.valueOf(condId));
    modelElement.setAttribute(ATT_RSS, String.valueOf(rss));
    modelElement.setAttribute(ATT_RMS, String.valueOf(rms));
    modelElement.setAttribute(ATT_AIC, String.valueOf(aic));
    modelElement.setAttribute(ATT_BIC, String.valueOf(bic));
    modelElement.setAttribute(ATT_CHECKED, isChecked == null ? "" : String.valueOf(isChecked));
    modelElement.setAttribute(ATT_COMMENT, comment == null ? "" : comment);
    modelElement.setAttribute(ATT_QSCORE, qualityScore == null ? "" : String.valueOf(qualityScore));

    modelElement.setAttribute(ATT_RSQUARED, String.valueOf(rsquared));

    Element element = new Element(ATT_FORMULA);
    element.addContent(formula);/* w  w w  . j  av  a2s.  c o  m*/
    modelElement.addContent(element);

    element = new Element(ATT_PARAM);
    element.addContent(parameter.toXmlString());
    modelElement.addContent(element);

    element = new Element(ATT_INDEP);
    element.addContent(independent.toXmlString());
    modelElement.addContent(element);

    if (depXml != null) {
        element = new Element(ATT_DEP);
        PmmXmlDoc pd = new PmmXmlDoc();
        pd.add(depXml);
        element.addContent(pd.toXmlString());
        modelElement.addContent(element);
    }

    element = new Element(ATT_MLIT);
    element.addContent(modelLit.toXmlString());
    modelElement.addContent(element);
    element = new Element(ATT_EMLIT);
    element.addContent(estLit.toXmlString());
    modelElement.addContent(element);

    return modelElement;
}

From source file:de.bund.bfr.knime.pmm.common.ParamXml.java

License:Open Source License

@Override
public Element toXmlElement() {
    Element ret = new Element(ELEMENT_PARAM);

    ret.setAttribute(ATT_NAME, XmlHelper.getNonNull(name));
    ret.setAttribute(ATT_ORIGNAME, XmlHelper.getNonNull(origName));
    ret.setAttribute(ATT_IS_START, XmlHelper.getNonNull(isStartParam));
    ret.setAttribute(ATT_VALUE, XmlHelper.getNonNull(value));
    ret.setAttribute(ATT_ERROR, XmlHelper.getNonNull(error));
    ret.setAttribute(ATT_MIN, XmlHelper.getNonNull(min));
    ret.setAttribute(ATT_MAX, XmlHelper.getNonNull(max));
    ret.setAttribute(ATT_P, XmlHelper.getNonNull(P));
    ret.setAttribute(ATT_T, XmlHelper.getNonNull(t));
    ret.setAttribute(ATT_MINGUESS, XmlHelper.getNonNull(minGuess));
    ret.setAttribute(ATT_MAXGUESS, XmlHelper.getNonNull(maxGuess));
    ret.setAttribute(ATT_CATEGORY, XmlHelper.getNonNull(category));
    ret.setAttribute(ATT_UNIT, XmlHelper.getNonNull(unit));
    ret.setAttribute(ATT_DESCRIPTION, XmlHelper.getNonNull(description));

    if (correlations != null) {
        for (String origname : correlations.keySet()) {
            Element element = new Element(ATT_CORRELATION);
            Double d = correlations.get(origname);

            element.setAttribute(ATT_ORIGNAME, origname);
            element.setAttribute(ATT_VALUE, XmlHelper.getNonNull(d));
            ret.addContent(element);//from   w  ww.  jav a 2 s .  c o m
        }
    }

    return ret;
}

From source file:de.bund.bfr.knime.pmm.common.PmmTimeSeries.java

License:Open Source License

@Override
public Element toXmlElement() {
    Element ret = new Element(ELEMENT_TIMESERIES);
    try {//from   w w w  .j  av a2 s  .  c  om
        if (getCondId() != null) {
            ret.setAttribute(TimeSeriesSchema.ATT_CONDID, getCondId() + "");
        }
        if (getCombaseId() != null) {
            if (!getCombaseId().isEmpty()) {
                ret.setAttribute(TimeSeriesSchema.ATT_COMBASEID, getCombaseId());
            }
        }
        if (hasMatrix()) {
            ret.setAttribute(TimeSeriesSchema.ATT_MATRIX, getMatrix().toXmlString());
        }
        if (hasAgent()) {
            ret.setAttribute(TimeSeriesSchema.ATT_AGENT, getAgent().toXmlString());
        }
        if (hasMisc()) {
            ret.setAttribute(TimeSeriesSchema.ATT_MISC, getMisc().toXmlString());
        }
        Element element = new Element(ELEMENT_TSXML);
        PmmXmlDoc timeSeriesXmlDoc = this.getPmmXml(TimeSeriesSchema.ATT_TIMESERIES);
        element.addContent(timeSeriesXmlDoc.toXmlString());
        ret.addContent(element);
        element = new Element(ELEMENT_MDINFO);
        PmmXmlDoc mdInfoXmlDoc = this.getPmmXml(TimeSeriesSchema.ATT_MDINFO);
        element.addContent(mdInfoXmlDoc.toXmlString());
        ret.addContent(element);
        element = new Element(ELEMENT_LITMD);
        PmmXmlDoc litMdDoc = this.getPmmXml(TimeSeriesSchema.ATT_LITMD);
        element.addContent(litMdDoc.toXmlString());
        ret.addContent(element);
        ret.setAttribute(TimeSeriesSchema.ATT_DBUUID,
                XmlHelper.getNonNull(getString(TimeSeriesSchema.ATT_DBUUID)));
    } catch (PmmException ex) {
        ex.printStackTrace();
    }
    return ret;
}

From source file:de.bund.bfr.knime.pmm.common.TimeSeriesXml.java

License:Open Source License

@Override
public Element toXmlElement() {
    Element ret = new Element(ELEMENT_TIMESERIES);

    ret.setAttribute(ATT_NAME, XmlHelper.getNonNull(name));
    ret.setAttribute(ATT_TIME, XmlHelper.getNonNull(time));
    ret.setAttribute(ATT_TIME_UNIT, XmlHelper.getNonNull(timeUnit));
    ret.setAttribute(ATT_ORIG_TIME_UNIT, XmlHelper.getNonNull(origTimeUnit));
    ret.setAttribute(ATT_CONCENTRATION, XmlHelper.getNonNull(concentration));
    ret.setAttribute(ATT_CONCENTRATION_UNIT, XmlHelper.getNonNull(concentrationUnit));
    ret.setAttribute(ATT_CONCENTRATION_UNIT_OBJECT_TYPE, XmlHelper.getNonNull(concentrationUnitObjectType));
    ret.setAttribute(ATT_ORIG_CONCENTRATION_UNIT, XmlHelper.getNonNull(origConcentrationUnit));
    ret.setAttribute(ATT_CONCENTRATION_STDDEV, XmlHelper.getNonNull(concentrationStdDev));
    ret.setAttribute(ATT_NUMBER_OF_MEASUREMENTS, XmlHelper.getNonNull(numberOfMeasurements));

    return ret;//from  w  w  w . j  ava2s .  c  om
}

From source file:de.bund.bfr.knime.pmm.extendedtable.items.MDAgentXml.java

License:Open Source License

public Element toXmlElement() {
    Element ret = new Element(ELEMENT_AGENT);

    ret.setAttribute(ATT_ID, XmlHelper.getNonNull(id));
    ret.setAttribute(ATT_NAME, XmlHelper.getNonNull(name));
    ret.setAttribute(ATT_DETAIL, XmlHelper.getNonNull(detail));
    ret.setAttribute(ATT_DBUUID, XmlHelper.getNonNull(dbuuid));

    return ret;/*from w ww .  j a  v  a  2 s .c om*/
}

From source file:de.bund.bfr.knime.pmm.extendedtable.items.MDLiteratureItem.java

License:Open Source License

public Element toXmlElement() {
    Element ret = new Element(ELEMENT_LITERATURE);

    ret.setAttribute(ATT_AUTHOR, XmlHelper.getNonNull(author));
    ret.setAttribute(ATT_YEAR, XmlHelper.getNonNull(year));
    ret.setAttribute(ATT_TITLE, XmlHelper.removeDirt(title));
    ret.setAttribute(ATT_ABSTRACT, XmlHelper.removeDirt(abstractText));
    ret.setAttribute(ATT_JOURNAL, XmlHelper.getNonNull(journal));
    ret.setAttribute(ATT_VOLUME, XmlHelper.getNonNull(volume));
    ret.setAttribute(ATT_ISSUE, XmlHelper.getNonNull(issue));
    ret.setAttribute(ATT_PAGE, XmlHelper.getNonNull(page));
    ret.setAttribute(ATT_APPROVAL_MODE, XmlHelper.getNonNull(approvalMode));
    ret.setAttribute(ATT_WEBSITE, XmlHelper.getNonNull(website));
    ret.setAttribute(ATT_TYPE, XmlHelper.getNonNull(type));
    ret.setAttribute(ATT_COMMENT, XmlHelper.getNonNull(comment));
    ret.setAttribute(ATT_ID, XmlHelper.getNonNull(id));
    ret.setAttribute(ATT_DBUUID, XmlHelper.getNonNull(dbuuid));

    return ret;//from  w  w  w  .ja  v a2  s.com
}

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

License:Open Source License

/**
 * This method inits the accelerator table of the main window's menus. We separate
 * the initialisation of the accelerator tables for each window to keep an better
 * overiew.//from www  .j av a  2s . com
 * 
 * This method creates all the acceleratorkeys-child-elements, but only, if they don't
 * already exist. We do this because when loading older acceleratorkeys-xml-document-structures,
 * we might have new elements that would not be initialised. but now we can call this 
 * method after loading the xml-document, and create elements and default values for all
 * new elements. This ensures compatibility to older/news settings-file-versions.
 */
private void initMainKeys() {
    // this is our element variable which will be used below to set all the child elements
    Element acckey;

    // now we have to go through an endless list of accelerator keys. it is important
    // that the attribute values have exactly the same spelling like the actions' names
    // which can be found in the properties-files (resources). This ensures we can easily
    // assign accelerator keys to actions:
    //
    // javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance(zettelkasten.ZettelkastenApp.class).getContext().getActionMap(ZettelkastenView.class, this);
    // AbstractAction ac = (AbstractAction) actionMap.get(CAcceleratorKey.getActionName());
    // KeyStroke ks = KeyStroke.getKeyStroke(CAcceleratorKey.getAccelerator());
    // ac.putValue(AbstractAction.ACCELERATOR_KEY, ks);        

    //
    // The actions of the main window's file menu
    //

    // the accelerator for the "newEntry" action
    if (!findElement(MAINKEYS, "newEntry")) {
        acckey = new Element("key");
        acckey.setAttribute("action", "newEntry");
        acckey.setText(mask + " N");
        acceleratorKeysMain.getRootElement().addContent(acckey);
    }

    // the accelerator for the "insertEntry" action
    if (!findElement(MAINKEYS, "insertEntry")) {
        acckey = new Element("key");
        acckey.setAttribute("action", "insertEntry");
        acckey.setText(mask + " I");
        acceleratorKeysMain.getRootElement().addContent(acckey);
    }

    // the accelerator for the "quickNewEntry" action
    if (!findElement(MAINKEYS, "quickNewEntry")) {
        acckey = new Element("key");
        acckey.setAttribute("action", "quickNewEntry");
        acckey.setText(mask + " alt N");
        acceleratorKeysMain.getRootElement().addContent(acckey);
    }

    // the accelerator for the "quickNewEntryWithTitle" action
    if (!findElement(MAINKEYS, "quickNewEntryWithTitle")) {
        acckey = new Element("key");
        acckey.setAttribute("action", "quickNewEntryWithTitle");
        acckey.setText(mask + " shift N");
        acceleratorKeysMain.getRootElement().addContent(acckey);
    }

    // the accelerator for the "openDocument" action
    if (!findElement(MAINKEYS, "openDocument")) {
        acckey = new Element("key");
        acckey.setAttribute("action", "openDocument");
        acckey.setText(mask + " O");
        acceleratorKeysMain.getRootElement().addContent(acckey);
    }

    // the accelerator for the "saveDocument" action
    if (!findElement(MAINKEYS, "saveDocument")) {
        acckey = new Element("key");
        acckey.setAttribute("action", "saveDocument");
        acckey.setText(mask + " S");
        acceleratorKeysMain.getRootElement().addContent(acckey);
    }

    // the accelerator for the "saveDocumentAs" action
    if (!findElement(MAINKEYS, "saveDocumentAs")) {
        acckey = new Element("key");
        acckey.setAttribute("action", "saveDocumentAs");
        acckey.setText(mask + " shift S");
        acceleratorKeysMain.getRootElement().addContent(acckey);
    }

    // the accelerator for the "importWindow" action
    if (!findElement(MAINKEYS, "importWindow")) {
        acckey = new Element("key");
        acckey.setAttribute("action", "importWindow");
        acckey.setText(mask + " shift I");
        acceleratorKeysMain.getRootElement().addContent(acckey);
    }

    // the accelerator for the "exportWindow" action
    if (!findElement(MAINKEYS, "exportWindow")) {
        acckey = new Element("key");
        acckey.setAttribute("action", "exportWindow");
        acckey.setText(mask + " shift E");
        acceleratorKeysMain.getRootElement().addContent(acckey);
    }

    // the accelerator for the "quit" action
    if (!findElement(MAINKEYS, "quit")) {
        acckey = new Element("key");
        acckey.setAttribute("action", "quit");
        acckey.setText(mask + " Q");
        acceleratorKeysMain.getRootElement().addContent(acckey);
    }

    //
    // The actions of the main window's edit menu
    //

    // the accelerator for the "copyPlain" action
    if (!findElement(MAINKEYS, "copyPlain")) {
        acckey = new Element("key");
        acckey.setAttribute("action", "copyPlain");
        acckey.setText(mask + " shift C");
        acceleratorKeysMain.getRootElement().addContent(acckey);
    }

    // the accelerator for the "editEntry" action
    if (!findElement(MAINKEYS, "editEntry")) {
        acckey = new Element("key");
        acckey.setAttribute("action", "editEntry");
        acckey.setText(mask + " E");
        acceleratorKeysMain.getRootElement().addContent(acckey);
    }

    // the accelerator for the "deleteCurrentEntry" action
    if (!findElement(MAINKEYS, "deleteCurrentEntry")) {
        acckey = new Element("key");
        acckey.setAttribute("action", "deleteCurrentEntry");
        acckey.setText(mask + " shift " + delkey);
        acceleratorKeysMain.getRootElement().addContent(acckey);
    }

    // the accelerator for the "manualInsertEntry" action
    if (!findElement(MAINKEYS, "manualInsertEntry")) {
        acckey = new Element("key");
        acckey.setAttribute("action", "manualInsertEntry");
        acckey.setText(mask + " alt I");
        acceleratorKeysMain.getRootElement().addContent(acckey);
    }

    // the accelerator for the "manualInsertLinks" action
    if (!findElement(MAINKEYS, "manualInsertLinks")) {
        acckey = new Element("key");
        acckey.setAttribute("action", "manualInsertLinks");
        acckey.setText(mask + " alt L");
        acceleratorKeysMain.getRootElement().addContent(acckey);
    }

    // the accelerator for the "selectAllText" action
    if (!findElement(MAINKEYS, "selectAllText")) {
        acckey = new Element("key");
        acckey.setAttribute("action", "selectAllText");
        acckey.setText(mask + " A");
        acceleratorKeysMain.getRootElement().addContent(acckey);
    }

    // the accelerator for the "addToDesktop" action
    if (!findElement(MAINKEYS, "addToDesktop")) {
        acckey = new Element("key");
        acckey.setAttribute("action", "addToDesktop");
        acckey.setText("F9");
        acceleratorKeysMain.getRootElement().addContent(acckey);
    }

    // the accelerator for the "addToBookmark" action
    if (!findElement(MAINKEYS, "addToBookmark")) {
        acckey = new Element("key");
        acckey.setAttribute("action", "addToBookmark");
        acckey.setText(mask + " B");
        acceleratorKeysMain.getRootElement().addContent(acckey);
    }

    // the accelerator for the "updateDisplay" action
    if (!findElement(MAINKEYS, "updateDisplay")) {
        acckey = new Element("key");
        acckey.setAttribute("action", "updateDisplay");
        acckey.setText("F5");
        acceleratorKeysMain.getRootElement().addContent(acckey);
    }

    //
    // The actions of the main window's find menu
    //

    // the accelerator for the "find" action
    if (!findElement(MAINKEYS, "find")) {
        acckey = new Element("key");
        acckey.setAttribute("action", "find");
        acckey.setText(mask + " F");
        acceleratorKeysMain.getRootElement().addContent(acckey);
    }

    // the accelerator for the "replace" action
    if (!findElement(MAINKEYS, "replace")) {
        acckey = new Element("key");
        acckey.setAttribute("action", "replace");
        acckey.setText(mask + " R");
        acceleratorKeysMain.getRootElement().addContent(acckey);
    }

    // the accelerator for the "findLive" action
    if (!findElement(MAINKEYS, "findLive")) {
        acckey = new Element("key");
        acckey.setAttribute("action", "findLive");
        acckey.setText(mask + " shift F");
        acceleratorKeysMain.getRootElement().addContent(acckey);
    }

    // the accelerator for the "showFirstEntry" action
    if (!findElement(MAINKEYS, "showFirstEntry")) {
        acckey = new Element("key");
        acckey.setAttribute("action", "showFirstEntry");
        acckey.setText(mask + " shift " + minuskey);
        acceleratorKeysMain.getRootElement().addContent(acckey);
    }

    // the accelerator for the "gotoEntry" action
    if (!findElement(MAINKEYS, "gotoEntry")) {
        acckey = new Element("key");
        acckey.setAttribute("action", "gotoEntry");
        acckey.setText(mask + " G");
        acceleratorKeysMain.getRootElement().addContent(acckey);
    }
    // the accelerator for the "showRandomEntry" action
    if (!findElement(MAINKEYS, "showRandomEntry")) {
        acckey = new Element("key");
        acckey.setAttribute("action", "showRandomEntry");
        acckey.setText(ctrlkey + " " + numbersign);
        acceleratorKeysMain.getRootElement().addContent(acckey);
    }
    // the accelerator for the "historyFor" action
    if (!findElement(MAINKEYS, "historyFor")) {
        acckey = new Element("key");
        acckey.setAttribute("action", "historyFor");
        acckey.setText(historykey + " RIGHT");
        acceleratorKeysMain.getRootElement().addContent(acckey);
    }
    // the accelerator for the "historyBack" action
    if (!findElement(MAINKEYS, "historyBack")) {
        acckey = new Element("key");
        acckey.setAttribute("action", "historyBack");
        acckey.setText(historykey + " LEFT");
        acceleratorKeysMain.getRootElement().addContent(acckey);
    }
    // the accelerator for the "showLastEntry" action
    if (!findElement(MAINKEYS, "showLastEntry")) {
        acckey = new Element("key");
        acckey.setAttribute("action", "showLastEntry");
        acckey.setText(mask + " shift " + pluskey);
        acceleratorKeysMain.getRootElement().addContent(acckey);
    }

    // the accelerator for the "showPrevEntry" action
    if (!findElement(MAINKEYS, "showPrevEntry")) {
        acckey = new Element("key");
        acckey.setAttribute("action", "showPrevEntry");
        acckey.setText(mask + " " + minuskey);
        acceleratorKeysMain.getRootElement().addContent(acckey);
    }

    // the accelerator for the "showNextEntry" action
    if (!findElement(MAINKEYS, "showNextEntry")) {
        acckey = new Element("key");
        acckey.setAttribute("action", "showNextEntry");
        acckey.setText(mask + " " + pluskey);
        acceleratorKeysMain.getRootElement().addContent(acckey);
    }

    //
    // The actions of the main window's view menu
    //

    // the accelerator for the "menuShowLinks" action
    if (!findElement(MAINKEYS, "menuShowLinks")) {
        acckey = new Element("key");
        acckey.setAttribute("action", "menuShowLinks");
        acckey.setText(mask + " F1");
        acceleratorKeysMain.getRootElement().addContent(acckey);
    }

    // the accelerator for the "menuShowLuhmann" action
    if (!findElement(MAINKEYS, "menuShowLuhmann")) {
        acckey = new Element("key");
        acckey.setAttribute("action", "menuShowLuhmann");
        acckey.setText(mask + " F2");
        acceleratorKeysMain.getRootElement().addContent(acckey);
    }

    // the accelerator for the "menuShowKeywords" action
    if (!findElement(MAINKEYS, "menuShowKeywords")) {
        acckey = new Element("key");
        acckey.setAttribute("action", "menuShowKeywords");
        acckey.setText(mask + " F3");
        acceleratorKeysMain.getRootElement().addContent(acckey);
    }

    // the accelerator for the "menuShowAuthors" action
    if (!findElement(MAINKEYS, "menuShowAuthors")) {
        acckey = new Element("key");
        acckey.setAttribute("action", "menuShowAuthors");
        acckey.setText(mask + " F4");
        acceleratorKeysMain.getRootElement().addContent(acckey);
    }

    // the accelerator for the "menuShowTitles" action
    if (!findElement(MAINKEYS, "menuShowTitles")) {
        acckey = new Element("key");
        acckey.setAttribute("action", "menuShowTitles");
        acckey.setText(mask + " F5");
        acceleratorKeysMain.getRootElement().addContent(acckey);
    }

    // the accelerator for the "menuShowCluster" action
    if (!findElement(MAINKEYS, "menuShowCluster")) {
        acckey = new Element("key");
        acckey.setAttribute("action", "menuShowCluster");
        acckey.setText(mask + " F6");
        acceleratorKeysMain.getRootElement().addContent(acckey);
    }

    // the accelerator for the "menuShowBookmarks" action
    if (!findElement(MAINKEYS, "menuShowBookmarks")) {
        acckey = new Element("key");
        acckey.setAttribute("action", "menuShowBookmarks");
        acckey.setText(mask + " F7");
        acceleratorKeysMain.getRootElement().addContent(acckey);
    }

    // the accelerator for the "menuShowAttachments" action
    if (!findElement(MAINKEYS, "menuShowAttachments")) {
        acckey = new Element("key");
        acckey.setAttribute("action", "menuShowAttachments");
        acckey.setText(mask + " F8");
        acceleratorKeysMain.getRootElement().addContent(acckey);
    }

    // the accelerator for the "showSearchResultWindow" action
    if (!findElement(MAINKEYS, "showSearchResultWindow")) {
        acckey = new Element("key");
        acckey.setAttribute("action", "showSearchResultWindow");
        acckey.setText("F3");
        acceleratorKeysMain.getRootElement().addContent(acckey);
    }

    // the accelerator for the "showDesktopWindow" action
    if (!findElement(MAINKEYS, "showDesktopWindow")) {
        acckey = new Element("key");
        acckey.setAttribute("action", "showDesktopWindow");
        acckey.setText("F4");
        acceleratorKeysMain.getRootElement().addContent(acckey);
    }

    // the accelerator for the "showNewEntryWindow" action
    if (!findElement(MAINKEYS, "showNewEntryWindow")) {
        acckey = new Element("key");
        acckey.setAttribute("action", "showNewEntryWindow");
        acckey.setText("F11");
        acceleratorKeysMain.getRootElement().addContent(acckey);
    }

    // the accelerator for the "highlightKeywords" action
    if (!findElement(MAINKEYS, "highlightKeywords")) {
        acckey = new Element("key");
        acckey.setAttribute("action", "highlightKeywords");
        acckey.setText("F7");
        acceleratorKeysMain.getRootElement().addContent(acckey);
    }

    //
    // The actions of the main window's popup menu
    //

    // the accelerator for the "addToKeywordList" action
    if (!findElement(MAINKEYS, "addToKeywordList")) {
        acckey = new Element("key");
        acckey.setAttribute("action", "addToKeywordList");
        acckey.setText(mask + " shift K");
        acceleratorKeysMain.getRootElement().addContent(acckey);
    }

    // the accelerator for the "setSelectionAsTitle" action
    if (!findElement(MAINKEYS, "setSelectionAsTitle")) {
        acckey = new Element("key");
        acckey.setAttribute("action", "setSelectionAsTitle");
        acckey.setText(mask + " alt U");
        acceleratorKeysMain.getRootElement().addContent(acckey);
    }

    // the accelerator for the "setFirstLineAsTitle" action
    if (!findElement(MAINKEYS, "setFirstLineAsTitle")) {
        acckey = new Element("key");
        acckey.setAttribute("action", "setFirstLineAsTitle");
        acckey.setText(mask + " shift U");
        acceleratorKeysMain.getRootElement().addContent(acckey);
    }
}