Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 326636 | Differences between
and this patch

Collapse All | Expand All

(-)plugin.xml (+11 lines)
Lines 741-745 Link Here
741
         <adapter type="org.eclipse.cdt.ui.text.c.hover.ICEditorTextHover"/>
741
         <adapter type="org.eclipse.cdt.ui.text.c.hover.ICEditorTextHover"/>
742
      </factory>
742
      </factory>
743
   </extension>
743
   </extension>
744
   
745
   <extension
746
         point="org.eclipse.ui.editors">
747
      <editor
748
            class="org.eclipse.cdt.dsf.debug.internal.ui.disassembly.DisassemblyEditor"
749
            default="false"
750
            icon="icons/disassembly.gif"
751
            id="org.eclipse.cdt.dsf.ui.disassembly"
752
            name="%disassemblyView.name">
753
      </editor>
754
   </extension>
744
755
745
</plugin>
756
</plugin>
(-)src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyEditor.java (-12 / +51 lines)
Lines 11-22 Link Here
11
package org.eclipse.cdt.dsf.debug.internal.ui.disassembly;
11
package org.eclipse.cdt.dsf.debug.internal.ui.disassembly;
12
12
13
import org.eclipse.core.runtime.IProgressMonitor;
13
import org.eclipse.core.runtime.IProgressMonitor;
14
import org.eclipse.jface.action.IMenuManager;
14
import org.eclipse.jface.action.ToolBarManager;
15
import org.eclipse.swt.SWT;
16
import org.eclipse.swt.layout.GridData;
17
import org.eclipse.swt.layout.GridLayout;
18
import org.eclipse.swt.widgets.Composite;
19
import org.eclipse.swt.widgets.Label;
20
import org.eclipse.swt.widgets.ToolBar;
15
import org.eclipse.ui.IActionBars;
21
import org.eclipse.ui.IActionBars;
16
import org.eclipse.ui.IEditorInput;
22
import org.eclipse.ui.IEditorInput;
17
import org.eclipse.ui.IEditorPart;
23
import org.eclipse.ui.IEditorPart;
18
import org.eclipse.ui.IEditorSite;
24
import org.eclipse.ui.IEditorSite;
19
import org.eclipse.ui.IWorkbenchActionConstants;
20
import org.eclipse.ui.PartInitException;
25
import org.eclipse.ui.PartInitException;
21
26
22
/**
27
/**
Lines 25-30 Link Here
25
public class DisassemblyEditor extends DisassemblyPart implements IEditorPart {
30
public class DisassemblyEditor extends DisassemblyPart implements IEditorPart {
26
31
27
	private IEditorInput fInput;
32
	private IEditorInput fInput;
33
	private ToolBarManager fToolBarManager;
34
	private Label fContentDescriptionLabel;
28
35
29
	/**
36
	/**
30
	 * 
37
	 * 
Lines 33-55 Link Here
33
		super();
40
		super();
34
	}
41
	}
35
42
43
	/*
44
	 * @see org.eclipse.cdt.dsf.debug.internal.ui.disassembly.DisassemblyPart#createPartControl(org.eclipse.swt.widgets.Composite)
45
	 */
36
	@Override
46
	@Override
37
	protected IActionBars getActionBars() {
47
	public void createPartControl(Composite parent) {
38
		return getEditorSite().getActionBars();
48
		GridLayout layout = new GridLayout(1, false);
49
		layout.marginWidth = 0;
50
		layout.marginHeight = 0;
51
		layout.verticalSpacing = 0;
52
		parent.setLayout(layout);
53
		Composite topBar = new Composite(parent, SWT.NONE);
54
		topBar.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
55
		GridLayout layout2 = new GridLayout(2, false);
56
		layout2.marginTop = 1;
57
		layout2.marginLeft = 1;
58
		layout2.marginWidth = 0;
59
		layout2.marginHeight = 0;
60
		topBar.setLayout(layout2);
61
		fContentDescriptionLabel = new Label(topBar, SWT.NONE);
62
		fContentDescriptionLabel.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, true, false));
63
		fToolBarManager = new ToolBarManager();
64
		ToolBar toolbar = fToolBarManager.createControl(topBar);
65
		toolbar.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false));
66
		Composite inner = new Composite(parent, SWT.NONE);
67
		inner.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
68
		super.createPartControl(inner);
39
	}
69
	}
40
70
	
41
	/*
71
	/*
42
	 * @see org.eclipse.cdt.dsf.debug.internal.ui.disassembly.DisassemblyPart#fillContextMenu(org.eclipse.jface.action.IMenuManager)
72
	 * @see org.eclipse.ui.part.WorkbenchPart#setContentDescription(java.lang.String)
43
	 */
73
	 */
44
	@Override
74
	@Override
45
	protected void fillContextMenu(IMenuManager manager) {
75
	protected void setContentDescription(String description) {
46
		super.fillContextMenu(manager);
76
		fContentDescriptionLabel.setText(description);
47
		manager.appendToGroup(IWorkbenchActionConstants.GO_TO, fActionGotoPC);
77
		fContentDescriptionLabel.getParent().layout(true);
48
		manager.appendToGroup(IWorkbenchActionConstants.GO_TO, fActionGotoAddress);
78
	}
49
		manager.appendToGroup("group.bottom", fActionRefreshView); //$NON-NLS-1$
50
79
80
	@Override
81
	protected IActionBars getActionBars() {
82
		return getEditorSite().getActionBars();
51
	}
83
	}
52
	
84
85
	@Override
86
	protected void contributeToActionBars(IActionBars bars) {
87
		super.contributeToActionBars(bars);
88
		fillLocalToolBar(fToolBarManager);
89
		fToolBarManager.update(true);
90
	}
91
53
	/*
92
	/*
54
	 * @see org.eclipse.ui.IEditorPart#getEditorInput()
93
	 * @see org.eclipse.ui.IEditorPart#getEditorInput()
55
	 */
94
	 */
(-)src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyPart.java (-5 / +22 lines)
Lines 67-72 Link Here
67
import org.eclipse.debug.core.model.IBreakpoint;
67
import org.eclipse.debug.core.model.IBreakpoint;
68
import org.eclipse.debug.core.sourcelookup.containers.LocalFileStorage;
68
import org.eclipse.debug.core.sourcelookup.containers.LocalFileStorage;
69
import org.eclipse.debug.ui.DebugUITools;
69
import org.eclipse.debug.ui.DebugUITools;
70
import org.eclipse.debug.ui.contexts.DebugContextEvent;
71
import org.eclipse.debug.ui.contexts.IDebugContextListener;
70
import org.eclipse.jface.action.Action;
72
import org.eclipse.jface.action.Action;
71
import org.eclipse.jface.action.GroupMarker;
73
import org.eclipse.jface.action.GroupMarker;
72
import org.eclipse.jface.action.IAction;
74
import org.eclipse.jface.action.IAction;
Lines 226-232 Link Here
226
	private Color fLabelColor;
228
	private Color fLabelColor;
227
	private Control fRedrawControl;
229
	private Control fRedrawControl;
228
	private RGB fPCAnnotationRGB;
230
	private RGB fPCAnnotationRGB;
229
	private Composite fComposite;
231
	protected Composite fComposite;
230
232
231
	private DropTarget fDropTarget;
233
	private DropTarget fDropTarget;
232
	private DragSource fDragSource;
234
	private DragSource fDragSource;
Lines 315-320 Link Here
315
	private AddressBarContributionItem fAddressBar = null;
317
	private AddressBarContributionItem fAddressBar = null;
316
	private Action fJumpToAddressAction = new JumpToAddressAction(this);
318
	private Action fJumpToAddressAction = new JumpToAddressAction(this);
317
319
320
    private IDebugContextListener fDebugContextListener;
321
318
	private final class ActionRefreshView extends AbstractDisassemblyAction {
322
	private final class ActionRefreshView extends AbstractDisassemblyAction {
319
		public ActionRefreshView() {
323
		public ActionRefreshView() {
320
			super(DisassemblyPart.this);
324
			super(DisassemblyPart.this);
Lines 400-406 Link Here
400
404
401
	private final class ActionToggleSource extends AbstractDisassemblyAction {
405
	private final class ActionToggleSource extends AbstractDisassemblyAction {
402
		public ActionToggleSource() {
406
		public ActionToggleSource() {
403
			super(DisassemblyPart.this);
407
			super(DisassemblyPart.this, IAction.AS_CHECK_BOX);
404
			setText(DisassemblyMessages.Disassembly_action_ShowSource_label);
408
			setText(DisassemblyMessages.Disassembly_action_ShowSource_label);
405
		}
409
		}
406
		@Override
410
		@Override
Lines 420-426 Link Here
420
424
421
	private final class ActionToggleSymbols extends AbstractDisassemblyAction {
425
	private final class ActionToggleSymbols extends AbstractDisassemblyAction {
422
		public ActionToggleSymbols() {
426
		public ActionToggleSymbols() {
423
			super(DisassemblyPart.this);
427
			super(DisassemblyPart.this, IAction.AS_CHECK_BOX);
424
			setText(DisassemblyMessages.Disassembly_action_ShowSymbols_label);
428
			setText(DisassemblyMessages.Disassembly_action_ShowSymbols_label);
425
		}
429
		}
426
		@Override
430
		@Override
Lines 669-674 Link Here
669
	protected void setSite(IWorkbenchPartSite site) {
673
	protected void setSite(IWorkbenchPartSite site) {
670
		super.setSite(site);
674
		super.setSite(site);
671
        site.getPage().addPartListener(fPartListener);
675
        site.getPage().addPartListener(fPartListener);
676
		DebugUITools.getDebugContextManager().addDebugContextListener(fDebugContextListener = new IDebugContextListener() {
677
            public void debugContextChanged(DebugContextEvent event) {
678
                if ((event.getFlags() & DebugContextEvent.ACTIVATED) != 0) {
679
                    updateDebugContext();
680
                }
681
            }
682
        });
672
	}
683
	}
673
684
674
	private DisassemblyDocument createDocument() {
685
	private DisassemblyDocument createDocument() {
Lines 681-686 Link Here
681
	 */
692
	 */
682
	@Override
693
	@Override
683
	public void dispose() {
694
	public void dispose() {
695
	    if (fDebugContextListener != null) {
696
	        DebugUITools.getDebugContextManager().removeDebugContextListener(fDebugContextListener);
697
	        fDebugContextListener = null;
698
	    }
684
		IWorkbenchPartSite site = getSite();
699
		IWorkbenchPartSite site = getSite();
685
		site.setSelectionProvider(null);
700
		site.setSelectionProvider(null);
686
		site.getPage().removePartListener(fPartListener);
701
		site.getPage().removePartListener(fPartListener);
Lines 1807-1813 Link Here
1807
		resetViewer();
1822
		resetViewer();
1808
		if (fDebugSessionId != null) {
1823
		if (fDebugSessionId != null) {
1809
			fJumpToAddressAction.setEnabled(true);
1824
			fJumpToAddressAction.setEnabled(true);
1810
			fAddressBar.enableAddressBox(true);
1825
			if (fAddressBar != null)
1826
			    fAddressBar.enableAddressBox(true);
1811
1827
1812
			int activeFrame = getActiveStackFrame();
1828
			int activeFrame = getActiveStackFrame();
1813
			if (activeFrame > 0) {
1829
			if (activeFrame > 0) {
Lines 1825-1831 Link Here
1825
			fViewer.addViewportListener(this);
1841
			fViewer.addViewportListener(this);
1826
        } else {
1842
        } else {
1827
        	fJumpToAddressAction.setEnabled(false);
1843
        	fJumpToAddressAction.setEnabled(false);
1828
        	fAddressBar.enableAddressBox(false);
1844
            if (fAddressBar != null)
1845
                fAddressBar.enableAddressBox(false);
1829
			fViewer.removeViewportListener(this);
1846
			fViewer.removeViewportListener(this);
1830
        	fGotoMarkerPending = null;
1847
        	fGotoMarkerPending = null;
1831
        }
1848
        }
(-)src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyView.java (-16 lines)
Lines 10-25 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.cdt.dsf.debug.internal.ui.disassembly;
11
package org.eclipse.cdt.dsf.debug.internal.ui.disassembly;
12
12
13
import org.eclipse.debug.ui.IDebugUIConstants;
14
import org.eclipse.jface.action.IMenuManager;
13
import org.eclipse.jface.action.IMenuManager;
15
import org.eclipse.jface.action.Separator;
14
import org.eclipse.jface.action.Separator;
16
import org.eclipse.jface.viewers.ISelection;
17
import org.eclipse.ui.IActionBars;
15
import org.eclipse.ui.IActionBars;
18
import org.eclipse.ui.IMemento;
16
import org.eclipse.ui.IMemento;
19
import org.eclipse.ui.ISelectionListener;
20
import org.eclipse.ui.IViewPart;
17
import org.eclipse.ui.IViewPart;
21
import org.eclipse.ui.IViewSite;
18
import org.eclipse.ui.IViewSite;
22
import org.eclipse.ui.IWorkbenchPart;
23
import org.eclipse.ui.PartInitException;
19
import org.eclipse.ui.PartInitException;
24
import org.eclipse.ui.actions.ActionFactory;
20
import org.eclipse.ui.actions.ActionFactory;
25
21
Lines 28-35 Link Here
28
 */
24
 */
29
public class DisassemblyView extends DisassemblyPart implements IViewPart {
25
public class DisassemblyView extends DisassemblyPart implements IViewPart {
30
26
31
	private ISelectionListener fDebugViewListener;
32
33
	/**
27
	/**
34
	 * 
28
	 * 
35
	 */
29
	 */
Lines 61-70 Link Here
61
	 */
55
	 */
62
	public void init(IViewSite site, IMemento memento) throws PartInitException {
56
	public void init(IViewSite site, IMemento memento) throws PartInitException {
63
		setSite(site);
57
		setSite(site);
64
		site.getPage().addSelectionListener(IDebugUIConstants.ID_DEBUG_VIEW, fDebugViewListener= new ISelectionListener() {
65
			public void selectionChanged(IWorkbenchPart part, ISelection selection) {
66
				updateDebugContext();
67
			}});
68
	}
58
	}
69
59
70
	/*
60
	/*
Lines 92-101 Link Here
92
	protected void closePart() {
82
	protected void closePart() {
93
		getViewSite().getPage().hideView(this);
83
		getViewSite().getPage().hideView(this);
94
	}
84
	}
95
96
	@Override
97
	public void dispose() {
98
		getSite().getPage().removeSelectionListener(IDebugUIConstants.ID_DEBUG_VIEW, fDebugViewListener);
99
		super.dispose();
100
	}
101
}
85
}
(-)src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/AbstractDisassemblyAction.java (-1 / +19 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2008, 2009 Wind River Systems, Inc. and others.
2
 * Copyright (c) 2008, 2010 Wind River Systems, Inc. and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 35-40 Link Here
35
	}
35
	}
36
36
37
	/**
37
	/**
38
	 * Create a disassembly action.
39
	 * 
40
	 * @param disassemblyPart
41
	 * @param style
42
	 *            one of <code>AS_PUSH_BUTTON</code>,
43
	 *            <code>AS_CHECK_BOX</code>, <code>AS_DROP_DOWN_MENU</code>,
44
	 *            <code>AS_RADIO_BUTTON</code>, and
45
	 *            <code>AS_UNSPECIFIED</code>.
46
	 */
47
	public AbstractDisassemblyAction(IDisassemblyPart disassemblyPart, int style) {
48
		super(null, style);
49
		Assert.isLegal(disassemblyPart != null);
50
		fDisassemblyPart= disassemblyPart;
51
		fDisassemblyPart.addPropertyListener(this);
52
	}
53
54
55
	/**
38
	 * @return the disassembly part
56
	 * @return the disassembly part
39
	 */
57
	 */
40
	public final IDisassemblyPart getDisassemblyPart() {
58
	public final IDisassemblyPart getDisassemblyPart() {

Return to bug 326636