Search in sources :

Example 1 with DataBindingContext

use of org.eclipse.core.databinding.DataBindingContext in project translationstudio8 by heartsome.

the class TermDbManagerDialog method initDataBindings.

/**
	 * 初始化数据绑定 将界面与<code>currServer</code>进行绑定
	 * @return ;
	 */
protected void initDataBindings() {
    DataBindingContext bindingContext = new DataBindingContext();
    IObservableValue widgetValue = WidgetProperties.text(SWT.Modify).observe(instanceText);
    final IObservableValue instanceModelValue = BeanProperties.value("instance").observe(currServer);
    bindingContext.bindValue(widgetValue, instanceModelValue, null, null);
    widgetValue = WidgetProperties.text(SWT.Modify).observe(hostText);
    final IObservableValue hostModelValue = BeanProperties.value("host").observe(currServer);
    bindingContext.bindValue(widgetValue, hostModelValue, null, null);
    widgetValue = WidgetProperties.text(SWT.Modify).observe(portText);
    final IObservableValue protModelValue = BeanProperties.value("port").observe(currServer);
    bindingContext.bindValue(widgetValue, protModelValue, null, null);
    widgetValue = WidgetProperties.text(SWT.Modify).observe(locationText);
    final IObservableValue locationModelValue = BeanProperties.value("itlDBLocation").observe(currServer);
    bindingContext.bindValue(widgetValue, locationModelValue, null, null);
    widgetValue = WidgetProperties.text(SWT.Modify).observe(usernameText);
    final IObservableValue usernameModelValue = BeanProperties.value("userName").observe(currServer);
    bindingContext.bindValue(widgetValue, usernameModelValue, null, null);
    widgetValue = WidgetProperties.text(SWT.Modify).observe(passwordText);
    final IObservableValue passwordModelValue = BeanProperties.value("password").observe(currServer);
    bindingContext.bindValue(widgetValue, passwordModelValue, null, null);
    ViewerSupport.bind(dbTableViewer, currServerdbListInput, BeanProperties.values(new String[] { "index", "dbName", "langs" }));
}
Also used : DataBindingContext(org.eclipse.core.databinding.DataBindingContext) IObservableValue(org.eclipse.core.databinding.observable.value.IObservableValue)

Example 2 with DataBindingContext

use of org.eclipse.core.databinding.DataBindingContext in project translationstudio8 by heartsome.

the class TmDbManagerDialog method initDataBindings.

/**
	 * 初始化数据绑定 将界面与<code>currServer</code>进行绑定
	 * @return ;
	 */
protected void initDataBindings() {
    DataBindingContext bindingContext = new DataBindingContext();
    IObservableValue widgetValue = WidgetProperties.text(SWT.Modify).observe(instanceText);
    final IObservableValue instanceModelValue = BeanProperties.value("instance").observe(currServer);
    bindingContext.bindValue(widgetValue, instanceModelValue, null, null);
    widgetValue = WidgetProperties.text(SWT.Modify).observe(hostText);
    final IObservableValue hostModelValue = BeanProperties.value("host").observe(currServer);
    bindingContext.bindValue(widgetValue, hostModelValue, null, null);
    widgetValue = WidgetProperties.text(SWT.Modify).observe(portText);
    final IObservableValue protModelValue = BeanProperties.value("port").observe(currServer);
    bindingContext.bindValue(widgetValue, protModelValue, null, null);
    widgetValue = WidgetProperties.text(SWT.Modify).observe(locationText);
    final IObservableValue locationModelValue = BeanProperties.value("itlDBLocation").observe(currServer);
    bindingContext.bindValue(widgetValue, locationModelValue, null, null);
    widgetValue = WidgetProperties.text(SWT.Modify).observe(usernameText);
    final IObservableValue usernameModelValue = BeanProperties.value("userName").observe(currServer);
    bindingContext.bindValue(widgetValue, usernameModelValue, null, null);
    widgetValue = WidgetProperties.text(SWT.Modify).observe(passwordText);
    final IObservableValue passwordModelValue = BeanProperties.value("password").observe(currServer);
    bindingContext.bindValue(widgetValue, passwordModelValue, null, null);
    ViewerSupport.bind(dbTableViewer, currServerdbListInput, BeanProperties.values(new String[] { "index", "dbName", "langs" }));
}
Also used : DataBindingContext(org.eclipse.core.databinding.DataBindingContext) IObservableValue(org.eclipse.core.databinding.observable.value.IObservableValue)

Example 3 with DataBindingContext

use of org.eclipse.core.databinding.DataBindingContext in project translationstudio8 by heartsome.

the class View method bindValue.

private void bindValue() {
    DataBindingContext dbc = new DataBindingContext();
    ConverterUtil.bindValue(dbc, positiveSupportList, positiveConverterViewModel);
    ConverterUtil.bindValue(dbc, reverseSupportList, reverseConverterViewModel);
}
Also used : DataBindingContext(org.eclipse.core.databinding.DataBindingContext)

Example 4 with DataBindingContext

use of org.eclipse.core.databinding.DataBindingContext in project translationstudio8 by heartsome.

the class ProjectSettingLanguagePage method initDataBindings.

private void initDataBindings() {
    DataBindingContext ctx = new DataBindingContext();
    IObservableValue widgetValue = ViewersObservables.observeSingleSelection(srcLangComboViewer);
    IObservableValue modelValue = BeanProperties.value(ProjectInfoBean.class, "sourceLang").observe(projCfgBean);
    ctx.bindValue(widgetValue, modelValue, null, null);
}
Also used : ProjectInfoBean(net.heartsome.cat.common.bean.ProjectInfoBean) DataBindingContext(org.eclipse.core.databinding.DataBindingContext) IObservableValue(org.eclipse.core.databinding.observable.value.IObservableValue)

Example 5 with DataBindingContext

use of org.eclipse.core.databinding.DataBindingContext in project translationstudio8 by heartsome.

the class ConfigConversionDialog method bindValue.

/**
	 * 对 UI 和 View Model 进行绑定 ;
	 */
private void bindValue() {
    DataBindingContext dbc = new DataBindingContext();
    ConverterUtil.bindValue(dbc, supportList, converterViewModel);
}
Also used : DataBindingContext(org.eclipse.core.databinding.DataBindingContext)

Aggregations

DataBindingContext (org.eclipse.core.databinding.DataBindingContext)11 IObservableValue (org.eclipse.core.databinding.observable.value.IObservableValue)5 ConversionConfigBean (net.heartsome.cat.convert.ui.model.ConversionConfigBean)2 UpdateValueStrategy (org.eclipse.core.databinding.UpdateValueStrategy)2 MultiValidator (org.eclipse.core.databinding.validation.MultiValidator)2 GridData (org.eclipse.swt.layout.GridData)2 GridLayout (org.eclipse.swt.layout.GridLayout)2 Composite (org.eclipse.swt.widgets.Composite)2 Label (org.eclipse.swt.widgets.Label)2 Text (org.eclipse.swt.widgets.Text)2 ProjectInfoBean (net.heartsome.cat.common.bean.ProjectInfoBean)1