Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 318589 - setting an image in a table column creates an indent for the text in the first column
Summary: setting an image in a table column creates an indent for the text in the firs...
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.6   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-01 08:11 EDT by Bogdan Dumitriu CLA
Modified: 2021-12-22 17:50 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bogdan Dumitriu CLA 2010-07-01 08:11:57 EDT
Build Identifier: 20100617-1415

Run the following snippet:

public class Snippet {

	public static void main(String[] args) {
		Display display = new Display();
		final Image image = display.getSystemImage(SWT.ICON_INFORMATION);
		Shell shell = new Shell(display);
		shell.setLayout(new FillLayout());

		Table table = new Table(shell, SWT.NONE);
		table.setHeaderVisible(true);
		table.setLinesVisible(true);
		TableColumn column1 = new TableColumn(table, SWT.NONE);
		column1.setText("Column 1");
		TableColumn column2 = new TableColumn(table, SWT.NONE);
		column2.setText("Column 2");
		TableItem item = new TableItem(table, SWT.NONE);
		item.setText(0, "row 1");
		item.setImage(1, image);
		column1.pack();
		column2.pack();

		shell.setSize(500, 200);
		shell.open();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch()) {
				display.sleep();
			}
		}
		if (image != null) {
			image.dispose();
		}
		display.dispose();
	}
}

Note that the text in the first column is wrongly indented with an indent the size of the image. There is no indent if no image is set.

Reproducible: Always

Steps to Reproduce:
1. Run the snippet.
Comment 1 Bogdan Dumitriu CLA 2010-07-01 08:13:19 EDT
Sorry about the missing import section for the snippet. Here it is:

import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.*;
Comment 2 Eclipse Webmaster CLA 2019-09-06 16:04:13 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.
Comment 3 Eclipse Genie CLA 2021-12-22 17:50:33 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.