khunnie
khunnie

Reputation: 3

Add empty rows in a tableviewer

I want to use a "Add" button to add empty rows in the table using table viewer. After adding a new row, the user can edit it. How can I implement this design? Thanks!

Upvotes: 0

Views: 161

Answers (1)

greg-449
greg-449

Reputation: 111142

You should add the rows to the data that your content provider returns in the getElements method using something that the label provider will show as empty. You then call refresh on the table.

For editing you will use the normal EditingSupport and make sure it can deal with empty entries.

Upvotes: 1

Related Questions