1 11 package org.eclipse.debug.internal.ui; 12 13 import org.eclipse.debug.core.model.IDebugTarget; 14 import org.eclipse.debug.core.model.IThread; 15 import org.eclipse.jface.text.source.Annotation; 16 import org.eclipse.ui.texteditor.ITextEditor; 17 18 23 public class InstructionPointerContext { 24 25 28 private IThread fThread; 29 30 33 private IDebugTarget fDebugTarget; 34 35 38 private ITextEditor fEditor; 39 40 43 private Annotation fAnnotation; 44 45 public InstructionPointerContext(IDebugTarget target, IThread thread, ITextEditor editor, Annotation annotation) { 46 fDebugTarget = target; 47 fThread = thread; 48 fEditor = editor; 49 fAnnotation = annotation; 50 } 51 52 55 public boolean equals(Object other) { 56 if (other instanceof InstructionPointerContext) { 57 InstructionPointerContext otherContext = (InstructionPointerContext) other; 58 if (getAnnotation().equals(otherContext.getAnnotation())){ 59 return getEditor().equals(otherContext.getEditor()); 60 } 61 } 62 return false; 63 } 64 65 68 public int hashCode() { 69 return getAnnotation().hashCode() + getEditor().hashCode(); 70 } 71 72 75 public IThread getThread() { 76 return fThread; 77 } 78 79 82 public IDebugTarget getDebugTarget() { 83 return fDebugTarget; 84 } 85 86 89 public ITextEditor getEditor() { 90 return fEditor; 91 } 92 93 96 public Annotation getAnnotation() { 97 return fAnnotation; 98 } 99 100 } 101 | Popular Tags |