updated controls to add spacing, added highliting for databinding
diff --git a/ECP2/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/AbstractTextControl.java b/ECP2/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/AbstractTextControl.java index fbe6599..a0b909e 100644 --- a/ECP2/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/AbstractTextControl.java +++ b/ECP2/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/AbstractTextControl.java
@@ -147,11 +147,12 @@ public Object convert(Object value) { try { controlDecoration.hide(); - text.setBackground(null); + updateValidationColor(null); return super.convert(value); } catch (NumberFormatException e) { controlDecoration.show(); - text.setBackground(text.getShell().getDisplay().getSystemColor(SWT.COLOR_RED)); + updateValidationColor(text.getShell().getDisplay().getSystemColor(SWT.COLOR_RED)); + controlDecoration.setDescriptionText("Invalid input " + e.getLocalizedMessage()); throw e; } }
diff --git a/ECP2/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/MultiControl.java b/ECP2/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/MultiControl.java index 772ef12..0a72644 100644 --- a/ECP2/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/MultiControl.java +++ b/ECP2/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/MultiControl.java
@@ -140,7 +140,7 @@ @Override public Composite createControl(Composite parent) { Composite superComposite = new Composite(parent, SWT.NONE); - GridLayoutFactory.fillDefaults().numColumns(2).spacing(2, 0).equalWidth(false).applyTo(superComposite); + GridLayoutFactory.fillDefaults().numColumns(2).spacing(10, 0).equalWidth(false).applyTo(superComposite); // VALIDATION validationLabel = new Label(superComposite, SWT.NONE);
diff --git a/ECP2/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/SingleControl.java b/ECP2/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/SingleControl.java index bbb23e0..6faee5d 100644 --- a/ECP2/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/SingleControl.java +++ b/ECP2/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/SingleControl.java
@@ -63,7 +63,7 @@ if (isEmbedded()) { numColumns--; } - GridLayoutFactory.fillDefaults().numColumns(numColumns).spacing(2, 0).applyTo(composite); + GridLayoutFactory.fillDefaults().numColumns(numColumns).spacing(10, 0).applyTo(composite); GridDataFactory.fillDefaults().grab(true, false).align(SWT.FILL, SWT.BEGINNING).applyTo(composite); if (!isEmbedded()) { validationLabel = new Label(composite, SWT.NONE);