diff options
author | Darin Wright | 2003-07-31 15:43:25 +0000 |
---|---|---|
committer | Darin Wright | 2003-07-31 15:43:25 +0000 |
commit | 3fb0e99be790718990b7ef99b28450eab4c2cab1 (patch) | |
tree | ef71aa876ee528417457d687d87a6cc4f28377e2 /org.eclipse.debug.ui/ui/org/eclipse | |
parent | ed443befd6d71b8838cdaf49221516c41d9a811b (diff) | |
download | eclipse.platform.debug-3fb0e99be790718990b7ef99b28450eab4c2cab1.tar.gz eclipse.platform.debug-3fb0e99be790718990b7ef99b28450eab4c2cab1.tar.xz eclipse.platform.debug-3fb0e99be790718990b7ef99b28450eab4c2cab1.zip |
code cleanup
Diffstat (limited to 'org.eclipse.debug.ui/ui/org/eclipse')
3 files changed, 41 insertions, 38 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerAnnotation.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerAnnotation.java index cf09e6869..fb84812ae 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerAnnotation.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerAnnotation.java @@ -23,13 +23,14 @@ import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.widgets.Canvas; /** - * An annotation for the vertical ruler in text editors that shows one of two images for the - * current instruction pointer when debugging (one for the top stack frame, one for all others). + * An annotation for the vertical ruler in text editors that shows one of two + * images for the current instruction pointer when debugging (one for the top + * stack frame, one for all others). */ public class InstructionPointerAnnotation extends Annotation { /** - * The thread for this instruction pointer annotation. This is necessary only so that + * The frame for this instruction pointer annotation. This is necessary only so that * instances of this class can be distinguished by equals(). */ private IStackFrame fStackFrame; @@ -46,16 +47,16 @@ public class InstructionPointerAnnotation extends Annotation { * * @see org.eclipse.jface.text.source.Annotation */ - public static final int INSTRUCTION_POINTER_ANNOTATION_LAYER = 6; + private static final int INSTRUCTION_POINTER_ANNOTATION_LAYER = 6; /** - * Construct an instance of an InstructionPointerAnnotation based on the - * specified stack frame. + * Construct an instruction pointer annotation for the given stack frame. + * + * @param stackFrame frame to create an instruction pointer annotation for */ public InstructionPointerAnnotation(IStackFrame stackFrame) { setLayer(INSTRUCTION_POINTER_ANNOTATION_LAYER); setStackFrame(stackFrame); - setTopStackFrame(stackFrame); } /** @@ -67,9 +68,11 @@ public class InstructionPointerAnnotation extends Annotation { } /** - * Retrieve the image associated with the instruction pointer. + * Returns the image associated with this instruction pointer. + * + * @return image associated with this instruction pointer */ - protected Image getInstructionPointerImage(boolean topStackFrame) { + private Image getInstructionPointerImage(boolean topStackFrame) { IDebugEditorPresentation presentation = (IDebugEditorPresentation)DebugUIPlugin.getModelPresentation(); Image image = presentation.getInstructionPointerImage(getStackFrame()); if (image == null) { @@ -99,24 +102,39 @@ public class InstructionPointerAnnotation extends Annotation { return getStackFrame().hashCode(); } + /** + * Sets the stack frame associated with this annotation and determines + * if the frame is on top of the stack. + * + * @param stackFrame frame associated with this annotation + */ private void setStackFrame(IStackFrame stackFrame) { fStackFrame = stackFrame; - } - - public IStackFrame getStackFrame() { - return fStackFrame; - } - - private void setTopStackFrame(IStackFrame stackFrame) { IThread thread = stackFrame.getThread(); try { fTopStackFrame = stackFrame.equals(thread.getTopStackFrame()); } catch (DebugException de) { fTopStackFrame = false; - } + } } - - public boolean isTopStackFrame() { + + /** + * Returns the stack frame associated with this annotation + * + * @return the stack frame associated with this annotation + */ + private IStackFrame getStackFrame() { + return fStackFrame; + } + + /** + * Returns whether the stack frame associated with this annotation is the + * top stack frame in its thread. + * + * @return whether the stack frame associated with this annotation is the + * top stack frame in its thread + */ + private boolean isTopStackFrame() { return fTopStackFrame; } diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerContext.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerContext.java index 2d032b706..5d702d361 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerContext.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerContext.java @@ -11,7 +11,6 @@ package org.eclipse.debug.internal.ui; -import org.eclipse.debug.core.model.IStackFrame; import org.eclipse.ui.texteditor.ITextEditor; /** @@ -22,11 +21,6 @@ import org.eclipse.ui.texteditor.ITextEditor; public class InstructionPointerContext { /** - * The stack frame for this context. - */ - private IStackFrame fStackFrame; - - /** * The text editor for this context. */ private ITextEditor fTextEditor; @@ -36,8 +30,7 @@ public class InstructionPointerContext { */ private InstructionPointerAnnotation fAnnotation; - public InstructionPointerContext(IStackFrame stackFrame, ITextEditor textEditor, InstructionPointerAnnotation annotation) { - setStackFrame(stackFrame); + public InstructionPointerContext(ITextEditor textEditor, InstructionPointerAnnotation annotation) { setTextEditor(textEditor); setAnnotation(annotation); } @@ -48,7 +41,7 @@ public class InstructionPointerContext { public boolean equals(Object other) { if (other instanceof InstructionPointerContext) { InstructionPointerContext otherContext = (InstructionPointerContext) other; - return getStackFrame().equals(otherContext.getStackFrame()); + return getAnnotation().equals(otherContext.getAnnotation()); } return false; } @@ -57,15 +50,7 @@ public class InstructionPointerContext { * @see java.lang.Object#hashCode() */ public int hashCode() { - return getStackFrame().hashCode(); - } - - private void setStackFrame(IStackFrame stackFrame) { - fStackFrame = stackFrame; - } - - public IStackFrame getStackFrame() { - return fStackFrame; + return getAnnotation().hashCode(); } private void setTextEditor(ITextEditor textEditor) { diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerManager.java index 69a4a3729..6306ed48d 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerManager.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerManager.java @@ -121,7 +121,7 @@ public class InstructionPointerManager { } // Create a context object & add it to the list - InstructionPointerContext context = new InstructionPointerContext(stackFrame, textEditor, instPtrAnnotation); + InstructionPointerContext context = new InstructionPointerContext(textEditor, instPtrAnnotation); contextList.remove(context); contextList.add(context); } |