Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Re: Jface Databinding Validator not called
Re: Jface Databinding Validator not called [message #329417] Mon, 23 June 2008 16:59 Go to next message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

Julien wrote:
> Hello,
>
> I'm using Jface databinding in eclipse 3.3 and I have an issue using
> Jface databinding. I'm using a validator to simulate the read only
> status. When the user try to change a value in a widget, the validator
> is called and the value from the model is set to the widget. The problem
> is that the validator is not called each time when i press the Keyboard
> Delete key(Maybe others). I've modified the hello world databinding
> Snippet to illustrate the problem. Just press Delete a few times and you
> will reproduct the behavior i've explained.
> Am I doing something wrong or is it a bug?

First: DataBinding is supported on the eclipse.platform newsgroup, so
you will get a better response if post there in the future. Be sure to
put "[DataBinding]" at the beginning of the subject line to help us
notice your question. I've copied eclipse.platform to this reply.

As for your question, why don't you make the widget read-only instead of
relying on DataBinding to enforce it?

Eric
Re: Jface Databinding Validator not called [message #329433 is a reply to message #329417] Tue, 24 June 2008 08:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jdenet.sodifrance.fr

Eric Rizzo a écrit :
> Julien wrote:
>> Hello,
>>
>> I'm using Jface databinding in eclipse 3.3 and I have an issue using
>> Jface databinding. I'm using a validator to simulate the read only
>> status. When the user try to change a value in a widget, the validator
>> is called and the value from the model is set to the widget. The
>> problem is that the validator is not called each time when i press the
>> Keyboard Delete key(Maybe others). I've modified the hello world
>> databinding Snippet to illustrate the problem. Just press Delete a few
>> times and you will reproduct the behavior i've explained.
>> Am I doing something wrong or is it a bug?
>
> First: DataBinding is supported on the eclipse.platform newsgroup, so
> you will get a better response if post there in the future. Be sure to
> put "[DataBinding]" at the beginning of the subject line to help us
> notice your question. I've copied eclipse.platform to this reply.
>
> As for your question, why don't you make the widget read-only instead of
> relying on DataBinding to enforce it?
>
> Eric

Thanks Eric,

Text Widgets can be set to readonly by using setEditable(false) but
CCombos setEditable(false) allow the user to select a value in the
combo. The setEnabled method don't meet my requirements because the user
loose tooltip and copy/Paste/Select actions on the widget. This is why
I'm trying to use a validator to reflect a readOnly status.

Best regards,
Julien
Re: Jface Databinding Validator not called [message #329447 is a reply to message #329433] Tue, 24 June 2008 19:46 Go to previous message
Matthew Hall is currently offline Matthew HallFriend
Messages: 368
Registered: July 2009
Senior Member
Julien wrote:
> Eric Rizzo a écrit :
>> Julien wrote:
>>> Hello,
>>>
>>> I'm using Jface databinding in eclipse 3.3 and I have an issue using
>>> Jface databinding. I'm using a validator to simulate the read only
>>> status. When the user try to change a value in a widget, the
>>> validator is called and the value from the model is set to the
>>> widget. The problem is that the validator is not called each time
>>> when i press the Keyboard Delete key(Maybe others). I've modified the
>>> hello world databinding Snippet to illustrate the problem. Just press
>>> Delete a few times and you will reproduct the behavior i've explained.
>>> Am I doing something wrong or is it a bug?
>>
>> First: DataBinding is supported on the eclipse.platform newsgroup, so
>> you will get a better response if post there in the future. Be sure
>> to put "[DataBinding]" at the beginning of the subject line to help us
>> notice your question. I've copied eclipse.platform to this reply.
>>
>> As for your question, why don't you make the widget read-only instead
>> of relying on DataBinding to enforce it?
>>
>> Eric
>
> Thanks Eric,
>
> Text Widgets can be set to readonly by using setEditable(false) but
> CCombos setEditable(false) allow the user to select a value in the
> combo. The setEnabled method don't meet my requirements because the user
> loose tooltip and copy/Paste/Select actions on the widget. This is why
> I'm trying to use a validator to reflect a readOnly status.
>
> Best regards,
> Julien

Julien,

CCombo.setEditable applies to editing of the text field, not to the
drop-down selection. I think that setEnabled() is the only way of
disabling the drop-down in SWT.

I suggest either:
* Use a Text instead of CCombo
* Submit a request for new API on CCombo supporting what you're asking
for, or
* Live with the inconveniences of CCombo.setEnabled(false).

Without knowing more about your program's interface it's hard to make a
better suggestion. I suspect there's another way to tackle this problem
by tweaking the UI. Maybe introduce a button that copies the CCombo's
text to the clipboard?

Matthew
Previous Topic:Re: Busy Section
Next Topic:Help search behavior
Goto Forum:
  


Current Time: Tue Jul 16 13:35:54 GMT 2024

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

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

Back to the top