[JFace,Databinding]BooleanCellEditor not updating model [message #334748] |
Wed, 25 February 2009 19:00  |
Eclipse User |
|
|
|
Hi,
I am trying to use BooleanCellEditor, that I found in JFace snippets, with
databinding to an EMF model object using ObservableValueEditingSupport.
But I think it is not updating the model object and also not working well
its LabelProvider. I tried to debug this and I think it is something about
deactivating. It just not triggers editor update so editingsupport is not
working to update. Well, I looked at ComboboxCellEditor code and updated
BooleanCellEditor deactivation with following:
Object newValue = doGetValue();
markDirty();
boolean isValid = isCorrect(newValue);
setValueValid(isValid);
fireApplyEditorValue();
deactivate();
Well it seems to update the model object now. But the problem is that, if I
enter editing mode and leave without changing the checkbox state, after
exiting editing mode LabelProvider does not show anything. I am not sure if
it is even called.
Can someone help me with this?
Thanks,
Tankut Koray
|
|
|
Re: [JFace,Databinding]BooleanCellEditor not updating model [message #334768 is a reply to message #334748] |
Thu, 26 February 2009 11:16  |
Eclipse User |
|
|
|
Could you provide a standalone snippet demonstrating the problem you're
seeing? This is tough to visualize
Matthew
Tankut Koray wrote:
> Hi,
>
> I am trying to use BooleanCellEditor, that I found in JFace snippets,
> with databinding to an EMF model object using
> ObservableValueEditingSupport.
>
> But I think it is not updating the model object and also not working
> well its LabelProvider. I tried to debug this and I think it is
> something about deactivating. It just not triggers editor update so
> editingsupport is not working to update. Well, I looked at
> ComboboxCellEditor code and updated BooleanCellEditor deactivation with
> following:
>
> Object newValue = doGetValue();
> markDirty();
> boolean isValid = isCorrect(newValue);
> setValueValid(isValid);
> fireApplyEditorValue();
> deactivate();
>
> Well it seems to update the model object now. But the problem is that,
> if I enter editing mode and leave without changing the checkbox state,
> after exiting editing mode LabelProvider does not show anything. I am
> not sure if it is even called.
>
> Can someone help me with this?
>
> Thanks,
> Tankut Koray
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.05916 seconds