diff options
Diffstat (limited to 'plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/IntegerEditor.java')
-rw-r--r-- | plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/IntegerEditor.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/IntegerEditor.java b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/IntegerEditor.java index 37cfa907e48..65d9f08da0a 100644 --- a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/IntegerEditor.java +++ b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/IntegerEditor.java @@ -59,7 +59,7 @@ public class IntegerEditor extends StringEditor { public IntegerEditor(Composite parent, int style, String label) { super(parent, style, label); - targetValidator = new IntegerValidator(); + targetValidator = new IntegerValidator(true); targetToModelConverter = new IConverter() { @@ -78,7 +78,7 @@ public class IntegerEditor extends StringEditor { if (fromObject instanceof String) { String newString = ((String) fromObject).replaceAll(" ", ""); //$NON-NLS-1$ //$NON-NLS-2$ try { - Integer i = (Integer) StringToNumberConverter.toInteger(false).convert(newString); + Integer i = StringToNumberConverter.toInteger(false).convert(newString); return i; } catch (Exception ex) { @@ -107,8 +107,9 @@ public class IntegerEditor extends StringEditor { if (fromObject instanceof Integer) { return Integer.toString((Integer) fromObject); + } else if (fromObject != null) { + errorBinding = true; } - errorBinding = true; return ""; //$NON-NLS-1$ } |