diff options
author | Anton Leherbauer | 2010-09-30 10:03:29 +0000 |
---|---|---|
committer | Anton Leherbauer | 2010-09-30 10:03:29 +0000 |
commit | 437d771c941e55174abcf469c2e515612a371ae7 (patch) | |
tree | 438101fc72532f7cf3e695896a4bd101199e3e3c /dsf | |
parent | 5b14b5fefb3961968818ff9d62baa3040bd65be7 (diff) | |
download | org.eclipse.cdt-437d771c941e55174abcf469c2e515612a371ae7.tar.gz org.eclipse.cdt-437d771c941e55174abcf469c2e515612a371ae7.tar.xz org.eclipse.cdt-437d771c941e55174abcf469c2e515612a371ae7.zip |
Bug 326145 - [source lookup] Changing the color of the IP annotation is not reflected immediately in the editor and disassembly
Diffstat (limited to 'dsf')
4 files changed, 27 insertions, 55 deletions
diff --git a/dsf/org.eclipse.cdt.dsf.ui/plugin.properties b/dsf/org.eclipse.cdt.dsf.ui/plugin.properties index 2c24784f98b..37f942defc9 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/plugin.properties +++ b/dsf/org.eclipse.cdt.dsf.ui/plugin.properties @@ -26,7 +26,7 @@ command.gotoSymbol.description=Navigate to symbolic address command.rulerToggleBreakpoint.name=Toggle Breakpoint command.rulerToggleBreakpoint.description=Toggle breakpoint in disassembly ruler -commandContext.name= In DSF Disassembly +commandContext.name= In Disassembly commandContext.description= When debugging in assembly mode # actions @@ -55,9 +55,6 @@ popup.runToLine.label=Run To &Line # Preferences -debugCallStack = Debug Call Stack -debugCurrentInstructionPointer = Debug Current Instruction Pointer - StaleData.foreground.label=Stale data foreground color StaleData.foreground.description=This color is used to indicate that a given element of data in a view is stale. User should refresh the view to see current data. The foreground color is used only when the view is showing data in columns. diff --git a/dsf/org.eclipse.cdt.dsf.ui/plugin.xml b/dsf/org.eclipse.cdt.dsf.ui/plugin.xml index c9072e8599f..f497bc65a96 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/plugin.xml +++ b/dsf/org.eclipse.cdt.dsf.ui/plugin.xml @@ -10,50 +10,6 @@ <extension point="org.eclipse.core.runtime.preferences"> <initializer class="org.eclipse.cdt.dsf.debug.internal.ui.PreferenceInitializer"/> </extension> - - <extension point="org.eclipse.ui.editors.annotationTypes"> - <type - name="org.eclipse.cdt.dsf.debug.currentIP"> - </type> - <type - name="org.eclipse.cdt.dsf.debug.secondaryIP"> - </type> - </extension> - - <extension point="org.eclipse.ui.editors.markerAnnotationSpecification"> - <specification - annotationImageProvider="org.eclipse.cdt.dsf.debug.ui.sourcelookup.InstructionPointerImageProvider" - annotationType="org.eclipse.cdt.dsf.debug.currentIP" - colorPreferenceKey="currentIPColor" - colorPreferenceValue="198,219,174" - highlightPreferenceKey="currentIPHighlight" - highlightPreferenceValue="true" - label="%debugCurrentInstructionPointer" - overviewRulerPreferenceKey="currentIPOverviewRuler" - overviewRulerPreferenceValue="true" - presentationLayer="6" - textPreferenceKey="currentIPIndication" - textPreferenceValue="false" - verticalRulerPreferenceKey="currentIPVerticalRuler" - verticalRulerPreferenceValue="true"> - </specification> - <specification - annotationImageProvider="org.eclipse.cdt.dsf.debug.ui.sourcelookup.InstructionPointerImageProvider" - annotationType="org.eclipse.cdt.dsf.debug.secondaryIP" - colorPreferenceKey="secondaryIPColor" - colorPreferenceValue="219,235,204" - highlightPreferenceKey="secondaryIPHighlight" - highlightPreferenceValue="true" - label="%debugCallStack" - overviewRulerPreferenceKey="secondaryIPOverviewRuler" - overviewRulerPreferenceValue="true" - presentationLayer="6" - textPreferenceKey="secondaryIPIndication" - textPreferenceValue="false" - verticalRulerPreferenceKey="secondaryIPVerticalRuler" - verticalRulerPreferenceValue="true"> - </specification> - </extension> <extension point="org.eclipse.ui.viewActions"> <!-- Variables View menu contributions --> diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/presentation/DisassemblyIPAnnotation.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/presentation/DisassemblyIPAnnotation.java index 54d7c62cffc..87c075383ce 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/presentation/DisassemblyIPAnnotation.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/presentation/DisassemblyIPAnnotation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2009 Wind River Systems and others. + * Copyright (c) 2007, 2010 Wind River Systems 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 @@ -25,8 +25,8 @@ import org.eclipse.swt.widgets.Canvas; */ public class DisassemblyIPAnnotation extends Annotation implements IAnnotationPresentation { - public static final String ID_TOP = "org.eclipse.cdt.dsf.debug.currentIP"; //$NON-NLS-1$ - public static final String ID_SECONDARY = "org.eclipse.cdt.dsf.debug.secondaryIP"; //$NON-NLS-1$ + public static final String ID_TOP = IDebugUIConstants.ANNOTATION_TYPE_INSTRUCTION_POINTER_CURRENT; + public static final String ID_SECONDARY = IDebugUIConstants.ANNOTATION_TYPE_INSTRUCTION_POINTER_SECONDARY; private Image fImage; private int fContext = Integer.MIN_VALUE; diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/sourcelookup/InstructionPointerManager.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/sourcelookup/InstructionPointerManager.java index 0b5d7d70dd8..5bc3e98902d 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/sourcelookup/InstructionPointerManager.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/sourcelookup/InstructionPointerManager.java @@ -19,15 +19,19 @@ import java.util.List; import org.eclipse.cdt.dsf.concurrent.ThreadSafe; import org.eclipse.cdt.dsf.datamodel.DMContexts; import org.eclipse.cdt.dsf.debug.service.IRunControl; -import org.eclipse.cdt.dsf.debug.service.IStack; import org.eclipse.cdt.dsf.debug.service.IRunControl.IExecutionDMContext; +import org.eclipse.cdt.dsf.debug.service.IStack; import org.eclipse.cdt.dsf.debug.service.IStack.IFrameDMContext; import org.eclipse.debug.ui.DebugUITools; import org.eclipse.debug.ui.IDebugUIConstants; import org.eclipse.jface.text.Position; import org.eclipse.jface.text.source.Annotation; import org.eclipse.jface.text.source.IAnnotationModel; +import org.eclipse.jface.text.source.IAnnotationPresentation; +import org.eclipse.swt.graphics.GC; import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.graphics.Rectangle; +import org.eclipse.swt.widgets.Canvas; import org.eclipse.ui.IEditorInput; import org.eclipse.ui.texteditor.IDocumentProvider; import org.eclipse.ui.texteditor.ITextEditor; @@ -41,17 +45,17 @@ class InstructionPointerManager { /** * Current instruction pointer annotation type. */ - private static final String ID_CURRENT_IP= "org.eclipse.cdt.dsf.debug.currentIP"; //$NON-NLS-1$ + private static final String ID_CURRENT_IP= IDebugUIConstants.ANNOTATION_TYPE_INSTRUCTION_POINTER_CURRENT; /** * Secondary instruction pointer annotation type. */ - private static final String ID_SECONDARY_IP= "org.eclipse.cdt.dsf.debug.secondaryIP"; //$NON-NLS-1$ + private static final String ID_SECONDARY_IP= IDebugUIConstants.ANNOTATION_TYPE_INSTRUCTION_POINTER_SECONDARY; /** * Editor annotation object for instruction pointers. */ - static class IPAnnotation extends Annotation { + static class IPAnnotation extends Annotation implements IAnnotationPresentation { /** The image for this annotation. */ private Image fImage; @@ -101,6 +105,21 @@ class InstructionPointerManager { return fFrame.hashCode(); } + /* + * @see org.eclipse.jface.text.source.IAnnotationPresentation#paint(org.eclipse.swt.graphics.GC, org.eclipse.swt.widgets.Canvas, org.eclipse.swt.graphics.Rectangle) + */ + public void paint(GC gc, Canvas canvas, Rectangle bounds) { + Rectangle imageBounds = fImage.getBounds(); + gc.drawImage(fImage, bounds.x + (bounds.width - imageBounds.width) / 2 , bounds.y + (bounds.height - imageBounds.height) / 2); + } + + /* + * @see org.eclipse.jface.text.source.IAnnotationPresentation#getLayer() + */ + public int getLayer() { + return 5; + } + } /** |