Search in sources :

Example 21 with DatabaseExplorerDialog

use of org.pentaho.di.ui.core.database.dialog.DatabaseExplorerDialog in project pentaho-kettle by pentaho.

the class ColumnExistsDialog method getTableName.

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();
    }
}
Also used : DatabaseMeta(org.pentaho.di.core.database.DatabaseMeta) DatabaseExplorerDialog(org.pentaho.di.ui.core.database.dialog.DatabaseExplorerDialog) MessageBox(org.eclipse.swt.widgets.MessageBox)

Example 22 with DatabaseExplorerDialog

use of org.pentaho.di.ui.core.database.dialog.DatabaseExplorerDialog in project pentaho-kettle by pentaho.

the class JobEntryWaitForSQLDialog method getTableName.

private void getTableName() {
    // New class: SelectTableDialog
    int connr = wConnection.getSelectionIndex();
    if (connr >= 0) {
        DatabaseMeta inf = jobMeta.getDatabase(connr);
        DatabaseExplorerDialog std = new DatabaseExplorerDialog(shell, SWT.NONE, inf, jobMeta.getDatabases());
        std.setSelectedSchemaAndTable(wSchemaname.getText(), wTablename.getText());
        if (std.open()) {
            wTablename.setText(Const.NVL(std.getTableName(), ""));
        }
    } else {
        MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_ERROR);
        mb.setMessage(BaseMessages.getString(PKG, "JobEntryWaitForSQL.ConnectionError2.DialogMessage"));
        mb.setText(BaseMessages.getString(PKG, "System.Dialog.Error.Title"));
        mb.open();
    }
}
Also used : DatabaseMeta(org.pentaho.di.core.database.DatabaseMeta) DatabaseExplorerDialog(org.pentaho.di.ui.core.database.dialog.DatabaseExplorerDialog) MessageBox(org.eclipse.swt.widgets.MessageBox)

Example 23 with DatabaseExplorerDialog

use of org.pentaho.di.ui.core.database.dialog.DatabaseExplorerDialog in project pentaho-kettle by pentaho.

the class MonetDBBulkLoaderDialog method getTableName.

protected void getTableName() {
    DatabaseMeta inf = null;
    // New class: SelectTableDialog
    int connr = -1;
    if (wConnection != null && wConnection.getCComboWidget() != null) {
        connr = wConnection.getCComboWidget().getSelectionIndex();
    }
    if (connr >= 0) {
        inf = transMeta.getDatabase(connr);
    }
    if (inf != null) {
        if (log.isDebug()) {
            logDebug(BaseMessages.getString(PKG, "MonetDBBulkLoaderDialog.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, "MonetDBBulkLoaderDialog.InvalidConnection.DialogMessage"));
        mb.setText(BaseMessages.getString(PKG, "MonetDBBulkLoaderDialog.InvalidConnection.DialogTitle"));
        mb.open();
    }
}
Also used : DatabaseMeta(org.pentaho.di.core.database.DatabaseMeta) DatabaseExplorerDialog(org.pentaho.di.ui.core.database.dialog.DatabaseExplorerDialog) MessageBox(org.eclipse.swt.widgets.MessageBox)

Example 24 with DatabaseExplorerDialog

use of org.pentaho.di.ui.core.database.dialog.DatabaseExplorerDialog in project pentaho-kettle by pentaho.

the class LucidDBStreamingLoaderDialog method getTableName.

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();
    }
}
Also used : DatabaseMeta(org.pentaho.di.core.database.DatabaseMeta) DatabaseExplorerDialog(org.pentaho.di.ui.core.database.dialog.DatabaseExplorerDialog) MessageBox(org.eclipse.swt.widgets.MessageBox)

Example 25 with DatabaseExplorerDialog

use of org.pentaho.di.ui.core.database.dialog.DatabaseExplorerDialog in project pentaho-kettle by pentaho.

the class JobEntryTableExistsDialog method getTableName.

private void getTableName() {
    // New class: SelectTableDialog
    int connr = wConnection.getSelectionIndex();
    if (connr >= 0) {
        DatabaseMeta inf = jobMeta.getDatabase(connr);
        DatabaseExplorerDialog std = new DatabaseExplorerDialog(shell, SWT.NONE, inf, jobMeta.getDatabases());
        std.setSelectedSchemaAndTable(wSchemaname.getText(), wTablename.getText());
        if (std.open()) {
            wSchemaname.setText(Const.NVL(std.getSchemaName(), ""));
            wTablename.setText(Const.NVL(std.getTableName(), ""));
        }
    } else {
        MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_ERROR);
        mb.setMessage(BaseMessages.getString(PKG, "System.Dialog.ConnectionError.DialogMessage"));
        mb.setText(BaseMessages.getString(PKG, "System.Dialog.Error.Title"));
        mb.open();
    }
}
Also used : DatabaseMeta(org.pentaho.di.core.database.DatabaseMeta) DatabaseExplorerDialog(org.pentaho.di.ui.core.database.dialog.DatabaseExplorerDialog) MessageBox(org.eclipse.swt.widgets.MessageBox)

Aggregations

DatabaseMeta (org.pentaho.di.core.database.DatabaseMeta)29 DatabaseExplorerDialog (org.pentaho.di.ui.core.database.dialog.DatabaseExplorerDialog)29 MessageBox (org.eclipse.swt.widgets.MessageBox)27 Database (org.pentaho.di.core.database.Database)3 KettleException (org.pentaho.di.core.exception.KettleException)3 RowMetaInterface (org.pentaho.di.core.row.RowMetaInterface)3 ValueMetaInterface (org.pentaho.di.core.row.ValueMetaInterface)3 HasDatabasesInterface (org.pentaho.di.trans.HasDatabasesInterface)1