blob: 4e1ef408c81f9e082bac32874e687f2830ae3d99 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2000, 2003 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.jdt.internal.debug.ui.launcher;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.debug.core.IStatusHandler;
import org.eclipse.jdt.internal.debug.ui.JDIDebugUIPlugin;
import org.eclipse.jface.dialogs.MessageDialog;
/**
* Prompts the user to continue waiting for a connection
* from a debuggable VM.
*/
public class VMConnectTimeoutStatusHandler implements IStatusHandler {
/**
* @see IStatusHandler#handleStatus(IStatus, Object)
*/
public Object handleStatus(IStatus status, Object source) throws CoreException {
final boolean[] result = new boolean[1];
JDIDebugUIPlugin.getStandardDisplay().syncExec(new Runnable() {
public void run() {
String title= LauncherMessages.getString("VMConnectTimeoutStatusHandler.Java_Application_1"); //$NON-NLS-1$
String message= LauncherMessages.getString("jdkLauncher.error.timeout"); //$NON-NLS-1$
result[0]= (MessageDialog.openQuestion(JDIDebugUIPlugin.getActiveWorkbenchShell(), title, message));
}
});
return new Boolean(result[0]);
}
}