Java Code Examples for org.pentaho.di.core.row.RowMetaInterface#getFieldNames()

The following examples show how to use org.pentaho.di.core.row.RowMetaInterface#getFieldNames() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ColumnExistsDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
private void get() {
  try {
    String columnName = wColumnName.getText();
    String tableName = wTableName.getText();

    wColumnName.removeAll();
    wTableName.removeAll();
    RowMetaInterface r = transMeta.getPrevStepFields( stepname );
    if ( r != null ) {
      r.getFieldNames();

      for ( int i = 0; i < r.getFieldNames().length; i++ ) {
        wTableName.add( r.getFieldNames()[i] );
        wColumnName.add( r.getFieldNames()[i] );
      }
    }
    wColumnName.setText( columnName );
    wTableName.setText( tableName );
  } catch ( KettleException ke ) {
    new ErrorDialog( shell, BaseMessages.getString( PKG, "ColumnExistsDialog.FailedToGetFields.DialogTitle" ),
        BaseMessages.getString( PKG, "ColumnExistsDialog.FailedToGetFields.DialogMessage" ), ke );
  }

}
 
Example 2
Source File: RssInputDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
private void setURLPreviousField() {
  try {

    wUrlField.removeAll();

    RowMetaInterface r = transMeta.getPrevStepFields( stepname );
    if ( r != null ) {
      r.getFieldNames();

      for ( int i = 0; i < r.getFieldNames().length; i++ ) {
        wUrlField.add( r.getFieldNames()[i] );

      }
    }

  } catch ( KettleException ke ) {
    new ErrorDialog(
      shell, BaseMessages.getString( PKG, "RssInputDialog.FailedToGetFields.DialogTitle" ), BaseMessages
        .getString( PKG, "RssInputDialog.FailedToGetFields.DialogMessage" ), ke );
  }
}
 
Example 3
Source File: LDIFInputDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
private void setFileField() {
  if ( !gotPreviousField ) {
    try {
      String value = wFilenameField.getText();
      wFilenameField.removeAll();

      RowMetaInterface r = transMeta.getPrevStepFields( stepname );
      if ( r != null ) {
        r.getFieldNames();

        for ( int i = 0; i < r.getFieldNames().length; i++ ) {
          wFilenameField.add( r.getFieldNames()[i] );

        }
      }
      gotPreviousField = true;
      if ( value != null ) {
        wFilenameField.setText( value );
      }
    } catch ( KettleException ke ) {
      new ErrorDialog(
        shell, BaseMessages.getString( PKG, "LDIFInputDialog.FailedToGetFields.DialogTitle" ), BaseMessages
          .getString( PKG, "LDIFInputDialog.FailedToGetFields.DialogMessage" ), ke );
    }
  }
}
 
Example 4
Source File: PaloDimOutputDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
private void fillPreviousFieldTableViewColumn() throws KettleException {
  RowMetaInterface r = transMeta.getPrevStepFields( stepname );
  if ( r != null ) {
    String[] fieldNames = r.getFieldNames();
    colinf[2] = new ColumnInfo( getLocalizedColumn( 2 ), ColumnInfo.COLUMN_TYPE_CCOMBO, fieldNames, true );

    /* Get all number fields to include in the consolidation factor column */
    String[] fieldTypes = r.getFieldNamesAndTypes( 0 );
    ArrayList<String> intFields = new ArrayList<String>();
    intFields.add( BaseMessages.getString( PKG, "PaloDimOutputDialog.ConsolidationFactorDefault" ) );
    for ( int i = 0; i < fieldNames.length; i++ ) {
      if ( fieldTypes[i].toLowerCase().indexOf( "integer" ) >= 0
        || fieldTypes[i].toLowerCase().indexOf( "number" ) > 0 ) {
        intFields.add( fieldNames[i] );
      }
    }

    String[] fieldNamesDefault = intFields.toArray( new String[intFields.size()] );
    colinf[3] = new ColumnInfo( getLocalizedColumn( 3 ), ColumnInfo.COLUMN_TYPE_CCOMBO, fieldNamesDefault, true );
  }
}
 
Example 5
Source File: GetXMLDataDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
private void setXMLStreamField() {
  try {

    wXMLField.removeAll();

    RowMetaInterface r = transMeta.getPrevStepFields( stepname );
    if ( r != null ) {
      String[] fieldNames = r.getFieldNames();
      if ( fieldNames != null ) {

        for ( int i = 0; i < fieldNames.length; i++ ) {
          wXMLField.add( fieldNames[i] );
        }
      }
    }
  } catch ( KettleException ke ) {
    if ( !Const.isOSX() ) { // see PDI-8871 for details
      shell.setFocus();
    }
    wXMLField.add( EMPTY_FIELDS );
    wXMLField.setText( EMPTY_FIELDS );
    new ErrorDialog( shell, BaseMessages.getString( PKG, "GetXMLDataDialog.FailedToGetFields.DialogTitle" ),
        BaseMessages.getString( PKG, "GetXMLDataDialog.FailedToGetFields.DialogMessage" ), ke );
  }
}
 
Example 6
Source File: GetFilesRowsCountDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
private void setFileField() {
  try {

    wFilenameField.removeAll();

    RowMetaInterface r = transMeta.getPrevStepFields( stepname );
    if ( r != null ) {
      r.getFieldNames();

      for ( int i = 0; i < r.getFieldNames().length; i++ ) {
        wFilenameField.add( r.getFieldNames()[i] );

      }
    }

  } catch ( KettleException ke ) {
    new ErrorDialog( shell, BaseMessages.getString( PKG, "GetFilesRowsCountDialog.FailedToGetFields.DialogTitle" ),
      BaseMessages.getString( PKG, "GetFilesRowsCountDialog.FailedToGetFields.DialogMessage" ), ke );
  }
}
 
Example 7
Source File: CreditCardValidatorDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
private void get() {
  if ( !gotPreviousFields ) {
    try {
      String columnName = wFieldName.getText();
      wFieldName.removeAll();
      RowMetaInterface r = transMeta.getPrevStepFields( stepname );
      if ( r != null ) {
        r.getFieldNames();

        for ( int i = 0; i < r.getFieldNames().length; i++ ) {
          wFieldName.add( r.getFieldNames()[i] );
        }
      }
      wFieldName.setText( columnName );
      gotPreviousFields = true;
    } catch ( KettleException ke ) {
      new ErrorDialog( shell,
        BaseMessages.getString( PKG, "CreditCardValidatorDialog.FailedToGetFields.DialogTitle" ),
        BaseMessages.getString( PKG, "CreditCardValidatorDialog.FailedToGetFields.DialogMessage" ), ke );
    }
  }
}
 
Example 8
Source File: BaseStepDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
/**
 * Create a new field mapping between source and target steps.
 *
 * @param shell        the shell of the parent window
 * @param sourceFields the source fields
 * @param targetFields the target fields
 * @param fieldMapping the list of source to target mappings to default to (can be empty but not null)
 * @throws KettleException in case something goes wrong during the field mapping
 */
public static final void generateFieldMapping( Shell shell, RowMetaInterface sourceFields,
                                               RowMetaInterface targetFields,
                                               List<SourceToTargetMapping> fieldMapping ) throws KettleException {
  // Build the mapping: let the user decide!!
  String[] source = sourceFields.getFieldNames();
  for ( int i = 0; i < source.length; i++ ) {
    ValueMetaInterface v = sourceFields.getValueMeta( i );
    source[ i ] += EnterMappingDialog.STRING_ORIGIN_SEPARATOR + v.getOrigin() + ")";
  }
  String[] target = targetFields.getFieldNames();

  EnterMappingDialog dialog = new EnterMappingDialog( shell, source, target, fieldMapping );
  List<SourceToTargetMapping> newMapping = dialog.open();
  if ( newMapping != null ) {
    fieldMapping.clear();
    fieldMapping.addAll( newMapping );
  }
}
 
Example 9
Source File: TransUnitTestSetLocationDialog.java    From pentaho-pdi-dataset with Apache License 2.0 6 votes vote down vote up
protected void getSortFields() {
  try {
    String datasetName = wDatasetName.getText();
    if ( StringUtils.isEmpty( datasetName ) ) {
      throw new KettleException( "Please select a data set to get order fields from" );
    }

    DataSet dataSet = findDataSet( datasetName );
    RowMetaInterface setRowMeta = dataSet.getSetRowMeta( false );
    String[] setFieldNames = setRowMeta.getFieldNames();

    wFieldOrder.clearAll();
    for ( String setFieldName : setFieldNames ) {
      TableItem item = new TableItem( wFieldOrder.table, SWT.NONE );
      item.setText( 1, setFieldName );
    }
    wFieldOrder.removeEmptyRows();
    wFieldOrder.setRowNums();
    wFieldOrder.optWidth( true );

  } catch ( Exception e ) {
    new ErrorDialog( shell, "Error", "Error getting sort fields", e );
  }
}
 
Example 10
Source File: AnalyticQueryMeta.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
public void getFields( RowMetaInterface r, String origin, RowMetaInterface[] info, StepMeta nextStep,
  VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException {
  // re-assemble a new row of metadata
  //
  RowMetaInterface fields = new RowMeta();

  // Add existing values
  fields.addRowMeta( r );

  // add analytic values
  for ( int i = 0; i < number_of_fields; i++ ) {

    int index_of_subject = -1;
    index_of_subject = r.indexOfValue( subjectField[i] );

    // if we found the subjectField in the RowMetaInterface, and we should....
    if ( index_of_subject > -1 ) {
      ValueMetaInterface vmi = r.getValueMeta( index_of_subject ).clone();
      vmi.setOrigin( origin );
      vmi.setName( aggregateField[i] );
      fields.addValueMeta( r.size() + i, vmi );
    } else {
      // we have a condition where the subjectField can't be found from the rowMetaInterface
      StringBuilder sbfieldNames = new StringBuilder();
      String[] fieldNames = r.getFieldNames();
      for ( int j = 0; j < fieldNames.length; j++ ) {
        sbfieldNames.append( "[" + fieldNames[j] + "]" + ( j < fieldNames.length - 1 ? ", " : "" ) );
      }
      throw new KettleStepException( BaseMessages.getString(
        PKG, "AnalyticQueryMeta.Exception.SubjectFieldNotFound", getParentStepMeta().getName(),
        subjectField[i], sbfieldNames.toString() ) );
    }
  }

  r.clear();
  // Add back to Row Meta
  r.addRowMeta( fields );
}
 
Example 11
Source File: BaseStepXulDialog.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
/**
 * Gets fields from previous steps and populate a ComboVar.
 *
 * @param comboVar
 *          the comboVar to populate
 * @param TransMeta
 *          the source transformation
 * @param StepMeta
 *          the source step
 */
public static final void getFieldsFromPrevious( ComboVar comboVar, TransMeta transMeta, StepMeta stepMeta ) {
  String selectedField = null;
  int indexField = -1;
  try {
    RowMetaInterface r = transMeta.getPrevStepFields( stepMeta );
    selectedField = comboVar.getText();
    comboVar.removeAll();

    if ( r != null && !r.isEmpty() ) {
      r.getFieldNames();
      comboVar.setItems( r.getFieldNames() );
      indexField = r.indexOfValue( selectedField );
    }
    // Select value if possible...
    if ( indexField > -1 ) {
      comboVar.select( indexField );
    } else {
      if ( selectedField != null ) {
        comboVar.setText( selectedField );
      }
    }

  } catch ( KettleException ke ) {
    new ErrorDialog( comboVar.getShell(),
      BaseMessages.getString( PKG, "BaseStepDialog.FailedToGetFieldsPrevious.DialogTitle" ),
      BaseMessages.getString( PKG, "BaseStepDialog.FailedToGetFieldsPrevious.DialogMessage" ), ke );
  }
}
 
Example 12
Source File: BaseStepDialog.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
/**
 * Gets fields from previous steps and populate a ComboVar.
 *
 * @param comboVar  the Combo Box (with Variables) to populate
 * @param transMeta the transformation metadata
 * @param stepMeta  the step metadata
 */
public static final void getFieldsFromPrevious( ComboVar comboVar, TransMeta transMeta, StepMeta stepMeta ) {
  String selectedField = null;
  int indexField = -1;
  try {
    RowMetaInterface r = transMeta.getPrevStepFields( stepMeta );
    selectedField = comboVar.getText();
    comboVar.removeAll();

    if ( r != null && !r.isEmpty() ) {
      r.getFieldNames();
      comboVar.setItems( r.getFieldNames() );
      indexField = r.indexOfValue( selectedField );
    }
    // Select value if possible...
    if ( indexField > -1 ) {
      comboVar.select( indexField );
    } else {
      if ( selectedField != null ) {
        comboVar.setText( selectedField );
      }
    }
  } catch ( KettleException ke ) {
    new ErrorDialog( comboVar.getShell(),
      BaseMessages.getString( PKG, "BaseStepDialog.FailedToGetFieldsPrevious.DialogTitle" ),
      BaseMessages.getString( PKG, "BaseStepDialog.FailedToGetFieldsPrevious.DialogMessage" ), ke );
  }
}
 
Example 13
Source File: ZipFileDialog.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
private void get() {
  if ( !gotPreviousFields ) {
    gotPreviousFields = true;
    String source = wSourceFileNameField.getText();
    String target = wTargetFileNameField.getText();
    String base = wBaseFolderField.getText();

    try {

      wSourceFileNameField.removeAll();
      wTargetFileNameField.removeAll();
      wBaseFolderField.removeAll();
      RowMetaInterface r = transMeta.getPrevStepFields( stepname );
      if ( r != null ) {
        String[] fields = r.getFieldNames();
        wSourceFileNameField.setItems( fields );
        wTargetFileNameField.setItems( fields );
        wBaseFolderField.setItems( fields );
      }
    } catch ( KettleException ke ) {
      new ErrorDialog(
        shell, BaseMessages.getString( PKG, "ZipFileDialog.FailedToGetFields.DialogTitle" ), BaseMessages
          .getString( PKG, "ZipFileDialog.FailedToGetFields.DialogMessage" ), ke );
    } finally {
      if ( source != null ) {
        wSourceFileNameField.setText( source );
      }
      if ( target != null ) {
        wTargetFileNameField.setText( target );
      }
      if ( base != null ) {
        wBaseFolderField.setText( base );
      }
    }
  }
}
 
Example 14
Source File: PGPDecryptStreamDialog.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
private void get() {
  if ( !gotPreviousFields ) {
    try {
      String fieldvalue = wStreamFieldName.getText();
      String passphrasefieldvalue = wPassphraseFieldName.getText();
      wStreamFieldName.removeAll();
      wPassphraseFieldName.removeAll();
      RowMetaInterface r = transMeta.getPrevStepFields( stepname );
      if ( r != null ) {
        String[] fields = r.getFieldNames();
        wStreamFieldName.setItems( fields );
        wPassphraseFieldName.setItems( fields );
      }
      if ( fieldvalue != null ) {
        wStreamFieldName.setText( fieldvalue );
      }
      if ( passphrasefieldvalue != null ) {
        wPassphraseFieldName.setText( passphrasefieldvalue );
      }
      gotPreviousFields = true;
    } catch ( KettleException ke ) {
      new ErrorDialog( shell,
        BaseMessages.getString( PKG, "PGPDecryptStreamDialog.FailedToGetFields.DialogTitle" ),
        BaseMessages.getString( PKG, "PGPDecryptStreamDialog.FailedToGetFields.DialogMessage" ), ke );
    }
  }
}
 
Example 15
Source File: DenormaliserDialog.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
private void getPreviousFieldNames() {
  if ( !gotPreviousFields ) {
    String keyValue = wKeyField.getText();
    try {
      wKeyField.removeAll();
      RowMetaInterface r = transMeta.getPrevStepFields( stepname );

      if ( r != null ) {
        r.getFieldNames();

        for ( int i = 0; i < r.getFieldNames().length; i++ ) {
          wKeyField.add( r.getFieldNames()[i] );
        }
      }
      if ( keyValue != null ) {
        wKeyField.setText( keyValue );
      }
      gotPreviousFields = true;
    } catch ( KettleException ke ) {
      if ( keyValue != null ) {
        wKeyField.setText( keyValue );
      }
      new ErrorDialog(
        shell, BaseMessages.getString( PKG, "DenormaliserDialog.FailedToGetFields.DialogTitle" ), BaseMessages
          .getString( PKG, "DenormaliserDialog.FailedToGetFields.DialogMessage" ), ke );
    }
  }
}
 
Example 16
Source File: RestInputIT.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
@Test
public void testRESTInput() throws Exception {
  //
  // Create a new transformation...
  //
  TransMeta transMeta = new TransMeta();
  transMeta.setName( "restinput" );

  PluginRegistry registry = PluginRegistry.getInstance();

  StepMeta inputStep = createRestInputStep( transMeta, registry );

  RowStepCollector rowStepCollector = new RowStepCollector();
  final Trans trans = createAndTestTrans( registry, transMeta, inputStep, rowStepCollector, "limit", 5 );
  trans.startThreads();

  trans.waitUntilFinished();

  // Compare the results
  List<RowMetaAndData> resultRows = rowStepCollector.getRowsWritten();

  assertTrue( rowStepCollector.getRowsError().isEmpty() );
  assertEquals( 1, rowStepCollector.getRowsWritten().size() );

  final RowMetaAndData rowMetaAndData = resultRows.get( 0 );
  final RowMetaInterface rowMeta = rowMetaAndData.getRowMeta();

  final String[] fieldNames = rowMeta.getFieldNames();
  final Object[] data = rowMetaAndData.getData();

  assertEquals( "pageSize", fieldNames[0] );
  assertEquals( "name", fieldNames[1] );
  assertEquals( "result", fieldNames[2] );

  assertEquals( Integer.valueOf( 5 ), data[0] );
  assertEquals( "limit", data[1] );
  assertEquals( "limit:5", data[2] );
}
 
Example 17
Source File: InlineEtlQueryExecutor.java    From pentaho-metadata with GNU Lesser General Public License v2.1 5 votes vote down vote up
private boolean registerAsStepListener( Trans trans, Query query, Map fieldMap ) throws Exception {
  boolean success = false;
  if ( trans != null ) {
    List<StepMetaDataCombi> stepList = trans.getSteps();
    // assume the last step
    for ( StepMetaDataCombi step : stepList ) {
      if ( !"Unique rows".equals( step.stepname ) ) { //$NON-NLS-1$
        continue;
      }
      if ( logger.isDebugEnabled() ) {
        logger.debug( "STEP NAME: " + step.stepname ); //$NON-NLS-1$
      }
      RowMetaInterface row = trans.getTransMeta().getStepFields( step.stepMeta ); // step.stepname?
      // create the metadata that the Pentaho result sets need
      String[] fieldNames = row.getFieldNames();

      String[][] columns = new String[1][fieldNames.length];
      for ( int column = 0; column < fieldNames.length; column++ ) {
        columns[0][column] = fieldNames[column];
      }

      // build valid metadata
      QueryModelMetaData metadata = new QueryModelMetaData( fieldMap, columns, null, query.getSelections() );

      results = new MemoryResultSet( metadata );
      errorResults = new MemoryResultSet( metadata );

      // add ourself as a row listener
      step.step.addRowListener( this );
      success = true;
    }
  }
  return success;
}
 
Example 18
Source File: TransUnitTestSetLocationDialog.java    From pentaho-pdi-dataset with Apache License 2.0 4 votes vote down vote up
protected void getFieldMappings() {

    try {

      TransUnitTestSetLocation loc = new TransUnitTestSetLocation();
      getInfo( loc );

      String stepName = wStepName.getText();
      String datasetName = wDatasetName.getText();
      if ( StringUtils.isEmpty( stepName ) || StringUtils.isEmpty( datasetName ) ) {
        throw new KettleException( "Please select a step and a data set to map fields between" );
      }

      RowMetaInterface stepRowMeta = stepFieldsMap.get( stepName );
      if ( stepRowMeta == null ) {
        throw new KettleException( "Unable to find fields for step " + stepName );
      }
      String[] stepFieldNames = stepRowMeta.getFieldNames();

      DataSet dataSet = findDataSet( datasetName );
      RowMetaInterface setRowMeta = dataSet.getSetRowMeta( false );
      String[] setFieldNames = setRowMeta.getFieldNames();

      // Get the current mappings...
      //
      List<SourceToTargetMapping> currentMappings = new ArrayList<>();
      for ( TransUnitTestFieldMapping mapping : loc.getFieldMappings() ) {
        int stepFieldIndex = stepRowMeta.indexOfValue( mapping.getStepFieldName() );
        int setFieldIndex = stepRowMeta.indexOfValue( mapping.getDataSetFieldName() );
        if ( stepFieldIndex >= 0 && setFieldIndex >= 0 ) {
          currentMappings.add( new SourceToTargetMapping( stepFieldIndex, setFieldIndex ) );
        }
      }
      // Edit them
      //
      EnterMappingDialog mappingDialog = new EnterMappingDialog( shell, stepFieldNames, setFieldNames, currentMappings );
      List<SourceToTargetMapping> newMappings = mappingDialog.open();
      if ( newMappings != null ) {
        // Simply clean everything and add the new mappings
        //
        wFieldMappings.clearAll();
        for ( SourceToTargetMapping sourceToTargetMapping : newMappings ) {
          TableItem item = new TableItem( wFieldMappings.table, SWT.NONE );
          item.setText( 1, stepFieldNames[ sourceToTargetMapping.getSourcePosition() ] );
          item.setText( 2, setFieldNames[ sourceToTargetMapping.getTargetPosition() ] );
        }
        wFieldMappings.removeEmptyRows();
        wFieldMappings.setRowNums();
        wFieldMappings.optWidth( true );
      }
    } catch ( Exception e ) {
      new ErrorDialog( shell, "Error", "Error mapping fields from step to dataset", e );
    }
  }
 
Example 19
Source File: SFTPPutDialog.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
private void getFields() {
  if ( !gotPreviousFields ) {
    gotPreviousFields = true;
    try {
      String source = wSourceFileNameField.getText();
      String rep = wRemoteDirectory.getText();
      String after = wDestinationFolderFieldName.getText();
      String remote = wRemoteFileName.getText();

      wSourceFileNameField.removeAll();
      wRemoteDirectory.removeAll();
      wDestinationFolderFieldName.removeAll();
      wRemoteFileName.removeAll();
      RowMetaInterface r = transMeta.getPrevStepFields( stepname );
      if ( r != null ) {
        String[] fields = r.getFieldNames();
        wSourceFileNameField.setItems( fields );
        wRemoteDirectory.setItems( fields );
        wDestinationFolderFieldName.setItems( fields );
        wRemoteFileName.setItems( fields );

        if ( source != null ) {
          wSourceFileNameField.setText( source );
        }
        if ( rep != null ) {
          wRemoteDirectory.setText( rep );
        }
        if ( after != null ) {
          wDestinationFolderFieldName.setText( after );
        }
        if ( remote != null ) {
          wRemoteFileName.setText( remote );
        }
      }
    } catch ( KettleException ke ) {
      new ErrorDialog(
        shell, BaseMessages.getString( PKG, "SFTPPUTDialog.FailedToGetFields.DialogTitle" ), BaseMessages
          .getString( PKG, "SFTPPUTDialog.FailedToGetFields.DialogMessage" ), ke );
    }
  }
}
 
Example 20
Source File: DimensionLookupDialog.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
private void getFieldsFromTable() {
  if ( !gotTableFields ) {
    if ( !Utils.isEmpty( wTable.getText() ) ) {
      DatabaseMeta ci = transMeta.findDatabase( wConnection.getText() );
      if ( ci != null ) {
        Database db = new Database( loggingObject, ci );
        try {
          db.connect();
          RowMetaInterface r =
            db.getTableFieldsMeta(
              transMeta.environmentSubstitute( wSchema.getText() ),
              transMeta.environmentSubstitute( wTable.getText() ) );
          if ( null != r ) {
            String[] fieldNames = r.getFieldNames();
            if ( null != fieldNames ) {
              // Version
              String version = wVersion.getText();
              wVersion.setItems( fieldNames );
              if ( version != null ) {
                wVersion.setText( version );
              }
              // from date
              String fromdate = wFromdate.getText();
              wFromdate.setItems( fieldNames );
              if ( fromdate != null ) {
                wFromdate.setText( fromdate );
              }
              // to date
              String todate = wTodate.getText();
              wTodate.setItems( fieldNames );
              if ( todate != null ) {
                wTodate.setText( todate );
              }
              // tk
              String tk = wTk.getText();
              wTk.setItems( fieldNames );
              if ( tk != null ) {
                wTk.setText( tk );
              }
              // AltStartDateField
              String sd = wAltStartDateField.getText();
              wAltStartDateField.setItems( fieldNames );
              if ( sd != null ) {
                wAltStartDateField.setText( sd );
              }
            }
          }
        } catch ( Exception e ) {

          // ignore any errors here. drop downs will not be
          // filled, but no problem for the user
        }
      }
    }
    gotTableFields = true;
  }
}