Search in sources :

Example 1 with LinkTransformer

use of org.freeplane.features.link.LinkTransformer in project freeplane by freeplane.

the class AttributeConditionController method getValuesForProperty.

public ComboBoxModel getValuesForProperty(final Object selectedItem, NamedObject simpleCond) {
    final MapModel map = Controller.getCurrentController().getMap();
    final AttributeRegistry registry = AttributeRegistry.getRegistry(map);
    try {
        final AttributeRegistryElement element = registry.getElement(selectedItem.toString());
        final SortedComboBoxModel list = element.getValues();
        SortedComboBoxModel linkedList = new SortedComboBoxModel();
        for (int i = 0; i < list.getSize(); i++) {
            final Object value = list.getElementAt(i);
            final Object transformedValue = new LinkTransformer(Controller.getCurrentModeController(), 1).transformContent(value, map);
            linkedList.add(transformedValue);
        }
        values.setExtensionList(linkedList);
    } catch (NoSuchElementException e) {
        values.setExtensionList(null);
    }
    return values;
}
Also used : NamedObject(org.freeplane.core.resources.NamedObject) MapModel(org.freeplane.features.map.MapModel) LinkTransformer(org.freeplane.features.link.LinkTransformer) SortedComboBoxModel(org.freeplane.core.util.collection.SortedComboBoxModel) NoSuchElementException(java.util.NoSuchElementException)

Aggregations

NoSuchElementException (java.util.NoSuchElementException)1 NamedObject (org.freeplane.core.resources.NamedObject)1 SortedComboBoxModel (org.freeplane.core.util.collection.SortedComboBoxModel)1 LinkTransformer (org.freeplane.features.link.LinkTransformer)1 MapModel (org.freeplane.features.map.MapModel)1