Search in sources :

Example 31 with ClassIdentifier

use of org.eclipse.scout.rt.platform.classid.ClassIdentifier in project scout.rt by eclipse.

the class ExtensionScope method resolveRegistryItems.

/**
 * Returns a set of resolved registry items for the given scope items.
 *
 * @param scopeItems
 * @return
 */
public Set<T> resolveRegistryItems(Set<ScopeItem> scopeItems) {
    if (CollectionUtility.isEmpty(scopeItems)) {
        return Collections.emptySet();
    }
    Set<T> collector = new TreeSet<T>(new P_ExtensionRegistryItemComparator());
    for (ScopeItem scopeItem : scopeItems) {
        ClassIdentifier classIdentifier = scopeItem.getIdentifier();
        if (!scopeItem.isLastSegment()) {
            continue;
        }
        List<T> localExtensions = m_extensionItems.get(classIdentifier);
        if (CollectionUtility.hasElements(localExtensions)) {
            collector.addAll(localExtensions);
        }
    }
    return collector;
}
Also used : TreeSet(java.util.TreeSet) ClassIdentifier(org.eclipse.scout.rt.platform.classid.ClassIdentifier)

Aggregations

ClassIdentifier (org.eclipse.scout.rt.platform.classid.ClassIdentifier)31 Test (org.junit.Test)23 IExtensionRegistry (org.eclipse.scout.rt.shared.extension.IExtensionRegistry)11 MultiTemplateUsageForm (org.eclipse.scout.rt.client.extension.ui.form.fixture.MultiTemplateUsageForm)10 FirstTemplateBox (org.eclipse.scout.rt.client.extension.ui.form.fixture.MultiTemplateUsageForm.MainBox.FirstTemplateBox)10 SecondTemplateBox (org.eclipse.scout.rt.client.extension.ui.form.fixture.MultiTemplateUsageForm.MainBox.SecondTemplateBox)10 TopFieldsBox (org.eclipse.scout.rt.client.extension.ui.form.fixture.AbstractTemplateGroupsBox.TopFieldsBox)7 AbstractTemplateFieldsBox (org.eclipse.scout.rt.client.extension.ui.form.fixture.AbstractTemplateFieldsBox)4 AbstractFormData (org.eclipse.scout.rt.shared.data.form.AbstractFormData)4 AbstractStringField (org.eclipse.scout.rt.client.ui.form.fields.stringfield.AbstractStringField)3 Map (java.util.Map)2 TreeSet (java.util.TreeSet)2 TopStringField (org.eclipse.scout.rt.client.extension.ui.form.fixture.AbstractTemplateFieldsBox.TopStringField)2 MainBoxStringField (org.eclipse.scout.rt.client.extension.ui.form.fixture.MultiTemplateUsageForm.MainBox.MainBoxStringField)2 AbstractFormFieldData (org.eclipse.scout.rt.shared.data.form.fields.AbstractFormFieldData)2 AbstractValueFieldData (org.eclipse.scout.rt.shared.data.form.fields.AbstractValueFieldData)2 AbstractPropertyData (org.eclipse.scout.rt.shared.data.form.properties.AbstractPropertyData)2 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1