/*******************************************************************************
 * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
 * Distributed under license by Red Hat, Inc. All rights reserved.
 * This program is made available under the terms of the
 * Eclipse Public License v1.0 which accompanies this distribution,
 * and is available at http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Exadel, Inc. and Red Hat, Inc. - initial API and implementation
 ******************************************************************************/ 
package org.jboss.ide.eclipse.as.ui.actions;

import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.osgi.util.NLS;
import org.eclipse.wst.server.core.IServer;

public class DebugServerActionDelegate extends RunServerActionDelegate {

	protected String getLaunchMode() {
		return ILaunchManager.DEBUG_MODE;
	}


	protected String computeToolTip() {
		IServer selected = ServerManager.getInstance().getSelectedServer();
		String name = selected == null ? "" : selected.getName(); //$NON-NLS-1$
		if( selected != null && selected.getServerState() == IServer.STATE_STARTED)
			return NLS.bind(ServerActionMessages.RESTART_IN_DEBUG_MODE, name);
		return NLS.bind(ServerActionMessages.START_IN_DEBUG_MODE, name);
	}	

}
