Search in sources :

Example 1 with MapsEmfObservableInfo

use of org.eclipse.wb.internal.rcp.databinding.emf.model.observables.MapsEmfObservableInfo in project windowbuilder by eclipse.

the class GlobalObservableFactory method createObserveMaps.

@Override
public MapsBeanObservableInfo createObserveMaps(ObservableInfo inputObservable, ObservableInfo domainObservable, Class<?> elementType, boolean[] useViewerSupport) throws Exception {
    if (inputObservable instanceof ListEmfObservableInfo || inputObservable instanceof DetailListEmfObservableInfo) {
        useViewerSupport[0] = false;
        MapsEmfObservableInfo observeMaps = new MapsEmfObservableInfo(domainObservable, getPropertiesSupport(inputObservable));
        observeMaps.setElementType(elementType);
        return observeMaps;
    }
    return null;
}
Also used : ListEmfObservableInfo(org.eclipse.wb.internal.rcp.databinding.emf.model.observables.ListEmfObservableInfo) DetailListEmfObservableInfo(org.eclipse.wb.internal.rcp.databinding.emf.model.observables.DetailListEmfObservableInfo) MapsEmfObservableInfo(org.eclipse.wb.internal.rcp.databinding.emf.model.observables.MapsEmfObservableInfo) DetailListEmfObservableInfo(org.eclipse.wb.internal.rcp.databinding.emf.model.observables.DetailListEmfObservableInfo)

Example 2 with MapsEmfObservableInfo

use of org.eclipse.wb.internal.rcp.databinding.emf.model.observables.MapsEmfObservableInfo in project windowbuilder by eclipse.

the class EmfObserveTypeContainer method createMaps.

AstObjectInfo createMaps(AstEditor editor, Expression[] arguments, int startIndex, IModelResolver resolver) throws Exception {
    // prepare domain
    ObservableInfo domainObservable = (ObservableInfo) resolver.getModel(arguments[startIndex]);
    if (domainObservable == null) {
        AbstractParser.addError(editor, MessageFormat.format(Messages.EmfObserveTypeContainer_argumentNotFound, arguments[startIndex]), new Throwable());
        return null;
    }
    // prepare reference properties
    Assert.instanceOf(ArrayCreation.class, arguments[startIndex + 1]);
    ArrayCreation arrayReferenceProperties = (ArrayCreation) arguments[startIndex + 1];
    List<Expression> expressionReferenceProperties = DomGenerics.expressions(arrayReferenceProperties.getInitializer());
    List<String> referenceProperties = Lists.newArrayList();
    for (Expression expression : expressionReferenceProperties) {
        Assert.instanceOf(QualifiedName.class, expression);
        referenceProperties.add(CoreUtils.getNodeReference(expression));
    }
    if (!expressionReferenceProperties.isEmpty()) {
        addEMFPackage(expressionReferenceProperties.get(0));
    }
    // create observable
    MapsEmfObservableInfo observeMaps = new MapsEmfObservableInfo(domainObservable, m_propertiesSupport);
    observeMaps.setEMFProperties(referenceProperties);
    return observeMaps;
}
Also used : MapsEmfObservableInfo(org.eclipse.wb.internal.rcp.databinding.emf.model.observables.MapsEmfObservableInfo) DetailValueEmfObservableInfo(org.eclipse.wb.internal.rcp.databinding.emf.model.observables.DetailValueEmfObservableInfo) ObservableInfo(org.eclipse.wb.internal.rcp.databinding.model.ObservableInfo) ListEmfObservableInfo(org.eclipse.wb.internal.rcp.databinding.emf.model.observables.ListEmfObservableInfo) DetailListEmfObservableInfo(org.eclipse.wb.internal.rcp.databinding.emf.model.observables.DetailListEmfObservableInfo) KnownElementsObservableInfo(org.eclipse.wb.internal.rcp.databinding.model.widgets.input.KnownElementsObservableInfo) ValueEmfObservableInfo(org.eclipse.wb.internal.rcp.databinding.emf.model.observables.ValueEmfObservableInfo) MapsEmfObservableInfo(org.eclipse.wb.internal.rcp.databinding.emf.model.observables.MapsEmfObservableInfo) Expression(org.eclipse.jdt.core.dom.Expression) ArrayCreation(org.eclipse.jdt.core.dom.ArrayCreation)

Aggregations

DetailListEmfObservableInfo (org.eclipse.wb.internal.rcp.databinding.emf.model.observables.DetailListEmfObservableInfo)2 ListEmfObservableInfo (org.eclipse.wb.internal.rcp.databinding.emf.model.observables.ListEmfObservableInfo)2 MapsEmfObservableInfo (org.eclipse.wb.internal.rcp.databinding.emf.model.observables.MapsEmfObservableInfo)2 ArrayCreation (org.eclipse.jdt.core.dom.ArrayCreation)1 Expression (org.eclipse.jdt.core.dom.Expression)1 DetailValueEmfObservableInfo (org.eclipse.wb.internal.rcp.databinding.emf.model.observables.DetailValueEmfObservableInfo)1 ValueEmfObservableInfo (org.eclipse.wb.internal.rcp.databinding.emf.model.observables.ValueEmfObservableInfo)1 ObservableInfo (org.eclipse.wb.internal.rcp.databinding.model.ObservableInfo)1 KnownElementsObservableInfo (org.eclipse.wb.internal.rcp.databinding.model.widgets.input.KnownElementsObservableInfo)1