Search in sources :

Example 1 with NoFilteringCondition

use of org.freeplane.features.filter.condition.NoFilteringCondition in project freeplane by freeplane.

the class FilterController method saveConditions.

void saveConditions(final DefaultComboBoxModel filterConditionModel, final String pathToFilterFile) throws IOException {
    final XMLElement saver = new XMLElement();
    saver.setName("filter_conditions");
    final Writer writer = new FileWriter(pathToFilterFile);
    for (int i = 0; i < filterConditionModel.getSize(); i++) {
        final ASelectableCondition cond = (ASelectableCondition) filterConditionModel.getElementAt(i);
        if (cond != null && !(cond instanceof NoFilteringCondition)) {
            cond.toXml(saver);
        }
    }
    final XMLWriter xmlWriter = new XMLWriter(writer);
    xmlWriter.write(saver, true);
    writer.close();
}
Also used : FileWriter(java.io.FileWriter) NoFilteringCondition(org.freeplane.features.filter.condition.NoFilteringCondition) XMLElement(org.freeplane.n3.nanoxml.XMLElement) XMLWriter(org.freeplane.n3.nanoxml.XMLWriter) Writer(java.io.Writer) FileWriter(java.io.FileWriter) XMLWriter(org.freeplane.n3.nanoxml.XMLWriter) ASelectableCondition(org.freeplane.features.filter.condition.ASelectableCondition)

Aggregations

FileWriter (java.io.FileWriter)1 Writer (java.io.Writer)1 ASelectableCondition (org.freeplane.features.filter.condition.ASelectableCondition)1 NoFilteringCondition (org.freeplane.features.filter.condition.NoFilteringCondition)1 XMLElement (org.freeplane.n3.nanoxml.XMLElement)1 XMLWriter (org.freeplane.n3.nanoxml.XMLWriter)1