Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restrict Pin View and Open View to active CPP debug context. #1049

Merged
merged 1 commit into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
182 changes: 112 additions & 70 deletions debug/org.eclipse.cdt.debug.ui/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -718,76 +718,6 @@
helpContextId="add_line_breakpoint_action_context"
tooltip="%AddLineBreakpoint.tooltip"/>
</viewContribution>
<viewContribution
targetID="org.eclipse.debug.ui.RegisterView"
id="org.eclipse.debug.ui.registersView.toolbar">
<menu
label="%Dummy"
id="org.eclipse.cdt.debug.ui.refresh">
<separator name="refreshGroup"/>
<separator name="emptyRefreshGroup"/>
</menu>
</viewContribution>
<viewContribution
id="org.eclipse.cdt.debug.ui.expression.toolbar"
targetID="org.eclipse.debug.ui.ExpressionView">
<action
class="org.eclipse.cdt.debug.internal.ui.actions.PinDebugContextActionDelegate"
icon="icons/elcl16/toolbar_pinned.gif"
id="org.eclipse.pinclone.expression.pinDebugContext"
label="%PinView.name "
style="toggle"
toolbarPath="pinGroup">
</action>
<action
class="org.eclipse.cdt.debug.internal.ui.actions.OpenNewViewActionDelegate"
icon="icons/elcl16/open_new.gif"
id="org.eclipse.pinclone.expression.clone"
label="%OpenNewView.name"
style="push"
toolbarPath="pinGroup">
</action>
</viewContribution>
<viewContribution
id="org.eclipse.cdt.debug.ui.variable.toolbar"
targetID="org.eclipse.debug.ui.VariableView">
<action
class="org.eclipse.cdt.debug.internal.ui.actions.PinDebugContextActionDelegate"
icon="icons/elcl16/toolbar_pinned.gif"
id="org.eclipse.pinclone.variable.pinDebugContext"
label="%PinView.name "
style="toggle"
toolbarPath="pinGroup">
</action>
<action
class="org.eclipse.cdt.debug.internal.ui.actions.OpenNewViewActionDelegate"
icon="icons/elcl16/open_new.gif"
id="org.eclipse.pinclone.variable.clone"
label="%OpenNewView.name"
style="push"
toolbarPath="pinGroup">
</action>
</viewContribution>
<viewContribution
id="org.eclipse.cdt.debug.ui.register.toolbar"
targetID="org.eclipse.debug.ui.RegisterView">
<action
class="org.eclipse.cdt.debug.internal.ui.actions.PinDebugContextActionDelegate"
icon="icons/elcl16/toolbar_pinned.gif"
id="org.eclipse.pinclone.register.pinDebugContext"
label="%PinView.name "
style="toggle"
toolbarPath="pinGroup">
</action>
<action
class="org.eclipse.cdt.debug.internal.ui.actions.OpenNewViewActionDelegate"
icon="icons/elcl16/open_new.gif"
id="org.eclipse.pinclone.register.clone"
label="%OpenNewView.name"
style="push"
toolbarPath="pinGroup">
</action>
</viewContribution>
</extension>
<extension
point="org.eclipse.ui.editorActions">
Expand Down Expand Up @@ -1402,6 +1332,102 @@
</visibleWhen>
</command>
</menuContribution>
<menuContribution
allPopups="false"
locationURI="toolbar:org.eclipse.debug.ui.VariableView?after=additions">
<separator
name="org.eclipse.cdt.debug.ui.pinGroup"
visible="true">
</separator>
<command
commandId="org.eclipse.cdt.debug.ui.PinViewCommand"
icon="icons/elcl16/toolbar_pinned.gif"
label="%PinView.name "
style="toggle">
<visibleWhen
checkEnabled="false">
<test
property="org.eclipse.cdt.dsf.ui.canPinViewEnabled">
</test>
</visibleWhen>
</command>
<command
commandId="org.eclipse.cdt.debug.ui.OpenNewViewCommand"
icon="icons/elcl16/open_new.gif"
label="%OpenNewView.name"
style="push">
<visibleWhen
checkEnabled="false">
<test
property="org.eclipse.cdt.dsf.ui.canPinViewEnabled">
</test>
</visibleWhen>
</command>
</menuContribution>
<menuContribution
allPopups="false"
locationURI="toolbar:org.eclipse.debug.ui.ExpressionView?after=additions">
<separator
name="org.eclipse.cdt.debug.ui.pinGroup"
visible="true">
</separator>
<command
commandId="org.eclipse.cdt.debug.ui.PinViewCommand"
icon="icons/elcl16/toolbar_pinned.gif"
label="%PinView.name "
style="toggle">
<visibleWhen
checkEnabled="false">
<test
property="org.eclipse.cdt.dsf.ui.canPinViewEnabled">
</test>
</visibleWhen>
</command>
<command
commandId="org.eclipse.cdt.debug.ui.OpenNewViewCommand"
icon="icons/elcl16/open_new.gif"
label="%OpenNewView.name"
style="push">
<visibleWhen
checkEnabled="false">
<test
property="org.eclipse.cdt.dsf.ui.canPinViewEnabled">
</test>
</visibleWhen>
</command>
</menuContribution>
<menuContribution
allPopups="false"
locationURI="toolbar:org.eclipse.debug.ui.RegisterView?after=additions">
<separator
name="org.eclipse.cdt.debug.ui.pinGroup"
visible="true">
</separator>
<command
commandId="org.eclipse.cdt.debug.ui.PinViewCommand"
icon="icons/elcl16/toolbar_pinned.gif"
label="%PinView.name "
style="toggle">
<visibleWhen
checkEnabled="false">
<test
property="org.eclipse.cdt.dsf.ui.canPinViewEnabled">
</test>
</visibleWhen>
</command>
<command
commandId="org.eclipse.cdt.debug.ui.OpenNewViewCommand"
icon="icons/elcl16/open_new.gif"
label="%OpenNewView.name"
style="push">
<visibleWhen
checkEnabled="false">
<test
property="org.eclipse.cdt.dsf.ui.canPinViewEnabled">
</test>
</visibleWhen>
</command>
</menuContribution>

</extension>
<extension
Expand Down Expand Up @@ -1689,6 +1715,14 @@
id="org.eclipse.ui.commands.toggleState">
</state>
</command>
<command
id="org.eclipse.cdt.debug.ui.PinViewCommand"
name="%PinView.name ">
</command>
<command
id="org.eclipse.cdt.debug.ui.OpenNewViewCommand"
name="%OpenNewView.name">
</command>
</extension>
<extension
point="org.eclipse.ui.handlers">
Expand Down Expand Up @@ -1771,6 +1805,14 @@
class="org.eclipse.cdt.debug.internal.ui.commands.ToggleInstructionStepModeHandler"
commandId="org.eclipse.cdt.debug.internal.ui.actions.ToggleInstructionStepModeCommand">
</handler>
<handler
class="org.eclipse.cdt.debug.internal.ui.actions.PinViewHandler"
commandId="org.eclipse.cdt.debug.ui.PinViewCommand">
</handler>
<handler
class="org.eclipse.cdt.debug.internal.ui.actions.OpenNewViewHandler"
commandId="org.eclipse.cdt.debug.ui.OpenNewViewCommand">
</handler>
</extension>
<extension
point="org.eclipse.core.expressions.definitions">
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*******************************************************************************
* Copyright (c) 2010, 2014 Texas Instruments and others
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Patrick Chuong (Texas Instruments) - Initial implementation of run()
* Marc Dumais (Ericsson) - Bug 437692
* Raghunandana Murthappa(Advantest Europe GmbH) - Issue 1048
*******************************************************************************/
package org.eclipse.cdt.debug.internal.ui.actions;

import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.handlers.HandlerUtil;

/**
* Handler that opens the new View of the view type selected. This is used by
* the OpenNewViewCommand which is contributed to debug related views.
*/
public class OpenNewViewHandler extends AbstractHandler {
private OpenNewViewAction fOpenNewViewAction = new OpenNewViewAction();

@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
IViewPart viewPart = (IViewPart) HandlerUtil.getActivePart(event);
fOpenNewViewAction.init(viewPart);
fOpenNewViewAction.run();

return IStatus.OK;
}

}
Loading
Loading