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

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

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

TableView.getNonEmpty介绍

[英]Return the row/table-item on the specified index. IMPORTANT: the indexes of the non-empty rows are populated with a call to nrNonEmpty(). Make sure to call that first.
[中]

代码示例

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

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 ok() {
 if ( Utils.isEmpty( wStepname.getText() ) ) {
  return;
 }
 int nrfields = wFields.nrNonEmpty();
 input.allocate( nrfields );
 for ( int i = 0; i < nrfields; i++ ) {
  TableItem item = wFields.getNonEmpty( i );
  //CHECKSTYLE:Indentation:OFF
  input.getCompareFields()[i] = item.getText( 1 );
 }
 stepname = wStepname.getText(); // return value
 input.setStoreValues( wStoreValues.getSelection() );
 input.setRejectDuplicateRow( wRejectDuplicateRow.getSelection() );
 input.setErrorDescription( wErrorDesc.getText() );
 dispose();
}

代码示例来源: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 getInfo( SecretKeyGeneratorMeta 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.getAlgorithm()[i] = item.getText( 1 );
  in.getScheme()[i] = item.getText( 2 );
  in.getSecretKeyLength()[i] = item.getText( 3 );
  in.getSecretKeyCount()[i] = item.getText( 4 );
 }
 in.setSecretKeyFieldName( wSecretKeyField.getText() );
 in.setAlgorithmFieldName( wAlgorithmField.getText() );
 in.setSecretKeyLengthFieldName( wSecretKeyLengthField.getText() );
 in.setOutputKeyInBinary( wOutputKeyAsByinary.getSelection() );
}

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

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 ok() {
 if ( Utils.isEmpty( wStepname.getText() ) ) {
  return;
 }
 stepname = wStepname.getText(); // return value
 // Table table = wFields.table;
 int count = wFields.nrNonEmpty();
 input.allocate( count );
 //CHECKSTYLE:Indentation:OFF
 for ( int i = 0; i < count; i++ ) {
  TableItem item = wFields.getNonEmpty( i );
  input.getFields()[i].setFieldName( item.getText( 1 ) );
  input.getFields()[i].setFieldValue( item.getText( 2 ) );
 }
 dispose();
}

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

相关文章