use of org.pentaho.di.ui.core.database.dialog.DatabaseExplorerDialog in project pentaho-kettle by pentaho.
the class JobEntryColumnsExistDialog 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, "JobEntryColumnsExist.ConnectionError.DialogMessage"));
mb.setText(BaseMessages.getString(PKG, "System.Dialog.Error.Title"));
mb.open();
}
}
use of org.pentaho.di.ui.core.database.dialog.DatabaseExplorerDialog in project pentaho-kettle by pentaho.
the class MySQLBulkLoaderDialog 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) {
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();
}
}
use of org.pentaho.di.ui.core.database.dialog.DatabaseExplorerDialog in project pentaho-kettle by pentaho.
the class SpoonDBDelegate method exploreDB.
/**
* return a schema, table combination from the explorer
*
* @param databaseMeta
* @param aLook
* @return schema [0] and table [1]
*/
public String[] exploreDB(DatabaseMeta databaseMeta, boolean aLook) {
List<DatabaseMeta> databases = null;
HasDatabasesInterface activeHasDatabasesInterface = spoon.getActiveHasDatabasesInterface();
if (activeHasDatabasesInterface != null) {
databases = activeHasDatabasesInterface.getDatabases();
}
DatabaseExplorerDialog std = new DatabaseExplorerDialog(spoon.getShell(), SWT.NONE, databaseMeta, databases, aLook);
std.open();
return new String[] { std.getSchemaName(), std.getTableName() };
}
use of org.pentaho.di.ui.core.database.dialog.DatabaseExplorerDialog in project pentaho-kettle by pentaho.
the class SynchronizeAfterMergeDialog 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) {
if (log.isDebug()) {
logDebug(BaseMessages.getString(PKG, "SynchronizeAfterMergeDialog.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(), ""));
wTable.setFocus();
setTableFieldCombo();
}
} else {
MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_ERROR);
mb.setMessage(BaseMessages.getString(PKG, "SynchronizeAfterMergeDialog.InvalidConnection.DialogMessage"));
mb.setText(BaseMessages.getString(PKG, "SynchronizeAfterMergeDialog.InvalidConnection.DialogTitle"));
mb.open();
}
}
use of org.pentaho.di.ui.core.database.dialog.DatabaseExplorerDialog in project pentaho-kettle by pentaho.
the class UpdateDialog 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) {
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();
}
}
Aggregations