Community
Participate
Working Groups
Created attachment 101693 [details] Screenshot of truncated table header from RAP Hi, I use the following snippet to layout TableViewer in a ScrolledForm : ... TableViewer tableViewer = new TableViewer(toolkit.createTable(form.getBody(), SWT.VIRTUAL)); tableViewer.getTable().setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true)); tableViewer.getTable().setLinesVisible(true); tableViewer.getTable().setHeaderVisible(true); tableViewer.setUseHashlookup(true); tableViewer.setItemCount(0); String[] titles = new String[]{"Template Name","Product ID","Product Name"}; for (String title : titles) { TableColumn column = new TableColumn(tableViewer.getTable(),SWT.NONE); column.setText(title); column.pack(); } ... The result is some of the table header texts are truncated, user has to resize the columns in order to make them visible. Attached is the screenshot from RAP & RCP. Regards, Setya
Created attachment 101694 [details] Screenshot of table header in RCP
Is this happened only first time when you start the application? Is reload of the page in browser fixed the problem?
This is probably related to the text-size-determination. When pack() is called the first time and the column texts haven't beed measured yet, it uses an estimation adn tells the client to measure these texts properly. This results in a further request that contains the actual text sizes. So far so good. When processing this request, the table is resized (grow 100px, then shrink 100px or so). Only resizing a table does not affect its column sizes, which is usually desired, but not helpful in this case. I assume that the same applies for TreeColumns also.
(In reply to comment #2) > Is this happened only first time when you start the application? Is reload of > the page in browser fixed the problem? > No, reloading the browser won't do it.
Currently, there is a mechanism (RePackControlsVisitor) to re-pack the packed controls after the correct text size determination. We have to extend/change it to support widgets like TreeColumn/TableColumn.
Fixed in CVS HEAD by extending the RePackVisitor to pack the columns after the shell enlargement.