Search in sources :

Example 1 with DetailValueEmfObservableInfo

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

the class EmfObserveTypeContainer method createDetailValue.

AstObjectInfo createDetailValue(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
    DetailValueEmfObservableInfo observeDetailValue = new DetailValueEmfObservableInfo(masterObservable, m_propertiesSupport);
    observeDetailValue.setDetailPropertyReference(null, detailPropertyReference);
    observeDetailValue.setCodeSupport(new EmfObservableDetailValueCodeSupport());
    // 
    return observeDetailValue;
}
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) EmfObservableDetailValueCodeSupport(org.eclipse.wb.internal.rcp.databinding.emf.model.observables.EmfObservableDetailValueCodeSupport) DetailValueEmfObservableInfo(org.eclipse.wb.internal.rcp.databinding.emf.model.observables.DetailValueEmfObservableInfo)

Example 2 with DetailValueEmfObservableInfo

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

the class EmfValuePropertyCodeSupport method createDetailObservable.

@Override
protected ObservableInfo createDetailObservable(ObservableInfo masterObservable, PropertiesSupport propertiesSupport) throws Exception {
    Assert.isNotNull(m_parserPropertyReference);
    // 
    DetailValueEmfObservableInfo observeDetailValue = new DetailValueEmfObservableInfo(masterObservable, propertiesSupport);
    observeDetailValue.setDetailPropertyReference(null, m_parserPropertyReference);
    observeDetailValue.setCodeSupport(new EmfValuePropertyDetailCodeSupport());
    // 
    return observeDetailValue;
}
Also used : DetailValueEmfObservableInfo(org.eclipse.wb.internal.rcp.databinding.emf.model.observables.DetailValueEmfObservableInfo)

Example 3 with DetailValueEmfObservableInfo

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

the class GlobalObservableFactory method createDetailObservable.

// //////////////////////////////////////////////////////////////////////////
// 
// IGlobalObservableFactory: Observable
// 
// //////////////////////////////////////////////////////////////////////////
@Override
public ObservableInfo createDetailObservable(SingleSelectionObservableInfo masterObservable, BindableInfo object, Type type) throws Exception {
    if (masterObservable.isViewer()) {
        // prepare input
        ObservableInfo inputObservable = null;
        BindableInfo property = object.resolvePropertyReference("setInput");
        for (AbstractBindingInfo binding : object.getBindings()) {
            if (binding.getTargetProperty() == property) {
                AbstractViewerInputBindingInfo viewerBinding = (AbstractViewerInputBindingInfo) binding;
                inputObservable = viewerBinding.getInputObservable();
                break;
            }
        }
        // create detail observable
        if (inputObservable instanceof ListEmfObservableInfo) {
            PropertiesSupport propertiesSupport = getPropertiesSupport(inputObservable);
            boolean version_2_5 = propertiesSupport.isEMFProperties();
            ObservableInfo observable = null;
            // 
            if (type == Type.OnlyValue) {
                observable = new DetailValueEmfObservableInfo(masterObservable, propertiesSupport);
                // 
                if (version_2_5) {
                    observable.setCodeSupport(new EmfValuePropertyDetailCodeSupport());
                } else {
                    observable.setCodeSupport(new EmfObservableDetailValueCodeSupport());
                }
            } else if (type == Type.OnlyList) {
                observable = new DetailListEmfObservableInfo(masterObservable, propertiesSupport);
                // 
                if (version_2_5) {
                    observable.setCodeSupport(new EmfListPropertyDetailCodeSupport());
                } else {
                    observable.setCodeSupport(new EmfObservableDetailListCodeSupport());
                }
            }
            return observable;
        }
    }
    return null;
}
Also used : AbstractBindingInfo(org.eclipse.wb.internal.rcp.databinding.model.AbstractBindingInfo) MapsEmfObservableInfo(org.eclipse.wb.internal.rcp.databinding.emf.model.observables.MapsEmfObservableInfo) DetailValueEmfObservableInfo(org.eclipse.wb.internal.rcp.databinding.emf.model.observables.DetailValueEmfObservableInfo) SingleSelectionObservableInfo(org.eclipse.wb.internal.rcp.databinding.model.widgets.observables.SingleSelectionObservableInfo) 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) DetailEmfObservableInfo(org.eclipse.wb.internal.rcp.databinding.emf.model.observables.DetailEmfObservableInfo) MapsBeanObservableInfo(org.eclipse.wb.internal.rcp.databinding.model.beans.observables.MapsBeanObservableInfo) EmfListPropertyDetailCodeSupport(org.eclipse.wb.internal.rcp.databinding.emf.model.observables.properties.EmfListPropertyDetailCodeSupport) 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) EmfObservableDetailListCodeSupport(org.eclipse.wb.internal.rcp.databinding.emf.model.observables.EmfObservableDetailListCodeSupport) AbstractViewerInputBindingInfo(org.eclipse.wb.internal.rcp.databinding.model.widgets.input.AbstractViewerInputBindingInfo) EPropertyBindableInfo(org.eclipse.wb.internal.rcp.databinding.emf.model.bindables.EPropertyBindableInfo) BindableInfo(org.eclipse.wb.internal.rcp.databinding.model.BindableInfo) EObjectBindableInfo(org.eclipse.wb.internal.rcp.databinding.emf.model.bindables.EObjectBindableInfo) DetailListEmfObservableInfo(org.eclipse.wb.internal.rcp.databinding.emf.model.observables.DetailListEmfObservableInfo) EmfValuePropertyDetailCodeSupport(org.eclipse.wb.internal.rcp.databinding.emf.model.observables.properties.EmfValuePropertyDetailCodeSupport) EmfObservableDetailValueCodeSupport(org.eclipse.wb.internal.rcp.databinding.emf.model.observables.EmfObservableDetailValueCodeSupport) DetailValueEmfObservableInfo(org.eclipse.wb.internal.rcp.databinding.emf.model.observables.DetailValueEmfObservableInfo)

Aggregations

DetailValueEmfObservableInfo (org.eclipse.wb.internal.rcp.databinding.emf.model.observables.DetailValueEmfObservableInfo)3 DetailListEmfObservableInfo (org.eclipse.wb.internal.rcp.databinding.emf.model.observables.DetailListEmfObservableInfo)2 EmfObservableDetailValueCodeSupport (org.eclipse.wb.internal.rcp.databinding.emf.model.observables.EmfObservableDetailValueCodeSupport)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 ObservableInfo (org.eclipse.wb.internal.rcp.databinding.model.ObservableInfo)2 KnownElementsObservableInfo (org.eclipse.wb.internal.rcp.databinding.model.widgets.input.KnownElementsObservableInfo)2 EObjectBindableInfo (org.eclipse.wb.internal.rcp.databinding.emf.model.bindables.EObjectBindableInfo)1 EPropertyBindableInfo (org.eclipse.wb.internal.rcp.databinding.emf.model.bindables.EPropertyBindableInfo)1 PropertiesSupport (org.eclipse.wb.internal.rcp.databinding.emf.model.bindables.PropertiesSupport)1 DetailEmfObservableInfo (org.eclipse.wb.internal.rcp.databinding.emf.model.observables.DetailEmfObservableInfo)1 EmfObservableDetailListCodeSupport (org.eclipse.wb.internal.rcp.databinding.emf.model.observables.EmfObservableDetailListCodeSupport)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 BindableInfo (org.eclipse.wb.internal.rcp.databinding.model.BindableInfo)1 MapsBeanObservableInfo (org.eclipse.wb.internal.rcp.databinding.model.beans.observables.MapsBeanObservableInfo)1 AbstractViewerInputBindingInfo (org.eclipse.wb.internal.rcp.databinding.model.widgets.input.AbstractViewerInputBindingInfo)1 SingleSelectionObservableInfo (org.eclipse.wb.internal.rcp.databinding.model.widgets.observables.SingleSelectionObservableInfo)1