Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-ui-dev] help: ObservableValueEditingSupport, TextCellEditor and MessageDialog

Hello,

I have a little problem with Editing Support and a Message Dialog.

Situation:
I have a model class which is binded with a treeviewer. In the model i open a Message Dialog and then I set a value of the model. If i click form one cell directly to an other cell, the first time is all fine, The value is binded to the model. But the binding is brocken of the second cell. So i can change the value in the cell but the value doesn't bind to the model.  

So if I override the method "focusLost" of the "TextCellEditor" and call the "saveCellEditorValue" method (ObservedEditingSupport), than it's ok. But I think it's the wrong approach?!?

textCellEditor = new TextCellEditor((Composite) super.getViewer().getControl())
            {
                @Override
                protected void focusLost()
                {
                    ImplObservableValueEditingSupport.this.saveCellEditorValue(cellEditor, null);
                }
            };

I think the problem is the "SafeRunnable" in CellEditor.fireApplyEditorValue() method. Why it's needed?

protected void fireApplyEditorValue() {
                Object[] array = listeners.getListeners();
                for (int i = 0; i < array.length; i++) {
                        final ICellEditorListener l = (ICellEditorListener) array[i];
                        SafeRunnable.run(new SafeRunnable() {
                                public void run() {
                                        l.applyEditorValue();
                                }
                        });
                }
        }

Or what can I do to fix my problem?

Thank you!

Best regards
Rubin

Back to the top