package net.sourceforge.phpdt.internal.debug.ui.launcher;
+import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import net.sourceforge.phpdt.internal.debug.ui.PHPDebugUiMessages;
import net.sourceforge.phpdt.internal.debug.ui.PHPDebugUiPlugin;
-import net.sourceforge.phpdt.internal.debug.ui.preferences.EditInterpreterDialog;
import net.sourceforge.phpdt.internal.debug.ui.preferences.EditPathMapDialog;
+import net.sourceforge.phpdt.internal.debug.ui.preferences.PHPInterpreterPreferencePage;
import net.sourceforge.phpdt.internal.launching.PHPInterpreter;
import net.sourceforge.phpdt.internal.launching.PHPLaunchConfigurationAttribute;
import net.sourceforge.phpdt.internal.launching.PHPRuntime;
// protected Button loadPathDefaultButton;
protected Button fRemoteDebugCheckBox;
+ protected Button fRemoteDebugTranslate;
protected Button fOpenDBGSessionInBrowserCheckBox;
handlePathMapRemoveButtonSelected();
} else if (source == fRemoteDebugCheckBox) {
setRemoteTabEnableState();
+ } else if (source == fRemoteDebugTranslate) {
+ setRemoteTabEnableState();
} else {
updateLaunchConfigurationDialog();
;
private static final boolean DEFAULT_REMOTE_DEBUG = false;
+ private static final boolean DEFAULT_REMOTE_DEBUG_TRANSLATE = false;
+
private static final boolean DEFAULT_OPEN_DBGSESSION_IN_BROWSER = true;
static String[] columnTitles = {
fRemoteDebugCheckBox.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
fRemoteDebugCheckBox.addSelectionListener(fListener);
+ fRemoteDebugTranslate = new Button(comp, SWT.CHECK);
+ fRemoteDebugTranslate.setText(PHPDebugUiMessages
+ .getString("LaunchConfigurationTab.PHPEnvironment.remoteDebugTab.RemoteTranslate.label"));
+ fRemoteDebugTranslate.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
+ fRemoteDebugTranslate.addSelectionListener(fListener);
+
fOpenDBGSessionInBrowserCheckBox = new Button(comp, SWT.CHECK);
fOpenDBGSessionInBrowserCheckBox.setText(PHPDebugUiMessages
.getString("LaunchConfigurationTab.PHPEnvironment.remoteDebugTab.OpenDBGSessionInBrowserCheckBox.label"));
private void setRemoteTabEnableState() {
boolean state = fRemoteDebugCheckBox.getSelection();
fRemoteSourcePath.setEnabled(state);
-
+ fRemoteDebugTranslate.setEnabled(state);
+
fRemoteDebugPathMapTable.setEnabled(state);
if (!state) {
fPathMapEditButton.setEnabled(false);
//
if (fRemoteDebugCheckBox.getSelection()) {
fOpenDBGSessionInBrowserCheckBox.setEnabled(true);
+ fRemoteDebugTranslate.setEnabled(true);
int selectCount = this.fRemoteDebugPathMapTable.getSelectionIndices().length;
if (selectCount < 1) {
fPathMapEditButton.setEnabled(false);
interpreterAddButton.setText(PHPDebugUiMessages.getString("LaunchConfigurationTab.PHPEnvironment.interpreterAddButton.label"));
interpreterAddButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent evt) {
- PHPInterpreter newInterpreter = new PHPInterpreter(null, null);
- EditInterpreterDialog editor = new EditInterpreterDialog(getShell(), PHPDebugUiMessages
- .getString("LaunchConfigurationTab.PHPEnvironment.editInterpreterDialog.title"));
- editor.create();
- editor.setInterpreterToEdit(newInterpreter);
- if (EditInterpreterDialog.OK == editor.open()) {
+ PHPInterpreter newInterpreter = new PHPInterpreter(null);
+ File phpRuntime = PHPInterpreterPreferencePage.getFile(getShell(), null);
+ if (phpRuntime != null) {
+ newInterpreter.setInstallLocation(phpRuntime);
PHPRuntime.getDefault().addInstalledInterpreter(newInterpreter);
- interpreterCombo.add(newInterpreter.getName());
- interpreterCombo.select(interpreterCombo.indexOf(newInterpreter.getName()));
+ interpreterCombo.add(newInterpreter.getInstallLocation().toString());
+ interpreterCombo.select(interpreterCombo.indexOf(newInterpreter.getInstallLocation().toString()));
}
}
});
fRemoteDebugCheckBox.setSelection(DEFAULT_REMOTE_DEBUG);
}
try {
+ fRemoteDebugTranslate.setSelection(configuration.getAttribute(
+ PHPLaunchConfigurationAttribute.REMOTE_DEBUG_TRANSLATE, DEFAULT_REMOTE_DEBUG_TRANSLATE));
+ } catch (CoreException ce) {
+ fRemoteDebugTranslate.setSelection(DEFAULT_REMOTE_DEBUG_TRANSLATE);
+ }
+ try {
fOpenDBGSessionInBrowserCheckBox.setSelection(configuration.getAttribute(
PHPLaunchConfigurationAttribute.OPEN_DBGSESSION_IN_BROWSER, DEFAULT_OPEN_DBGSESSION_IN_BROWSER));
} catch (CoreException ce) {
String[] interpreterNames = new String[installedInterpretersWorkingCopy.size()];
for (int interpreterIndex = 0; interpreterIndex < installedInterpretersWorkingCopy.size(); interpreterIndex++) {
PHPInterpreter interpreter = (PHPInterpreter) installedInterpretersWorkingCopy.get(interpreterIndex);
- interpreterNames[interpreterIndex] = interpreter.getName();
+ interpreterNames[interpreterIndex] = interpreter.getInstallLocation().toString();
}
interpreterCombo.setItems(interpreterNames);
PHPInterpreter selectedInterpreter = PHPRuntime.getDefault().getSelectedInterpreter();
if (selectedInterpreter != null)
- interpreterCombo.select(interpreterCombo.indexOf(selectedInterpreter.getName()));
+ interpreterCombo.select(interpreterCombo.indexOf(selectedInterpreter.getInstallLocation().toString()));
}
public void performApply(ILaunchConfigurationWorkingCopy configuration) {
// }
configuration.setAttribute(PHPLaunchConfigurationAttribute.REMOTE_DEBUG, fRemoteDebugCheckBox.getSelection());
+ configuration.setAttribute(PHPLaunchConfigurationAttribute.REMOTE_DEBUG_TRANSLATE, fRemoteDebugTranslate.getSelection());
configuration.setAttribute(PHPLaunchConfigurationAttribute.FILE_MAP, getMapFromPathMapTable());
configuration.setAttribute(PHPLaunchConfigurationAttribute.REMOTE_PATH, fRemoteSourcePath.getText());
configuration.setAttribute(PHPLaunchConfigurationAttribute.OPEN_DBGSESSION_IN_BROWSER, fOpenDBGSessionInBrowserCheckBox