Java Code Examples for org.pentaho.di.core.Const#sortStrings()

The following examples show how to use org.pentaho.di.core.Const#sortStrings() . 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: GroupByDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
protected void setComboBoxes() {
  // Something was changed in the row.
  //
  final Map<String, Integer> fields = new HashMap<String, Integer>();

  // Add the currentMeta fields...
  fields.putAll( inputFields );

  Set<String> keySet = fields.keySet();
  List<String> entries = new ArrayList<String>( keySet );

  String[] fieldNames = entries.toArray( new String[entries.size()] );

  Const.sortStrings( fieldNames );
  ciKey[0].setComboValues( fieldNames );
  ciReturn[1].setComboValues( fieldNames );
}
 
Example 2
Source File: MonetDBBulkLoaderDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
protected void setComboBoxes() {
  // Something was changed in the row.
  //
  final Map<String, Integer> fields = new HashMap<String, Integer>();

  // Add the currentMeta fields...
  fields.putAll( inputFields );

  Set<String> keySet = fields.keySet();
  List<String> entries = new ArrayList<String>( keySet );

  String[] fieldNames = entries.toArray( new String[entries.size()] );
  Const.sortStrings( fieldNames );
  // return fields
  if ( ciReturn != null ) {
    ciReturn[1].setComboValues( fieldNames );
  }
}
 
Example 3
Source File: ReplaceStringDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
protected void setComboBoxes() {
  // Something was changed in the row.
  //
  final Map<String, Integer> fields = new HashMap<String, Integer>();

  // Add the currentMeta fields...
  fields.putAll( inputFields );

  Set<String> keySet = fields.keySet();
  List<String> entries = new ArrayList<String>( keySet );

  String[] fieldNames = entries.toArray( new String[entries.size()] );

  Const.sortStrings( fieldNames );
  ciKey[0].setComboValues( fieldNames );
  ciKey[6].setComboValues( fieldNames );
}
 
Example 4
Source File: GPBulkLoaderDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
protected void setComboBoxes() {
  // Something was changed in the row.
  //
  final Map<String, Integer> fields = new HashMap<String, Integer>();

  // Add the currentMeta fields...
  fields.putAll( inputFields );

  Set<String> keySet = fields.keySet();
  List<String> entries = new ArrayList<String>( keySet );

  String[] fieldNames = entries.toArray( new String[entries.size()] );
  Const.sortStrings( fieldNames );
  // return fields
  ciReturn[1].setComboValues( fieldNames );
}
 
Example 5
Source File: AddXMLDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
protected void setComboBoxes() {
  // Something was changed in the row.
  //
  final Map<String, Integer> fields = new HashMap<String, Integer>();

  // Add the currentMeta fields...
  fields.putAll( inputFields );

  Set<String> keySet = fields.keySet();
  List<String> entries = new ArrayList<String>( keySet );

  String[] fieldNames = entries.toArray( new String[entries.size()] );

  Const.sortStrings( fieldNames );
  colinf[0].setComboValues( fieldNames );
}
 
Example 6
Source File: SetValueConstantDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
protected void setComboBoxes() {
  // Something was changed in the row.
  //
  final Map<String, Integer> fields = new HashMap<String, Integer>();

  // Add the currentMeta fields...
  fields.putAll( inputFields );

  Set<String> keySet = fields.keySet();
  List<String> entries = new ArrayList<String>( keySet );

  String[] fieldNames = entries.toArray( new String[entries.size()] );

  Const.sortStrings( fieldNames );
  colinf[0].setComboValues( fieldNames );
}
 
Example 7
Source File: OraBulkLoaderDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
protected void setComboBoxes() {
  // Something was changed in the row.
  //
  final Map<String, Integer> fields = new HashMap<String, Integer>();

  // Add the currentMeta fields...
  fields.putAll( inputFields );

  Set<String> keySet = fields.keySet();
  List<String> entries = new ArrayList<String>( keySet );

  String[] fieldNames = entries.toArray( new String[entries.size()] );
  Const.sortStrings( fieldNames );
  // return fields
  ciReturn[1].setComboValues( fieldNames );

}
 
Example 8
Source File: FieldsChangeSequenceDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
protected void setComboBoxes() {
  // Something was changed in the row.
  //
  final Map<String, Integer> fields = new HashMap<String, Integer>();

  // Add the currentMeta fields...
  fields.putAll( inputFields );

  Set<String> keySet = fields.keySet();
  List<String> entries = new ArrayList<String>( keySet );

  String[] fieldNames = entries.toArray( new String[entries.size()] );

  Const.sortStrings( fieldNames );
  colinf[0].setComboValues( fieldNames );
}
 
Example 9
Source File: WriteToLogDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
protected void setComboBoxes() {
  // Something was changed in the row.
  //
  final Map<String, Integer> fields = new HashMap<String, Integer>();

  // Add the currentMeta fields...
  fields.putAll( inputFields );

  Set<String> keySet = fields.keySet();
  List<String> entries = new ArrayList<String>( keySet );

  String[] fieldNames = entries.toArray( new String[entries.size()] );

  Const.sortStrings( fieldNames );
  colinf[0].setComboValues( fieldNames );
}
 
Example 10
Source File: CombinationLookupDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
protected void setComboBoxes() {
  // Something was changed in the row.
  //
  final Map<String, Integer> fields = new HashMap<String, Integer>();

  // Add the currentMeta fields...
  fields.putAll( inputFields );

  Set<String> keySet = fields.keySet();
  List<String> entries = new ArrayList<String>( keySet );

  String[] fieldNames = entries.toArray( new String[ entries.size() ] );
  Const.sortStrings( fieldNames );
  // Key fields
  ciKey[ 1 ].setComboValues( fieldNames );
}
 
Example 11
Source File: SelectValuesDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
protected void setComboBoxes() {
  // Something was changed in the row.
  //
  final Map<String, Integer> fields = new HashMap<String, Integer>();

  // Add the currentMeta fields...
  fields.putAll( inputFields );

  Set<String> keySet = fields.keySet();
  List<String> entries = new ArrayList<String>( keySet );

  String[] fieldNames = entries.toArray( new String[entries.size()] );

  Const.sortStrings( fieldNames );

  bPreviousFieldsLoaded = true;
  for ( int i = 0; i < fieldColumns.size(); i++ ) {
    ColumnInfo colInfo = fieldColumns.get( i );
    colInfo.setComboValues( fieldNames );
  }
}
 
Example 12
Source File: SynchronizeAfterMergeDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
protected void setComboBoxes() {
  // Something was changed in the row.
  //
  final Map<String, Integer> fields = new HashMap<String, Integer>();

  // Add the currentMeta fields...
  fields.putAll( inputFields );

  Set<String> keySet = fields.keySet();
  List<String> entries = new ArrayList<String>( keySet );

  fieldNames = entries.toArray( new String[entries.size()] );

  Const.sortStrings( fieldNames );
  ciKey[2].setComboValues( fieldNames );
  ciKey[3].setComboValues( fieldNames );
  ciReturn[1].setComboValues( fieldNames );
}
 
Example 13
Source File: SalesforceUpdateDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
protected void setComboBoxes() {
  // Something was changed in the row.
  //
  final Map<String, Integer> fields = new HashMap<String, Integer>();

  // Add the currentMeta fields...
  fields.putAll( inputFields );

  Set<String> keySet = fields.keySet();
  List<String> entries = new ArrayList<String>( keySet );

  String[] fieldNames = entries.toArray( new String[entries.size()] );
  Const.sortStrings( fieldNames );
  // return fields
  ciReturn[1].setComboValues( fieldNames );
}
 
Example 14
Source File: SetVariableDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
protected void setComboBoxes() {
  // Something was changed in the row.
  //
  final Map<String, Integer> fields = new HashMap<String, Integer>();

  // Add the currentMeta fields...
  fields.putAll( inputFields );

  Set<String> keySet = fields.keySet();
  List<String> entries = new ArrayList<String>( keySet );

  String[] fieldNames = entries.toArray( new String[entries.size()] );

  Const.sortStrings( fieldNames );
  colinf[0].setComboValues( fieldNames );
}
 
Example 15
Source File: TeraFastDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
/**
 * ...
 */
protected void setComboBoxes() {
  // Something was changed in the row.
  //
  final Map<String, Integer> fields = new HashMap<String, Integer>();

  // Add the currentMeta fields...
  fields.putAll( this.inputFields );

  Set<String> keySet = fields.keySet();
  List<String> entries = new ArrayList<String>( keySet );

  String[] fieldNames = entries.toArray( new String[entries.size()] );
  Const.sortStrings( fieldNames );
  // return fields
  this.ciReturn[1].setComboValues( fieldNames );
}
 
Example 16
Source File: CalculatorDialog.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
protected void setComboBoxes() {
  // Something was changed in the row.
  //
  final Map<String, Integer> fields = new HashMap<String, Integer>();

  // Add the currentMeta fields...
  fields.putAll( inputFields );

  shell.getDisplay().syncExec( new Runnable() {
    @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
      }
    }
  } );

  Set<String> keySet = fields.keySet();
  List<String> entries = new ArrayList<String>( keySet );

  String[] fieldNames = entries.toArray( new String[entries.size()] );

  Const.sortStrings( fieldNames );
  colinf[2].setComboValues( fieldNames );
  colinf[3].setComboValues( fieldNames );
  colinf[4].setComboValues( fieldNames );
}
 
Example 17
Source File: StringOperationsDialog.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
protected void setComboBoxes() {
  Set<String> keySet = inputFields.keySet();
  List<String> entries = new ArrayList<String>( keySet );
  String[] fieldNames = entries.toArray( new String[entries.size()] );
  Const.sortStrings( fieldNames );
  ciKey[0].setComboValues( fieldNames );

}
 
Example 18
Source File: InsertUpdateDialog.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
private void getSchemaNames() {
  DatabaseMeta databaseMeta = transMeta.findDatabase( wConnection.getText() );
  if ( databaseMeta != null ) {
    Database database = new Database( loggingObject, databaseMeta );
    try {
      database.connect();
      String[] schemas = database.getSchemas();

      if ( null != schemas && schemas.length > 0 ) {
        schemas = Const.sortStrings( schemas );
        EnterSelectionDialog dialog =
          new EnterSelectionDialog( shell, schemas, BaseMessages.getString(
            PKG, "InsertUpDateDialog.AvailableSchemas.Title", wConnection.getText() ), BaseMessages
            .getString( PKG, "InsertUpDateDialog.AvailableSchemas.Message", wConnection.getText() ) );
        String d = dialog.open();
        if ( d != null ) {
          wSchema.setText( Const.NVL( d, "" ) );
          setTableFieldCombo();
        }

      } else {
        MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR );
        mb.setMessage( BaseMessages.getString( PKG, "InsertUpDateDialog.NoSchema.Error" ) );
        mb.setText( BaseMessages.getString( PKG, "InsertUpDateDialog.GetSchemas.Error" ) );
        mb.open();
      }
    } catch ( Exception e ) {
      new ErrorDialog( shell, BaseMessages.getString( PKG, "System.Dialog.Error.Title" ), BaseMessages
        .getString( PKG, "InsertUpDateDialog.ErrorGettingSchemas" ), e );
    } finally {
      database.disconnect();
    }
  }
}
 
Example 19
Source File: CombinationLookupDialog.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
private void getSchemaNames() {
  DatabaseMeta databaseMeta = transMeta.findDatabase( wConnection.getText() );
  if ( databaseMeta != null ) {
    Database database = new Database( loggingObject, databaseMeta );
    try {
      database.connect();
      String[] schemas = database.getSchemas();

      if ( null != schemas && schemas.length > 0 ) {
        schemas = Const.sortStrings( schemas );
        EnterSelectionDialog dialog =
          new EnterSelectionDialog( shell, schemas, BaseMessages.getString(
            PKG, "CombinationLookupDialog.AvailableSchemas.Title", wConnection.getText() ), BaseMessages
            .getString( PKG, "CombinationLookupDialog.AvailableSchemas.Message", wConnection.getText() ) );
        String d = dialog.open();
        if ( d != null ) {
          wSchema.setText( Const.NVL( d, "" ) );
          setTableFieldCombo();
        }

      } else {
        MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR );
        mb.setMessage( BaseMessages.getString( PKG, "CombinationLookupDialog.NoSchema.Error" ) );
        mb.setText( BaseMessages.getString( PKG, "CombinationLookupDialog.GetSchemas.Error" ) );
        mb.open();
      }
    } catch ( Exception e ) {
      new ErrorDialog( shell, BaseMessages.getString( PKG, "System.Dialog.Error.Title" ), BaseMessages
        .getString( PKG, "CombinationLookupDialog.ErrorGettingSchemas" ), e );
    } finally {
      database.disconnect();
    }
  }
}
 
Example 20
Source File: UpdateDialog.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
private void getSchemaNames() {
  DatabaseMeta databaseMeta = transMeta.findDatabase( wConnection.getText() );
  if ( databaseMeta != null ) {
    Database database = new Database( loggingObject, databaseMeta );
    try {
      database.connect();
      String[] schemas = database.getSchemas();

      if ( null != schemas && schemas.length > 0 ) {
        schemas = Const.sortStrings( schemas );
        EnterSelectionDialog dialog = new EnterSelectionDialog( shell, schemas,
          BaseMessages.getString( PKG, "UpdateDialog.AvailableSchemas.Title", wConnection.getText() ),
          BaseMessages.getString( PKG, "UpdateDialog.AvailableSchemas.Message", wConnection.getText() ) );
        String d = dialog.open();
        if ( d != null ) {
          wSchema.setText( Const.NVL( d, "" ) );
          setTableFieldCombo();
        }

      } else {
        MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR );
        mb.setMessage( BaseMessages.getString( PKG, "UpdateDialog.NoSchema.Error" ) );
        mb.setText( BaseMessages.getString( PKG, "UpdateDialog.GetSchemas.Error" ) );
        mb.open();
      }
    } catch ( Exception e ) {
      new ErrorDialog( shell,
        BaseMessages.getString( PKG, "System.Dialog.Error.Title" ),
        BaseMessages.getString( PKG, "UpdateDialog.ErrorGettingSchemas" ), e );
    } finally {
      database.disconnect();
    }
  }
}