public void addColumnResizeListeners( Table table ) { TableColumn[] columns = table.getColumns(); int len = Math.min( weights.length, columns.length ); for ( int i = 0; i < len - 1; i++ ) { if ( weights[i] > 0 ) { columns[i].addListener( SWT.Resize, getColumnResizeListener( i ) ); } } }
protected void applyWeigths( Table table ) { if ( resizing ) { return; } float width = getTableWidth( table ); TableColumn[] columns = table.getColumns(); int f = 0; for ( int w : weights ) { f += w; } int len = Math.min( weights.length, columns.length ); resizing = true; for ( int i = 0; i < len; i++ ) { int cw = weights[ i ] == 0 ? 0 : Math.round( width / f * weights[ i ] ); width -= cw + 1; columns[ i ].setWidth( cw ); f -= weights[ i ]; } resizing = false; }
TableColumn[] columns = table.getColumns(); int firstWidth = 0, restWidth = 0; int len = Math.min( weights.length, columns.length );
stream( topicsTable.getTable().getColumns() ).forEach( column -> { if ( column.getWidth() > 0 ) {
Arrays.stream( propertiesTable.getTable().getColumns() ).forEach( column -> { if ( column.getWidth() > 0 ) {
stream( sslTable.getTable().getColumns() ).forEach( column -> { if ( column.getWidth() > 0 ) {
stream( propertiesTable.getTable().getColumns() ).forEach( column -> { if ( column.getWidth() > 0 ) {
stream( optionsTable.getTable().getColumns() ).forEach( column -> { if ( column.getWidth() > 0 ) {
stream( optionsTable.getTable().getColumns() ).forEach( column -> { if ( column.getWidth() > 0 ) {
stream( fieldsTable.getTable().getColumns() ).forEach( column -> { if ( column.getWidth() > 0 ) {
stream( fieldsTable.getTable().getColumns() ).forEach( column -> { if ( column.getWidth() > 0 ) {
/** * @return */ private Item[] getViewerColumns() { if (targetControl instanceof Table) { return ((Table) targetControl).getColumns(); } else if (targetControl instanceof Tree) { return ((Tree) targetControl).getColumns(); } return new Item[0]; }
/** * @return */ private Item[] getViewerColumns() { if (targetControl instanceof Table) { return ((Table) targetControl).getColumns(); } else if (targetControl instanceof Tree) { return ((Tree) targetControl).getColumns(); } return new Item[0]; }
/** * {@inheritDoc} * * @since 3.5 */ @Override protected void setColumnWidths(Scrollable tableTree, int[] widths) { TableColumn[] columns = ((Table) tableTree).getColumns(); for (int i = 0; i < widths.length; i++) { columns[i].setWidth(widths[i]); } }
public static boolean hasAlignmentChanged( final Table table ) { boolean result = false; TableColumn[] columns = table.getColumns(); for( int i = 0; !result && i < columns.length; i++ ) { if( hasAlignmentChanged( columns[ i ] ) ) { result = true; } } return result; }
protected void layout(Composite composite, boolean flushCache) { Table table = (Table) composite; TableColumn[] tableColumns = table.getColumns(); int width = table.getClientArea().width - 10; tableColumns[0].setWidth(width); } }
public int[] getColumWidths() { TableColumn tc[] = table.getColumns(); int c = getColumnCount(); int out[] = new int[c]; for (int x = 0; x < c; x++) { out[x] = tc[x].getWidth(); } return out; }
-announced part omitted- Table table = db.getTable("TableName"); for(Row row :table){ for(Column column : table.getColumns()){ columnName = column.getName(); value=row.get(columnName); ps.setString(index, String);
/** Builds a {@link TableViewer} on the given parent. */ public TableViewer buildTable(Composite parent) { Table control = Portal.buildTable(parent, style, linesVisible, headerVisible, columnBuilders); return buildViewer(new TableViewer(control), Arrays.asList(control.getColumns()), TableViewerColumn::new); }
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(); } }