Search in sources :

Example 1 with SQLStatementsDialog

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

the class SpoonDBDelegate method getJobSQL.

/**
 * Get & show the SQL required to run the loaded job entry...
 */
public void getJobSQL(JobMeta jobMeta) {
    GetJobSQLProgressDialog pspd = new GetJobSQLProgressDialog(spoon.getShell(), jobMeta, spoon.getRepository());
    List<SQLStatement> stats = pspd.open();
    if (stats != null) {
        if (stats.size() > 0) {
            SQLStatementsDialog ssd = new SQLStatementsDialog(spoon.getShell(), jobMeta, SWT.NONE, stats);
            ssd.open();
        } else {
            MessageBox mb = new MessageBox(spoon.getShell(), SWT.OK | SWT.ICON_INFORMATION);
            mb.setMessage(BaseMessages.getString(PKG, "Spoon.Dialog.JobNoSQLNeedEexecuted.Message"));
            mb.setText(BaseMessages.getString(PKG, "Spoon.Dialog.JobNoSQLNeedEexecuted.Title"));
            mb.open();
        }
    }
}
Also used : SQLStatementsDialog(org.pentaho.di.ui.core.dialog.SQLStatementsDialog) GetJobSQLProgressDialog(org.pentaho.di.ui.spoon.dialog.GetJobSQLProgressDialog) SQLStatement(org.pentaho.di.core.SQLStatement) MessageBox(org.eclipse.swt.widgets.MessageBox)

Example 2 with SQLStatementsDialog

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

the class SpoonDBDelegate method getTransSQL.

/**
 * Get & show the SQL required to run the loaded transformation...
 */
public void getTransSQL(TransMeta transMeta) {
    GetSQLProgressDialog pspd = new GetSQLProgressDialog(spoon.getShell(), transMeta);
    List<SQLStatement> stats = pspd.open();
    if (stats != null) {
        if (stats.size() > 0) {
            SQLStatementsDialog ssd = new SQLStatementsDialog(spoon.getShell(), Variables.getADefaultVariableSpace(), SWT.NONE, stats);
            String sn = ssd.open();
            if (sn != null) {
                StepMeta esi = transMeta.findStep(sn);
                if (esi != null) {
                    spoon.delegates.steps.editStep(transMeta, esi);
                }
            }
        } else {
            MessageBox mb = new MessageBox(spoon.getShell(), SWT.OK | SWT.ICON_INFORMATION);
            mb.setMessage(BaseMessages.getString(PKG, "Spoon.Dialog.NoSQLNeedEexecuted.Message"));
            // "SQL"
            mb.setText(BaseMessages.getString(PKG, "Spoon.Dialog.NoSQLNeedEexecuted.Title"));
            mb.open();
        }
    }
}
Also used : GetSQLProgressDialog(org.pentaho.di.ui.spoon.dialog.GetSQLProgressDialog) SQLStatementsDialog(org.pentaho.di.ui.core.dialog.SQLStatementsDialog) SQLStatement(org.pentaho.di.core.SQLStatement) StepMeta(org.pentaho.di.trans.step.StepMeta) MessageBox(org.eclipse.swt.widgets.MessageBox)

Aggregations

MessageBox (org.eclipse.swt.widgets.MessageBox)2 SQLStatement (org.pentaho.di.core.SQLStatement)2 SQLStatementsDialog (org.pentaho.di.ui.core.dialog.SQLStatementsDialog)2 StepMeta (org.pentaho.di.trans.step.StepMeta)1 GetJobSQLProgressDialog (org.pentaho.di.ui.spoon.dialog.GetJobSQLProgressDialog)1 GetSQLProgressDialog (org.pentaho.di.ui.spoon.dialog.GetSQLProgressDialog)1