private Control createTable(Composite parent) { Composite c= new Composite(parent, SWT.NONE); GridLayout gl= new GridLayout(); gl.numColumns= 2; gl.marginWidth= 0; gl.marginHeight= 0; c.setLayout(gl); fTable= new Table(c, SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI | SWT.FULL_SELECTION | SWT.HIDE_SELECTION | SWT.BORDER); fTable.setFont(parent.getFont()); GridData tableGD= new GridData(GridData.FILL_BOTH); tableGD.heightHint= SWTUtil.getTableHeightHint(fTable, ROW_COUNT); //tableGD.widthHint= 40; fTable.setLayoutData(tableGD); fTable.setLinesVisible(true); TableLayout layout= new TableLayout(); fTable.setLayout(layout); fTable.setHeaderVisible(true); ColumnLayoutData[] columnLayoutData= new ColumnLayoutData[SIZE]; columnLayoutData[STATE_PROP]= new ColumnPixelData(18, false, true); columnLayoutData[KEY_PROP]= new ColumnWeightData(40, true); columnLayoutData[VAL_PROP]= new ColumnWeightData(40, true); for (int i= 0; i < fgTitles.length; i++) { TableColumn tc= new TableColumn(fTable, SWT.NONE, i); tc.setText(fgTitles[i]); layout.addColumnData(columnLayoutData[i]); tc.setResizable(columnLayoutData[i].resizable); } createButtonComposite(c); return c; }
private Control createTable(Composite parent) { Composite c= new Composite(parent, SWT.NONE); GridLayout gl= new GridLayout(); gl.numColumns= 2; gl.marginWidth= 0; gl.marginHeight= 0; c.setLayout(gl); fTable= new Table(c, SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI | SWT.FULL_SELECTION | SWT.HIDE_SELECTION | SWT.BORDER); fTable.setFont(parent.getFont()); GridData tableGD= new GridData(GridData.FILL_BOTH); tableGD.heightHint= SWTUtil.getTableHeightHint(fTable, ROW_COUNT); //tableGD.widthHint= 40; fTable.setLayoutData(tableGD); fTable.setLinesVisible(true); TableLayout layout= new TableLayout(); fTable.setLayout(layout); fTable.setHeaderVisible(true); ColumnLayoutData[] columnLayoutData= new ColumnLayoutData[SIZE]; columnLayoutData[STATE_PROP]= new ColumnPixelData(18, false, true); columnLayoutData[KEY_PROP]= new ColumnWeightData(40, true); columnLayoutData[VAL_PROP]= new ColumnWeightData(40, true); for (int i= 0; i < fgTitles.length; i++) { TableColumn tc= new TableColumn(fTable, SWT.NONE, i); tc.setText(fgTitles[i]); layout.addColumnData(columnLayoutData[i]); tc.setResizable(columnLayoutData[i].resizable); } createButtonComposite(c); return c; }