tabFolder.setLayoutData(gridData);
// addLoadPathTab(tabFolder);
- addInterpreterTab(tabFolder);
addRemoteDebugTab(tabFolder);
+ addInterpreterTab(tabFolder);
}
protected void addRemoteDebugTab(TabFolder tabFolder) {
IProject project = ResourcesPlugin.getWorkspace().getRoot()
.getProject(projectName);
if (project != null) {
- IPath remotePath = project.getLocation();
+ IPath remotePath = project.getFullPath();
String fileName = configuration.getAttribute(
PHPLaunchConfigurationAttribute.FILE_NAME, "");
if (fileName != "") {
} catch (CoreException ce) {
fRemoteDebugCheckBox.setSelection(DEFAULT_REMOTE_DEBUG);
}
- if (fRemoteDebugCheckBox.getSelection()) {
- tabFolder.setSelection(0);
- }
+ tabFolder.setSelection(fRemoteDebugCheckBox.getSelection() ? 0 : 1);
try {
fRemoteDebugTranslate.setSelection(configuration.getAttribute(
PHPLaunchConfigurationAttribute.REMOTE_DEBUG_TRANSLATE,
} catch (CoreException e) {
log(e);
}
- if (interpreterName != null && !interpreterName.equals(""))
+ if (interpreterName != null && !interpreterName.equals("")) {
interpreterCombo.select(interpreterCombo.indexOf(interpreterName));
+ }
+ if (interpreterCombo.getSelectionIndex() < 0) {
+ // previous definition had been deleted
+ ((ILaunchConfigurationWorkingCopy) configuration).setAttribute(
+ PHPLaunchConfigurationAttribute.SELECTED_INTERPRETER, "");
+ setErrorMessage(PHPDebugUiMessages
+ .getString("LaunchConfigurationTab.PHPEnvironment.interpreter_not_selected_error_message"));
+ }
}
protected void initializeInterpreterCombo(Combo interpreterCombo) {
public boolean isValid(ILaunchConfiguration launchConfig) {
try {
- String selectedInterpreter = launchConfig.getAttribute(
- PHPLaunchConfigurationAttribute.SELECTED_INTERPRETER, "");
- if (selectedInterpreter.length() == 0) {
- setErrorMessage(PHPDebugUiMessages
- .getString("LaunchConfigurationTab.PHPEnvironment.interpreter_not_selected_error_message"));
- return false;
+ if (launchConfig.getAttribute(
+ PHPLaunchConfigurationAttribute.SELECTED_INTERPRETER, "")
+ .equals("")) {
+ if (!launchConfig.getAttribute(
+ PHPLaunchConfigurationAttribute.REMOTE_DEBUG, false)) {
+ setErrorMessage(PHPDebugUiMessages
+ .getString("LaunchConfigurationTab.PHPEnvironment.interpreter_not_selected_error_message"));
+ return false;
+ }
}
} catch (CoreException e) {
log(e);