Search in sources :

Example 26 with MessageDialogWithToggle

use of org.eclipse.jface.dialogs.MessageDialogWithToggle in project pentaho-kettle by pentaho.

the class JobGraph method editEntryParallel.

/**
 * Go from serial to parallel to serial execution
 */
public void editEntryParallel() {
    JobEntryCopy je = getJobEntry();
    JobEntryCopy jeOld = (JobEntryCopy) je.clone_deep();
    je.setLaunchingInParallel(!je.isLaunchingInParallel());
    JobEntryCopy jeNew = (JobEntryCopy) je.clone_deep();
    spoon.addUndoChange(jobMeta, new JobEntryCopy[] { jeOld }, new JobEntryCopy[] { jeNew }, new int[] { jobMeta.indexOfJobEntry(jeNew) });
    jobMeta.setChanged();
    if (getJobEntry().isLaunchingInParallel()) {
        // 
        if ("Y".equalsIgnoreCase(spoon.props.getCustomParameter(STRING_PARALLEL_WARNING_PARAMETER, "Y"))) {
            MessageDialogWithToggle md = new MessageDialogWithToggle(shell, BaseMessages.getString(PKG, "JobGraph.ParallelJobEntriesWarning.DialogTitle"), null, BaseMessages.getString(PKG, "JobGraph.ParallelJobEntriesWarning.DialogMessage", Const.CR) + Const.CR, MessageDialog.WARNING, new String[] { BaseMessages.getString(PKG, "JobGraph.ParallelJobEntriesWarning.Option1") }, 0, BaseMessages.getString(PKG, "JobGraph.ParallelJobEntriesWarning.Option2"), "N".equalsIgnoreCase(spoon.props.getCustomParameter(STRING_PARALLEL_WARNING_PARAMETER, "Y")));
            MessageDialogWithToggle.setDefaultImage(GUIResource.getInstance().getImageSpoon());
            md.open();
            spoon.props.setCustomParameter(STRING_PARALLEL_WARNING_PARAMETER, md.getToggleState() ? "N" : "Y");
            spoon.props.saveProps();
        }
    }
    spoon.refreshGraph();
}
Also used : JobEntryCopy(org.pentaho.di.job.entry.JobEntryCopy) MessageDialogWithToggle(org.eclipse.jface.dialogs.MessageDialogWithToggle)

Example 27 with MessageDialogWithToggle

use of org.eclipse.jface.dialogs.MessageDialogWithToggle in project pentaho-kettle by pentaho.

the class SetVariableDialog method ok.

private void ok() {
    if (Utils.isEmpty(wStepname.getText())) {
        return;
    }
    // return value
    stepname = wStepname.getText();
    int count = wFields.nrNonEmpty();
    input.allocate(count);
    // CHECKSTYLE:Indentation:OFF
    for (int i = 0; i < count; i++) {
        TableItem item = wFields.getNonEmpty(i);
        input.getFieldName()[i] = item.getText(1);
        input.getVariableName()[i] = item.getText(2);
        input.getVariableType()[i] = SetVariableMeta.getVariableType(item.getText(3));
        input.getDefaultValue()[i] = item.getText(4);
    }
    input.setUsingFormatting(wFormat.getSelection());
    // 
    if ("Y".equalsIgnoreCase(props.getCustomParameter(STRING_USAGE_WARNING_PARAMETER, "Y"))) {
        MessageDialogWithToggle md = new MessageDialogWithToggle(shell, BaseMessages.getString(PKG, "SetVariableDialog.UsageWarning.DialogTitle"), null, BaseMessages.getString(PKG, "SetVariableDialog.UsageWarning.DialogMessage", Const.CR) + Const.CR, MessageDialog.WARNING, new String[] { BaseMessages.getString(PKG, "SetVariableDialog.UsageWarning.Option1") }, 0, BaseMessages.getString(PKG, "SetVariableDialog.UsageWarning.Option2"), "N".equalsIgnoreCase(props.getCustomParameter(STRING_USAGE_WARNING_PARAMETER, "Y")));
        MessageDialogWithToggle.setDefaultImage(GUIResource.getInstance().getImageSpoon());
        md.open();
        props.setCustomParameter(STRING_USAGE_WARNING_PARAMETER, md.getToggleState() ? "N" : "Y");
        props.saveProps();
    }
    dispose();
}
Also used : TableItem(org.eclipse.swt.widgets.TableItem) MessageDialogWithToggle(org.eclipse.jface.dialogs.MessageDialogWithToggle)

Example 28 with MessageDialogWithToggle

use of org.eclipse.jface.dialogs.MessageDialogWithToggle in project pentaho-kettle by pentaho.

the class MergeJoinDialog method ok.

private void ok() {
    if (Utils.isEmpty(wStepname.getText())) {
        return;
    }
    getMeta(input);
    // 
    if ("Y".equalsIgnoreCase(props.getCustomParameter(STRING_SORT_WARNING_PARAMETER, "Y"))) {
        MessageDialogWithToggle md = new MessageDialogWithToggle(shell, BaseMessages.getString(PKG, "MergeJoinDialog.InputNeedSort.DialogTitle"), null, BaseMessages.getString(PKG, "MergeJoinDialog.InputNeedSort.DialogMessage", Const.CR) + Const.CR, MessageDialog.WARNING, new String[] { BaseMessages.getString(PKG, "MergeJoinDialog.InputNeedSort.Option1") }, 0, BaseMessages.getString(PKG, "MergeJoinDialog.InputNeedSort.Option2"), "N".equalsIgnoreCase(props.getCustomParameter(STRING_SORT_WARNING_PARAMETER, "Y")));
        MessageDialogWithToggle.setDefaultImage(GUIResource.getInstance().getImageSpoon());
        md.open();
        props.setCustomParameter(STRING_SORT_WARNING_PARAMETER, md.getToggleState() ? "N" : "Y");
        props.saveProps();
    }
    // return value
    stepname = wStepname.getText();
    dispose();
}
Also used : MessageDialogWithToggle(org.eclipse.jface.dialogs.MessageDialogWithToggle)

Example 29 with MessageDialogWithToggle

use of org.eclipse.jface.dialogs.MessageDialogWithToggle in project pentaho-kettle by pentaho.

the class FieldsChangeSequenceDialog method ok.

private void ok() {
    if (Utils.isEmpty(wStepname.getText())) {
        return;
    }
    // return value
    stepname = wStepname.getText();
    input.setStart(wStart.getText());
    input.setIncrement(wIncrement.getText());
    input.setResultFieldName(wResult.getText());
    int nrfields = wFields.nrNonEmpty();
    input.allocate(nrfields);
    for (int i = 0; i < nrfields; i++) {
        TableItem ti = wFields.getNonEmpty(i);
        // CHECKSTYLE:Indentation:OFF
        input.getFieldName()[i] = ti.getText(1);
    }
    if ("Y".equalsIgnoreCase(props.getCustomParameter(STRING_CHANGE_SEQUENCE_WARNING_PARAMETER, "Y"))) {
        MessageDialogWithToggle md = new MessageDialogWithToggle(shell, BaseMessages.getString(PKG, "FieldsChangeSequenceDialog.InputNeedSort.DialogTitle"), null, BaseMessages.getString(PKG, "FieldsChangeSequenceDialog.InputNeedSort.DialogMessage", Const.CR) + Const.CR, MessageDialog.WARNING, new String[] { BaseMessages.getString(PKG, "FieldsChangeSequenceDialog.InputNeedSort.Option1") }, 0, BaseMessages.getString(PKG, "FieldsChangeSequenceDialog.InputNeedSort.Option2"), "N".equalsIgnoreCase(props.getCustomParameter(STRING_CHANGE_SEQUENCE_WARNING_PARAMETER, "Y")));
        MessageDialogWithToggle.setDefaultImage(GUIResource.getInstance().getImageSpoon());
        md.open();
        props.setCustomParameter(STRING_CHANGE_SEQUENCE_WARNING_PARAMETER, md.getToggleState() ? "N" : "Y");
        props.saveProps();
    }
    dispose();
}
Also used : TableItem(org.eclipse.swt.widgets.TableItem) MessageDialogWithToggle(org.eclipse.jface.dialogs.MessageDialogWithToggle)

Example 30 with MessageDialogWithToggle

use of org.eclipse.jface.dialogs.MessageDialogWithToggle in project pentaho-kettle by pentaho.

the class DenormaliserDialog method ok.

private void ok() {
    if (Utils.isEmpty(wStepname.getText())) {
        return;
    }
    int sizegroup = wGroup.nrNonEmpty();
    int nrfields = wTarget.nrNonEmpty();
    input.setKeyField(wKeyField.getText());
    input.allocate(sizegroup, nrfields);
    for (int i = 0; i < sizegroup; i++) {
        TableItem item = wGroup.getNonEmpty(i);
        // CHECKSTYLE:Indentation:OFF
        input.getGroupField()[i] = item.getText(1);
    }
    for (int i = 0; i < nrfields; i++) {
        DenormaliserTargetField field = new DenormaliserTargetField();
        TableItem item = wTarget.getNonEmpty(i);
        field.setTargetName(item.getText(1));
        field.setFieldName(item.getText(2));
        field.setKeyValue(item.getText(3));
        field.setTargetType(item.getText(4));
        field.setTargetFormat(item.getText(5));
        field.setTargetLength(Const.toInt(item.getText(6), -1));
        field.setTargetPrecision(Const.toInt(item.getText(7), -1));
        field.setTargetCurrencySymbol(item.getText(8));
        field.setTargetDecimalSymbol(item.getText(9));
        field.setTargetGroupingSymbol(item.getText(10));
        field.setTargetNullString(item.getText(11));
        field.setTargetAggregationType(item.getText(12));
        // CHECKSTYLE:Indentation:OFF
        input.getDenormaliserTargetField()[i] = field;
    }
    stepname = wStepname.getText();
    if ("Y".equalsIgnoreCase(props.getCustomParameter(STRING_SORT_WARNING_PARAMETER, "Y"))) {
        MessageDialogWithToggle md = new MessageDialogWithToggle(shell, BaseMessages.getString(PKG, "DenormaliserDialog.Unpivot.DialogTitle"), null, BaseMessages.getString(PKG, "DenormaliserDialog.Unpivot.DialogMessage", Const.CR, Const.CR), MessageDialog.WARNING, new String[] { BaseMessages.getString(PKG, "DenormaliserDialog.WarningMessage.Option.1") }, 0, BaseMessages.getString(PKG, "DenormaliserDialog.WarningMessage.Option.2"), "N".equalsIgnoreCase(props.getCustomParameter(STRING_SORT_WARNING_PARAMETER, "Y")));
        MessageDialogWithToggle.setDefaultImage(GUIResource.getInstance().getImageSpoon());
        md.open();
        props.setCustomParameter(STRING_SORT_WARNING_PARAMETER, md.getToggleState() ? "N" : "Y");
        props.saveProps();
    }
    dispose();
}
Also used : DenormaliserTargetField(org.pentaho.di.trans.steps.denormaliser.DenormaliserTargetField) TableItem(org.eclipse.swt.widgets.TableItem) MessageDialogWithToggle(org.eclipse.jface.dialogs.MessageDialogWithToggle)

Aggregations

MessageDialogWithToggle (org.eclipse.jface.dialogs.MessageDialogWithToggle)66 IPreferenceStore (org.eclipse.jface.preference.IPreferenceStore)16 TableItem (org.eclipse.swt.widgets.TableItem)8 KettleExtensionPoint (org.pentaho.di.core.extension.KettleExtensionPoint)6 Point (org.pentaho.di.core.gui.Point)6 ArrayList (java.util.ArrayList)5 Shell (org.eclipse.swt.widgets.Shell)5 IOException (java.io.IOException)4 IProject (org.eclipse.core.resources.IProject)4 File (java.io.File)3 Display (org.eclipse.swt.widgets.Display)3 MessageBox (org.eclipse.swt.widgets.MessageBox)3 BackingStoreException (org.osgi.service.prefs.BackingStoreException)3 QueryEditorPart (com.cubrid.common.ui.query.editor.QueryEditorPart)2 JobFamily (com.cubrid.common.ui.spi.progress.JobFamily)2 List (java.util.List)2 Job (org.eclipse.core.runtime.jobs.Job)2 IPerspectiveDescriptor (org.eclipse.ui.IPerspectiveDescriptor)2 ConnectionContainer (org.knime.core.node.workflow.ConnectionContainer)2 WorkflowManager (org.knime.core.node.workflow.WorkflowManager)2