[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] Re: TableViewer center column values

Win32 bug. Work-around add a 0 width column at the beginning.

Tom

Oliver schrieb:
Hi,

I have a TableViewer with 4 column. All values in the columns shall be centered. I do this by this code:

TableViewerColumn column = new TableViewerColumn(colorTable, SWT.CENTER);
column.getColumn().setText(ColorfinderI18nMgr.getString("1st header"));

column = new TableViewerColumn(colorTable, SWT.CENTER);
column.getColumn().setText(ColorfinderI18nMgr.getString("2nd header"));

column = new TableViewerColumn(colorTable, SWT.CENTER);
column.getColumn().setText(ColorfinderI18nMgr.getString("3rd header"));

column = new TableViewerColumn(colorTable, SWT.CENTER);
column.getColumn().setText(ColorfinderI18nMgr.getString("4th header"));



The problem is that in the first column all values are left-aligned. The other 3 column are correctly centered. Changing to SWT.RIGHT for instance does only affect the column 2, 3 and 4. The column 1 is always left aligned.

Any ideas ?



--
B e s t S o l u t i o n . at
--------------------------------------------------------------------
Tom Schindl                                          JFace-Committer
--------------------------------------------------------------------