1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-24 09:25:31 +02:00

"Show Debugger Console" action.

This commit is contained in:
Mikhail Khodjaiants 2002-10-23 19:01:55 +00:00
parent 35da5932ef
commit 7c1f24d612
9 changed files with 120 additions and 3 deletions

View file

@ -1,3 +1,11 @@
2002-10-23 Mikhail Khodjaiants
"Show Debugger Console" action.
Action images:
debugger_console.gif (clcl, dlcl, elcl);
* DebuggerConsoleActionDelegate.java: implementation of action delegate.
* plugin.xml: action extenions
* plugin.properties: action label and tooltip text.
2002-10-22 Mikhail Khodjaiants
Implementation of the "Show ASCII" action.
Action images:

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 158 B

After

Width:  |  Height:  |  Size: 158 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 161 B

After

Width:  |  Height:  |  Size: 158 B

View file

@ -23,6 +23,9 @@ RestartAction.tooltip=Restart
SwitchToDisassemblyAction.label=Disassembly Mode
SwitchToDisassemblyAction.tooltip=Disassembly Mode On/Off
ShowDebuggerConsoleAction.label=Show Debugger Console
ShowDebuggerConsoleAction.tooltip=Show Debugger Console On Target Selection
AddBreakpoint.label=Add/Remove &Breakpoint
EnableBreakpoint.label=T&oggle Breakpoint
BreakpointProperties.label=Breakpoint P&roperties...

View file

@ -237,6 +237,21 @@
</pluginState>
</enablement>
</action>
<action
class="org.eclipse.cdt.debug.internal.ui.actions.DebuggerConsoleActionDelegate"
enablesFor="1"
label="%ShowDebuggerConsoleAction.label"
menubarPath="renderGroup"
helpContextId="show_debugger_console_action_context"
icon="icons/full/clcl16/debugger_console.gif"
id="org.eclipse.cdt.debug.internal.ui.actions.DebuggerConsoleActionDelegate">
<enablement>
<pluginState
value="activated"
id="org.eclipse.cdt.debug.ui">
</pluginState>
</enablement>
</action>
</viewerContribution>
<viewerContribution
targetID="#CEditorRulerContext"
@ -355,14 +370,14 @@
tooltip="%RestartAction.tooltip">
</action>
<action
label="%ShowFullPathsAction.label"
toolbarPath="renderGroup"
id="org.eclipse.cdt.debug.internal.ui.actions.ShowFullPathsAction"
disabledIcon="icons/full/dlcl16/show_paths.gif"
toolbarPath="renderGroup"
hoverIcon="icons/full/clcl16/show_paths.gif"
class="org.eclipse.cdt.debug.internal.ui.actions.ShowFullPathsAction"
disabledIcon="icons/full/dlcl16/show_paths.gif"
icon="icons/full/elcl16/show_parents.gif"
helpContextId="show_full_paths_action_context"
label="%ShowFullPathsAction.label"
tooltip="%ShowFullPathsAction.tooltip">
</action>
<action
@ -377,6 +392,18 @@
label="%SwitchToDisassemblyAction.label"
tooltip="%SwitchToDisassemblyAction.tooltip">
</action>
<action
toolbarPath="renderGroup"
id="org.eclipse.cdt.debug.internal.ui.actions.DebuggerConsoleActionDelegate"
hoverIcon="icons/full/clcl16/debugger_console.gif"
class="org.eclipse.cdt.debug.internal.ui.actions.DebuggerConsoleActionDelegate"
disabledIcon="icons/full/dlcl16/debugger_console.gif"
enablesFor="1"
icon="icons/full/elcl16/debugger_console.gif"
helpContextId="show_debugger_console_action_context"
label="%ShowDebuggerConsoleAction.label"
tooltip="%ShowDebuggerConsoleAction.tooltip">
</action>
</viewContribution>
<viewContribution
targetID="org.eclipse.debug.ui.BreakpointView"
@ -460,6 +487,9 @@
<action
id="org.eclipse.cdt.debug.internal.ui.actions.SwitchToDisassemblyActionDelegate">
</action>
<action
id="org.eclipse.cdt.debug.internal.ui.actions.DebuggerConsoleActionDelegate">
</action>
</debugActionGroup>
</extension>

View file

@ -0,0 +1,76 @@
/*
*(c) Copyright QNX Software Systems Ltd. 2002.
* All Rights Reserved.
*
*/
package org.eclipse.cdt.debug.internal.ui.actions;
import org.eclipse.cdt.debug.core.IDebuggerProcessSupport;
import org.eclipse.cdt.debug.internal.core.model.CDebugElement;
import org.eclipse.debug.core.DebugException;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
/**
* Enter type comment.
*
* @since: Oct 23, 2002
*/
public class DebuggerConsoleActionDelegate extends AbstractListenerActionDelegate
{
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.internal.ui.actions.AbstractDebugActionDelegate#doAction(Object)
*/
protected void doAction( Object element ) throws DebugException
{
if ( element != null && element instanceof CDebugElement )
{
IDebuggerProcessSupport dps = (IDebuggerProcessSupport)((CDebugElement)element).getDebugTarget().getAdapter( IDebuggerProcessSupport.class );
if ( dps != null && dps.supportsDebuggerProcess() )
{
dps.setDebuggerProcessDefault( !dps.isDebuggerProcessDefault() );
}
}
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.internal.ui.actions.AbstractDebugActionDelegate#isEnabledFor(Object)
*/
protected boolean isEnabledFor( Object element )
{
if ( element != null && element instanceof CDebugElement )
{
IDebuggerProcessSupport dps = (IDebuggerProcessSupport)((CDebugElement)element).getDebugTarget().getAdapter( IDebuggerProcessSupport.class );
return ( dps != null && dps.supportsDebuggerProcess() );
}
return false;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.internal.ui.actions.AbstractDebugActionDelegate#enableForMultiSelection()
*/
protected boolean enableForMultiSelection()
{
return false;
}
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#selectionChanged(IAction, ISelection)
*/
public void selectionChanged( IAction action, ISelection selection )
{
super.selectionChanged(action, selection);
boolean checked = false;
if ( selection != null && selection instanceof IStructuredSelection )
{
Object element = ((IStructuredSelection)selection).getFirstElement();
if ( element != null && element instanceof CDebugElement )
{
IDebuggerProcessSupport dps = (IDebuggerProcessSupport)((CDebugElement)element).getDebugTarget().getAdapter( IDebuggerProcessSupport.class );
checked = ( dps != null && dps.supportsDebuggerProcess() ) ? dps.isDebuggerProcessDefault() : false;
}
}
action.setChecked( checked );
}
}