Search in sources :

Example 1 with PropertyMorphDefinition

use of org.kie.workbench.common.stunner.core.definition.morph.PropertyMorphDefinition in project kie-wb-common by kiegroup.

the class AbstractMorphAdapter method getMorphProperties.

protected Iterable<MorphProperty> getMorphProperties(final String definitionId, final String baseId) {
    if (null != definitionId) {
        final List<MorphProperty> result = new LinkedList<>();
        for (MorphDefinition morphDefinition : morphDefinitions) {
            final boolean acceptsDefinition = morphDefinition.accepts(definitionId) || (null != baseId && morphDefinition.accepts(baseId));
            if (acceptsDefinition && (morphDefinition instanceof PropertyMorphDefinition)) {
                final PropertyMorphDefinition propertyMorphDefinition = (PropertyMorphDefinition) morphDefinition;
                final Iterable<MorphProperty> morphProperties = propertyMorphDefinition.getMorphProperties(definitionId);
                addAll(result, morphProperties);
                final Iterable<MorphProperty> baseMorphProperties = null != baseId ? propertyMorphDefinition.getMorphProperties(definitionId) : null;
                if (null != baseMorphProperties) {
                    addAll(result, baseMorphProperties);
                }
            }
        }
        return result;
    }
    return null;
}
Also used : MorphProperty(org.kie.workbench.common.stunner.core.definition.morph.MorphProperty) PropertyMorphDefinition(org.kie.workbench.common.stunner.core.definition.morph.PropertyMorphDefinition) PropertyMorphDefinition(org.kie.workbench.common.stunner.core.definition.morph.PropertyMorphDefinition) MorphDefinition(org.kie.workbench.common.stunner.core.definition.morph.MorphDefinition) LinkedList(java.util.LinkedList)

Aggregations

LinkedList (java.util.LinkedList)1 MorphDefinition (org.kie.workbench.common.stunner.core.definition.morph.MorphDefinition)1 MorphProperty (org.kie.workbench.common.stunner.core.definition.morph.MorphProperty)1 PropertyMorphDefinition (org.kie.workbench.common.stunner.core.definition.morph.PropertyMorphDefinition)1