1 package net.sourceforge.phpdt.externaltools.internal.program.launchConfigurations;
3 import org.eclipse.core.resources.IFile;
4 import org.eclipse.core.resources.ResourcesPlugin;
5 import net.sourceforge.phpdt.externaltools.internal.ui.FileSelectionDialog;
6 import net.sourceforge.phpdt.externaltools.launchConfigurations.ExternalToolsMainTab;
7 import net.sourceforge.phpdt.externaltools.model.IExternalToolConstants;
8 import net.sourceforge.phpdt.externaltools.model.ToolUtil;
10 public class ProgramMainTab extends ExternalToolsMainTab {
13 * Prompts the user for a program location within the workspace and sets the
14 * location as a String containing the workspace_loc variable or
15 * <code>null</code> if no location was obtained from the user.
17 protected void handleWorkspaceLocationButtonSelected() {
18 FileSelectionDialog dialog;
19 dialog = new FileSelectionDialog(getShell(), ResourcesPlugin.getWorkspace().getRoot(), "&Select a program");
21 IFile file = dialog.getResult();
25 StringBuffer buf = new StringBuffer();
26 ToolUtil.buildVariableTag(IExternalToolConstants.VAR_WORKSPACE_LOC, file.getFullPath().toString(), buf);
27 String text= buf.toString();
29 locationField.setText(text);