import org.eclipse.jface.dialogs.TrayDialog;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.layout.GridLayoutFactory;
+import org.eclipse.jface.layout.TableColumnLayout;
import org.eclipse.jface.resource.FontDescriptor;
import org.eclipse.jface.viewers.ArrayContentProvider;
import org.eclipse.jface.viewers.CellEditor;
import org.eclipse.jface.viewers.ColumnLabelProvider;
+import org.eclipse.jface.viewers.ColumnWeightData;
import org.eclipse.jface.viewers.EditingSupport;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.TableViewerColumn;
final Composite composite = (Composite) super.createDialogArea(parent);
GridLayoutFactory.fillDefaults().margins(10,10).numColumns(2).applyTo(composite);
GridDataFactory.fillDefaults().grab(true,true).applyTo(composite);
-
- tableViewer = new TableViewer(composite, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI);
- GridDataFactory.fillDefaults().grab(true, true).applyTo(tableViewer.getControl());
+
+ Composite tableComposite = new Composite(composite, SWT.NONE);
+ TableColumnLayout tcl = new TableColumnLayout();
+ tableComposite.setLayout(tcl);
+ GridDataFactory.fillDefaults().grab(true, true).applyTo(tableComposite);
+
+ tableViewer = new TableViewer(tableComposite, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI);
// Colors
Display display = getShell().getDisplay();
}
});
+ tcl.setColumnData(column1.getColumn(), new ColumnWeightData(5, 300));
+ tcl.setColumnData(column2.getColumn(), new ColumnWeightData(1, 150));
+ tcl.setColumnData(column3.getColumn(), new ColumnWeightData(1, 200));
+
// Decorations
tableViewer.getTable().setHeaderVisible(true);
tableViewer.getTable().setLinesVisible(true);