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