Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » ICellEditorValidator problem
ICellEditorValidator problem [message #464203] Fri, 18 November 2005 11:48 Go to next message
martin is currently offline martin
Messages: 49
Registered: July 2009
Member
Hi all,

I want to add input validation to a TableViewer. I do this by setting an
ICellEditorValidator as validator of a TextCellEditor. The method
isValid just checks if the entered String is empty:

public String isValid(Object value) {
if (((String)value).trim().length() == 0) {
return "a name is required";
}
return null;
}

isValid gets called correctly and returns the error message if an empty
String is entered into the TextCellEditor, but the TableViewer ignores
this and accepts the new value instead of rejecting it and showing the
error message.

Am I missing some kind of validation-enabling, or is validation not
implemented by TableViewer/TextCellEditor?

tia,
M
Re: ICellEditorValidator problem [message #464233 is a reply to message #464203] Fri, 18 November 2005 15:04 Go to previous message
Steve Northover is currently offline Steve Northover
Messages: 1636
Registered: July 2009
Senior Member
You need to ask this question on eclipse.platform. That's where JFace
issues are discussed.

"martin" <address.starts.after.hyphen-martin.umgeher@joanneum.at> wrote in
message news:dll0of$th7$1@news.eclipse.org...
> Hi all,
>
> I want to add input validation to a TableViewer. I do this by setting an
> ICellEditorValidator as validator of a TextCellEditor. The method
> isValid just checks if the entered String is empty:
>
> public String isValid(Object value) {
> if (((String)value).trim().length() == 0) {
> return "a name is required";
> }
> return null;
> }
>
> isValid gets called correctly and returns the error message if an empty
> String is entered into the TextCellEditor, but the TableViewer ignores
> this and accepts the new value instead of rejecting it and showing the
> error message.
>
> Am I missing some kind of validation-enabling, or is validation not
> implemented by TableViewer/TextCellEditor?
>
> tia,
> M
Previous Topic:DDE Conflict (Excel/Bloomberg)
Next Topic:Table behavior when pressing CTRL+UP/DOWN
Goto Forum:
  


Current Time: Wed Aug 27 11:20:23 EDT 2014

Powered by FUDForum. Page generated in 0.01729 seconds