KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > debug > ui > SuspendTimeoutStatusHandler


1 /*******************************************************************************
2  * Copyright (c) 2000, 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.jdt.internal.debug.ui;
12
13
14 import com.ibm.icu.text.MessageFormat;
15
16 import org.eclipse.core.runtime.CoreException;
17 import org.eclipse.core.runtime.IStatus;
18 import org.eclipse.debug.core.IStatusHandler;
19 import org.eclipse.jdt.debug.core.IJavaThread;
20 import org.eclipse.jface.dialogs.ErrorDialog;
21 import org.eclipse.swt.widgets.Display;
22
23 public class SuspendTimeoutStatusHandler implements IStatusHandler {
24
25     /**
26      * @see IStatusHandler#handleStatus(IStatus, Object)
27      */

28     public Object JavaDoc handleStatus(IStatus status, Object JavaDoc source) throws CoreException {
29         IJavaThread thread= (IJavaThread) source;
30         final ErrorDialog dialog= new ErrorDialog(JDIDebugUIPlugin.getActiveWorkbenchShell(), DebugUIMessages.SuspendTimeoutHandler_suspend, MessageFormat.format(DebugUIMessages.SuspendTimeoutHandler_timeout_occurred, new String JavaDoc[] {thread.getName()}), status, IStatus.WARNING | IStatus.ERROR | IStatus.INFO); //
31
Display display= JDIDebugUIPlugin.getStandardDisplay();
32         display.syncExec(new Runnable JavaDoc() {
33             public void run() {
34                 dialog.open();
35             }
36         });
37         return null;
38     }
39 }
40
Popular Tags