Skip to main content


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 16:48 Go to next message
martin is currently offline martinFriend
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 20:04 Go to previous message
Steve Northover is currently offline Steve NorthoverFriend
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: Thu Apr 25 11:31:28 GMT 2024

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

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

Back to the top