X-Git-Url: http://secure.phpeclipse.com diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/program/launchConfigurations/ProgramMainTab.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/program/launchConfigurations/ProgramMainTab.java new file mode 100644 index 0000000..08e0978 --- /dev/null +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/externaltools/internal/program/launchConfigurations/ProgramMainTab.java @@ -0,0 +1,33 @@ +package net.sourceforge.phpdt.externaltools.internal.program.launchConfigurations; + +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.ResourcesPlugin; +import net.sourceforge.phpdt.externaltools.internal.ui.FileSelectionDialog; +import net.sourceforge.phpdt.externaltools.launchConfigurations.ExternalToolsMainTab; +import net.sourceforge.phpdt.externaltools.model.IExternalToolConstants; +import net.sourceforge.phpdt.externaltools.model.ToolUtil; + +public class ProgramMainTab extends ExternalToolsMainTab { + + /** + * Prompts the user for a program location within the workspace and sets the + * location as a String containing the workspace_loc variable or + * null if no location was obtained from the user. + */ + protected void handleWorkspaceLocationButtonSelected() { + FileSelectionDialog dialog; + dialog = new FileSelectionDialog(getShell(), ResourcesPlugin.getWorkspace().getRoot(), "&Select a program"); + dialog.open(); + IFile file = dialog.getResult(); + if (file == null) { + return; + } + StringBuffer buf = new StringBuffer(); + ToolUtil.buildVariableTag(IExternalToolConstants.VAR_WORKSPACE_LOC, file.getFullPath().toString(), buf); + String text= buf.toString(); + if (text != null) { + locationField.setText(text); + } + } + +}