Skip to content

Commit

Permalink
Cannot save web service when editing run configuration apache#4258
Browse files Browse the repository at this point in the history
Add method addListener to MEtaSeleciionLine widget
  • Loading branch information
nadment committed Aug 29, 2024
1 parent 36717fd commit 1c38407
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down Expand Up @@ -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);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down Expand Up @@ -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
//
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 1c38407

Please sign in to comment.