Skip to content

Commit dde4425

Browse files
subyssurendran666eclipse-releng-boteclipse-jdt-bot
authored
Close HotCodeReplace dialog automatically when process ends (#630)
* Close popup on thread termination via DebugEventListener * Version bump(s) for 4.36 stream --------- Co-authored-by: eclipse-releng-bot <98035380+eclipse-releng-bot@users.noreply.github.com> Co-authored-by: Eclipse JDT Bot <jdt-bot@eclipse.org>
1 parent 88e6357 commit dde4425

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

org.eclipse.jdt.debug.ui/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
22
Bundle-ManifestVersion: 2
33
Bundle-Name: %pluginName
44
Bundle-SymbolicName: org.eclipse.jdt.debug.ui; singleton:=true
5-
Bundle-Version: 3.14.0.qualifier
5+
Bundle-Version: 3.14.100.qualifier
66
Bundle-Activator: org.eclipse.jdt.internal.debug.ui.JDIDebugUIPlugin
77
Bundle-Vendor: %providerName
88
Bundle-Localization: plugin

org.eclipse.jdt.debug.ui/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
</parent>
1919
<groupId>org.eclipse.jdt</groupId>
2020
<artifactId>org.eclipse.jdt.debug.ui</artifactId>
21-
<version>3.14.0-SNAPSHOT</version>
21+
<version>3.14.100-SNAPSHOT</version>
2222
<packaging>eclipse-plugin</packaging>
2323
<properties>
2424
<defaultSigning-excludeInnerJars>true</defaultSigning-excludeInnerJars>

org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/HotCodeReplaceErrorDialog.java

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,15 @@
1414
package org.eclipse.jdt.internal.debug.ui;
1515

1616
import org.eclipse.core.runtime.IStatus;
17+
import org.eclipse.debug.core.DebugEvent;
1718
import org.eclipse.debug.core.DebugException;
19+
import org.eclipse.debug.core.DebugPlugin;
20+
import org.eclipse.debug.core.IDebugEventSetListener;
1821
import org.eclipse.debug.core.ILaunch;
1922
import org.eclipse.debug.core.ILaunchConfiguration;
2023
import org.eclipse.debug.core.model.IDebugTarget;
2124
import org.eclipse.debug.ui.DebugUITools;
25+
import org.eclipse.jdt.internal.debug.core.model.JDIThread;
2226
import org.eclipse.jface.dialogs.IDialogConstants;
2327
import org.eclipse.jface.preference.IPreferenceStore;
2428
import org.eclipse.osgi.util.NLS;
@@ -29,14 +33,15 @@
2933
import org.eclipse.swt.layout.GridData;
3034
import org.eclipse.swt.widgets.Button;
3135
import org.eclipse.swt.widgets.Composite;
36+
import org.eclipse.swt.widgets.Display;
3237
import org.eclipse.swt.widgets.Shell;
3338

3439
/**
3540
* An error dialog reporting a problem with a debug
3641
* target which gives the user the option to continue
3742
* or terminate/disconnect or restart the target.
3843
*/
39-
public class HotCodeReplaceErrorDialog extends ErrorDialogWithToggle {
44+
public class HotCodeReplaceErrorDialog extends ErrorDialogWithToggle implements IDebugEventSetListener {
4045

4146
protected IDebugTarget target;
4247
// The IDs of the buttons. Set to the sum of the other possible IDs generated by
@@ -53,6 +58,7 @@ public class HotCodeReplaceErrorDialog extends ErrorDialogWithToggle {
5358
public HotCodeReplaceErrorDialog(Shell parentShell, String dialogTitle, String message, IStatus status, String preferenceKey, String toggleMessage, String toggleMessage2, IPreferenceStore store, IDebugTarget target) {
5459
super(parentShell, dialogTitle, message, status, preferenceKey, toggleMessage, toggleMessage2, store);
5560
this.target = target;
61+
DebugPlugin.getDefault().addDebugEventListener(this);
5662
}
5763

5864
/* (non-Javadoc)
@@ -149,4 +155,16 @@ public void run() {
149155
super.buttonPressed(id, target);
150156
}
151157
}
158+
159+
@Override
160+
public void handleDebugEvents(DebugEvent[] events) {
161+
for (DebugEvent event : events) {
162+
if (event.getSource() instanceof JDIThread de) {
163+
if (de.isTerminated()) {
164+
Display.getDefault().asyncExec(() -> this.close());
165+
}
166+
}
167+
}
168+
169+
}
152170
}

0 commit comments

Comments
 (0)