@SuppressWarnings( { "rawtypes", "unchecked" } ) public void addDatabases( XulMenuList wConnection, Class<? extends DatabaseInterface> databaseType ) { List<String> databases = new ArrayList<String>(); for ( int i = 0; i < transMeta.nrDatabases(); i++ ) { DatabaseMeta ci = transMeta.getDatabase( i ); if ( databaseType == null || ci.getDatabaseInterface().getClass().equals( databaseType ) ) { databases.add( ci.getName() ); } } wConnection.setElements( databases ); }
private void getTableName() { int connr = wConnection.getSelectionIndex(); if ( connr < 0 ) { return; } DatabaseMeta inf = transMeta.getDatabase( connr ); logDebug( BaseMessages.getString( PKG, "DimensionLookupDialog.Log.LookingAtConnection" ) + inf.toString() ); DatabaseExplorerDialog std = new DatabaseExplorerDialog( shell, SWT.NONE, inf, transMeta.getDatabases() ); std.setSelectedSchemaAndTable( wSchema.getText(), wTable.getText() ); if ( std.open() ) { wSchema.setText( Const.NVL( std.getSchemaName(), "" ) ); wTable.setText( Const.NVL( std.getTableName(), "" ) ); setTableFieldCombo(); } }
private void getTableName() { // New class: SelectTableDialog int connr = wConnection.getSelectionIndex(); if ( connr >= 0 ) { DatabaseMeta inf = transMeta.getDatabase( connr ); DatabaseExplorerDialog std = new DatabaseExplorerDialog( shell, SWT.NONE, inf, transMeta.getDatabases() ); std.setSelectedSchemaAndTable( wSchemaname.getText(), wTablenameText.getText() ); if ( std.open() ) { wSchemaname.setText( Const.NVL( std.getSchemaName(), "" ) ); wTablenameText.setText( Const.NVL( std.getTableName(), "" ) ); } } else { MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR ); mb.setMessage( BaseMessages.getString( PKG, "ColumnExistsDialog.ConnectionError2.DialogMessage" ) ); mb.setText( BaseMessages.getString( PKG, "System.Dialog.Error.Title" ) ); mb.open(); } }
/** * Adds the databases with the specified type to the Combo Box component. * * @param wConnection the Combo Box component * @param databaseType the database type */ public void addDatabases( CCombo wConnection, Class<? extends DatabaseInterface> databaseType ) { for ( int i = 0; i < transMeta.nrDatabases(); i++ ) { DatabaseMeta ci = transMeta.getDatabase( i ); if ( databaseType == null || ci.getDatabaseInterface().getClass().equals( databaseType ) ) { wConnection.add( ci.getName() ); } } }
private void getTableName() { // New class: SelectTableDialog int connr = wConnection.getSelectionIndex(); if ( connr >= 0 ) { DatabaseMeta inf = transMeta.getDatabase( connr ); logDebug( BaseMessages.getString( PKG, "SQLFileOutputDialog.Log.LookingAtConnection", inf.toString() ) ); DatabaseExplorerDialog std = new DatabaseExplorerDialog( shell, SWT.NONE, inf, transMeta.getDatabases() ); std.setSelectedSchemaAndTable( wSchema.getText(), wTable.getText() ); if ( std.open() ) { wSchema.setText( Const.NVL( std.getSchemaName(), "" ) ); wTable.setText( Const.NVL( std.getTableName(), "" ) ); } } else { MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR ); mb.setMessage( BaseMessages.getString( PKG, "SQLFileOutputDialog.ConnectionError2.DialogMessage" ) ); mb.setText( BaseMessages.getString( PKG, "System.Dialog.Error.Title" ) ); mb.open(); } }
public void addDatabases( ComboVar wConnection, Class<? extends DatabaseInterface> databaseType ) { for ( int i = 0; i < transMeta.nrDatabases(); i++ ) { DatabaseMeta ci = transMeta.getDatabase( i ); if ( databaseType == null || ci.getDatabaseInterface().getClass().equals( databaseType ) ) { wConnection.add( ci.getName() ); } } // Add the metaDBConnectionName if we have it // and it is already not added to the list in wConnection. if ( !Utils.isEmpty( input.getDbConnectionName() ) ) { String[] arrayDatabaseList = wConnection.getItems(); if ( arrayDatabaseList == null ) { List<String> databaseNameList = Arrays.asList(); if ( !databaseNameList.contains( input.getDbConnectionName() ) ) { wConnection.add( input.getDbConnectionName() ); } } } }
private void getTableName() { DatabaseMeta inf = null; // New class: SelectTableDialog int connr = wConnection.getSelectionIndex(); if ( connr >= 0 ) { inf = transMeta.getDatabase( connr ); } if ( inf != null ) { logDebug( BaseMessages.getString( PKG, "PGBulkLoaderDialog.Log.LookingAtConnection" ) + inf.toString() ); DatabaseExplorerDialog std = new DatabaseExplorerDialog( shell, SWT.NONE, inf, transMeta.getDatabases() ); std.setSelectedSchemaAndTable( wSchema.getText(), wTable.getText() ); if ( std.open() ) { wSchema.setText( Const.NVL( std.getSchemaName(), "" ) ); wTable.setText( Const.NVL( std.getTableName(), "" ) ); } } else { MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR ); mb.setMessage( BaseMessages.getString( PKG, "PGBulkLoaderDialog.InvalidConnection.DialogMessage" ) ); mb.setText( BaseMessages.getString( PKG, "PGBulkLoaderDialog.InvalidConnection.DialogTitle" ) ); mb.open(); } }
/** * Copy information from the meta-data input to the dialog fields. */ public void getData() { if ( log.isDebug() ) { logDebug( BaseMessages.getString( PKG, "DynamicSQLRowDialog.Log.GettingKeyInfo" ) ); } wSQL.setText( Const.NVL( input.getSql(), "" ) ); wLimit.setText( "" + input.getRowLimit() ); wOuter.setSelection( input.isOuterJoin() ); wuseVars.setSelection( input.isVariableReplace() ); if ( input.getSQLFieldName() != null ) { wSQLFieldName.setText( input.getSQLFieldName() ); } wqueryOnlyOnChange.setSelection( input.isQueryOnlyOnChange() ); if ( input.getDatabaseMeta() != null ) { wConnection.setText( input.getDatabaseMeta().getName() ); } else if ( transMeta.nrDatabases() == 1 ) { wConnection.setText( transMeta.getDatabase( 0 ).getName() ); } wStepname.selectAll(); wStepname.setFocus(); }
private void getTableName() { DatabaseMeta inf = null; // New class: SelectTableDialog int connr = wConnection.getSelectionIndex(); if ( connr >= 0 ) { inf = transMeta.getDatabase( connr ); } if ( inf != null ) { logDebug( BaseMessages.getString( PKG, "LucidDBStreamingLoaderDialog.Log.LookingAtConnection" ) + inf.toString() ); DatabaseExplorerDialog std = new DatabaseExplorerDialog( shell, SWT.NONE, inf, transMeta.getDatabases() ); std.setSelectedSchemaAndTable( wSchema.getText(), wTable.getText() ); if ( std.open() ) { wSchema.setText( Const.NVL( std.getSchemaName(), "" ) ); wTable.setText( Const.NVL( std.getTableName(), "" ) ); } } else { MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR ); mb .setMessage( BaseMessages .getString( PKG, "LucidDBStreamingLoaderDialog.InvalidConnection.DialogMessage" ) ); mb.setText( BaseMessages.getString( PKG, "LucidDBStreamingLoaderDialog.InvalidConnection.DialogTitle" ) ); mb.open(); } }
/** * Copy information from the meta-data input to the dialog fields. */ public void getData() { if ( log.isDebug() ) { logDebug( BaseMessages.getString( PKG, "TableExistsDialog.Log.GettingKeyInfo" ) ); } if ( input.getDatabase() != null ) { wConnection.setText( input.getDatabase().getName() ); } else if ( transMeta.nrDatabases() == 1 ) { wConnection.setText( transMeta.getDatabase( 0 ).getName() ); } if ( input.getDynamicTablenameField() != null ) { wTableName.setText( input.getDynamicTablenameField() ); } if ( input.getSchemaname() != null ) { wSchemaname.setText( input.getSchemaname() ); } if ( input.getResultFieldName() != null ) { wResult.setText( input.getResultFieldName() ); } wStepname.selectAll(); wStepname.setFocus(); }
private void getTableName() { DatabaseMeta inf = null; // New class: SelectTableDialog int connr = wConnection.getSelectionIndex(); if ( connr >= 0 ) { inf = transMeta.getDatabase( connr ); } if ( inf != null ) { logDebug( BaseMessages.getString( PKG, "DeleteDialog.Log.LookingAtConnection" ) + inf.toString() ); DatabaseExplorerDialog std = new DatabaseExplorerDialog( shell, SWT.NONE, inf, transMeta.getDatabases() ); std.setSelectedSchemaAndTable( wSchema.getText(), wTable.getText() ); if ( std.open() ) { wSchema.setText( Const.NVL( std.getSchemaName(), "" ) ); wTable.setText( Const.NVL( std.getTableName(), "" ) ); setTableFieldCombo(); } } else { MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR ); mb.setMessage( BaseMessages.getString( PKG, "DeleteDialog.InvalidConnection.DialogMessage" ) ); mb.setText( BaseMessages.getString( PKG, "DeleteDialog.InvalidConnection.DialogTitle" ) ); mb.open(); } }
private void getTableName() { DatabaseMeta inf = null; // New class: SelectTableDialog int connr = wConnection.getSelectionIndex(); if ( connr >= 0 ) { inf = transMeta.getDatabase( connr ); } if ( inf != null ) { logDebug( BaseMessages.getString( PKG, "CombinationLookupDialog.Log.LookingAtConnection", inf.toString() ) ); DatabaseExplorerDialog std = new DatabaseExplorerDialog( shell, SWT.NONE, inf, transMeta.getDatabases() ); std.setSelectedSchemaAndTable( wSchema.getText(), wTable.getText() ); if ( std.open() ) { wSchema.setText( Const.NVL( std.getSchemaName(), "" ) ); wTable.setText( Const.NVL( std.getTableName(), "" ) ); setTableFieldCombo(); } } else { MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR ); mb.setMessage( BaseMessages.getString( PKG, "CombinationLookupDialog.ConnectionError2.DialogMessage" ) ); mb.setText( BaseMessages.getString( PKG, "System.Dialog.Error.Title" ) ); mb.open(); } }
private void getTableName( TextVar schema, TextVar tableName ) { DatabaseMeta inf = null; // New class: SelectTableDialog int connr = wConnection.getSelectionIndex(); if ( connr >= 0 ) { inf = transMeta.getDatabase( connr ); } if ( inf != null ) { if ( log.isDebug() ) { logDebug( BaseMessages.getString( PKG, "GPLoadDialog.Log.LookingAtConnection" ) + inf.toString() ); } DatabaseExplorerDialog std = new DatabaseExplorerDialog( shell, SWT.NONE, inf, transMeta.getDatabases() ); std.setSelectedSchemaAndTable( wSchema.getText(), wTable.getText() ); if ( std.open() ) { schema.setText( Const.NVL( std.getSchemaName(), "" ) ); tableName.setText( Const.NVL( std.getTableName(), "" ) ); } } else { MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR ); mb.setMessage( BaseMessages.getString( PKG, "GPLoadDialog.InvalidConnection.DialogMessage" ) ); mb.setText( BaseMessages.getString( PKG, "GPLoadDialog.InvalidConnection.DialogTitle" ) ); mb.open(); } }
private void getTableName() { DatabaseMeta inf = null; // New class: SelectTableDialog int connr = wConnection.getSelectionIndex(); if ( connr >= 0 ) { inf = transMeta.getDatabase( connr ); } if ( inf != null ) { if ( log.isDebug() ) { logDebug( BaseMessages.getString( PKG, "MySQLBulkLoaderDialog.Log.LookingAtConnection" ) + inf.toString() ); } DatabaseExplorerDialog std = new DatabaseExplorerDialog( shell, SWT.NONE, inf, transMeta.getDatabases() ); std.setSelectedSchemaAndTable( wSchema.getText(), wTable.getText() ); if ( std.open() ) { wSchema.setText( Const.NVL( std.getSchemaName(), "" ) ); wTable.setText( Const.NVL( std.getTableName(), "" ) ); } } else { MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR ); mb.setMessage( BaseMessages.getString( PKG, "MySQLBulkLoaderDialog.InvalidConnection.DialogMessage" ) ); mb.setText( BaseMessages.getString( PKG, "MySQLBulkLoaderDialog.InvalidConnection.DialogTitle" ) ); mb.open(); } }
private void getTableName() { DatabaseMeta inf = null; // New class: SelectTableDialog int connr = wConnection.getSelectionIndex(); if ( connr >= 0 ) { inf = transMeta.getDatabase( connr ); } if ( inf != null ) { if ( log.isDebug() ) { logDebug( BaseMessages.getString( PKG, "GPBulkLoaderDialog.Log.LookingAtConnection" ) + inf.toString() ); } DatabaseExplorerDialog std = new DatabaseExplorerDialog( shell, SWT.NONE, inf, transMeta.getDatabases() ); std.setSelectedSchemaAndTable( wSchema.getText(), wTable.getText() ); if ( std.open() ) { wSchema.setText( Const.NVL( std.getSchemaName(), "" ) ); wTable.setText( Const.NVL( std.getTableName(), "" ) ); } } else { MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR ); mb.setMessage( BaseMessages.getString( PKG, "GPBulkLoaderDialog.InvalidConnection.DialogMessage" ) ); mb.setText( BaseMessages.getString( PKG, "GPBulkLoaderDialog.InvalidConnection.DialogTitle" ) ); mb.open(); } }
private void getTableName() { // New class: SelectTableDialog int connr = wConnection.getSelectionIndex(); if ( connr >= 0 ) { DatabaseMeta inf = transMeta.getDatabase( connr ); if ( log.isDebug() ) { logDebug( BaseMessages.getString( PKG, "TableOutputDialog.Log.LookingAtConnection", inf.toString() ) ); } DatabaseExplorerDialog std = new DatabaseExplorerDialog( shell, SWT.NONE, inf, transMeta.getDatabases() ); std.setSelectedSchemaAndTable( wSchema.getText(), wTable.getText() ); if ( std.open() ) { wSchema.setText( Const.NVL( std.getSchemaName(), "" ) ); wTable.setText( Const.NVL( std.getTableName(), "" ) ); setTableFieldCombo(); } } else { MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR ); mb.setMessage( BaseMessages.getString( PKG, "TableOutputDialog.ConnectionError2.DialogMessage" ) ); mb.setText( BaseMessages.getString( PKG, "System.Dialog.Error.Title" ) ); mb.open(); } }
private void getTableName() { DatabaseMeta inf = null; // New class: SelectTableDialog int connr = wConnection.getSelectionIndex(); if ( connr >= 0 ) { inf = transMeta.getDatabase( connr ); } if ( inf != null ) { if ( log.isDebug() ) { logDebug( BaseMessages.getString( PKG, "InsertUpdateDialog.Log.LookingAtConnection" ) + inf.toString() ); } DatabaseExplorerDialog std = new DatabaseExplorerDialog( shell, SWT.NONE, inf, transMeta.getDatabases() ); std.setSelectedSchemaAndTable( wSchema.getText(), wTable.getText() ); if ( std.open() ) { wSchema.setText( Const.NVL( std.getSchemaName(), "" ) ); wTable.setText( Const.NVL( std.getTableName(), "" ) ); setTableFieldCombo(); } } else { MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR ); mb.setMessage( BaseMessages.getString( PKG, "InsertUpdateDialog.InvalidConnection.DialogMessage" ) ); mb.setText( BaseMessages.getString( PKG, "InsertUpdateDialog.InvalidConnection.DialogTitle" ) ); mb.open(); } }
private void getTableName() { DatabaseMeta inf = null; // New class: SelectTableDialog int connr = wConnection.getSelectionIndex(); if ( connr >= 0 ) { inf = transMeta.getDatabase( connr ); } if ( inf != null ) { if ( log.isDebug() ) { logDebug( BaseMessages.getString( PKG, "OraBulkLoaderDialog.Log.LookingAtConnection" ) + inf.toString() ); } DatabaseExplorerDialog std = new DatabaseExplorerDialog( shell, SWT.NONE, inf, transMeta.getDatabases() ); std.setSelectedSchemaAndTable( wSchema.getText(), wTable.getText() ); if ( std.open() ) { wSchema.setText( Const.NVL( std.getSchemaName(), "" ) ); wTable.setText( Const.NVL( std.getTableName(), "" ) ); setTableFieldCombo(); } } else { MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR ); mb.setMessage( BaseMessages.getString( PKG, "OraBulkLoaderDialog.InvalidConnection.DialogMessage" ) ); mb.setText( BaseMessages.getString( PKG, "OraBulkLoaderDialog.InvalidConnection.DialogTitle" ) ); mb.open(); } }
private void getTableName() { DatabaseMeta inf = null; // New class: SelectTableDialog int connr = wConnection.getSelectionIndex(); if ( connr >= 0 ) { inf = transMeta.getDatabase( connr ); } if ( inf != null ) { if ( log.isDebug() ) { logDebug( BaseMessages.getString( PKG, "DatabaseLookupDialog.Log.LookingAtConnection" ) + inf.toString() ); } DatabaseExplorerDialog std = new DatabaseExplorerDialog( shell, SWT.NONE, inf, transMeta.getDatabases() ); std.setSelectedSchemaAndTable( wSchema.getText(), wTable.getText() ); if ( std.open() ) { wSchema.setText( Const.NVL( std.getSchemaName(), "" ) ); wTable.setText( Const.NVL( std.getTableName(), "" ) ); setTableFieldCombo(); } } else { MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR ); mb.setMessage( BaseMessages.getString( PKG, "DatabaseLookupDialog.InvalidConnection.DialogMessage" ) ); mb.setText( BaseMessages.getString( PKG, "DatabaseLookupDialog.InvalidConnection.DialogTitle" ) ); mb.open(); } }
private void getTableName() { DatabaseMeta inf = null; // New class: SelectTableDialog int connr = wConnection.getSelectionIndex(); if ( connr >= 0 ) { inf = transMeta.getDatabase( connr ); } if ( inf != null ) { if ( log.isDebug() ) { logDebug( BaseMessages.getString( PKG, "UpdateDialog.Log.LookingAtConnection" ) + inf.toString() ); } DatabaseExplorerDialog std = new DatabaseExplorerDialog( shell, SWT.NONE, inf, transMeta.getDatabases() ); std.setSelectedSchemaAndTable( wSchema.getText(), wTable.getText() ); if ( std.open() ) { wSchema.setText( Const.NVL( std.getSchemaName(), "" ) ); wTable.setText( Const.NVL( std.getTableName(), "" ) ); setTableFieldCombo(); } } else { MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR ); mb.setMessage( BaseMessages.getString( PKG, "UpdateDialog.InvalidConnection.DialogMessage" ) ); mb.setText( BaseMessages.getString( PKG, "UpdateDialog.InvalidConnection.DialogTitle" ) ); mb.open(); } }