Search in sources :

Example 1 with BindingInfo

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

Example 2 with BindingInfo

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

the class DatabindingsProvider method createBinding.

// //////////////////////////////////////////////////////////////////////////
// 
// Creation/Editing
// 
// //////////////////////////////////////////////////////////////////////////
@Override
public IBindingInfo createBinding(IObserveInfo target, IObserveInfo targetProperty, IObserveInfo model, IObserveInfo modelProperty) throws Exception {
    // prepare target
    BindableInfo targetBindable = (BindableInfo) target;
    BindableInfo targetBindableProperty = (BindableInfo) targetProperty;
    IObservableFactory targetFactory = targetBindableProperty.getObservableFactory();
    // prepare model
    BindableInfo modelBindable = (BindableInfo) model;
    BindableInfo modelBindableProperty = (BindableInfo) modelProperty;
    IObservableFactory modelFactory = modelBindableProperty.getObservableFactory();
    // calculate type
    Type type = org.eclipse.wb.internal.rcp.databinding.DatabindingsProvider.calculateObserveType(targetFactory, modelFactory);
    // handle input type
    if (type == Type.Input) {
        // XXX
        throw new UnsupportedOperationException();
    }
    // create binding
    BindingInfo binding = new BindingInfo(targetBindable, targetBindableProperty, modelBindable, modelBindableProperty);
    binding.setDocumentEditor(new AttributeDocumentEditor(binding));
    // 
    return binding;
}
Also used : ObserveType(org.eclipse.wb.internal.core.databinding.ui.ObserveType) Type(org.eclipse.wb.internal.rcp.databinding.model.IObservableFactory.Type) BindableInfo(org.eclipse.wb.internal.rcp.databinding.model.BindableInfo) WidgetBindableInfo(org.eclipse.wb.internal.rcp.databinding.xwt.model.widgets.WidgetBindableInfo) 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) AttributeDocumentEditor(org.eclipse.wb.internal.rcp.databinding.xwt.model.AttributeDocumentEditor) IObservableFactory(org.eclipse.wb.internal.rcp.databinding.model.IObservableFactory)

Example 3 with BindingInfo

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

the class DatabindingsProvider method getContentProviders.

// //////////////////////////////////////////////////////////////////////////
// 
// UI editing
// 
// //////////////////////////////////////////////////////////////////////////
@Override
public List<IUiContentProvider> getContentProviders(IBindingInfo ibinding, IPageListener listener) throws Exception {
    List<IUiContentProvider> providers = Lists.newArrayList();
    BindingInfo binding = (BindingInfo) ibinding;
    binding.createContentProviders(providers, listener, this);
    return providers;
}
Also used : 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) IUiContentProvider(org.eclipse.wb.internal.core.databinding.ui.editor.IUiContentProvider)

Example 4 with BindingInfo

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

the class DatabindingParser method createBinding.

private BindingInfo createBinding(BindableInfo target, BindableInfo targetProperty, BindableInfo model, BindableInfo modelProperty, Map<String, String> attributes) throws Exception {
    BindingInfo binding = new BindingInfo(target, targetProperty, model, modelProperty);
    binding.setMode(attributes.get("mode"));
    binding.setTrigger(attributes.get("updatesourcetrigger"));
    m_provider.getBindings0().add(binding);
    return binding;
}
Also used : BindingInfo(org.eclipse.wb.internal.rcp.databinding.xwt.model.BindingInfo)

Aggregations

BindingInfo (org.eclipse.wb.internal.rcp.databinding.xwt.model.BindingInfo)4 IBindingInfo (org.eclipse.wb.internal.core.databinding.model.IBindingInfo)3 AbstractBindingInfo (org.eclipse.wb.internal.rcp.databinding.model.AbstractBindingInfo)3 IDesignPageSite (org.eclipse.wb.core.editor.IDesignPageSite)1 ObserveType (org.eclipse.wb.internal.core.databinding.ui.ObserveType)1 IUiContentProvider (org.eclipse.wb.internal.core.databinding.ui.editor.IUiContentProvider)1 BindableInfo (org.eclipse.wb.internal.rcp.databinding.model.BindableInfo)1 IObservableFactory (org.eclipse.wb.internal.rcp.databinding.model.IObservableFactory)1 Type (org.eclipse.wb.internal.rcp.databinding.model.IObservableFactory.Type)1 AttributeDocumentEditor (org.eclipse.wb.internal.rcp.databinding.xwt.model.AttributeDocumentEditor)1 WidgetBindableInfo (org.eclipse.wb.internal.rcp.databinding.xwt.model.widgets.WidgetBindableInfo)1