Cannot center image in table column [message #592444] |
Thu, 03 April 2003 15:00 |
Laurent Gauthier Messages: 2 Registered: October 2009 |
Junior Member |
|
|
I am trying to center images in a table column but no cigar!
It is always left aligned!
Centering text is no problem.
Here is a code snippet:
//-------------------
TableColumn column5 = new TableColumn(table, SWT.CENTER);
column5.setText("Required");
column5.setWidth(80);
//------------------
I am using a TableViewer and subclassed CheckboxCellEditor so that layout
data would be SWT.CENTER but that does not work either.
Here is the CCheckboxCellEditor class:
//--------------------------
public class CCheckboxCellEditor extends CheckboxCellEditor {
public CCheckboxCellEditor(Composite parent) {
super(parent);
}
/**
* @return the layout data object
*/
public LayoutData getLayoutData() {
LayoutData result = new LayoutData();
result.horizontalAlignment = SWT.CENTER;
return result;
}
}
|
|
|
Powered by
FUDForum. Page generated in 0.02534 seconds