I've currently implemented a Table
with a TableEditor
in my Eclipse plugin to support cell-level editing with keyboard support (to traverse cells with the editor).
I also need a way to delete rows, and I didn't want to go with the practice of adding a delete button next to the table as it requires 2 clicks to delete a row (1 to select a row, and 1 to delete it). Instead I want a separate column which is populated with delete icons. I've thought of 2 ways to accomplish this and have run into issues with both:
Add another column to the
Table
, set the icon withTableItem.setImage()
. There are multiple issues with this approach, and you can see them below:- When selecting a row, the icon gets selected too
- When hovering over the icon, it gets a tooltip of the image which apparently can't be disabled
- Can't seem to vertically center the image inside the cell
Add a
ScrolledComposite
next to the table and fill it with delete icons. This sounds a little insane, but I've actually made it pretty far with this one. The idea is to fill aScrolledComposite
with delete icons, force it to scroll with the table's scrollbar, and delete the corresponding row when an icon is clicked. I've only run into one blocking issue with this approach:- Can't seem to hide the scrollbar
- Can't seem to hide the scrollbar
So my questions are:
- How I can solve the issues mentioned for either of these approaches?
- Is there some other better approach?