use of org.jboss.tools.openshift.internal.ui.validator.ResourceNameValidator in project jbosstools-openshift by jbosstools.
the class ResourceNameControl method doCreateControl.
@SuppressWarnings({ "rawtypes", "unchecked" })
public void doCreateControl(Composite parent, DataBindingContext dbc, Object model) {
// Resource Name
final Label resourceNameLabel = new Label(parent, SWT.NONE);
resourceNameLabel.setText(label);
resourceNameLabel.setToolTipText("The name used to identify the resources that will support the deployed image.");
layoutLabel(resourceNameLabel);
final Text resourceNameText = new Text(parent, SWT.BORDER);
layoutText(resourceNameText);
final IObservableValue resourceNameTextObservable = WidgetProperties.text(SWT.Modify).observe(resourceNameText);
ResourceNameValidator validator = new ResourceNameValidator(resourceNameTextObservable);
final Binding nameBinding = ValueBindingBuilder.bind(resourceNameTextObservable).validatingAfterConvert(validator).to(BeanProperties.value(PROPERTY_RESOURCE_NAME).observe(model)).in(dbc);
dbc.addValidationStatusProvider(validator);
ControlDecorationSupport.create(nameBinding, SWT.LEFT | SWT.TOP, null, new RequiredControlDecorationUpdater(true));
}
Aggregations