Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/SwitchToDisassemblyActionDelegate.java')
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/SwitchToDisassemblyActionDelegate.java130
1 files changed, 0 insertions, 130 deletions
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/SwitchToDisassemblyActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/SwitchToDisassemblyActionDelegate.java
deleted file mode 100644
index 956f3660799..00000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/SwitchToDisassemblyActionDelegate.java
+++ /dev/null
@@ -1,130 +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.sourcelookup.ISourceMode;
-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.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
-
-/**
- * Enter type comment.
- *
- * @since: Oct 11, 2002
- */
-public class SwitchToDisassemblyActionDelegate 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() )
- {
- ISourceMode sourceMode = (ISourceMode)((CDebugElement)element).getDebugTarget().getAdapter( ISourceMode.class );
- if ( sourceMode != null )
- {
- sourceMode.setMode( ( getAction().isChecked() ) ? ISourceMode.MODE_DISASSEMBLY : ISourceMode.MODE_SOURCE );
- ((CDebugElement)element).fireChangeEvent( DebugEvent.CLIENT_REQUEST );
- if ( fViewPart != null && fViewPart instanceof ISelectionChangedListener )
- {
- 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 )
- {
- return ( ((CDebugElement)element).getDebugTarget().getAdapter( ISourceMode.class ) != null );
- }
- return false;
- }
-
- /**
- * @see AbstractDebugActionDelegate#enableForMultiSelection()
- */
- protected boolean enableForMultiSelection()
- {
- return false;
- }
-
- /**
- * @see AbstractDebugActionDelegate#getStatusMessage()
- */
- protected String getStatusMessage()
- {
- return CDebugUIPlugin.getResourceString("internal.ui.actions.SwitchToDisassemblyActionDelegate.Exceptions_occurred_attempting_to_switch_to_disassemblysource_mode."); //$NON-NLS-1$
- }
-
- /**
- * @see AbstractDebugActionDelegate#getErrorDialogMessage()
- */
- protected String getErrorDialogMessage()
- {
- return CDebugUIPlugin.getResourceString("internal.ui.actions.SwitchToDisassemblyActionDelegate.1"); //$NON-NLS-1$
- }
-
- /**
- * @see AbstractDebugActionDelegate#getErrorDialogTitle()
- */
- protected String getErrorDialogTitle()
- {
- return CDebugUIPlugin.getResourceString("internal.ui.actions.SwitchToDisassemblyActionDelegate.2"); //$NON-NLS-1$
- }
-
- /* (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 )
- {
- ISourceMode sourceMode = (ISourceMode)((CDebugElement)element).getDebugTarget().getAdapter( ISourceMode.class );
- checked = ( sourceMode != null && sourceMode.getMode() == ISourceMode.MODE_DISASSEMBLY );
- }
- }
- action.setChecked( checked );
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IViewActionDelegate#init(IViewPart)
- */
- public void init( IViewPart view )
- {
- super.init( view );
- fViewPart = view;
- }
-}

Back to the top