1 11 package org.eclipse.debug.internal.ui.viewers.update; 12 13 import org.eclipse.debug.core.DebugEvent; 14 import org.eclipse.debug.core.model.IStackFrame; 15 import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta; 16 import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta; 17 import org.eclipse.debug.internal.ui.viewers.provisional.AbstractModelProxy; 18 19 24 public class StackFrameEventHandler extends DebugEventHandler { 25 26 ThreadEventHandler fThreadHandler = null; 27 28 31 public StackFrameEventHandler(AbstractModelProxy proxy, ThreadEventHandler threadHandler) { 32 super(proxy); 33 fThreadHandler = threadHandler; 34 } 35 36 39 protected boolean handlesEvent(DebugEvent event) { 40 return event.getSource() instanceof IStackFrame; 41 } 42 43 46 protected void handleChange(DebugEvent event) { 47 IStackFrame frame = (IStackFrame) event.getSource(); 48 ModelDelta root = fThreadHandler.buildRootDelta(); 49 ModelDelta delta = fThreadHandler.addPathToThread(root, frame.getThread()); 50 delta = delta.addNode(frame.getThread(), IModelDelta.NO_CHANGE); 51 int flags = IModelDelta.NO_CHANGE; 52 if (event.getDetail() == DebugEvent.CONTENT) { 53 flags = flags | IModelDelta.CONTENT; 54 } else if (event.getDetail() == DebugEvent.STATE) { 55 flags = flags | IModelDelta.STATE; 56 } 57 delta = delta.addNode(frame, flags); 58 fireDelta(root); 59 } 60 61 } 62 | Popular Tags |