KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > debug > internal > ui > viewers > update > VariablesViewEventHandler


1 /*******************************************************************************
2  * Copyright (c) 2005, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

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.core.model.ISuspendResume;
16 import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
17 import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta;
18 import org.eclipse.debug.internal.ui.viewers.provisional.AbstractModelProxy;
19
20 /**
21  *
22  * @since 3.2
23  */

24 public class VariablesViewEventHandler extends DebugEventHandler {
25
26     private IStackFrame fFrame;
27
28     public VariablesViewEventHandler(AbstractModelProxy proxy, IStackFrame frame) {
29         super(proxy);
30         fFrame = frame;
31     }
32
33     protected boolean handlesEvent(DebugEvent event) {
34         return true;
35     }
36
37     protected void refreshRoot(DebugEvent event) {
38         if (event.getDetail() != DebugEvent.EVALUATION_IMPLICIT) {
39             // Don't refresh everytime an implicit evaluation finishes
40
if (event.getSource() instanceof ISuspendResume) {
41                 if (!((ISuspendResume)event.getSource()).isSuspended()) {
42                     // no longer suspended
43
return;
44                 }
45             }
46             
47             ModelDelta delta = new ModelDelta(fFrame, IModelDelta.CONTENT);
48             fireDelta(delta);
49         }
50     }
51
52 }
53
Popular Tags