Skip to content

Commit cd4ccff

Browse files
committed
Allow to pin Debug Inspect popup
Fixes eclipse-platform/eclipse.platform.ui#1906
1 parent 5dd3036 commit cd4ccff

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

debug/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugPopup.java

+14-2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
import org.eclipse.core.commands.ExecutionEvent;
2020
import org.eclipse.core.commands.ExecutionException;
2121
import org.eclipse.core.commands.IHandler;
22+
import org.eclipse.core.expressions.EvaluationResult;
23+
import org.eclipse.core.expressions.Expression;
24+
import org.eclipse.core.expressions.IEvaluationContext;
25+
import org.eclipse.core.runtime.CoreException;
2226
import org.eclipse.debug.internal.ui.views.DebugUIViewsMessages;
2327
import org.eclipse.jface.dialogs.IDialogSettings;
2428
import org.eclipse.jface.dialogs.PopupDialog;
@@ -27,6 +31,7 @@
2731
import org.eclipse.swt.widgets.Composite;
2832
import org.eclipse.swt.widgets.Control;
2933
import org.eclipse.swt.widgets.Shell;
34+
import org.eclipse.ui.ISources;
3035
import org.eclipse.ui.IWorkbench;
3136
import org.eclipse.ui.PlatformUI;
3237
import org.eclipse.ui.handlers.IHandlerActivation;
@@ -65,7 +70,7 @@ public abstract class DebugPopup extends PopupDialog {
6570
* the dialog, or <code>null</code>
6671
*/
6772
public DebugPopup(Shell parent, Point anchor, String commandId) {
68-
super(parent, PopupDialog.INFOPOPUPRESIZE_SHELLSTYLE, true, true, false, true, false, null, null);
73+
super(parent, PopupDialog.INFOPOPUPRESIZE_SHELLSTYLE, true, true, false, true, false, true, null, null);
6974
fAnchor = anchor;
7075
fCommandId = commandId;
7176
}
@@ -189,7 +194,14 @@ public Object execute(ExecutionEvent event) throws ExecutionException {
189194
};
190195

191196
fHandlerService = workbench.getAdapter(IHandlerService.class);
192-
fActivation = fHandlerService.activateHandler(commandId, fCloseHandler);
197+
fActivation = fHandlerService.activateHandler(commandId, fCloseHandler, new Expression() {
198+
@Override
199+
public EvaluationResult evaluate(IEvaluationContext context) throws CoreException {
200+
return EvaluationResult.valueOf( //
201+
context.getVariable(ISources.ACTIVE_SHELL_NAME) instanceof Shell shell //
202+
&& shell.getData() == DebugPopup.this);
203+
}
204+
});
193205
}
194206

195207
String infoText = getInfoText();

0 commit comments

Comments
 (0)