Re: Jface Databinding Validator not called [message #329417] |
Mon, 23 June 2008 12:59  |
Eclipse User |
|
|
|
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 #329447 is a reply to message #329433] |
Tue, 24 June 2008 15:46  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.02871 seconds