use of org.jboss.tools.openshift.internal.common.ui.databinding.RequiredStringValidator in project jbosstools-openshift by jbosstools.
the class OAuthDetailView method bindWidgetsToInternalModel.
private void bindWidgetsToInternalModel(DataBindingContext dbc) {
IValidator validator = new RequiredStringValidator("token");
this.tokenBinding = ValueBindingBuilder.bind(WidgetProperties.text(SWT.Modify).observe(tokenText)).converting(new TrimmingStringConverter()).validatingAfterConvert(validator).to(tokenObservable).validatingBeforeSet(validator).in(dbc);
ControlDecorationSupport.create(tokenBinding, SWT.LEFT | SWT.TOP, null, new RequiredControlDecorationUpdater());
org.jboss.tools.common.ui.databinding.DataBindingUtils.addDisposableValueChangeListener(changeListener, tokenObservable, tokenText);
}
use of org.jboss.tools.openshift.internal.common.ui.databinding.RequiredStringValidator in project jbosstools-openshift by jbosstools.
the class BasicAuthenticationDetailView method bindWidgetsToInternalModel.
private void bindWidgetsToInternalModel(DataBindingContext dbc) {
// username
this.usernameBinding = ValueBindingBuilder.bind(WidgetProperties.text(SWT.Modify).observe(usernameText)).converting(new TrimmingStringConverter()).validatingAfterConvert(new RequiredStringValidator("v3 username")).to(usernameObservable).in(dbc);
ControlDecorationSupport.create(usernameBinding, SWT.LEFT | SWT.TOP, null, new RequiredControlDecorationUpdater());
org.jboss.tools.common.ui.databinding.DataBindingUtils.addDisposableValueChangeListener(changeListener, usernameObservable, usernameText);
// password
this.passwordBinding = ValueBindingBuilder.bind(WidgetProperties.text(SWT.Modify).observe(passwordText)).converting(new TrimmingStringConverter()).validatingAfterConvert(new RequiredStringValidator("v3 password")).to(passwordObservable).in(dbc);
ControlDecorationSupport.create(passwordBinding, SWT.LEFT | SWT.TOP, null, new RequiredControlDecorationUpdater());
org.jboss.tools.common.ui.databinding.DataBindingUtils.addDisposableValueChangeListener(changeListener, passwordObservable, passwordText);
connectionAuthProvider = new ConnectionAuthenticationProvider();
}
Aggregations