I’m working with ContentProposalAdapter to give proposals to a cell in a table.
When I use the keyboard (choose which proposal via keyboard and press enter) the value gets replaced in the table cell (due to adapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE)).
But when I double click the proposal, the value in the cell remains unchanged. Any solutions to this?
Note that RCP app is based on 3.4.0.
I solved the same problem with
ContentProposalAdapter, however I’m using JFace 3.8 (appears to be the latest one, used in Eclipse 4.2 Juno). It might not be the case for your initial issue, but I’ll give a shot.Basically Text content proposal works correctly with mouse events, example provided by sambi reddy will prove that.
But when Text is used inside a Table as a CellEditor, content proposal popup is closed immediately after you select one of the proposals with mouse click. In my case it was caused by ‘FocusOut’ listener of the CellEditor which commits edited value whenever you move focus out of the cell. For sure, this behavior seems pretty natural. However, besides of committing it was also disposing underlying Text control. Thing is that popup used inside
ContentProposalAdapteris listening for disposal of control it proposes to and closes itself whenever this happens. That’s it.So the obvious solution in this particular case is: avoid commiting CellEditor value and not disposing underlying control if content proposal popup is open which could be checked by
contentProposalAdapter.isProposalPopupOpen().