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

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

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

Table.removeAll介绍

[英]Removes all of the items from the receiver.
[中]从接收器中删除所有项目。

代码示例

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

private void doClearDimensions() {
 tableViewFields.table.removeAll();
}

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

private void doClearFields() {
 tableViewFields.table.removeAll();
}

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

private void doClearLevels() {
 tableViewFields.table.removeAll();
}

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

private void doClearFields() {
 tableViewFields.table.removeAll();
 tableViewFields.add();
}

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

public void removeAll() {
 table.removeAll();
 if ( table.getItemCount() == 0 ) {
  new TableItem( table, SWT.NONE );
 }
}

代码示例来源:origin: caoxinyu/RedisClient

private void refresh(){
  table.removeAll();
  initHash();
  currentStatus = Status.Normal;
  statusChanged();
}

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

private void populateSSLData() {
 sslTable.getTable().removeAll();
 new TableItem( sslTable.getTable(), SWT.NONE );
 checkNotNull( sslTable.getItem( 0 ) );
 checkState( sslTable.getItem( 0 ).length == 2 );
 List<String> keys = Lists.newArrayList( sslConfig.keySet() );
 sort( keys );
 String firstKey = keys.remove( 0 );
 sslTable.getTable().getItem( 0 ).setText( 1, firstKey );
 sslTable.getTable().getItem( 0 ).setText( 2, sslConfig.get( firstKey ) );
 keys
  .forEach( key -> sslTable.add( key, sslConfig.get( key ) ) );
}

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

private void populateSSLData() {
 propertiesTable.getTable().removeAll();
 new TableItem( propertiesTable.getTable(), SWT.NONE );
 checkNotNull( propertiesTable.getItem( 0 ) );
 checkState( propertiesTable.getItem( 0 ).length == 2 );
 if ( dataMap.size() == 0 ) {
  //no data initialized
  return;
 }
 List<String> keys = Lists.newArrayList( dataMap.keySet() );
 sort( keys );
 String firstKey = keys.remove( 0 );
 propertiesTable.getTable().getItem( 0 ).setText( 1, firstKey );
 propertiesTable.getTable().getItem( 0 ).setText( 2, dataMap.get( firstKey ) );
 keys.stream()
  .forEach( key -> propertiesTable.add( key, dataMap.get( key ) ) );
}

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

private void fillStoredData() {
 if ( stepname != null ) {
  textStepName.setText( stepname );
 }
 int index = addConnectionLine.indexOf( meta.getDatabaseMeta() != null ? meta.getDatabaseMeta().getName() : "" );
 if ( index >= 0 ) {
  addConnectionLine.select( index );
 }
 if ( meta.getModelName() != null ) {
  comboModelName.add( meta.getModelName() );
  comboModelName.select( 0 );
 }
 textReadBatchSize.setText( String.valueOf( meta.getReadBatchSize() ) );
 tableViewFields.table.removeAll();
 tableViewFilter.table.removeAll();
 populateFielsTable( meta.getMappings() );
 populateFiltersTable( meta.getFilterList() );
 fillFilterCombos();
}

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

private void populateFiltersTable( ArrayList<ReadFilter> filters ) {
 tableViewFilter.table.removeAll();
 for ( ReadFilter filter : filters ) {
  tableViewFilter.add( filter.getOperator(), filter.getFieldName(), filter.getComparator(), filter.getValue() );
 }
 tableViewFilter.add( "", "", "", "" );
 tableViewFilter.setRowNums();
 tableViewFilter.optWidth( true );
}

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

public void clearAll( boolean ask ) {
 int id = SWT.YES;
 if ( ask ) {
  MessageBox mb = new MessageBox( parent.getShell(), SWT.YES | SWT.NO | SWT.ICON_QUESTION );
  mb.setMessage( BaseMessages.getString( PKG, "TableView.MessageBox.ClearTable.message" ) );
  mb.setText( BaseMessages.getString( PKG, "TableView.MessageBox.ClearTable.title" ) );
  id = mb.open();
 }
 if ( id == SWT.YES ) {
  table.removeAll();
  new TableItem( table, SWT.NONE );
  if ( !readonly ) {
   parent.getDisplay().asyncExec( new Runnable() {
    @Override
    public void run() {
     edit( 0, 1 );
    }
   } );
  }
  this.setModified(); // timh
 }
}

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

private void fillStoredData() {
 if ( stepname != null ) {
  textStepName.setText( stepname );
 }
 int index = addConnectionLine.indexOf( meta.getDatabaseMeta() != null ? meta.getDatabaseMeta().getName() : "" );
 if ( index >= 0 ) {
  addConnectionLine.select( index );
 }
 if ( meta.getDimension() != null ) {
  comboDimension.add( meta.getDimension() );
  comboDimension.select( 0 );
 }
 buttonBaseElementsOnly.setSelection( meta.getBaseElementsOnly() );
 tableViewFields.table.removeAll();
 if ( meta.getLevels().size() > 0 ) {
  for ( PaloDimensionLevel level : meta.getLevels() ) {
   tableViewFields.add( level.getLevelName(), String.valueOf( level.getLevelNumber() ), level.getFieldName(),
    level.getFieldType() );
  }
  tableViewFields.setRowNums();
  tableViewFields.optWidth( true );
 }
}

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

/**
 * Copy information from the meta-data input to the dialog fields.
 */
public void getData() {
 wType.select( input.getTypeByDesc() );
 if ( input.getResultFieldName() != null ) {
  wResult.setText( input.getResultFieldName() );
 }
 wResultType.setText( input.getResultTypeDesc( input.getResultType() ) );
 wCompatibility.setSelection( input.isCompatibilityMode() );
 wOldChecksumBehaviour.setSelection( input.isOldChecksumBehaviour() );
 Table table = wFields.table;
 if ( input.getFieldName().length > 0 ) {
  table.removeAll();
 }
 for ( int i = 0; i < input.getFieldName().length; i++ ) {
  TableItem ti = new TableItem( table, SWT.NONE );
  ti.setText( 0, "" + ( i + 1 ) );
  ti.setText( 1, input.getFieldName()[i] );
 }
 wFields.setRowNums();
 wFields.optWidth( true );
 wStepname.selectAll();
 wStepname.setFocus();
}

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

/**
 * Copy information from the meta-data input to the dialog fields.
 */
public void getData() {
 wLoglevel.select( input.getLogLevelByDesc().getLevel() );
 wPrintHeader.setSelection( input.isdisplayHeader() );
 wLimitRows.setSelection( input.isLimitRows() );
 wLimitRowsNumber.setText( "" + input.getLimitRowsNumber() );
 if ( input.getLogMessage() != null ) {
  wLogMessage.setText( input.getLogMessage() );
 }
 Table table = wFields.table;
 if ( input.getFieldName().length > 0 ) {
  table.removeAll();
 }
 for ( int i = 0; i < input.getFieldName().length; i++ ) {
  TableItem ti = new TableItem( table, SWT.NONE );
  ti.setText( 0, "" + ( i + 1 ) );
  ti.setText( 1, input.getFieldName()[i] );
 }
 wFields.setRowNums();
 wFields.optWidth( true );
 wStepname.selectAll();
 wStepname.setFocus();
}

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

private void doSelectConnection( boolean clearCurrentData ) {
 try {
  if ( clearCurrentData ) {
   tableViewFields.table.removeAll();
   comboCube.removeAll();
  }
  if ( addConnectionLine.getText() != null ) {
   DatabaseMeta dbMeta = transMeta.findDatabase( addConnectionLine.getText() );
   if ( dbMeta != null ) {
    PaloCellOutputData data = new PaloCellOutputData( dbMeta );
    data.helper.connect();
    List<String> cubes = data.helper.getCubesNames();
    Collections.sort( cubes, new PaloNameComparator() );
    for ( String cubeName : cubes ) {
     if ( comboCube.indexOf( cubeName ) == -1 ) {
      comboCube.add( cubeName );
     }
    }
    data.helper.disconnect();
   }
  }
 } catch ( Exception ex ) {
  new ErrorDialog( shell, BaseMessages.getString( PKG, "PaloCellOutputDialog.RetreiveCubesErrorTitle" ),
   BaseMessages.getString( PKG, "PaloCellOutputDialog.RetreiveCubesError" ), ex );
 }
}

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

/**
 * Copy information from the meta-data input to the dialog fields.
 */
public void getData() {
 Table table = wFields.table;
 if ( input.getStepName().length > 0 ) {
  table.removeAll();
 }
 for ( int i = 0; i < input.getStepName().length; i++ ) {
  TableItem ti = new TableItem( table, SWT.NONE );
  ti.setText( 0, "" + ( i + 1 ) );
  if ( input.getStepName()[i] != null ) {
   ti.setText( 1, input.getStepName()[i] );
  }
 }
 wFields.removeEmptyRows();
 wFields.setRowNums();
 wFields.optWidth( true );
 wStepname.selectAll();
 wStepname.setFocus();
}

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

/**
 * Copy information from the meta-data input to the dialog fields.
 */
public void getData() {
 wStart.setText( Const.NVL( input.getStart(), "1" ) );
 wIncrement.setText( Const.NVL( input.getIncrement(), "1" ) );
 wResult.setText( Const.NVL( input.getResultFieldName(), "result" ) );
 Table table = wFields.table;
 if ( input.getFieldName().length > 0 ) {
  table.removeAll();
 }
 for ( int i = 0; i < input.getFieldName().length; i++ ) {
  TableItem ti = new TableItem( table, SWT.NONE );
  ti.setText( 0, "" + ( i + 1 ) );
  ti.setText( 1, input.getFieldName()[i] );
 }
 wFields.setRowNums();
 wFields.optWidth( true );
 wStepname.selectAll();
 wStepname.setFocus();
}

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

/**
 * Copy information from the meta-data input to the dialog fields.
 */
public void getData() {
 Table table = wFields.table;
 table.removeAll();
 for ( int i = 0; i < input.getFieldName().length; i++ ) {
  TableItem ti = new TableItem( table, SWT.NONE );
  ti.setText( 0, "" + ( i + 1 ) );
  if ( input.getFieldName()[i] != null ) {
   ti.setText( 1, input.getFieldName()[i] );
  }
  if ( input.getFieldNewName()[i] != null && !input.getFieldNewName()[i].equals( input.getFieldName()[i] ) ) {
   ti.setText( 2, input.getFieldNewName()[i] );
  }
  ti.setText( 3, AggregateRowsMeta.aggregateTypeDesc[input.getAggregateType()[i]] );
 }
 if ( table.getItemCount() == 0 ) {
  TableItem ti = new TableItem( table, SWT.NONE );
  ti.setText( 0, "001" );
 }
 wStepname.selectAll();
 wStepname.setFocus();
}

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

/**
 * Copy information from the meta-data input to the dialog fields.
 */
public void getData() {
 Table table = wFields.table;
 if ( input.getFieldName().length > 0 ) {
  table.removeAll();
 }
 for ( int i = 0; i < input.getFieldName().length; i++ ) {
  TableItem ti = new TableItem( table, SWT.NONE );
  ti.setText( 0, "" + ( i + 1 ) );
  ti.setText( 1, input.getFieldName()[i] );
  ti.setText( 2, input.getAscending()[i] ? BaseMessages.getString( PKG, "System.Combo.Yes" ) : BaseMessages
   .getString( PKG, "System.Combo.No" ) );
 }
 wFields.setRowNums();
 wFields.optWidth( true );
 wStepname.selectAll();
 wStepname.setFocus();
}

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

/**
 * Copy information from the meta-data input to the dialog fields.
 */
public void getData() {
 Table table = wFields.table;
 if ( input.getStepName().length > 0 ) {
  table.removeAll();
 }
 for ( int i = 0; i < input.getStepName().length; i++ ) {
  TableItem ti = new TableItem( table, SWT.NONE );
  ti.setText( 0, "" + ( i + 1 ) );
  if ( input.getStepName()[i] != null ) {
   ti.setText( 1, input.getStepName()[i] );
   ti.setText( 2, "" + Const.toInt( input.getStepCopyNr()[i], 0 ) );
  }
 }
 wFields.removeEmptyRows();
 wFields.setRowNums();
 wFields.optWidth( true );
 wStepname.selectAll();
 wStepname.setFocus();
}

相关文章

Table类方法