KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > debug > ui > launcher > VMConnectTimeoutStatusHandler


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 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.launcher;
12
13
14 import org.eclipse.core.runtime.IStatus;
15 import org.eclipse.debug.core.IStatusHandler;
16 import org.eclipse.jdt.internal.debug.ui.JDIDebugUIPlugin;
17 import org.eclipse.jface.dialogs.MessageDialog;
18
19 /**
20  * Prompts the user to continue waiting for a connection
21  * from a debuggable VM.
22  */

23 public class VMConnectTimeoutStatusHandler implements IStatusHandler {
24
25     /**
26      * @see IStatusHandler#handleStatus(IStatus, Object)
27      */

28     public Object JavaDoc handleStatus(IStatus status, Object JavaDoc source) {
29         final boolean[] result = new boolean[1];
30         JDIDebugUIPlugin.getStandardDisplay().syncExec(new Runnable JavaDoc() {
31             public void run() {
32                 String JavaDoc title= LauncherMessages.VMConnectTimeoutStatusHandler_Java_Application_1;
33                 String JavaDoc message= LauncherMessages.jdkLauncher_error_timeout;
34                 result[0]= (MessageDialog.openQuestion(JDIDebugUIPlugin.getActiveWorkbenchShell(), title, message));
35             }
36         });
37         return Boolean.valueOf(result[0]);
38     }
39 }
40
Popular Tags