| 
| Cannot center image in table column [message #51369] | Thu, 03 April 2003 10:00 |  | 
| Eclipse User  |  |  |  |  | Originally posted by: lgauthier.zaq.com 
 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.03297 seconds