private static void resizeColumn(TableColumn tableColumn_) { tableColumn_.pack(); } private static void resizeTable(Table table_) { for (TableColumn tc : table.getColumns()) resizeColumn(tc); }
column.pack(); } else {
for(TableColumn col : table.getColumns()) { col.pack(); }
/** * Pack table. * * @param table the table */ public void packTable(Table table) { TableColumn[] columns = table.getColumns(); for (int i = 0; i < columns.length; i++) { columns[i].pack(); } }
tablecolumn[i + 1].setAlignment( SWT.RIGHT ); tablecolumn[i + 1].pack();
/** * Sets {@link #table} column widths. */ private void resizeTableColumns() { for (TableColumn column : table.getColumns()) { column.pack(); } }
public void createPartControl(Composite parent) { parent.setLayout(new GridLayout(1, true)); addSelectionButtons(parent); // Adds select/deselect all buttons myTableViewer = CheckboxTableViewer.newCheckList(parent, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL); myTableViewer.getTable().setLayoutData(new GridData(GridData.FILL_BOTH)); myTableViewer.setContentProvider(new MyContentProvider()); myTableViewer.setLabelProvider(new MyLabelProvider()); myTableViewer.setInput(getInput()); // Gets model TableColumn column = new TableColumn(myTableViewer.getTable(), SWT.FILL); column.setText("My column"); column.pack(); myTableViewer.getTable().setHeaderVisible(true); myTableViewer.getTable().setLinesVisible(true); }
void packColumns () { int columnCount = table1.getColumnCount(); for (int i = 0; i < columnCount; i++) { TableColumn tableColumn = table1.getColumn(i); tableColumn.pack(); } }
void packColumns () { int columnCount = colors.getColumnCount(); for (int i = 0; i < columnCount; i++) { TableColumn tableColumn = colors.getColumn(i); tableColumn.pack(); } }
@Override public void controlResized(ControlEvent e) { //Also try and reset the size of the columns as appropriate TableColumn[] columns = selectionGroup.getListTable() .getColumns(); for (int i = 0; i < columns.length; i++) { columns[i].pack(); } } });
/** * Resizes the columns to fit the size of the cells. */ private void resizeContextEntryTableColumnsToFit() { // Resizing the first column contextEntryTable.getColumn( 0 ).pack(); // Adding a little space to the first column contextEntryTable.getColumn( 0 ).setWidth( contextEntryTable.getColumn( 0 ).getWidth() + 5 ); // Resizing the second column contextEntryTable.getColumn( 1 ).pack(); }
/** * Resizes the columns to fit the size of the cells. */ private void resizeContextEntryTableColumnsToFit() { // Resizing the first column contextEntryTable.getColumn( 0 ).pack(); // Adding a little space to the first column contextEntryTable.getColumn( 0 ).setWidth( contextEntryTable.getColumn( 0 ).getWidth() + 5 ); // Resizing the second column contextEntryTable.getColumn( 1 ).pack(); }
/** * Resizes the columns to fit the size of the cells. */ private void resizeContextEntryTableColumnsToFit() { // Resizing the first column contextEntryTable.getColumn( 0 ).pack(); // Adding a little space to the first column contextEntryTable.getColumn( 0 ).setWidth( contextEntryTable.getColumn( 0 ).getWidth() + 5 ); // Resizing the second column contextEntryTable.getColumn( 1 ).pack(); }
/** * Resizes the columns to fit the size of the cells. */ private void resizeContextEntryTableColumnsToFit() { // Resizing the first column contextEntryTable.getColumn( 0 ).pack(); // Adding a little space to the first column contextEntryTable.getColumn( 0 ).setWidth( contextEntryTable.getColumn( 0 ).getWidth() + 5 ); // Resizing the second column contextEntryTable.getColumn( 1 ).pack(); }
/** * @since 2.1 */ @Override public void createControl(Composite parent) { super.createControl(parent); // set the with of the leftmost column ('name') getTableViewer().getTable().getColumns()[0].pack(); }
private void restoreColumnWidths(IDialogSettings settings, String qualifier) { int columnCount = fTable.getColumnCount(); for (int i = 0; i < columnCount; i++) { int width = -1; try { width = settings.getInt(qualifier + ".columnWidth" + i); //$NON-NLS-1$ } catch (NumberFormatException e) {} if (width <= 0) { fTable.getColumn(i).pack(); } else { fTable.getColumn(i).setWidth(width); } } }
@Override public void run() { fIsShowAddressColumn = !fIsShowAddressColumn; if (!fIsShowAddressColumn) { fTableViewer.getTable().getColumn(0).setWidth(0); } else { fTableViewer.getTable().getColumn(0).pack(); } updateActionLabel(); }
protected void refreshRuntimesViewer() { runtimesViewer.refresh(); // should listen on property changes instead? Object[] checkedElements = runtimesViewer.getCheckedElements(); if(checkedElements == null || checkedElements.length == 0) { AbstractMavenRuntime runtime = getDefaultRuntime(); runtimesViewer.setChecked(runtime, true); defaultRuntime = runtime.getName(); } for(TableColumn column : runtimesViewer.getTable().getColumns()) { column.pack(); } }