Community
Participate
Working Groups
As I have already commented on the forum: http://www.eclipse.org/newsportal/article.php?id=76737&group=eclipse.platform#76737 When I press a button in a toolbar, I need to be able to take into account the possible edited new cell values in a TableViewer. The right API for this is: TableViewer#applyEditorValue() but it is protected, not public. I have tried to find any other public API unsuccessfully. The solutions I have found are: 1) Calling applyEditorValue() with reflection 2) Deriving TableViewr for making applyEditorValue() visible public class MyTableViewer extends TableViewer { public TableViewer(Composite parent, int style) { super(parent, style); } @Override public void applyEditorValue() { super.applyEditorValue(); } } Both of these solutions do work, but I don't like to use a back door for solving this. The best solution for me would be to make this API public.
because cancleEditor is also public I'd like to see this happen
Another need I have: Access to save the current editor value, without deactivating the current cell, i.e., ColumnViewerEditor#saveEditorValue() I have developed a database-oriented CRUD framework on top of JFace and SWT, specially on TableViewer, and these are nearly the only non-public methods I have needed.
multi change because of intenion of stepping back as platform-ui committer
This has my vote! I run into the same problem in my "forms CRUD framework": it uses databinding to show validation errors and enable/disable the save command when the model changes taking into account these validation errors. When the user runs the save command while a cell editor is active the value is not yet applied to the model and this may result in the current value not being saved. (But even worse in my case: some forms show a dialog before doing the actual save. The save handler does another check for validation errors, when the command executes the model is still in the old valid state. While the dialog is open the cell editor loses focus and commits it value to the model. At the time the user presses OK the server suddenly throws a validation exception that should have been already caught in the UI.)
Can also cause problems with other actions such as closing an editor. It may think that it is not dirty and don't prompt for save. Such a problem was reported in bug 125827.
I came across this rather old bug today because I need this as well, and since no one has objected that applyEditorValue() should not be public, I went ahead and created a changeset in Gerrit. see https://git.eclipse.org/r/24230
(In reply to Stefan Winkler from comment #6) > I came across this rather old bug today because I need this as well, and > since no one has objected that applyEditorValue() should not be public, I > went ahead and created a changeset in Gerrit. > > see https://git.eclipse.org/r/24230 Thanks, for Luna we already have API freeze, I mark this one for early Mars. Please feel free to remind me after the Luna release.
Thanks Stefan for this contribution and sorry for the delay in the review from my side.
Fixed with https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=12ccfa3bd657579ab829932a7b8623dd02c02acf
Thanks. It is better late (6 years) that never.
Validated by running the corresponding tests.