Skip to content

Commit

Permalink
Merge pull request #2945 from bamaer/2944
Browse files Browse the repository at this point in the history
  • Loading branch information
hansva committed Jun 13, 2023
2 parents ebd9261 + 7aa638e commit 06f8b05
Show file tree
Hide file tree
Showing 21 changed files with 111 additions and 111 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,15 @@ public void applyCustomActionLogging(HopGuiWorkflowActionContext context) {
debugLevel = new ActionDebugLevel();
}

ActionDebugLevelDialog dialog = new ActionDebugLevelDialog(hopGui.getShell(), debugLevel);
ActionDebugLevelDialog dialog = new ActionDebugLevelDialog(hopGui.getDisplay().getActiveShell(), debugLevel);
if (dialog.open()) {
DebugLevelUtil.storeActionDebugLevel(
debugGroupAttributesMap, action.toString(), debugLevel);
}

workflowMeta.setChanged();
} catch (Exception e) {
new ErrorDialog(hopGui.getShell(), "Error", "Error changing action log settings", e);
new ErrorDialog(hopGui.getDisplay().getActiveShell(), "Error", "Error changing action log settings", e);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,15 @@ public void applyCustomTransformLogging(HopGuiPipelineTransformContext context)

IRowMeta inputRowMeta = pipelineMeta.getPrevTransformFields(variables, transformMeta);
TransformDebugLevelDialog dialog =
new TransformDebugLevelDialog(hopGui.getShell(), debugLevel, inputRowMeta);
new TransformDebugLevelDialog(hopGui.getDisplay().getActiveShell(), debugLevel, inputRowMeta);
if (dialog.open()) {
DebugLevelUtil.storeTransformDebugLevel(
debugGroupAttributesMap, transformMeta.getName(), debugLevel);
}

pipelineMeta.setChanged();
} catch (Exception e) {
new ErrorDialog(hopGui.getShell(), "Error", "Error changing transform log settings", e);
new ErrorDialog(hopGui.getDisplay().getActiveShell(), "Error", "Error changing transform log settings", e);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ public void menuToolsImport() {
KettleImport kettleImport = new KettleImport();
kettleImport.init(hopGui.getVariables(), hopGui.getLog());
KettleImportDialog dialog =
new KettleImportDialog(hopGui.getShell(), hopGui.getVariables(), kettleImport);
new KettleImportDialog(hopGui.getDisplay().getActiveShell(), hopGui.getVariables(), kettleImport);
dialog.open();
} catch (Exception e) {
new ErrorDialog(hopGui.getShell(), "Error", "Error importing from Kettle", e);
new ErrorDialog(hopGui.getDisplay().getActiveShell(), "Error", "Error importing from Kettle", e);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public void editProject() {
try {
Project project = projectConfig.loadProject(hopGui.getVariables());
ProjectDialog projectDialog =
new ProjectDialog(hopGui.getShell(), project, projectConfig, hopGui.getVariables(), true);
new ProjectDialog(hopGui.getDisplay().getActiveShell(), project, projectConfig, hopGui.getVariables(), true);
if (projectDialog.open() != null) {
config.addProjectConfig(projectConfig);

Expand Down Expand Up @@ -169,7 +169,7 @@ public void editProject() {
}
} catch (Exception e) {
new ErrorDialog(
hopGui.getShell(),
hopGui.getDisplay().getActiveShell(),
BaseMessages.getString(PKG, "ProjectGuiPlugin.EditProject.Error.Dialog.Header"),
BaseMessages.getString(
PKG, "ProjectGuiPlugin.EditProject.Error.Dialog.Message", projectName),
Expand All @@ -178,7 +178,7 @@ public void editProject() {
}

private boolean askAboutProjectRefresh(HopGui hopGui) {
MessageBox box = new MessageBox(hopGui.getShell(), SWT.ICON_QUESTION | SWT.YES | SWT.NO);
MessageBox box = new MessageBox(hopGui.getDisplay().getActiveShell(), SWT.ICON_QUESTION | SWT.YES | SWT.NO);
box.setText(BaseMessages.getString(PKG, "ProjectGuiPlugin.ReloadProject.Dialog.Header"));
box.setMessage(BaseMessages.getString(PKG, "ProjectGuiPlugin.ReloadProject.Dialog.Message"));
int answer = box.open();
Expand Down Expand Up @@ -282,7 +282,7 @@ public void selectProject() {
}
} catch (Exception e) {
new ErrorDialog(
hopGui.getShell(),
hopGui.getDisplay().getActiveShell(),
BaseMessages.getString(PKG, "ProjectGuiPlugin.ChangeProject.Error.Dialog.Header"),
BaseMessages.getString(
PKG, "ProjectGuiPlugin.ChangeProject.Error.Dialog.Message", projectName),
Expand Down Expand Up @@ -319,7 +319,7 @@ public void addNewProject() {
project.setParentProjectName(config.getStandardParentProject());

ProjectDialog projectDialog =
new ProjectDialog(hopGui.getShell(), project, projectConfig, variables, false);
new ProjectDialog(hopGui.getDisplay().getActiveShell(), project, projectConfig, variables, false);
String projectName = projectDialog.open();
if (projectName != null) {
config.addProjectConfig(projectConfig);
Expand All @@ -334,7 +334,7 @@ public void addNewProject() {
project.saveToFile();
} else {
// If projects exists load configuration
MessageBox box = new MessageBox(hopGui.getShell(), SWT.ICON_QUESTION | SWT.OK);
MessageBox box = new MessageBox(hopGui.getDisplay().getActiveShell(), SWT.ICON_QUESTION | SWT.OK);
box.setText(BaseMessages.getString(PKG, "ProjectGuiPlugin.ProjectExists.Dialog.Header"));
box.setMessage(
BaseMessages.getString(PKG, "ProjectGuiPlugin.ProjectExists.Dialog.Message"));
Expand Down Expand Up @@ -421,7 +421,7 @@ public void addNewProject() {

} catch (Exception e) {
new ErrorDialog(
hopGui.getShell(),
hopGui.getDisplay().getActiveShell(),
BaseMessages.getString(PKG, "ProjectGuiPlugin.AddProject.Error.Dialog.Header"),
BaseMessages.getString(PKG, "ProjectGuiPlugin.AddProject.Error.Dialog.Message"),
e);
Expand Down Expand Up @@ -553,7 +553,7 @@ public void editEnvironment() {

try {
LifecycleEnvironmentDialog dialog =
new LifecycleEnvironmentDialog(hopGui.getShell(), environment, hopGui.getVariables());
new LifecycleEnvironmentDialog(hopGui.getDisplay().getActiveShell(), environment, hopGui.getVariables());
if (dialog.open() != null) {
config.addEnvironment(environment);
ProjectsConfigSingleton.saveConfig();
Expand All @@ -573,7 +573,7 @@ public void editEnvironment() {
}
} catch (Exception e) {
new ErrorDialog(
hopGui.getShell(),
hopGui.getDisplay().getActiveShell(),
BaseMessages.getString(PKG, "ProjectGuiPlugin.EditEnvironment.Error.Dialog.Header"),
BaseMessages.getString(
PKG, "ProjectGuiPlugin.EditEnvironment.Error.Dialog.Message", environmentName),
Expand Down Expand Up @@ -619,7 +619,7 @@ public void selectEnvironment() {
}
} catch (Exception e) {
new ErrorDialog(
hopGui.getShell(),
hopGui.getDisplay().getActiveShell(),
BaseMessages.getString(PKG, "ProjectGuiPlugin.ChangeEnvironment.Error.Dialog.Header"),
BaseMessages.getString(
PKG, "ProjectGuiPlugin.ChangeEnvironment.Error.Dialog.Message", environmentName),
Expand Down Expand Up @@ -650,7 +650,7 @@ public void addNewEnvironment() {
LifecycleEnvironment environment =
new LifecycleEnvironment(null, "", projectName, new ArrayList<>());
LifecycleEnvironmentDialog dialog =
new LifecycleEnvironmentDialog(hopGui.getShell(), environment, hopGui.getVariables());
new LifecycleEnvironmentDialog(hopGui.getDisplay().getActiveShell(), environment, hopGui.getVariables());
String environmentName = dialog.open();
if (environmentName != null) {
config.addEnvironment(environment);
Expand All @@ -667,7 +667,7 @@ public void addNewEnvironment() {
}
} catch (Exception e) {
new ErrorDialog(
hopGui.getShell(),
hopGui.getDisplay().getActiveShell(),
BaseMessages.getString(PKG, "ProjectGuiPlugin.AddEnvironment.Error.Dialog.Header"),
BaseMessages.getString(PKG, "ProjectGuiPlugin.AddEnvironment.Error.Dialog.Message"),
e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public void callExtensionPoint(ILogChannel logChannelInterface, IVariables varia
logChannelInterface.logBasic("No last projects history found");
}
} catch (Exception e) {
new ErrorDialog(hopGui.getShell(), "Error", "Error initializing the Projects system", e);
new ErrorDialog(hopGui.getDisplay().getActiveShell(), "Error", "Error initializing the Projects system", e);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public void setInputDataSet(HopGuiPipelineTransformContext context) {
Collections.sort(setNames);
EnterSelectionDialog esd =
new EnterSelectionDialog(
hopGui.getShell(),
hopGui.getDisplay().getActiveShell(),
setNames.toArray(new String[setNames.size()]),
BaseMessages.getString(PKG, "TestingGuiPlugin.ContextAction.SetInputDataset.Header"),
BaseMessages.getString(
Expand All @@ -192,7 +192,7 @@ public void setInputDataSet(HopGuiPipelineTransformContext context) {
}
} catch (Exception e) {
new ErrorDialog(
hopGui.getShell(),
hopGui.getDisplay().getActiveShell(),
BaseMessages.getString(
PKG, "TestingGuiPlugin.ContextAction.SetInputDataset.Error.Header"),
BaseMessages.getString(
Expand Down Expand Up @@ -230,7 +230,7 @@ private boolean setInputDataSetOnTransform(
String[] setFieldNames = setFields.getFieldNames();

EnterMappingDialog mappingDialog =
new EnterMappingDialog(hopGui.getShell(), setFieldNames, transformFieldNames);
new EnterMappingDialog(hopGui.getDisplay().getActiveShell(), setFieldNames, transformFieldNames);
List<SourceToTargetMapping> mappings = mappingDialog.open();
if (mappings == null) {
return false;
Expand All @@ -249,7 +249,7 @@ private boolean setInputDataSetOnTransform(
}
EditRowsDialog orderDialog =
new EditRowsDialog(
hopGui.getShell(),
hopGui.getDisplay().getActiveShell(),
SWT.NONE,
BaseMessages.getString(PKG, "TestingGuiPlugin.SortOrder.Title"),
BaseMessages.getString(PKG, "TestingGuiPlugin.SortOrder.Message"),
Expand Down Expand Up @@ -330,7 +330,7 @@ public void clearInputDataSet(HopGuiPipelineTransformContext context) {
context.getPipelineGraph().updateGui();
} catch (Exception e) {
new ErrorDialog(
hopGui.getShell(),
hopGui.getDisplay().getActiveShell(),
BaseMessages.getString(
PKG, "TestingGuiPlugin.ContextAction.ClearInputDataset.Error.Header"),
BaseMessages.getString(
Expand All @@ -349,7 +349,7 @@ private boolean checkTestPresent(HopGui hopGui, PipelineMeta pipelineMeta) {
// there is no test defined of selected in the pipeline.
// Show a warning
//
MessageBox box = new MessageBox(hopGui.getShell(), SWT.OK | SWT.ICON_INFORMATION);
MessageBox box = new MessageBox(hopGui.getDisplay().getActiveShell(), SWT.OK | SWT.ICON_INFORMATION);
box.setMessage(
BaseMessages.getString(PKG, "TestingGuiPlugin.ContextAction.CheckTestPresent.Message"));
box.setText(
Expand Down Expand Up @@ -395,7 +395,7 @@ public void setGoldenDataSet(HopGuiPipelineTransformContext context) {
Collections.sort(setNames);
EnterSelectionDialog esd =
new EnterSelectionDialog(
hopGui.getShell(),
hopGui.getDisplay().getActiveShell(),
setNames.toArray(new String[setNames.size()]),
BaseMessages.getString(PKG, "TestingGuiPlugin.ContextAction.SetGoldenDataset.Header"),
BaseMessages.getString(
Expand All @@ -412,7 +412,7 @@ public void setGoldenDataSet(HopGuiPipelineTransformContext context) {
}
} catch (Exception e) {
new ErrorDialog(
hopGui.getShell(),
hopGui.getDisplay().getActiveShell(),
BaseMessages.getString(
PKG, "TestingGuiPlugin.ContextAction.SetGoldenDataset.Error.Header"),
BaseMessages.getString(
Expand Down Expand Up @@ -545,7 +545,7 @@ public void clearGoldenDataSet(HopGuiPipelineTransformContext context) {
saveUnitTest(variables, hopGui.getMetadataProvider(), currentUnitTest, pipelineMeta);
} catch (Exception e) {
new ErrorDialog(
hopGui.getShell(),
hopGui.getDisplay().getActiveShell(),
BaseMessages.getString(
PKG, "TestingGuiPlugin.ContextAction.ClearGoldenDataset.Error.Header"),
BaseMessages.getString(
Expand Down Expand Up @@ -655,7 +655,7 @@ public void createDataSetFromTransform(HopGuiPipelineTransformContext context) {
// to use it on the transform?
//
MessageBox box =
new MessageBox(hopGui.getShell(), SWT.YES | SWT.NO | SWT.CANCEL | SWT.ICON_QUESTION);
new MessageBox(hopGui.getDisplay().getActiveShell(), SWT.YES | SWT.NO | SWT.CANCEL | SWT.ICON_QUESTION);
box.setText(
BaseMessages.getString(
PKG, "TestingGuiPlugin.ContextAction.CreateDataset.DatasetType.Header"));
Expand Down Expand Up @@ -689,7 +689,7 @@ public void createDataSetFromTransform(HopGuiPipelineTransformContext context) {
}
} catch (Exception e) {
new ErrorDialog(
hopGui.getShell(),
hopGui.getDisplay().getActiveShell(),
BaseMessages.getString(PKG, "TestingGuiPlugin.ContextAction.CreateDataset.Error.Header"),
BaseMessages.getString(PKG, "TestingGuiPlugin.ContextAction.CreateDataset.Error.Message"),
e);
Expand Down Expand Up @@ -719,7 +719,7 @@ public void writeTransformDataToDataSet(HopGuiPipelineTransformContext context)
PipelineMeta pipelineMeta = context.getPipelineMeta();

if (pipelineMeta.hasChanged()) {
MessageBox box = new MessageBox(hopGui.getShell(), SWT.OK | SWT.ICON_INFORMATION);
MessageBox box = new MessageBox(hopGui.getDisplay().getActiveShell(), SWT.OK | SWT.ICON_INFORMATION);
box.setText(
BaseMessages.getString(
PKG, "TestingGuiPlugin.ContextAction.Run.SavePipelineDialog.Header"));
Expand All @@ -739,7 +739,7 @@ public void writeTransformDataToDataSet(HopGuiPipelineTransformContext context)
Collections.sort(setNames);
EnterSelectionDialog esd =
new EnterSelectionDialog(
hopGui.getShell(),
hopGui.getDisplay().getActiveShell(),
setNames.toArray(new String[setNames.size()]),
BaseMessages.getString(PKG, "TestingGuiPlugin.ContextAction.Run.ActionList.Item1"),
BaseMessages.getString(PKG, "TestingGuiPlugin.ContextAction.Run.ActionList.Item2"));
Expand All @@ -765,7 +765,7 @@ public void writeTransformDataToDataSet(HopGuiPipelineTransformContext context)
// Ask for the mapping between the output row and the data set field
//
EnterMappingDialog mappingDialog =
new EnterMappingDialog(hopGui.getShell(), transformFields, setFields);
new EnterMappingDialog(hopGui.getDisplay().getActiveShell(), transformFields, setFields);
List<SourceToTargetMapping> mapping = mappingDialog.open();
if (mapping == null) {
return;
Expand All @@ -790,7 +790,7 @@ public void writeTransformDataToDataSet(HopGuiPipelineTransformContext context)

} catch (Exception e) {
new ErrorDialog(
hopGui.getShell(),
hopGui.getDisplay().getActiveShell(),
BaseMessages.getString(PKG, "TestingGuiPlugin.ContextAction.Run.Error.Header"),
BaseMessages.getString(PKG, "TestingGuiPlugin.ContextAction.Run.Error.Message"),
e);
Expand Down Expand Up @@ -850,7 +850,7 @@ public void detachUnitTest() {
pipelineGraph.updateGui();
} catch (Exception e) {
new ErrorDialog(
hopGui.getShell(),
hopGui.getDisplay().getActiveShell(),
BaseMessages.getString(PKG, "TestingGuiPlugin.ToolbarElement.Detach.Error.Header"),
BaseMessages.getString(PKG, "TestingGuiPlugin.ToolbarElement.Detach.Error.Message"),
e);
Expand Down Expand Up @@ -935,7 +935,7 @@ public void deleteUnitTest() {
return; // doesn't exist
}

MessageBox box = new MessageBox(hopGui.getShell(), SWT.YES | SWT.NO | SWT.ICON_QUESTION);
MessageBox box = new MessageBox(hopGui.getDisplay().getActiveShell(), SWT.YES | SWT.NO | SWT.ICON_QUESTION);
box.setMessage(
BaseMessages.getString(
PKG,
Expand All @@ -960,7 +960,7 @@ public void deleteUnitTest() {
refreshUnitTestsList();
} catch (Exception e) {
new ErrorDialog(
hopGui.getShell(),
hopGui.getDisplay().getActiveShell(),
BaseMessages.getString(PKG, "TestingGuiPlugin.ToolbarElement.Delete.Error.Header"),
BaseMessages.getString(PKG, "TestingGuiPlugin.ToolbarElement.Delete.Error.Message"),
e);
Expand Down Expand Up @@ -1021,7 +1021,7 @@ public void editPipelineUnitTest() {
}
} catch (Exception e) {
new ErrorDialog(
hopGui.getShell(),
hopGui.getDisplay().getActiveShell(),
BaseMessages.getString(PKG, "TestingGuiPlugin.ToolbarElement.UnitTest.Error.Header"),
BaseMessages.getString(
PKG, "TestingGuiPlugin.ToolbarElement.UnitTest.Error.Message", unitTestName),
Expand Down Expand Up @@ -1144,7 +1144,7 @@ public void selectUnitTest() {
}
} catch (Exception e) {
new ErrorDialog(
hopGui.getShell(),
hopGui.getDisplay().getActiveShell(),
BaseMessages.getString(
PKG, "TestingGuiPlugin.ToolbarElement.GetUnitTestList.Error.Header"),
BaseMessages.getString(
Expand Down Expand Up @@ -1304,7 +1304,7 @@ private void tweakUnitTestTransform(
hopGui.getActiveFileTypeHandler().updateGui();
} catch (Exception exception) {
new ErrorDialog(
hopGui.getShell(),
hopGui.getDisplay().getActiveShell(),
BaseMessages.getString(PKG, "TestingGuiPlugin.TweakUnitTestTransform.Error.Header"),
BaseMessages.getString(
PKG,
Expand Down Expand Up @@ -1347,15 +1347,15 @@ public RowMetaAndData selectUnitTestFromAllTests() {
//
SelectRowDialog dialog =
new SelectRowDialog(
hopGui.getShell(), new Variables(), SWT.DIALOG_TRIM | SWT.MAX | SWT.RESIZE, rows);
hopGui.getDisplay().getActiveShell(), new Variables(), SWT.DIALOG_TRIM | SWT.MAX | SWT.RESIZE, rows);
RowMetaAndData selection = dialog.open();
if (selection != null) {
return selection;
}
return null;
} catch (Exception e) {
new ErrorDialog(
hopGui.getShell(),
hopGui.getDisplay().getActiveShell(),
BaseMessages.getString(PKG, "TestingGuiPlugin.SelectUnitTestFromAllTests.Error.Header"),
BaseMessages.getString(PKG, "TestingGuiPlugin.SelectUnitTestFromAllTests.Error.Message"),
e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public void callExtensionPoint(
if (inputLocation != null) {
PipelineUnitTestSetLocationDialog dialog =
new PipelineUnitTestSetLocationDialog(
hopGui.getShell(),
hopGui.getDisplay().getActiveShell(),
variables,
hopGui.getMetadataProvider(),
inputLocation,
Expand All @@ -121,7 +121,7 @@ public void callExtensionPoint(
if (goldenLocation != null) {
PipelineUnitTestSetLocationDialog dialog =
new PipelineUnitTestSetLocationDialog(
hopGui.getShell(),
hopGui.getDisplay().getActiveShell(),
variables,
hopGui.getMetadataProvider(),
goldenLocation,
Expand Down Expand Up @@ -162,7 +162,7 @@ public void callExtensionPoint(
}
}
} catch (Exception e) {
new ErrorDialog(hopGui.getShell(), "Error", "Error editing location", e);
new ErrorDialog(hopGui.getDisplay().getActiveShell(), "Error", "Error editing location", e);
}
}

Expand Down
Loading

0 comments on commit 06f8b05

Please sign in to comment.