Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » [DataBinding] TitleAreaDialogSupport not working properly?(Error message is shown at time of creation, default dialog message not shown if no error is found)
icon4.gif  [DataBinding] TitleAreaDialogSupport not working properly? [message #841393] Wed, 11 April 2012 08:39
Carusyte Missing name is currently offline Carusyte Missing nameFriend
Messages: 27
Registered: July 2009
Junior Member
According to the javadoc of TitleAreaDialogSupport.create(TitleAreaDialog, DataBindingContext), the error message will not be shown at the time of creation, but the outcome is just opposite. Another issue is that if no error is found, the dialog message would be blank. My code is roughly as below:

DataBindingContext ctx = new DataBindingContext();
IObservableValue uiOv = null, modelOv = null;
Binding binding = null;

uiOv = WidgetProperties.selection().observe(aCombo);
modelOv = PojoProperties.value("aProperty").observe(mdoel);
binding = ctx.bindValue(uiOv, modelOv, new UpdateValueStrategy()
	.setBeforeSetValidator(new IValidator() {
		@Override
		public IStatus validate(Object value) {
			if (value == null || "".equals(value))
				return ValidationStatus.info(infoMessage);
			return ValidationStatus.ok();
		}
	}), null);
ControlDecorationSupport.create(binding, SWT.TOP | SWT.LEFT);

// the rest of the binding boilerplate code is ommitted.

TitleAreaDialogSupport.create(this, ctx);

[Updated on: Wed, 11 April 2012 13:47]

Report message to a moderator

Previous Topic:Databinding without model
Next Topic:[DataBinding] Bind Control.enabled to viewer selection if instanceof of type XY
Goto Forum:
  


Current Time: Tue Mar 19 03:26:34 GMT 2024

Powered by FUDForum. Page generated in 0.01716 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top