Community
Participate
Working Groups
I20110428-0848 Cocoa (works fine on Windows 7) Tables and Trees without a column doesn't resize the width of the column when an item font changes. In the SDK, the problem can show up on the API Baselines preference page. package snippets; import org.eclipse.swt.SWT; import org.eclipse.swt.events.*; import org.eclipse.swt.graphics.*; import org.eclipse.swt.layout.*; import org.eclipse.swt.widgets.*; public class SnippetTableWidth { public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); shell.setLayout(new GridLayout(1, false)); Table table = new Table(shell, SWT.CHECK | SWT.FULL_SELECTION); table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); for (int i = 0; i < 5; i++) { TableItem item = new TableItem(table, SWT.NONE); item.setText("This is item number" + i); } final TableItem item0 = table.getItem(0); FontData[] fontData = display.getSystemFont().getFontData(); for (int i = 0; i < fontData.length; i++) fontData[i].setStyle(SWT.BOLD); final Font boldFont = new Font(display, fontData); Button button = new Button(shell, SWT.PUSH); button.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false)); button.setText("Toggle Bold"); button.addSelectionListener(new SelectionAdapter() { boolean fBold = false; public void widgetSelected(SelectionEvent e) { fBold = !fBold; item0.setFont(fBold ? boldFont : null); } }); shell.pack(); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); } }
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. If the bug is still relevant, please remove the "stalebug" whiteboard tag.