JFace Tableviewer empty - display string

150 Views Asked by At

I'm developing an eclipse RCP/RAP application. I have several GUI-classes that use the JFace TableViewer (internal org.eclipse.swt.widgets.Table). Some of my clients mentioned that it is a little confusing wether the "database-select failed" or there are just no elements.

So here's my question. Is there any way to display a "greyed out" text saying "No elements". There is something similar for the org.eclipse.swt.widgets.Text:

edtTest.setMessage("Please enter something");

Couldn't find anything like that.

Thank you in advance.

1

There are 1 best solutions below

0
greg-449 On

There isn't any simple support for this.

You could simulate this by adding a dummy row to the table and making your label provider implement IColorProvider so you can set the color of the row (or use one of the label providers based on StyledCellLabelProvider.

Alternatively use a separate label control and use StackLayout to make either the table of the label the visible control.