[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] Re: question re. TableTree-viewer's refresh behavior

Hi,

well that's because the win32 implementation of Tree provides those lines. E.g. on gtk there aren't any lines. If you don't want those lines to be shown you can remove them like described in this thread.

http://dev.eclipse.org/newslists/news.eclipse.platform.swt/msg27815.html

Tom

Daniel Krügler schrieb:
Tom Schindl wrote:
first of all TableTreeViewer should have been deprecated in 3.2 and you should better use a TreeViewer instead.

Although this is a logic conclusion considering the fact that TableTree itself has been deprecated, in my opinion the replacement
via TreeViewer shows some inconveniences. The most irritating one is that it seems not possible (at least for Win32) to create the TreeViewer
under non-SWT.FULL_SELECTION conditions, because otherwise there are
artifical tree lines for the root elements.


Consider this snippet:

void createControls(Composite p) {
    String[] data = {"Zürich", "Bremen", "Frankfurt"};

    TableTreeViewer ttViewer = new TableTreeViewer(p, SWT. MULTI |
        SWT. BORDER | SWT. V_SCROLL | SWT. CHECK);
    ttViewer.setContentProvider(controller);
    ttViewer.setLabelProvider(controller);
    ttViewer.setInput(data);

TreeViewer tViewer = new TreeViewer(p, SWT. MULTI | SWT. BORDER | SWT. V_SCROLL | SWT. CHECK);
tViewer.setContentProvider(controller);
tViewer.setLabelProvider(controller);
tViewer.setInput(data);
}


If you compare these two pseudo-tables (Indeed there is no tree structure in the data, because data is just an array of scalars), you will notice that tViewer always shows some dotted lines at the very left
side, in contrast to ttViewer. The only option I found to remove these lines where by adding SWT.FULL_SELECTION to the Tree widget flags,
which of course might not be what the user wanted to have.


Please note that I used this example of a pseudo-table, because in our
use-case we have input, which usually is a table-tree, but migth also degenerate to the above shown simple table, depending on filtering
conditions or the chosen input data.


Greetings from Bremen,

Daniel Krügler