crhurley4
crhurley4

Reputation: 21

How to make a TableEditor editable when there is nothing in it

I am having a problem with the TableEditor in SWT. I am working from the code in this link: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/tree/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet88.java

The code works pretty much perfect for what I want except for one thing. If the table has nothing in it, then I can't edit the column that I need to edit.

More specifically, I am using a TableViewer to populate the table with data from elsewhere in my code. If the table is populated with data from that other place then I can edit the value, but for some reason I can't edit the column when there is nothing in it (i.e. if I haven't already taken data from somewhere else). This is a pretty big drawback for me.

Hopefully it's just a matter of changing an attribute of the Editor, but I can't seem to find where/how to change it. Has anyone come across this problem before? Any help on this would be greatly appreciated!

Thanks in advance! :)

Upvotes: 0

Views: 79

Answers (1)

Eugene
Eugene

Reputation: 9474

Usually you would want to somehow hint the user there's a way to edit this. This can be achieved by adding a synthetic item in a table: enter image description here

Upvotes: 1

Related Questions