org.pentaho.di.ui.core.widget.TableView.nrNonEmpty()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(8.4k)|赞(0)|评价(0)|浏览(114)

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

TableView.nrNonEmpty介绍

[英]Count non-empty rows in the table... IMPORTANT: always call this method before calling getNonEmpty(int selnr): for performance reasons we cache the row indexes.
[中]计算表中的非空行数。。。重要提示:在调用GetNoneEmpty(int selnr)之前始终调用此方法:出于性能原因,我们缓存行索引。

代码示例

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

@Override
public void insertRow( int rowIndex ) {
 wFields.nrNonEmpty();
}

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

@Override
 public void run() {
  // Add the newly create fields.
  //
  int nrNonEmptyFields = wFields.nrNonEmpty();
  for ( int i = 0; i < nrNonEmptyFields; i++ ) {
   TableItem item = wFields.getNonEmpty( i );
   fields.put( item.getText( 1 ), Integer.valueOf( 1000000 + i ) ); // The number is just to debug the origin of
                                    // the fieldname
  }
 }
} );

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

public int indexOfString( String str, int column ) {
 int nrNonEmptyFields = nrNonEmpty();
 for ( int i = 0; i < nrNonEmptyFields; i++ ) {
  String cmp = getNonEmpty( i ).getText( column );
  if ( str.equalsIgnoreCase( cmp ) ) {
   return i;
  }
 }
 return -1;
}

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

public void widgetSelected( SelectionEvent e ) {
  int nrKeys = wKeys.nrNonEmpty();
  StringBuilder sb = new StringBuilder();
  for ( int i = 0; i < nrKeys; i++ ) {
   TableItem item = wKeys.getNonEmpty( i );
   sb.append( item.getText( 1 ) );
   if ( nrKeys > 1 && i != nrKeys - 1 ) {
    sb.append( "," );
   }
  }
  keyValTextBox.setText( sb.toString() );
  subShell.close();
 }
} );

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

public String[] listParameterNames() {
 int count = wParamFields.nrNonEmpty();
 java.util.List<String> list = new ArrayList<String>();
 for ( int i = 0; i < count; i++ ) {
  TableItem item = wParamFields.getNonEmpty( i );
  String parameterName = item.getText( 1 );
  if ( !Utils.isEmpty( parameterName ) ) {
   if ( !list.contains( parameterName ) ) {
    list.add( parameterName );
   }
  }
 }
 return list.toArray( new String[list.size()] );
}

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

private void getInfo() {
 partitionSchema.setName( wName.getText() );
 List<String> parts = new ArrayList<String>();
 int nrNonEmptyPartitions = wPartitions.nrNonEmpty();
 for ( int i = 0; i < nrNonEmptyPartitions; i++ ) {
  parts.add( wPartitions.getNonEmpty( i ).getText( 1 ) );
 }
 partitionSchema.setPartitionIDs( parts );
}

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

protected void getInfoVariables() {
 Map<String, String> map = new HashMap<String, String>();
 int nrNonEmptyVariables = wVariables.nrNonEmpty();
 for ( int i = 0; i < nrNonEmptyVariables; i++ ) {
  TableItem tableItem = wVariables.getNonEmpty( i );
  String varName = tableItem.getText( 1 );
  String varValue = tableItem.getText( 2 );
  if ( !Utils.isEmpty( varName ) ) {
   map.put( varName, varValue );
  }
 }
 configuration.setVariables( map );
}

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

private void getInfoArguments() {
 Map<String, String> map = new HashMap<String, String>();
 int nrNonEmptyArguments = wArguments.nrNonEmpty();
 for ( int i = 0; i < nrNonEmptyArguments; i++ ) {
  TableItem tableItem = wArguments.getNonEmpty( i );
  String varName = tableItem.getText( 1 );
  String varValue = tableItem.getText( 2 );
  if ( !Utils.isEmpty( varName ) ) {
   map.put( varName, varValue );
  }
 }
 configuration.setArguments( map );
}

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

public void applyChanges() {
  // The grid
  //
  int nrLines = wFieldMappings.nrNonEmpty();
  definition.getValueRenames().clear();
  for ( int i = 0; i < nrLines; i++ ) {
   TableItem item = wFieldMappings.getNonEmpty( i );
   definition.getValueRenames().add( new MappingValueRename( item.getText( 1 ), item.getText( 2 ) ) );
  }
 }
}

代码示例来源: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

private void getInfo( RandomCCNumberGeneratorMeta in ) throws KettleException {
 stepname = wStepname.getText(); // return value
 int count = wFields.nrNonEmpty();
 in.allocate( count );
 //CHECKSTYLE:Indentation:OFF
 for ( int i = 0; i < count; i++ ) {
  TableItem item = wFields.getNonEmpty( i );
  in.getFieldCCType()[i] = item.getText( 1 );
  in.getFieldCCLength()[i] = item.getText( 2 );
  in.getFieldCCSize()[i] = item.getText( 3 );
 }
 in.setCardNumberFieldName( wCCNumberField.getText() );
 in.setCardTypeFieldName( wCCTypeField.getText() );
 in.setCardLengthFieldName( wCCLengthField.getText() );
}

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

private void getInfo( SystemDataMeta in ) throws KettleException {
 stepname = wStepname.getText(); // return value
 int count = wFields.nrNonEmpty();
 in.allocate( count );
 //CHECKSTYLE:Indentation:OFF
 for ( int i = 0; i < count; i++ ) {
  TableItem item = wFields.getNonEmpty( i );
  in.getFieldName()[i] = item.getText( 1 );
  in.getFieldType()[i] = SystemDataTypes.getTypeFromString( item.getText( 2 ) );
 }
}

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

private void ok() {
 if ( Utils.isEmpty( wStepname.getText() ) ) {
  return;
 }
 stepname = wStepname.getText(); // return value
 int count = wFields.nrNonEmpty();
 input.allocate( count );
 //CHECKSTYLE:Indentation:OFF
 for ( int i = 0; i < count; i++ ) {
  TableItem item = wFields.getNonEmpty( i );
  input.getFieldName()[i] = item.getText( 1 );
  input.getReplaceByFieldValue()[i] = item.getText( 2 );
 }
 dispose();
}

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

private void ok() {
  if ( Utils.isEmpty( wStepname.getText() ) ) {
   return;
  }

  int nrTargets = wFields.nrNonEmpty();

  input.setFieldName( wField.getText() );

  input.allocate( nrTargets );

  for ( int i = 0; i < nrTargets; i++ ) {
   TableItem item = wFields.getNonEmpty( i );
   //CHECKSTYLE:Indentation:OFF
   input.getTargetField()[i] = item.getText( 1 );
  }
  stepname = wStepname.getText();

  dispose();
 }
}

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

private void ok() {
  if ( Utils.isEmpty( wStepname.getText() ) ) {
   return;
  }

  stepname = wStepname.getText(); // return value

  int count = wFields.nrNonEmpty();
  input.allocate( count );

  //CHECKSTYLE:Indentation:OFF
  for ( int i = 0; i < count; i++ ) {
   TableItem item = wFields.getNonEmpty( i );
   input.getFieldName()[i] = item.getText( 1 );
   input.getFieldType()[i] = RandomValueMeta.getType( item.getText( 2 ) );
  }
  dispose();
 }
}

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

private void getInfo( GetPreviousRowFieldMeta inf ) {
 int nrkeys = wFields.nrNonEmpty();
 inf.allocate( nrkeys );
 if ( log.isDebug() ) {
  logDebug( BaseMessages
   .getString( PKG, "GetPreviousRowFieldDialog.Log.FoundFields", String.valueOf( nrkeys ) ) );
 }
 //CHECKSTYLE:Indentation:OFF
 for ( int i = 0; i < nrkeys; i++ ) {
  TableItem item = wFields.getNonEmpty( i );
  inf.getFieldInStream()[i] = item.getText( 1 );
  inf.getFieldOutStream()[i] = item.getText( 2 );
 }
 stepname = wStepname.getText(); // return value
}

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

private boolean checkInputURL( RssInputMeta meta ) {
 if ( wUrlList.nrNonEmpty() < 1 ) {
  MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR );
  mb.setMessage( BaseMessages.getString( PKG, "RssInput.Log.UrlMissing" ) );
  mb.setText( BaseMessages.getString( PKG, "System.Dialog.Error.Title" ) );
  mb.open();
  return false;
 } else {
  return true;
 }
}

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

public void applyChanges() {
  int nrLines = wMappingParameters.nrNonEmpty();
  String[] variables = new String[ nrLines ];
  String[] inputFields = new String[ nrLines ];
  parameters.setVariable( variables );
  parameters.setInputField( inputFields );
  //CHECKSTYLE:Indentation:OFF
  for ( int i = 0; i < nrLines; i++ ) {
   TableItem item = wMappingParameters.getNonEmpty( i );
   parameters.getVariable()[ i ] = item.getText( 1 );
   parameters.getInputField()[ i ] = item.getText( 2 );
  }
  parameters.setInheritingAllVariables( wInheritAll.getSelection() );
 }
}

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

public void applyChanges() {
  int nrLines = wMappingParameters.nrNonEmpty();
  String[] variables = new String[ nrLines ];
  String[] inputFields = new String[ nrLines ];
  parameters.setVariable( variables );
  parameters.setInputField( inputFields );
  //CHECKSTYLE:Indentation:OFF
  for ( int i = 0; i < nrLines; i++ ) {
   TableItem item = wMappingParameters.getNonEmpty( i );
   parameters.getVariable()[ i ] = item.getText( 1 );
   parameters.getInputField()[ i ] = item.getText( 2 );
  }
  parameters.setInheritingAllVariables( wInheritAll.getSelection() );
 }
}

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

private void getInfo( StringCutMeta inf ) {
 int nrkeys = wFields.nrNonEmpty();
 inf.allocate( nrkeys );
 if ( log.isDebug() ) {
  logDebug( BaseMessages.getString( PKG, "StringCutDialog.Log.FoundFields", String.valueOf( nrkeys ) ) );
 }
 //CHECKSTYLE:Indentation:OFF
 for ( int i = 0; i < nrkeys; i++ ) {
  TableItem item = wFields.getNonEmpty( i );
  inf.getFieldInStream()[i] = item.getText( 1 );
  inf.getFieldOutStream()[i] = item.getText( 2 );
  inf.getCutFrom()[i] = item.getText( 3 );
  inf.getCutTo()[i] = item.getText( 4 );
 }
 stepname = wStepname.getText(); // return value
}

相关文章