use of org.eclipse.core.databinding.observable.value.IObservableValue 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" }));
}
use of org.eclipse.core.databinding.observable.value.IObservableValue 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" }));
}
use of org.eclipse.core.databinding.observable.value.IObservableValue 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);
}
use of org.eclipse.core.databinding.observable.value.IObservableValue in project translationstudio8 by heartsome.
the class NewTermDbBaseInfoPage method initDataBindings.
protected void initDataBindings() {
DataBindingContext bindingContext = new DataBindingContext();
WizardPageSupport.create(this, bindingContext);
IObservableValue widgetValue = WidgetProperties.text(SWT.Modify).observe(dbNameText);
final IObservableValue dbNameModelValue = BeanProperties.value("dbName").observe(dbModel);
bindingContext.bindValue(widgetValue, dbNameModelValue, null, null);
widgetValue = WidgetProperties.text(SWT.Modify).observe(instanceText);
final IObservableValue instanceModelValue = BeanProperties.value("instance").observe(dbModel);
bindingContext.bindValue(widgetValue, instanceModelValue, null, null);
widgetValue = WidgetProperties.text(SWT.Modify).observe(hostText);
final IObservableValue hostModelValue = BeanProperties.value("host").observe(dbModel);
bindingContext.bindValue(widgetValue, hostModelValue, null, null);
widgetValue = WidgetProperties.text(SWT.Modify).observe(portText);
final IObservableValue protModelValue = BeanProperties.value("port").observe(dbModel);
bindingContext.bindValue(widgetValue, protModelValue, null, null);
widgetValue = WidgetProperties.text(SWT.Modify).observe(locationText);
final IObservableValue locationModelValue = BeanProperties.value("itlDBLocation").observe(dbModel);
bindingContext.bindValue(widgetValue, locationModelValue, null, null);
//
widgetValue = WidgetProperties.text(SWT.Modify).observe(usernameText);
final IObservableValue usernameModelValue = BeanProperties.value("userName").observe(dbModel);
bindingContext.bindValue(widgetValue, usernameModelValue, null, null);
widgetValue = WidgetProperties.text(SWT.Modify).observe(passwordText);
final IObservableValue passwordModelValue = BeanProperties.value("password").observe(dbModel);
bindingContext.bindValue(widgetValue, passwordModelValue, null, null);
MultiValidator myValidator = new MultiValidator() {
@Override
protected IStatus validate() {
dbNameModelValue.getValue();
instanceModelValue.getValue();
hostModelValue.getValue();
protModelValue.getValue();
locationModelValue.getValue();
usernameModelValue.getValue();
passwordModelValue.getValue();
return validator();
}
};
bindingContext.addValidationStatusProvider(myValidator);
}
use of org.eclipse.core.databinding.observable.value.IObservableValue in project translationstudio8 by heartsome.
the class NewTmDbBaseInfoPage method initDataBindings.
protected void initDataBindings() {
DataBindingContext bindingContext = new DataBindingContext();
WizardPageSupport.create(this, bindingContext);
IObservableValue widgetValue = WidgetProperties.text(SWT.Modify).observe(dbNameText);
final IObservableValue dbNameModelValue = BeanProperties.value("dbName").observe(dbModel);
bindingContext.bindValue(widgetValue, dbNameModelValue, null, null);
widgetValue = WidgetProperties.text(SWT.Modify).observe(instanceText);
final IObservableValue instanceModelValue = BeanProperties.value("instance").observe(dbModel);
bindingContext.bindValue(widgetValue, instanceModelValue, null, null);
widgetValue = WidgetProperties.text(SWT.Modify).observe(hostText);
final IObservableValue hostModelValue = BeanProperties.value("host").observe(dbModel);
bindingContext.bindValue(widgetValue, hostModelValue, null, null);
widgetValue = WidgetProperties.text(SWT.Modify).observe(portText);
final IObservableValue protModelValue = BeanProperties.value("port").observe(dbModel);
bindingContext.bindValue(widgetValue, protModelValue, null, null);
widgetValue = WidgetProperties.text(SWT.Modify).observe(locationText);
final IObservableValue locationModelValue = BeanProperties.value("itlDBLocation").observe(dbModel);
bindingContext.bindValue(widgetValue, locationModelValue, null, null);
//
widgetValue = WidgetProperties.text(SWT.Modify).observe(usernameText);
final IObservableValue usernameModelValue = BeanProperties.value("userName").observe(dbModel);
bindingContext.bindValue(widgetValue, usernameModelValue, null, null);
widgetValue = WidgetProperties.text(SWT.Modify).observe(passwordText);
final IObservableValue passwordModelValue = BeanProperties.value("password").observe(dbModel);
bindingContext.bindValue(widgetValue, passwordModelValue, null, null);
MultiValidator myValidator = new MultiValidator() {
@Override
protected IStatus validate() {
dbNameModelValue.getValue();
instanceModelValue.getValue();
hostModelValue.getValue();
protModelValue.getValue();
locationModelValue.getValue();
usernameModelValue.getValue();
passwordModelValue.getValue();
return validator();
}
};
bindingContext.addValidationStatusProvider(myValidator);
}
Aggregations