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();
}
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();
}
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();
}
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();
}
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();
}
Aggregations