本文整理了Java中org.eclipse.swt.widgets.Table.getColumns()
方法的一些代码示例,展示了Table.getColumns()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table.getColumns()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Table
类名称:Table
方法名:getColumns
[英]Returns an array of TableColumn
s which are the columns in the receiver. Columns are returned in the order that they were created. If no TableColumn
s were created by the programmer, the array is empty, despite the fact that visually, one column of items may be visible. This occurs when the programmer uses the table like a list, adding items but never creating a column.
Note: This is not the actual structure used by the receiver to maintain its list of items, so modifying the array will not affect the receiver.
[中]返回TableColumn
的数组,它们是接收器中的列。列将按创建顺序返回。如果程序员没有创建TableColumn
s,则数组是空的,尽管在视觉上,一列项目可能是可见的。当程序员像列表一样使用表,添加项但从不创建列时,就会发生这种情况。
注意:这不是接收方维护其项目列表所使用的实际结构,因此修改数组不会影响接收方。
代码示例来源:origin: pentaho/pentaho-kettle
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 ) );
}
}
}
代码示例来源:origin: pentaho/pentaho-kettle
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;
}
代码示例来源:origin: pentaho/pentaho-kettle
TableColumn[] columns = table.getColumns();
int firstWidth = 0, restWidth = 0;
int len = Math.min( weights.length, columns.length );
代码示例来源:origin: pentaho/pentaho-kettle
stream( topicsTable.getTable().getColumns() ).forEach( column -> {
if ( column.getWidth() > 0 ) {
代码示例来源:origin: pentaho/pentaho-kettle
Arrays.stream( propertiesTable.getTable().getColumns() ).forEach( column -> {
if ( column.getWidth() > 0 ) {
代码示例来源:origin: pentaho/pentaho-kettle
stream( sslTable.getTable().getColumns() ).forEach( column -> {
if ( column.getWidth() > 0 ) {
代码示例来源:origin: pentaho/pentaho-kettle
stream( propertiesTable.getTable().getColumns() ).forEach( column -> {
if ( column.getWidth() > 0 ) {
代码示例来源:origin: pentaho/pentaho-kettle
stream( optionsTable.getTable().getColumns() ).forEach( column -> {
if ( column.getWidth() > 0 ) {
代码示例来源:origin: pentaho/pentaho-kettle
stream( optionsTable.getTable().getColumns() ).forEach( column -> {
if ( column.getWidth() > 0 ) {
代码示例来源:origin: pentaho/pentaho-kettle
stream( fieldsTable.getTable().getColumns() ).forEach( column -> {
if ( column.getWidth() > 0 ) {
代码示例来源:origin: pentaho/pentaho-kettle
stream( fieldsTable.getTable().getColumns() ).forEach( column -> {
if ( column.getWidth() > 0 ) {
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface
/**
* @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];
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface
/**
* @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];
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface
/**
* {@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]);
}
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt.q07
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;
}
代码示例来源:origin: org.eclipse/org.eclipse.wst.server.ui
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);
}
}
代码示例来源:origin: openaudible/openaudible
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;
}
代码示例来源:origin: stackoverflow.com
-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);
代码示例来源:origin: com.diffplug.durian/durian-swt
/** 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);
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.m2e.core.ui
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();
}
}
内容来源于网络,如有侵权,请联系作者删除!