mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-23 17:05:26 +02:00
Removed the "Show Debugger Console" action.
This commit is contained in:
parent
070f6eb80f
commit
f522b709fd
4 changed files with 6 additions and 329 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2004-04-07 Mikhail Khodjaiants
|
||||||
|
Removed the "Show Debugger Console" action.
|
||||||
|
* DebuggerConsoleActionDelegate.java
|
||||||
|
* ToggelDelegateAction.java
|
||||||
|
* plugin.xml
|
||||||
|
|
||||||
2004-04-02 Mikhail Khodjaiants
|
2004-04-02 Mikhail Khodjaiants
|
||||||
Removed dependency to xerces.
|
Removed dependency to xerces.
|
||||||
* DefaultSourceLocator.java
|
* DefaultSourceLocator.java
|
||||||
|
|
|
@ -308,22 +308,6 @@
|
||||||
</pluginState>
|
</pluginState>
|
||||||
</enablement>
|
</enablement>
|
||||||
</action>
|
</action>
|
||||||
<action
|
|
||||||
label="%ShowDebuggerConsoleAction.label"
|
|
||||||
style="toggle"
|
|
||||||
icon="icons/full/clcl16/debugger_console.gif"
|
|
||||||
helpContextId="show_debugger_console_action_context"
|
|
||||||
class="org.eclipse.cdt.debug.internal.ui.actions.DebuggerConsoleActionDelegate"
|
|
||||||
menubarPath="renderGroup"
|
|
||||||
enablesFor="1"
|
|
||||||
id="org.eclipse.cdt.debug.internal.ui.actions.DebuggerConsoleActionDelegate">
|
|
||||||
<enablement>
|
|
||||||
<pluginState
|
|
||||||
value="activated"
|
|
||||||
id="org.eclipse.cdt.debug.ui">
|
|
||||||
</pluginState>
|
|
||||||
</enablement>
|
|
||||||
</action>
|
|
||||||
</viewerContribution>
|
</viewerContribution>
|
||||||
<viewerContribution
|
<viewerContribution
|
||||||
targetID="#CEditorRulerContext"
|
targetID="#CEditorRulerContext"
|
||||||
|
@ -927,25 +911,6 @@
|
||||||
</pluginState>
|
</pluginState>
|
||||||
</enablement>
|
</enablement>
|
||||||
</action>
|
</action>
|
||||||
<action
|
|
||||||
style="toggle"
|
|
||||||
id="org.eclipse.cdt.debug.internal.ui.actions.DebuggerConsoleActionDelegate"
|
|
||||||
toolbarPath="renderGroup"
|
|
||||||
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">
|
|
||||||
<enablement>
|
|
||||||
<pluginState
|
|
||||||
value="activated"
|
|
||||||
id="org.eclipse.cdt.debug.ui">
|
|
||||||
</pluginState>
|
|
||||||
</enablement>
|
|
||||||
</action>
|
|
||||||
</viewContribution>
|
</viewContribution>
|
||||||
<viewContribution
|
<viewContribution
|
||||||
targetID="org.eclipse.debug.ui.DebugView"
|
targetID="org.eclipse.debug.ui.DebugView"
|
||||||
|
@ -1146,9 +1111,6 @@
|
||||||
<action
|
<action
|
||||||
id="org.eclipse.cdt.debug.internal.ui.actions.SwitchToDisassemblyActionDelegate">
|
id="org.eclipse.cdt.debug.internal.ui.actions.SwitchToDisassemblyActionDelegate">
|
||||||
</action>
|
</action>
|
||||||
<action
|
|
||||||
id="org.eclipse.cdt.debug.internal.ui.actions.DebuggerConsoleActionDelegate">
|
|
||||||
</action>
|
|
||||||
<action
|
<action
|
||||||
id="org.eclipse.cdt.debug.internal.ui.actions.AddGlobalsActionDelegate">
|
id="org.eclipse.cdt.debug.internal.ui.actions.AddGlobalsActionDelegate">
|
||||||
</action>
|
</action>
|
||||||
|
|
|
@ -1,105 +0,0 @@
|
||||||
/*
|
|
||||||
*(c) Copyright QNX Software Systems Ltd. 2002.
|
|
||||||
* All Rights Reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
package org.eclipse.cdt.debug.internal.ui.actions;
|
|
||||||
|
|
||||||
import org.eclipse.cdt.debug.core.model.IDebuggerProcessSupport;
|
|
||||||
import org.eclipse.cdt.debug.internal.core.model.CDebugElement;
|
|
||||||
import org.eclipse.debug.core.DebugEvent;
|
|
||||||
import org.eclipse.debug.core.DebugException;
|
|
||||||
import org.eclipse.debug.ui.AbstractDebugView;
|
|
||||||
import org.eclipse.jface.action.IAction;
|
|
||||||
import org.eclipse.jface.viewers.ISelection;
|
|
||||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
|
||||||
import org.eclipse.jface.viewers.Viewer;
|
|
||||||
import org.eclipse.ui.IViewPart;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Enter type comment.
|
|
||||||
*
|
|
||||||
* @since: Oct 23, 2002
|
|
||||||
*/
|
|
||||||
public class DebuggerConsoleActionDelegate extends AbstractListenerActionDelegate
|
|
||||||
{
|
|
||||||
private IViewPart fViewPart = null;
|
|
||||||
|
|
||||||
/* (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 && getAction() != null && getAction().isEnabled() )
|
|
||||||
{
|
|
||||||
IDebuggerProcessSupport dps = (IDebuggerProcessSupport)((CDebugElement)element).getDebugTarget().getAdapter( IDebuggerProcessSupport.class );
|
|
||||||
if ( dps != null && dps.supportsDebuggerProcess() )
|
|
||||||
{
|
|
||||||
dps.setDebuggerProcessDefault( getAction().isChecked() );
|
|
||||||
((CDebugElement)element).fireChangeEvent( DebugEvent.CLIENT_REQUEST );
|
|
||||||
if ( fViewPart != null && fViewPart instanceof AbstractDebugView )
|
|
||||||
{
|
|
||||||
final AbstractDebugView view = (AbstractDebugView)fViewPart;
|
|
||||||
fViewPart.getViewSite().getShell().getDisplay().asyncExec(
|
|
||||||
new Runnable()
|
|
||||||
{
|
|
||||||
public void run()
|
|
||||||
{
|
|
||||||
Viewer viewer = view.getViewer();
|
|
||||||
viewer.setSelection( viewer.getSelection() );
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (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 );
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.ui.IViewActionDelegate#init(IViewPart)
|
|
||||||
*/
|
|
||||||
public void init( IViewPart view )
|
|
||||||
{
|
|
||||||
super.init( view );
|
|
||||||
fViewPart = view;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,186 +0,0 @@
|
||||||
/*
|
|
||||||
*(c) Copyright QNX Software Systems Ltd. 2002.
|
|
||||||
* All Rights Reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
package org.eclipse.cdt.debug.internal.ui.actions;
|
|
||||||
|
|
||||||
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
|
|
||||||
import org.eclipse.debug.ui.IDebugView;
|
|
||||||
import org.eclipse.jface.action.IAction;
|
|
||||||
import org.eclipse.jface.util.IPropertyChangeListener;
|
|
||||||
import org.eclipse.jface.util.PropertyChangeEvent;
|
|
||||||
import org.eclipse.jface.viewers.ISelection;
|
|
||||||
import org.eclipse.jface.viewers.StructuredViewer;
|
|
||||||
import org.eclipse.ui.IPartListener;
|
|
||||||
import org.eclipse.ui.IViewActionDelegate;
|
|
||||||
import org.eclipse.ui.IViewPart;
|
|
||||||
import org.eclipse.ui.IWorkbenchPart;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* A generic Toggle view action delegate, meant to be subclassed to provide
|
|
||||||
* a specific filter.
|
|
||||||
*
|
|
||||||
* @since Oct 4, 2002
|
|
||||||
*/
|
|
||||||
public abstract class ToggleDelegateAction implements IViewActionDelegate,
|
|
||||||
IPropertyChangeListener,
|
|
||||||
IPartListener
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* The viewer that this action works for
|
|
||||||
*/
|
|
||||||
private StructuredViewer fViewer;
|
|
||||||
|
|
||||||
private IViewPart fView;
|
|
||||||
|
|
||||||
protected String fId = ""; //$NON-NLS-1$
|
|
||||||
|
|
||||||
private IAction fAction;
|
|
||||||
private boolean fNeedsInitialization = true;
|
|
||||||
|
|
||||||
protected void dispose()
|
|
||||||
{
|
|
||||||
if ( fView != null )
|
|
||||||
{
|
|
||||||
fView.getViewSite().getPage().removePartListener( this );
|
|
||||||
}
|
|
||||||
CDebugUIPlugin.getDefault().getPreferenceStore().removePropertyChangeListener( this );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @see IViewActionDelegate#init(IViewPart)
|
|
||||||
*/
|
|
||||||
public void init( IViewPart view )
|
|
||||||
{
|
|
||||||
setView( view );
|
|
||||||
initActionId();
|
|
||||||
IDebugView adapter = (IDebugView)view.getAdapter( IDebugView.class );
|
|
||||||
if ( adapter != null && adapter.getViewer() instanceof StructuredViewer )
|
|
||||||
{
|
|
||||||
setViewer( (StructuredViewer)adapter.getViewer() );
|
|
||||||
}
|
|
||||||
view.getViewSite().getPage().addPartListener( this );
|
|
||||||
CDebugUIPlugin.getDefault().getPreferenceStore().addPropertyChangeListener( this );
|
|
||||||
}
|
|
||||||
|
|
||||||
protected abstract void initActionId();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @see IActionDelegate#run(IAction)
|
|
||||||
*/
|
|
||||||
public void run( IAction action )
|
|
||||||
{
|
|
||||||
//do nothing.."run" will occur from the property change
|
|
||||||
//this allows for setting the checked state of the IAction
|
|
||||||
//to drive the execution of this delegate.
|
|
||||||
//see propertyChange(PropertyChangeEvent)
|
|
||||||
}
|
|
||||||
|
|
||||||
protected abstract void valueChanged( boolean on );
|
|
||||||
|
|
||||||
protected String getActionId()
|
|
||||||
{
|
|
||||||
return fId;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected StructuredViewer getViewer()
|
|
||||||
{
|
|
||||||
return fViewer;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void setViewer( StructuredViewer viewer )
|
|
||||||
{
|
|
||||||
fViewer = viewer;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @see IActionDelegate#selectionChanged(IAction, ISelection)
|
|
||||||
*/
|
|
||||||
public void selectionChanged( IAction action, ISelection selection )
|
|
||||||
{
|
|
||||||
if ( fNeedsInitialization )
|
|
||||||
{
|
|
||||||
setAction( action );
|
|
||||||
action.setId( getActionId() );
|
|
||||||
fNeedsInitialization = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected IAction getAction()
|
|
||||||
{
|
|
||||||
return fAction;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void setAction( IAction action )
|
|
||||||
{
|
|
||||||
fAction = action;
|
|
||||||
action.addPropertyChangeListener( this );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @see IPropertyChangeListener#propertyChange(PropertyChangeEvent)
|
|
||||||
*/
|
|
||||||
public void propertyChange( PropertyChangeEvent event )
|
|
||||||
{
|
|
||||||
if ( event.getProperty().equals( getActionId() ) )
|
|
||||||
{
|
|
||||||
getAction().setChecked( CDebugUIPlugin.getDefault().getPreferenceStore().getBoolean( getActionId() ) );
|
|
||||||
}
|
|
||||||
else if ( event.getProperty().equals( IAction.CHECKED ) )
|
|
||||||
{
|
|
||||||
CDebugUIPlugin.getDefault().getPreferenceStore().setValue( getActionId(), getAction().isChecked() );
|
|
||||||
valueChanged( getAction().isChecked() );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @see IPartListener#partActivated(IWorkbenchPart)
|
|
||||||
*/
|
|
||||||
public void partActivated( IWorkbenchPart part )
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @see IPartListener#partBroughtToTop(IWorkbenchPart)
|
|
||||||
*/
|
|
||||||
public void partBroughtToTop( IWorkbenchPart part )
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @see IPartListener#partClosed(IWorkbenchPart)
|
|
||||||
*/
|
|
||||||
public void partClosed( IWorkbenchPart part )
|
|
||||||
{
|
|
||||||
if ( part.equals( getView() ) )
|
|
||||||
{
|
|
||||||
dispose();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @see IPartListener#partDeactivated(IWorkbenchPart)
|
|
||||||
*/
|
|
||||||
public void partDeactivated( IWorkbenchPart part )
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @see IPartListener#partOpened(IWorkbenchPart)
|
|
||||||
*/
|
|
||||||
public void partOpened( IWorkbenchPart part )
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
protected IViewPart getView()
|
|
||||||
{
|
|
||||||
return fView;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void setView( IViewPart view )
|
|
||||||
{
|
|
||||||
fView = view;
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Add table
Reference in a new issue