use of org.eclipse.wb.internal.rcp.databinding.emf.model.observables.DetailListEmfObservableInfo in project windowbuilder by eclipse.
the class GlobalObservableFactory method filterElementPropertiesForTreeViewerInput.
@Override
public void filterElementPropertiesForTreeViewerInput(ObservableInfo inputObservable, Class<?> elementType, List<PropertyDescriptor> descriptors) throws Exception {
if (inputObservable instanceof ListEmfObservableInfo || inputObservable instanceof DetailListEmfObservableInfo) {
descriptors.clear();
PropertiesSupport propertiesSupport = getPropertiesSupport(inputObservable);
for (PropertyInfo emfProperty : propertiesSupport.getProperties(elementType)) {
descriptors.add(createProperty(emfProperty.name, emfProperty.type));
}
}
}
use of org.eclipse.wb.internal.rcp.databinding.emf.model.observables.DetailListEmfObservableInfo 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.DetailListEmfObservableInfo in project windowbuilder by eclipse.
the class EmfListPropertyCodeSupport method createDetailObservable.
@Override
protected ObservableInfo createDetailObservable(ObservableInfo masterObservable, PropertiesSupport propertiesSupport) throws Exception {
Assert.isNotNull(m_parserPropertyReference);
//
DetailListEmfObservableInfo observeDetailList = new DetailListEmfObservableInfo(masterObservable, propertiesSupport);
observeDetailList.setDetailPropertyReference(null, m_parserPropertyReference);
observeDetailList.setCodeSupport(new EmfListPropertyDetailCodeSupport());
//
return observeDetailList;
}
use of org.eclipse.wb.internal.rcp.databinding.emf.model.observables.DetailListEmfObservableInfo in project windowbuilder by eclipse.
the class EmfObserveTypeContainer method createDetailList.
AstObjectInfo createDetailList(AstEditor editor, Expression[] arguments, int startIndex, IModelResolver resolver) throws Exception {
// prepare master
ObservableInfo masterObservable = getMasterObservable(editor, resolver, arguments[startIndex]);
if (masterObservable == null) {
AbstractParser.addError(editor, MessageFormat.format(Messages.EmfObserveTypeContainer_masterObservableArgumentNotFound, arguments[startIndex]), new Throwable());
return null;
}
// prepare detail property
addEMFPackage(arguments[startIndex + 1]);
String detailPropertyReference = CoreUtils.getNodeReference(arguments[startIndex + 1]);
// create observable
DetailListEmfObservableInfo observeDetailList = new DetailListEmfObservableInfo(masterObservable, m_propertiesSupport);
observeDetailList.setDetailPropertyReference(null, detailPropertyReference);
observeDetailList.setCodeSupport(new EmfObservableDetailListCodeSupport());
//
return observeDetailList;
}
use of org.eclipse.wb.internal.rcp.databinding.emf.model.observables.DetailListEmfObservableInfo in project windowbuilder by eclipse.
the class GlobalObservableFactory method configureChooseElementForViewerInput.
// //////////////////////////////////////////////////////////////////////////
//
// IGlobalObservableFactory: UI
//
// //////////////////////////////////////////////////////////////////////////
@Override
public void configureChooseElementForViewerInput(ObservableInfo inputObservable, ChooseClassAndPropertiesConfiguration configuration) throws Exception {
if (inputObservable instanceof ListEmfObservableInfo || inputObservable instanceof DetailListEmfObservableInfo) {
final PropertiesSupport propertiesSupport = getPropertiesSupport(inputObservable);
configuration.setBaseClassName("org.eclipse.emf.ecore.EObject");
configuration.addPropertiesFilter(new IPropertiesFilter() {
@Override
public List<PropertyAdapter> filterProperties(Class<?> choosenClass, List<PropertyAdapter> properties) throws Exception {
properties = Lists.newArrayList();
for (PropertyInfo emfPropertyInfo : propertiesSupport.getProperties(choosenClass)) {
properties.add(new ChooseClassAndTreePropertiesUiContentProvider.ObservePropertyAdapter(null, new EPropertyBindableInfo(propertiesSupport, null, emfPropertyInfo.type, emfPropertyInfo.name, "\"" + emfPropertyInfo.name + "\"")));
}
return properties;
}
});
}
}
Aggregations