Search in sources :

Example 6 with AbstractBindingInfo

use of org.eclipse.wb.internal.rcp.databinding.model.AbstractBindingInfo in project windowbuilder by eclipse.

the class DatabindingsProvider method deleteAllBindings.

@Override
public void deleteAllBindings() {
    // delete all
    ExecutionUtils.runLog(new RunnableEx() {

        @Override
        public void run() throws Exception {
            for (AbstractBindingInfo binding : getBindings0()) {
                binding.delete();
            }
        }
    });
    getBindings().clear();
    // save
    saveEdit();
}
Also used : AbstractBindingInfo(org.eclipse.wb.internal.rcp.databinding.model.AbstractBindingInfo) RunnableEx(org.eclipse.wb.internal.core.utils.execution.RunnableEx)

Example 7 with AbstractBindingInfo

use of org.eclipse.wb.internal.rcp.databinding.model.AbstractBindingInfo in project windowbuilder by eclipse.

the class DatabindingsProvider method gotoDefinition.

@Override
public void gotoDefinition(IBindingInfo ibinding) {
    try {
        AbstractBindingInfo binding = (AbstractBindingInfo) ibinding;
        String source = binding.getDefinitionSource(this);
        // 
        if (source != null) {
            int position = m_javaInfoRoot.getEditor().getEnclosingNode(source).getStartPosition();
            IDesignPageSite site = IDesignPageSite.Helper.getSite(m_javaInfoRoot);
            site.openSourcePosition(position);
        }
    } catch (Throwable e) {
    }
}
Also used : AbstractBindingInfo(org.eclipse.wb.internal.rcp.databinding.model.AbstractBindingInfo) IDesignPageSite(org.eclipse.wb.core.editor.IDesignPageSite)

Example 8 with AbstractBindingInfo

use of org.eclipse.wb.internal.rcp.databinding.model.AbstractBindingInfo in project windowbuilder by eclipse.

the class DatabindingsProvider method addBinding.

@Override
public void addBinding(final IBindingInfo ibinding) {
    // post process
    ExecutionUtils.runLog(new RunnableEx() {

        @Override
        public void run() throws Exception {
            AbstractBindingInfo binding = (AbstractBindingInfo) ibinding;
            binding.create();
        }
    });
    // add
    getBindings().add(ibinding);
    // save
    saveEdit();
}
Also used : AbstractBindingInfo(org.eclipse.wb.internal.rcp.databinding.model.AbstractBindingInfo) RunnableEx(org.eclipse.wb.internal.core.utils.execution.RunnableEx)

Example 9 with AbstractBindingInfo

use of org.eclipse.wb.internal.rcp.databinding.model.AbstractBindingInfo 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

AbstractBindingInfo (org.eclipse.wb.internal.rcp.databinding.model.AbstractBindingInfo)9 RunnableEx (org.eclipse.wb.internal.core.utils.execution.RunnableEx)3 BindableInfo (org.eclipse.wb.internal.rcp.databinding.model.BindableInfo)2 IDesignPageSite (org.eclipse.wb.core.editor.IDesignPageSite)1 IUiContentProvider (org.eclipse.wb.internal.core.databinding.ui.editor.IUiContentProvider)1 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 DetailListEmfObservableInfo (org.eclipse.wb.internal.rcp.databinding.emf.model.observables.DetailListEmfObservableInfo)1 DetailValueEmfObservableInfo (org.eclipse.wb.internal.rcp.databinding.emf.model.observables.DetailValueEmfObservableInfo)1 EmfObservableDetailListCodeSupport (org.eclipse.wb.internal.rcp.databinding.emf.model.observables.EmfObservableDetailListCodeSupport)1 EmfObservableDetailValueCodeSupport (org.eclipse.wb.internal.rcp.databinding.emf.model.observables.EmfObservableDetailValueCodeSupport)1 ListEmfObservableInfo (org.eclipse.wb.internal.rcp.databinding.emf.model.observables.ListEmfObservableInfo)1 MapsEmfObservableInfo (org.eclipse.wb.internal.rcp.databinding.emf.model.observables.MapsEmfObservableInfo)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 ObservableInfo (org.eclipse.wb.internal.rcp.databinding.model.ObservableInfo)1 MapsBeanObservableInfo (org.eclipse.wb.internal.rcp.databinding.model.beans.observables.MapsBeanObservableInfo)1 WidgetBindableInfo (org.eclipse.wb.internal.rcp.databinding.model.widgets.bindables.WidgetBindableInfo)1