From 1c384078d8ab10e5a08612b4658a0636c044762f Mon Sep 17 00:00:00 2001 From: Nicolas Adment <39568358+nadment@users.noreply.github.com> Date: Thu, 29 Aug 2024 21:35:07 +0200 Subject: [PATCH] Cannot save web service when editing run configuration #4258 Add method addListener to MEtaSeleciionLine widget --- .../hop/www/async/AsyncWebServiceEditor.java | 15 ++++++++------- .../hop/ui/core/widget/MetaSelectionLine.java | 8 +++++++- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/plugins/misc/async/src/main/java/org/apache/hop/www/async/AsyncWebServiceEditor.java b/plugins/misc/async/src/main/java/org/apache/hop/www/async/AsyncWebServiceEditor.java index e5ad501eb15..6504f010eb8 100644 --- a/plugins/misc/async/src/main/java/org/apache/hop/www/async/AsyncWebServiceEditor.java +++ b/plugins/misc/async/src/main/java/org/apache/hop/www/async/AsyncWebServiceEditor.java @@ -36,13 +36,13 @@ import org.apache.hop.workflow.WorkflowMeta; import org.apache.hop.workflow.config.WorkflowRunConfiguration; import org.eclipse.swt.SWT; -import org.eclipse.swt.events.ModifyListener; import org.eclipse.swt.layout.FormAttachment; import org.eclipse.swt.layout.FormData; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Listener; import org.eclipse.swt.widgets.Text; /** @@ -227,12 +227,13 @@ public void createControl(Composite parent) { setWidgetsContent(); // Add listener to detect change after loading data - ModifyListener lsMod = e -> setChanged(); - wName.addModifyListener(lsMod); - wEnabled.addListener(SWT.Selection, e -> setChanged()); - wFilename.addModifyListener(lsMod); - wStatusVars.addModifyListener(lsMod); - wContentVar.addModifyListener(lsMod); + Listener lsMod = e -> setChanged(); + wName.addListener(SWT.Modify, lsMod); + wEnabled.addListener(SWT.Selection, lsMod); + wFilename.addListener(SWT.Modify, lsMod); + wRunConfiguration.addListener(SWT.Modify, lsMod); + wStatusVars.addListener(SWT.Modify, lsMod); + wContentVar.addListener(SWT.Modify, lsMod); } /** diff --git a/ui/src/main/java/org/apache/hop/ui/core/widget/MetaSelectionLine.java b/ui/src/main/java/org/apache/hop/ui/core/widget/MetaSelectionLine.java index 340f57cc021..7084a74dcc0 100644 --- a/ui/src/main/java/org/apache/hop/ui/core/widget/MetaSelectionLine.java +++ b/ui/src/main/java/org/apache/hop/ui/core/widget/MetaSelectionLine.java @@ -52,6 +52,7 @@ import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Listener; import org.eclipse.swt.widgets.ToolBar; /** @@ -184,7 +185,7 @@ public MetaSelectionLine( metadata.image(), (int) (ConstUi.SMALL_ICON_SIZE * props.getZoomFactor()), (int) (ConstUi.SMALL_ICON_SIZE * props.getZoomFactor())); - addListener(SWT.Dispose, e -> editImage.dispose()); + super.addListener(SWT.Dispose, e -> editImage.dispose()); // Toolbar for default actions // @@ -384,6 +385,11 @@ public void addToConnectionLine( setLayoutData(fdConnection); } + @Override + public void addListener(int eventTYpe, Listener listener) { + wCombo.addListener(eventTYpe, listener); + } + public void addModifyListener(ModifyListener lsMod) { wCombo.addModifyListener(lsMod); }