Skip to content

Commit

Permalink
Allow to pin Debug Inspect popup
Browse files Browse the repository at this point in the history
  • Loading branch information
mickaelistria committed Jun 11, 2024
1 parent a52d6dc commit 8a033d2
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions debug/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugPopup.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.IHandler;
import org.eclipse.core.expressions.EvaluationResult;
import org.eclipse.core.expressions.Expression;
import org.eclipse.core.expressions.IEvaluationContext;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.internal.ui.views.DebugUIViewsMessages;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.dialogs.PopupDialog;
Expand All @@ -27,6 +31,7 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.ISources;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.handlers.IHandlerActivation;
Expand Down Expand Up @@ -65,7 +70,7 @@ public abstract class DebugPopup extends PopupDialog {
* the dialog, or <code>null</code>
*/
public DebugPopup(Shell parent, Point anchor, String commandId) {
super(parent, PopupDialog.INFOPOPUPRESIZE_SHELLSTYLE, true, true, false, true, false, null, null);
super(parent, PopupDialog.INFOPOPUPRESIZE_SHELLSTYLE, true, true, false, true, false, true, null, null);
fAnchor = anchor;
fCommandId = commandId;
}
Expand Down Expand Up @@ -189,7 +194,14 @@ public Object execute(ExecutionEvent event) throws ExecutionException {
};

fHandlerService = workbench.getAdapter(IHandlerService.class);
fActivation = fHandlerService.activateHandler(commandId, fCloseHandler);
fActivation = fHandlerService.activateHandler(commandId, fCloseHandler, new Expression() {
@Override
public EvaluationResult evaluate(IEvaluationContext context) throws CoreException {
return EvaluationResult.valueOf( //
context.getVariable(ISources.ACTIVE_SHELL_NAME) instanceof Shell shell //
&& shell.getData() == DebugPopup.this);
}
});
}

String infoText = getInfoText();
Expand Down

0 comments on commit 8a033d2

Please sign in to comment.