org.eclipse.swt.widgets.Table.getColumn()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(5.2k)|赞(0)|评价(0)|浏览(234)

本文整理了Java中org.eclipse.swt.widgets.Table.getColumn()方法的一些代码示例,展示了Table.getColumn()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table.getColumn()方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Table
类名称:Table
方法名:getColumn

Table.getColumn介绍

[英]Returns the column at the given, zero-relative index in the receiver. Throws an exception if the index is out of range. Columns are returned in the order that they were created. If no TableColumns were created by the programmer, this method will throw ERROR_INVALID_RANGE despite the fact that a single column of data may be visible in the table. This occurs when the programmer uses the table like a list, adding items but never creating a column.
[中]返回接收器中给定的零相对索引处的列。如果索引超出范围,则引发异常。列将按创建顺序返回。如果程序员没有创建TableColumn,则此方法将抛出ERROR_INVALID_RANGE,尽管表中可能有一列数据可见。当程序员像列表一样使用表,添加项但从不创建列时,就会发生这种情况。

代码示例

代码示例来源:origin: pentaho/pentaho-kettle

public void setColumnText( int idx, String text ) {
 TableColumn col = table.getColumn( idx );
 col.setText( text );
}

代码示例来源:origin: pentaho/pentaho-kettle

private String getSelectedText() {
 String selection = "";
 for ( int c = 1; c < table.getColumnCount(); c++ ) {
  TableColumn tc = table.getColumn( c );
  if ( c > 1 ) {
   selection += CLIPBOARD_DELIMITER;
  }
  selection += tc.getText();
 }
 selection += Const.CR;
 TableItem[] items = table.getSelection();
 if ( items.length == 0 ) {
  return null;
 }
 for ( int r = 0; r < items.length; r++ ) {
  TableItem ti = items[r];
  for ( int c = 1; c < table.getColumnCount(); c++ ) {
   if ( c > 1 ) {
    selection += CLIPBOARD_DELIMITER;
   }
   selection += ti.getText( c );
  }
  selection += Const.CR;
 }
 return selection;
}

代码示例来源:origin: pentaho/pentaho-kettle

fieldsTable.getTable().addListener( SWT.Resize, event -> {
 Table table = (Table) event.widget;
 table.getColumn( 1 ).setWidth( 147 );
 table.getColumn( 2 ).setWidth( 147 );
 table.getColumn( 3 ).setWidth( 147 );
} );

代码示例来源:origin: pentaho/pentaho-kettle

fieldsTable.getTable().addListener( SWT.Resize, event -> {
 Table table = (Table) event.widget;
 table.getColumn( 1 ).setWidth( 147 );
 table.getColumn( 2 ).setWidth( 147 );
 table.getColumn( 3 ).setWidth( 147 );
} );

代码示例来源:origin: pentaho/pentaho-kettle

/**
 * @param sortable the sortable to set
 */
public void setSortable( boolean sortable ) {
 this.sortable = sortable;
 if ( !sortable ) {
  table.setSortColumn( null );
 } else {
  table.setSortColumn( table.getColumn( sortfield ) );
 }
}

代码示例来源:origin: pentaho/pentaho-kettle

sslTable.getTable().addListener( SWT.Resize, event -> {
 Table table = (Table) event.widget;
 table.getColumn( 1 ).setWidth( 200 );
 table.getColumn( 2 ).setWidth( 200 );
} );

代码示例来源:origin: pentaho/pentaho-kettle

@Override
 public void delete( int[] items ) {
  for ( int index : items ) {
   if ( !wFields.getNonEmptyIndexes().contains( index ) ) {
    continue;
   }
   Integer removeColumn = getIdxByValue( wFields.getNonEmptyIndexes(), index );
   if ( removeColumn == null ) {
    return; //can not happen (preventing warnings)
   }
   removeColumn++;  //data table have one technical column
   wData.table.getColumn( removeColumn ).dispose();
  }
  wFields.nrNonEmpty();
 }
} );

代码示例来源:origin: pentaho/pentaho-kettle

propertiesTable.getTable().addListener( SWT.Resize, event -> {
 Table table = (Table) event.widget;
 table.getColumn( 1 ).setWidth( 200 );
 table.getColumn( 2 ).setWidth( 200 );
} );

代码示例来源:origin: pentaho/pentaho-kettle

wData.table.getColumn( removeColumn ).dispose();
wFields.nrNonEmpty();

代码示例来源:origin: pentaho/pentaho-kettle

propertiesTable.getTable().addListener( SWT.Resize, event -> {
 Table table = (Table) event.widget;
 table.getColumn( 1 ).setWidth( 215 );
 table.getColumn( 2 ).setWidth( 215 );
} );

代码示例来源:origin: pentaho/pentaho-kettle

wPackages.setRowNums();
wPackages.optWidth( true );
wPackages.getTable().getColumn( 1 ).setWidth( 100 );

代码示例来源:origin: pentaho/pentaho-kettle

topicsTable.getTable().addListener( SWT.Resize, event -> {
 Table table = (Table) event.widget;
 table.getColumn( 1 ).setWidth( 330 );
} );

代码示例来源:origin: pentaho/pentaho-kettle

wSteps.table.getColumn( 0 ).setWidth( maxIconSize + 10 );
wSteps.table.getColumn( 0 ).setAlignment( SWT.CENTER );

代码示例来源:origin: pentaho/pentaho-kettle

optionsTable.getTable().addListener( SWT.Resize, event -> {
 Table table = (Table) event.widget;
 table.getColumn( 1 ).setWidth( 215 );
 table.getColumn( 2 ).setWidth( 215 );
} );

代码示例来源:origin: pentaho/pentaho-kettle

myTb.optWidth( true );
if ( flag ) {
 myTb.table.getColumn( 3 ).setWidth( 0 );
 System.out.println( myTb.table.getColumn( 3 ).getWidth() );

代码示例来源:origin: pentaho/pentaho-kettle

optionsTable.getTable().addListener( SWT.Resize, event -> {
 Table table = (Table) event.widget;
 table.getColumn( 1 ).setWidth( 215 );
 table.getColumn( 2 ).setWidth( 215 );
} );

代码示例来源:origin: pentaho/pentaho-kettle

wOptionFields.table.getColumn( 0 ).setText(
 BaseMessages.getString( PKG, "TransDialog.TransLogTable.Fields.Enabled" ) );

代码示例来源:origin: pentaho/pentaho-kettle

wOptionFields.table.getColumn( 0 ).setText(
 BaseMessages.getString( PKG, "TransDialog.TransLogTable.Fields.Enabled" ) );

代码示例来源:origin: pentaho/pentaho-kettle

wFieldsTab.getControl().setEnabled( true );
wCustomTab.getControl().setEnabled( false );
wFieldsTb.table.getColumn( 3 ).setWidth( 80 );
wFieldsTab.getControl().setEnabled( true );
wCustomTab.getControl().setEnabled( false );
wFieldsTb.table.getColumn( 3 ).setWidth( 0 );
wCustomTab.getControl().setEnabled( false );
wFieldsTb.table.getColumn( 3 ).setWidth( 80 );
wFieldsTab.getControl().setEnabled( true );
wCustomTab.getControl().setEnabled( true );
wFieldsTb.table.getColumn( 3 ).setWidth( 80 );

代码示例来源:origin: pentaho/pentaho-kettle

wOptionFields.table.getColumn( 0 ).setText(
 BaseMessages.getString( PKG, "TransDialog.TransLogTable.Fields.Enabled" ) );

相关文章

Table类方法