Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 284382

Summary: [Table] Checkbox horizontal position in CheckboxTableViewer is not centered
Product: [RT] RAP Reporter: Setya Nugdjaja <jsetya>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 1.2   
Target Milestone: 1.3 M2   
Hardware: PC   
OS: All   
Whiteboard:
Attachments:
Description Flags
Screenshot of CheckboxTableViewer none

Description Setya Nugdjaja CLA 2009-07-23 04:21:24 EDT
Created attachment 142354 [details]
Screenshot of CheckboxTableViewer

Hi,

Produced by the following snippet:

@Override
public void createPartControl(final Composite parent)
{   parent.setLayout(GridLayoutFactory.swtDefaults().create());
   
toolkit = new FormToolkit(parent.getDisplay());
Composite container = toolkit.createComposite(parent);
        container.setLayout(GridLayoutFactory.fillDefaults().numColumns(2).create());
container.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());
    
Composite tableViewerContainer = toolkit.createComposite(container);
    tableViewerContainer.setLayoutData(GridDataFactory.fillDefaults().grab(false, true).hint(150, 100).create());

TableColumnLayout layout = new TableColumnLayout();
tableViewerContainer.setLayout(layout);
    
CheckboxTableViewer checkboxTableViewer = new CheckboxTableViewer(toolkit.createTable(tableViewerContainer, SWT.CHECK));
    
checkboxTableViewer.setUseHashlookup(true);
    
TableViewerColumn tableViewerColumn = new TableViewerColumn(checkboxTableViewer,SWT.NULL);
layout.setColumnData(tableViewerColumn.getColumn(),new ColumnWeightData(100,false));

tableViewerColumn.setLabelProvider
(
   new ColumnLabelProvider()
   {
     @Override
     public String getText(Object element){return "Test Field";
   }
 }
);
    
checkboxTableViewer.setContentProvider
(
   new IStructuredContentProvider()
   {
     public void dispose(){}
      public void inputChanged(Viewer viewer, Object oldInput, Object newInput){}
      
    public Object[] getElements(Object element)
    {
      return new String[] {"Test"};
    }
  }
);
    
checkboxTableViewer.setInput("Test");
checkboxTableViewer.getTable().pack();
}

Attached is the screenshot.

Regards,

Setya
Comment 1 Ivan Furnadjiev CLA 2009-09-02 05:41:12 EDT
Left padding of 4 px is added to the checkbox Image object in the AppearanceBase.js ( table-check-box ).