KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > debug > ui > variables > JavaStackFrameContentProvider


1 /*******************************************************************************
2  * Copyright (c) 2006, 2007 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.jdt.internal.debug.ui.variables;
12
13 import org.eclipse.core.runtime.CoreException;
14 import org.eclipse.debug.internal.ui.model.elements.StackFrameContentProvider;
15 import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
16 import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate;
17 import org.eclipse.jdt.debug.core.IJavaThread;
18
19 /**
20  * @since 3.3
21  */

22 public class JavaStackFrameContentProvider extends StackFrameContentProvider {
23
24     /* (non-Javadoc)
25      *
26      * Cancels updates when thread is resumed.
27      *
28      * @see org.eclipse.debug.internal.ui.model.elements.StackFrameContentProvider#getAllChildren(java.lang.Object, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, org.eclipse.core.runtime.IProgressMonitor)
29      */

30     protected Object JavaDoc[] getAllChildren(Object JavaDoc parent, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
31         try {
32             return super.getAllChildren(parent, context, monitor);
33         } catch (CoreException e) {
34             if (e.getStatus().getCode() == IJavaThread.ERR_THREAD_NOT_SUSPENDED) {
35                 monitor.cancel();
36                 return EMPTY;
37             }
38             throw e;
39         }
40     }
41
42 }
43
Popular Tags