Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 181482 Details for
Bug 326636
[disassembly] Enable disassembly view as "editor"
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Work in progress
326636.patch (text/plain), 12.46 KB, created by
Anton Leherbauer
on 2010-10-22 05:33:39 EDT
(
hide
)
Description:
Work in progress
Filename:
MIME Type:
Creator:
Anton Leherbauer
Created:
2010-10-22 05:33:39 EDT
Size:
12.46 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.cdt.dsf.ui >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/dsf/org.eclipse.cdt.dsf.ui/plugin.xml,v >retrieving revision 1.20 >diff -u -r1.20 plugin.xml >--- plugin.xml 26 May 2010 16:16:43 -0000 1.20 >+++ plugin.xml 22 Oct 2010 09:29:36 -0000 >@@ -741,5 +741,16 @@ > <adapter type="org.eclipse.cdt.ui.text.c.hover.ICEditorTextHover"/> > </factory> > </extension> >+ >+ <extension >+ point="org.eclipse.ui.editors"> >+ <editor >+ class="org.eclipse.cdt.dsf.debug.internal.ui.disassembly.DisassemblyEditor" >+ default="false" >+ icon="icons/disassembly.gif" >+ id="org.eclipse.cdt.dsf.ui.disassembly" >+ name="%disassemblyView.name"> >+ </editor> >+ </extension> > > </plugin> >Index: src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyEditor.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyEditor.java,v >retrieving revision 1.3 >diff -u -r1.3 DisassemblyEditor.java >--- src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyEditor.java 18 Feb 2010 11:44:15 -0000 1.3 >+++ src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyEditor.java 22 Oct 2010 09:29:36 -0000 >@@ -11,12 +11,17 @@ > package org.eclipse.cdt.dsf.debug.internal.ui.disassembly; > > import org.eclipse.core.runtime.IProgressMonitor; >-import org.eclipse.jface.action.IMenuManager; >+import org.eclipse.jface.action.ToolBarManager; >+import org.eclipse.swt.SWT; >+import org.eclipse.swt.layout.GridData; >+import org.eclipse.swt.layout.GridLayout; >+import org.eclipse.swt.widgets.Composite; >+import org.eclipse.swt.widgets.Label; >+import org.eclipse.swt.widgets.ToolBar; > import org.eclipse.ui.IActionBars; > import org.eclipse.ui.IEditorInput; > import org.eclipse.ui.IEditorPart; > import org.eclipse.ui.IEditorSite; >-import org.eclipse.ui.IWorkbenchActionConstants; > import org.eclipse.ui.PartInitException; > > /** >@@ -25,6 +30,8 @@ > public class DisassemblyEditor extends DisassemblyPart implements IEditorPart { > > private IEditorInput fInput; >+ private ToolBarManager fToolBarManager; >+ private Label fContentDescriptionLabel; > > /** > * >@@ -33,23 +40,55 @@ > super(); > } > >+ /* >+ * @see org.eclipse.cdt.dsf.debug.internal.ui.disassembly.DisassemblyPart#createPartControl(org.eclipse.swt.widgets.Composite) >+ */ > @Override >- protected IActionBars getActionBars() { >- return getEditorSite().getActionBars(); >+ public void createPartControl(Composite parent) { >+ GridLayout layout = new GridLayout(1, false); >+ layout.marginWidth = 0; >+ layout.marginHeight = 0; >+ layout.verticalSpacing = 0; >+ parent.setLayout(layout); >+ Composite topBar = new Composite(parent, SWT.NONE); >+ topBar.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false)); >+ GridLayout layout2 = new GridLayout(2, false); >+ layout2.marginTop = 1; >+ layout2.marginLeft = 1; >+ layout2.marginWidth = 0; >+ layout2.marginHeight = 0; >+ topBar.setLayout(layout2); >+ fContentDescriptionLabel = new Label(topBar, SWT.NONE); >+ fContentDescriptionLabel.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, true, false)); >+ fToolBarManager = new ToolBarManager(); >+ ToolBar toolbar = fToolBarManager.createControl(topBar); >+ toolbar.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false)); >+ Composite inner = new Composite(parent, SWT.NONE); >+ inner.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); >+ super.createPartControl(inner); > } >- >+ > /* >- * @see org.eclipse.cdt.dsf.debug.internal.ui.disassembly.DisassemblyPart#fillContextMenu(org.eclipse.jface.action.IMenuManager) >+ * @see org.eclipse.ui.part.WorkbenchPart#setContentDescription(java.lang.String) > */ > @Override >- protected void fillContextMenu(IMenuManager manager) { >- super.fillContextMenu(manager); >- manager.appendToGroup(IWorkbenchActionConstants.GO_TO, fActionGotoPC); >- manager.appendToGroup(IWorkbenchActionConstants.GO_TO, fActionGotoAddress); >- manager.appendToGroup("group.bottom", fActionRefreshView); //$NON-NLS-1$ >+ protected void setContentDescription(String description) { >+ fContentDescriptionLabel.setText(description); >+ fContentDescriptionLabel.getParent().layout(true); >+ } > >+ @Override >+ protected IActionBars getActionBars() { >+ return getEditorSite().getActionBars(); > } >- >+ >+ @Override >+ protected void contributeToActionBars(IActionBars bars) { >+ super.contributeToActionBars(bars); >+ fillLocalToolBar(fToolBarManager); >+ fToolBarManager.update(true); >+ } >+ > /* > * @see org.eclipse.ui.IEditorPart#getEditorInput() > */ >Index: src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyPart.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyPart.java,v >retrieving revision 1.31.2.2 >diff -u -r1.31.2.2 DisassemblyPart.java >--- src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyPart.java 14 Oct 2010 09:19:00 -0000 1.31.2.2 >+++ src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyPart.java 22 Oct 2010 09:29:36 -0000 >@@ -67,6 +67,8 @@ > import org.eclipse.debug.core.model.IBreakpoint; > import org.eclipse.debug.core.sourcelookup.containers.LocalFileStorage; > import org.eclipse.debug.ui.DebugUITools; >+import org.eclipse.debug.ui.contexts.DebugContextEvent; >+import org.eclipse.debug.ui.contexts.IDebugContextListener; > import org.eclipse.jface.action.Action; > import org.eclipse.jface.action.GroupMarker; > import org.eclipse.jface.action.IAction; >@@ -226,7 +228,7 @@ > private Color fLabelColor; > private Control fRedrawControl; > private RGB fPCAnnotationRGB; >- private Composite fComposite; >+ protected Composite fComposite; > > private DropTarget fDropTarget; > private DragSource fDragSource; >@@ -315,6 +317,8 @@ > private AddressBarContributionItem fAddressBar = null; > private Action fJumpToAddressAction = new JumpToAddressAction(this); > >+ private IDebugContextListener fDebugContextListener; >+ > private final class ActionRefreshView extends AbstractDisassemblyAction { > public ActionRefreshView() { > super(DisassemblyPart.this); >@@ -400,7 +404,7 @@ > > private final class ActionToggleSource extends AbstractDisassemblyAction { > public ActionToggleSource() { >- super(DisassemblyPart.this); >+ super(DisassemblyPart.this, IAction.AS_CHECK_BOX); > setText(DisassemblyMessages.Disassembly_action_ShowSource_label); > } > @Override >@@ -420,7 +424,7 @@ > > private final class ActionToggleSymbols extends AbstractDisassemblyAction { > public ActionToggleSymbols() { >- super(DisassemblyPart.this); >+ super(DisassemblyPart.this, IAction.AS_CHECK_BOX); > setText(DisassemblyMessages.Disassembly_action_ShowSymbols_label); > } > @Override >@@ -669,6 +673,13 @@ > protected void setSite(IWorkbenchPartSite site) { > super.setSite(site); > site.getPage().addPartListener(fPartListener); >+ DebugUITools.getDebugContextManager().addDebugContextListener(fDebugContextListener = new IDebugContextListener() { >+ public void debugContextChanged(DebugContextEvent event) { >+ if ((event.getFlags() & DebugContextEvent.ACTIVATED) != 0) { >+ updateDebugContext(); >+ } >+ } >+ }); > } > > private DisassemblyDocument createDocument() { >@@ -681,6 +692,10 @@ > */ > @Override > public void dispose() { >+ if (fDebugContextListener != null) { >+ DebugUITools.getDebugContextManager().removeDebugContextListener(fDebugContextListener); >+ fDebugContextListener = null; >+ } > IWorkbenchPartSite site = getSite(); > site.setSelectionProvider(null); > site.getPage().removePartListener(fPartListener); >@@ -1807,7 +1822,8 @@ > resetViewer(); > if (fDebugSessionId != null) { > fJumpToAddressAction.setEnabled(true); >- fAddressBar.enableAddressBox(true); >+ if (fAddressBar != null) >+ fAddressBar.enableAddressBox(true); > > int activeFrame = getActiveStackFrame(); > if (activeFrame > 0) { >@@ -1825,7 +1841,8 @@ > fViewer.addViewportListener(this); > } else { > fJumpToAddressAction.setEnabled(false); >- fAddressBar.enableAddressBox(false); >+ if (fAddressBar != null) >+ fAddressBar.enableAddressBox(false); > fViewer.removeViewportListener(this); > fGotoMarkerPending = null; > } >Index: src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyView.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyView.java,v >retrieving revision 1.4 >diff -u -r1.4 DisassemblyView.java >--- src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyView.java 12 Feb 2010 19:45:13 -0000 1.4 >+++ src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyView.java 22 Oct 2010 09:29:36 -0000 >@@ -10,16 +10,12 @@ > *******************************************************************************/ > package org.eclipse.cdt.dsf.debug.internal.ui.disassembly; > >-import org.eclipse.debug.ui.IDebugUIConstants; > import org.eclipse.jface.action.IMenuManager; > import org.eclipse.jface.action.Separator; >-import org.eclipse.jface.viewers.ISelection; > import org.eclipse.ui.IActionBars; > import org.eclipse.ui.IMemento; >-import org.eclipse.ui.ISelectionListener; > import org.eclipse.ui.IViewPart; > import org.eclipse.ui.IViewSite; >-import org.eclipse.ui.IWorkbenchPart; > import org.eclipse.ui.PartInitException; > import org.eclipse.ui.actions.ActionFactory; > >@@ -28,8 +24,6 @@ > */ > public class DisassemblyView extends DisassemblyPart implements IViewPart { > >- private ISelectionListener fDebugViewListener; >- > /** > * > */ >@@ -61,10 +55,6 @@ > */ > public void init(IViewSite site, IMemento memento) throws PartInitException { > setSite(site); >- site.getPage().addSelectionListener(IDebugUIConstants.ID_DEBUG_VIEW, fDebugViewListener= new ISelectionListener() { >- public void selectionChanged(IWorkbenchPart part, ISelection selection) { >- updateDebugContext(); >- }}); > } > > /* >@@ -92,10 +82,4 @@ > protected void closePart() { > getViewSite().getPage().hideView(this); > } >- >- @Override >- public void dispose() { >- getSite().getPage().removeSelectionListener(IDebugUIConstants.ID_DEBUG_VIEW, fDebugViewListener); >- super.dispose(); >- } > } >Index: src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/AbstractDisassemblyAction.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/AbstractDisassemblyAction.java,v >retrieving revision 1.2 >diff -u -r1.2 AbstractDisassemblyAction.java >--- src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/AbstractDisassemblyAction.java 20 Oct 2009 09:14:13 -0000 1.2 >+++ src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/AbstractDisassemblyAction.java 22 Oct 2010 09:29:36 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2008, 2009 Wind River Systems, Inc. and others. >+ * Copyright (c) 2008, 2010 Wind River Systems, Inc. and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -35,6 +35,24 @@ > } > > /** >+ * Create a disassembly action. >+ * >+ * @param disassemblyPart >+ * @param style >+ * one of <code>AS_PUSH_BUTTON</code>, >+ * <code>AS_CHECK_BOX</code>, <code>AS_DROP_DOWN_MENU</code>, >+ * <code>AS_RADIO_BUTTON</code>, and >+ * <code>AS_UNSPECIFIED</code>. >+ */ >+ public AbstractDisassemblyAction(IDisassemblyPart disassemblyPart, int style) { >+ super(null, style); >+ Assert.isLegal(disassemblyPart != null); >+ fDisassemblyPart= disassemblyPart; >+ fDisassemblyPart.addPropertyListener(this); >+ } >+ >+ >+ /** > * @return the disassembly part > */ > public final IDisassemblyPart getDisassemblyPart() {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
aleherb+eclipse
:
iplog-
Actions:
View
|
Diff
Attachments on
bug 326636
: 181482 |
182974