Search in sources :

Example 1 with DefinitionSetAdapter

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

the class ClientDefinitionManager method init.

@PostConstruct
@SuppressWarnings("all")
public void init() {
    // DefinitionSet client adapters.
    Collection<SyncBeanDef<DefinitionSetAdapter>> beanDefSetAdapters = beanManager.lookupBeans(DefinitionSetAdapter.class);
    for (SyncBeanDef<DefinitionSetAdapter> defSet : beanDefSetAdapters) {
        DefinitionSetAdapter definitionSetAdapter = defSet.getInstance();
        addAdapter(definitionSetAdapter);
    }
    // DefinitionSetRule client adapters.
    Collection<SyncBeanDef<DefinitionSetRuleAdapter>> beanDefSetRuleAdapters = beanManager.lookupBeans(DefinitionSetRuleAdapter.class);
    for (SyncBeanDef<DefinitionSetRuleAdapter> defSet : beanDefSetRuleAdapters) {
        DefinitionSetRuleAdapter definitionSetRuleAdapter = defSet.getInstance();
        addAdapter(definitionSetRuleAdapter);
    }
    // Definition client adapters.
    Collection<SyncBeanDef<DefinitionAdapter>> beanDefAdapters = beanManager.lookupBeans(DefinitionAdapter.class);
    for (SyncBeanDef<DefinitionAdapter> defSet : beanDefAdapters) {
        DefinitionAdapter definitionAdapter = defSet.getInstance();
        addAdapter(definitionAdapter);
    }
    // Property client adapters.
    Collection<SyncBeanDef<PropertyAdapter>> beanPropAdapters = beanManager.lookupBeans(PropertyAdapter.class);
    for (SyncBeanDef<PropertyAdapter> defSet : beanPropAdapters) {
        PropertyAdapter propertyAdapter = defSet.getInstance();
        addAdapter(propertyAdapter);
    }
    // Morph adapters.
    Collection<SyncBeanDef<MorphAdapter>> beanMorphAdapters = beanManager.lookupBeans(MorphAdapter.class);
    for (SyncBeanDef<MorphAdapter> morphAdapter : beanMorphAdapters) {
        MorphAdapter morphAdapterInstance = morphAdapter.getInstance();
        addAdapter(morphAdapterInstance);
    }
    // Once adapters present, add the Definition Sets found on current context.
    Collection<SyncBeanDef<DefinitionSetProxy>> beanDefSets = beanManager.lookupBeans(DefinitionSetProxy.class);
    for (SyncBeanDef<DefinitionSetProxy> defSet : beanDefSets) {
        DefinitionSetProxy definitionSetProxy = defSet.getInstance();
        Object definitionSet = definitionSetProxy.getDefinitionSet();
        addDefinitionSet(definitionSet);
    }
}
Also used : DefinitionSetProxy(org.kie.workbench.common.stunner.core.definition.DefinitionSetProxy) SyncBeanDef(org.jboss.errai.ioc.client.container.SyncBeanDef) DefinitionAdapter(org.kie.workbench.common.stunner.core.definition.adapter.DefinitionAdapter) DefinitionSetAdapter(org.kie.workbench.common.stunner.core.definition.adapter.DefinitionSetAdapter) DefinitionSetRuleAdapter(org.kie.workbench.common.stunner.core.definition.adapter.DefinitionSetRuleAdapter) PropertyAdapter(org.kie.workbench.common.stunner.core.definition.adapter.PropertyAdapter) MorphAdapter(org.kie.workbench.common.stunner.core.definition.adapter.MorphAdapter) PostConstruct(javax.annotation.PostConstruct)

Aggregations

PostConstruct (javax.annotation.PostConstruct)1 SyncBeanDef (org.jboss.errai.ioc.client.container.SyncBeanDef)1 DefinitionSetProxy (org.kie.workbench.common.stunner.core.definition.DefinitionSetProxy)1 DefinitionAdapter (org.kie.workbench.common.stunner.core.definition.adapter.DefinitionAdapter)1 DefinitionSetAdapter (org.kie.workbench.common.stunner.core.definition.adapter.DefinitionSetAdapter)1 DefinitionSetRuleAdapter (org.kie.workbench.common.stunner.core.definition.adapter.DefinitionSetRuleAdapter)1 MorphAdapter (org.kie.workbench.common.stunner.core.definition.adapter.MorphAdapter)1 PropertyAdapter (org.kie.workbench.common.stunner.core.definition.adapter.PropertyAdapter)1