|
19 | 19 | import org.eclipse.core.commands.ExecutionEvent;
|
20 | 20 | import org.eclipse.core.commands.ExecutionException;
|
21 | 21 | 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; |
22 | 26 | import org.eclipse.debug.internal.ui.views.DebugUIViewsMessages;
|
23 | 27 | import org.eclipse.jface.dialogs.IDialogSettings;
|
24 | 28 | import org.eclipse.jface.dialogs.PopupDialog;
|
|
27 | 31 | import org.eclipse.swt.widgets.Composite;
|
28 | 32 | import org.eclipse.swt.widgets.Control;
|
29 | 33 | import org.eclipse.swt.widgets.Shell;
|
| 34 | +import org.eclipse.ui.ISources; |
30 | 35 | import org.eclipse.ui.IWorkbench;
|
31 | 36 | import org.eclipse.ui.PlatformUI;
|
32 | 37 | import org.eclipse.ui.handlers.IHandlerActivation;
|
@@ -65,7 +70,7 @@ public abstract class DebugPopup extends PopupDialog {
|
65 | 70 | * the dialog, or <code>null</code>
|
66 | 71 | */
|
67 | 72 | 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); |
69 | 74 | fAnchor = anchor;
|
70 | 75 | fCommandId = commandId;
|
71 | 76 | }
|
@@ -189,7 +194,14 @@ public Object execute(ExecutionEvent event) throws ExecutionException {
|
189 | 194 | };
|
190 | 195 |
|
191 | 196 | 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 | + }); |
193 | 205 | }
|
194 | 206 |
|
195 | 207 | String infoText = getInfoText();
|
|
0 commit comments