Search in sources :

Example 11 with IBindingInfo

use of org.eclipse.wb.internal.core.databinding.model.IBindingInfo in project windowbuilder by eclipse.

the class ControllerSupport method convertJavaInfosToGetters.

private static void convertJavaInfosToGetters(DatabindingsProvider provider, AstEditor editor, TypeDeclaration rootNode) throws Exception {
    provider.setController(true);
    provider.setControllerViewerField("m_" + StringUtils.uncapitalize(rootNode.getName().getIdentifier()));
    // 
    List<IBindingInfo> bindings = provider.getBindings();
    for (IBindingInfo binding : bindings) {
        convertJavaInfoToGetter(provider, binding.getModel());
        convertJavaInfoToGetter(provider, binding.getTarget());
    }
    editor.commitChanges();
}
Also used : IBindingInfo(org.eclipse.wb.internal.core.databinding.model.IBindingInfo)

Example 12 with IBindingInfo

use of org.eclipse.wb.internal.core.databinding.model.IBindingInfo in project windowbuilder by eclipse.

the class JComboBoxSelfObserveProperty method getText.

@Override
protected String getText() throws Exception {
    IBindingInfo binding = getBinding();
    if (binding == null) {
        return "";
    }
    int column = binding.getTargetProperty() == m_observeProperty ? 2 : 1;
    return BindingLabelProvider.INSTANCE.getColumnText(binding, column);
}
Also used : IBindingInfo(org.eclipse.wb.internal.core.databinding.model.IBindingInfo)

Example 13 with IBindingInfo

use of org.eclipse.wb.internal.core.databinding.model.IBindingInfo in project windowbuilder by eclipse.

the class ObserveProperty method getBindings.

// //////////////////////////////////////////////////////////////////////////
// 
// AbstractObserveProperty
// 
// //////////////////////////////////////////////////////////////////////////
@Override
public void getBindings(List<IBindingInfo> bindings, List<Boolean> isTargets) throws Exception {
    BindableInfo observeProperty = (BindableInfo) m_observeProperty;
    bindings.addAll(observeProperty.getBindings());
    // 
    for (IBindingInfo binding : bindings) {
        isTargets.add(binding.getTargetProperty() == m_observeProperty);
    }
}
Also used : BindableInfo(org.eclipse.wb.internal.rcp.databinding.model.BindableInfo) IBindingInfo(org.eclipse.wb.internal.core.databinding.model.IBindingInfo)

Example 14 with IBindingInfo

use of org.eclipse.wb.internal.core.databinding.model.IBindingInfo in project windowbuilder by eclipse.

the class ObserveProperty method getBindings.

// //////////////////////////////////////////////////////////////////////////
// 
// AbstractObserveProperty
// 
// //////////////////////////////////////////////////////////////////////////
@Override
public void getBindings(List<IBindingInfo> bindings, List<Boolean> isTargets) throws Exception {
    ObserveInfo observeProperty = (ObserveInfo) m_observeProperty;
    bindings.addAll(observeProperty.getBindings());
    // 
    for (IBindingInfo binding : bindings) {
        isTargets.add(binding.getTargetProperty() == m_observeProperty);
    }
}
Also used : IObserveInfo(org.eclipse.wb.internal.core.databinding.model.IObserveInfo) ObserveInfo(org.eclipse.wb.internal.swing.databinding.model.ObserveInfo) IBindingInfo(org.eclipse.wb.internal.core.databinding.model.IBindingInfo)

Example 15 with IBindingInfo

use of org.eclipse.wb.internal.core.databinding.model.IBindingInfo in project windowbuilder by eclipse.

the class DatabindingsProvider method gotoDefinition.

@Override
public void gotoDefinition(IBindingInfo ibinding) {
    BindingInfo binding = (BindingInfo) ibinding;
    int position = binding.getDefinitionOffset();
    if (position != -1) {
        IDesignPageSite site = IDesignPageSite.Helper.getSite(m_xmlObjectRoot);
        site.openSourcePosition(position);
    }
}
Also used : IDesignPageSite(org.eclipse.wb.core.editor.IDesignPageSite) BindingInfo(org.eclipse.wb.internal.rcp.databinding.xwt.model.BindingInfo) IBindingInfo(org.eclipse.wb.internal.core.databinding.model.IBindingInfo) AbstractBindingInfo(org.eclipse.wb.internal.rcp.databinding.model.AbstractBindingInfo)

Aggregations

IBindingInfo (org.eclipse.wb.internal.core.databinding.model.IBindingInfo)81 DatabindingsProvider (org.eclipse.wb.internal.rcp.databinding.DatabindingsProvider)51 CompositeInfo (org.eclipse.wb.internal.swt.model.widgets.CompositeInfo)48 BindingInfo (org.eclipse.wb.internal.rcp.databinding.model.context.BindingInfo)38 IObserveInfo (org.eclipse.wb.internal.core.databinding.model.IObserveInfo)18 TreeViewerInputBindingInfo (org.eclipse.wb.internal.rcp.databinding.model.widgets.input.TreeViewerInputBindingInfo)16 DetailListBeanObservableInfo (org.eclipse.wb.internal.rcp.databinding.model.beans.observables.DetailListBeanObservableInfo)14 DetailSetBeanObservableInfo (org.eclipse.wb.internal.rcp.databinding.model.beans.observables.DetailSetBeanObservableInfo)14 ListBeanObservableInfo (org.eclipse.wb.internal.rcp.databinding.model.beans.observables.ListBeanObservableInfo)14 SetBeanObservableInfo (org.eclipse.wb.internal.rcp.databinding.model.beans.observables.SetBeanObservableInfo)14 WritableListBeanObservableInfo (org.eclipse.wb.internal.rcp.databinding.model.beans.observables.WritableListBeanObservableInfo)14 WritableSetBeanObservableInfo (org.eclipse.wb.internal.rcp.databinding.model.beans.observables.WritableSetBeanObservableInfo)14 ObservableInfo (org.eclipse.wb.internal.rcp.databinding.model.ObservableInfo)13 CheckedElementsObservableInfo (org.eclipse.wb.internal.rcp.databinding.model.widgets.observables.CheckedElementsObservableInfo)13 ViewerObservableInfo (org.eclipse.wb.internal.rcp.databinding.model.widgets.observables.ViewerObservableInfo)13 MapsBeanObservableInfo (org.eclipse.wb.internal.rcp.databinding.model.beans.observables.MapsBeanObservableInfo)12 KnownElementsObservableInfo (org.eclipse.wb.internal.rcp.databinding.model.widgets.input.KnownElementsObservableInfo)12 ViewerInputBindingInfo (org.eclipse.wb.internal.rcp.databinding.model.widgets.input.ViewerInputBindingInfo)12 MultiSelectionObservableInfo (org.eclipse.wb.internal.rcp.databinding.model.widgets.observables.MultiSelectionObservableInfo)12 SingleSelectionObservableInfo (org.eclipse.wb.internal.rcp.databinding.model.widgets.observables.SingleSelectionObservableInfo)12