Search in sources :

Example 1 with DetailListEmfObservableInfo

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));
        }
    }
}
Also used : ListEmfObservableInfo(org.eclipse.wb.internal.rcp.databinding.emf.model.observables.ListEmfObservableInfo) DetailListEmfObservableInfo(org.eclipse.wb.internal.rcp.databinding.emf.model.observables.DetailListEmfObservableInfo) DetailListEmfObservableInfo(org.eclipse.wb.internal.rcp.databinding.emf.model.observables.DetailListEmfObservableInfo) PropertiesSupport(org.eclipse.wb.internal.rcp.databinding.emf.model.bindables.PropertiesSupport) PropertyInfo(org.eclipse.wb.internal.rcp.databinding.emf.model.bindables.PropertiesSupport.PropertyInfo)

Example 2 with DetailListEmfObservableInfo

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;
}
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 3 with DetailListEmfObservableInfo

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;
}
Also used : DetailListEmfObservableInfo(org.eclipse.wb.internal.rcp.databinding.emf.model.observables.DetailListEmfObservableInfo)

Example 4 with DetailListEmfObservableInfo

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;
}
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) DetailListEmfObservableInfo(org.eclipse.wb.internal.rcp.databinding.emf.model.observables.DetailListEmfObservableInfo) EmfObservableDetailListCodeSupport(org.eclipse.wb.internal.rcp.databinding.emf.model.observables.EmfObservableDetailListCodeSupport)

Example 5 with DetailListEmfObservableInfo

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;
            }
        });
    }
}
Also used : ListEmfObservableInfo(org.eclipse.wb.internal.rcp.databinding.emf.model.observables.ListEmfObservableInfo) DetailListEmfObservableInfo(org.eclipse.wb.internal.rcp.databinding.emf.model.observables.DetailListEmfObservableInfo) PropertiesSupport(org.eclipse.wb.internal.rcp.databinding.emf.model.bindables.PropertiesSupport) DetailListEmfObservableInfo(org.eclipse.wb.internal.rcp.databinding.emf.model.observables.DetailListEmfObservableInfo) List(java.util.List) IPropertiesFilter(org.eclipse.wb.internal.core.databinding.ui.editor.contentproviders.ChooseClassAndPropertiesConfiguration.IPropertiesFilter) PropertyAdapter(org.eclipse.wb.internal.core.databinding.ui.editor.contentproviders.PropertyAdapter) EPropertyBindableInfo(org.eclipse.wb.internal.rcp.databinding.emf.model.bindables.EPropertyBindableInfo) PropertyInfo(org.eclipse.wb.internal.rcp.databinding.emf.model.bindables.PropertiesSupport.PropertyInfo)

Aggregations

DetailListEmfObservableInfo (org.eclipse.wb.internal.rcp.databinding.emf.model.observables.DetailListEmfObservableInfo)6 ListEmfObservableInfo (org.eclipse.wb.internal.rcp.databinding.emf.model.observables.ListEmfObservableInfo)5 PropertiesSupport (org.eclipse.wb.internal.rcp.databinding.emf.model.bindables.PropertiesSupport)3 MapsEmfObservableInfo (org.eclipse.wb.internal.rcp.databinding.emf.model.observables.MapsEmfObservableInfo)3 EPropertyBindableInfo (org.eclipse.wb.internal.rcp.databinding.emf.model.bindables.EPropertyBindableInfo)2 PropertyInfo (org.eclipse.wb.internal.rcp.databinding.emf.model.bindables.PropertiesSupport.PropertyInfo)2 DetailValueEmfObservableInfo (org.eclipse.wb.internal.rcp.databinding.emf.model.observables.DetailValueEmfObservableInfo)2 EmfObservableDetailListCodeSupport (org.eclipse.wb.internal.rcp.databinding.emf.model.observables.EmfObservableDetailListCodeSupport)2 ObservableInfo (org.eclipse.wb.internal.rcp.databinding.model.ObservableInfo)2 KnownElementsObservableInfo (org.eclipse.wb.internal.rcp.databinding.model.widgets.input.KnownElementsObservableInfo)2 List (java.util.List)1 IPropertiesFilter (org.eclipse.wb.internal.core.databinding.ui.editor.contentproviders.ChooseClassAndPropertiesConfiguration.IPropertiesFilter)1 PropertyAdapter (org.eclipse.wb.internal.core.databinding.ui.editor.contentproviders.PropertyAdapter)1 EObjectBindableInfo (org.eclipse.wb.internal.rcp.databinding.emf.model.bindables.EObjectBindableInfo)1 DetailEmfObservableInfo (org.eclipse.wb.internal.rcp.databinding.emf.model.observables.DetailEmfObservableInfo)1 EmfObservableDetailValueCodeSupport (org.eclipse.wb.internal.rcp.databinding.emf.model.observables.EmfObservableDetailValueCodeSupport)1 ValueEmfObservableInfo (org.eclipse.wb.internal.rcp.databinding.emf.model.observables.ValueEmfObservableInfo)1 EmfListPropertyDetailCodeSupport (org.eclipse.wb.internal.rcp.databinding.emf.model.observables.properties.EmfListPropertyDetailCodeSupport)1 EmfValuePropertyDetailCodeSupport (org.eclipse.wb.internal.rcp.databinding.emf.model.observables.properties.EmfValuePropertyDetailCodeSupport)1 AbstractBindingInfo (org.eclipse.wb.internal.rcp.databinding.model.AbstractBindingInfo)1