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;
}
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;
}
Aggregations