import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
+//import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
protected Button fOpenDBGSessionInBrowserCheckBox;
+ protected Button fOpenDBGSessionInExternalBrowserCheckBox;
+
protected Button fPathMapRemoveButton;
protected Button fPathMapAddButton;
setRemoteTabEnableState();
} else if (source == fRemoteDebugTranslate) {
setRemoteTabEnableState();
+ } else if (source == fOpenDBGSessionInBrowserCheckBox) {
+ setRemoteTabEnableState();
} else {
updateLaunchConfigurationDialog();
}
makeupTargetFile();
-
}
}
private static final boolean DEFAULT_OPEN_DBGSESSION_IN_BROWSER = true;
+ private static final boolean DEFAULT_OPEN_DBGSESSION_IN_EXTERNAL_BROWSER = false;
+
static String[] columnTitles = {
PHPDebugUiMessages
.getString("LaunchConfigurationTab.PHPEnvironment.remoteDebugTab.PathMapTableTitle.local"),
tabFolder.setLayoutData(gridData);
// addLoadPathTab(tabFolder);
- addInterpreterTab(tabFolder);
addRemoteDebugTab(tabFolder);
+ addInterpreterTab(tabFolder);
}
protected void addRemoteDebugTab(TabFolder tabFolder) {
GridData.HORIZONTAL_ALIGN_BEGINNING));
fOpenDBGSessionInBrowserCheckBox.addSelectionListener(fListener);
+ // addendum
+ fOpenDBGSessionInExternalBrowserCheckBox = new Button(comp, SWT.CHECK);
+ fOpenDBGSessionInExternalBrowserCheckBox
+ .setText(PHPDebugUiMessages
+ .getString("LaunchConfigurationTab.PHPEnvironment.remoteDebugTab.OpenDBGSessionInExternalBrowserCheckBox.label"));
+ fOpenDBGSessionInExternalBrowserCheckBox.setLayoutData(new GridData(
+ SWT.BEGINNING));
+ ((GridData) fOpenDBGSessionInExternalBrowserCheckBox.getLayoutData()).horizontalIndent = 16;
+ fOpenDBGSessionInExternalBrowserCheckBox
+ .addSelectionListener(fListener);
+ // addendum
+
label = new Label(comp, SWT.NONE);
label
.setText(PHPDebugUiMessages
fPathMapRemoveButton.setEnabled(false);
fPathMapAddButton.setEnabled(false);
fOpenDBGSessionInBrowserCheckBox.setEnabled(false);
+ fOpenDBGSessionInExternalBrowserCheckBox.setEnabled(false);
} else {
setPathMapButtonsEnableState();
}
//
if (fRemoteDebugCheckBox.getSelection()) {
fOpenDBGSessionInBrowserCheckBox.setEnabled(true);
+ fOpenDBGSessionInExternalBrowserCheckBox
+ .setEnabled(fOpenDBGSessionInBrowserCheckBox.getSelection());
fRemoteDebugTranslate.setEnabled(true);
int selectCount = this.fRemoteDebugPathMapTable
.getSelectionIndices().length;
// is customizable on the configuration
// }
- protected SelectionListener getLoadPathSelectionListener() {
- return new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- System.out.println("Loadpath list selection occurred: "
- + e.getSource());
- }
- };
- }
-
- protected SelectionListener getLoadPathDefaultButtonSelectionListener() {
- return new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- setUseLoadPathDefaults(((Button) e.getSource()).getSelection());
- }
- };
- }
+// protected SelectionListener getLoadPathSelectionListener() {
+// return new SelectionAdapter() {
+// public void widgetSelected(SelectionEvent e) {
+// System.out.println("Loadpath list selection occurred: "
+// + e.getSource());
+// }
+// };
+// }
+
+// protected SelectionListener getLoadPathDefaultButtonSelectionListener() {
+// return new SelectionAdapter() {
+// public void widgetSelected(SelectionEvent e) {
+// setUseLoadPathDefaults(((Button) e.getSource()).getSelection());
+// }
+// };
+// }
protected void addInterpreterTab(TabFolder tabFolder) {
Composite interpreterComposite = new Composite(tabFolder, SWT.NONE);
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);
}
+ tabFolder.setSelection(fRemoteDebugCheckBox.getSelection() ? 0 : 1);
try {
fRemoteDebugTranslate.setSelection(configuration.getAttribute(
PHPLaunchConfigurationAttribute.REMOTE_DEBUG_TRANSLATE,
fOpenDBGSessionInBrowserCheckBox
.setSelection(DEFAULT_OPEN_DBGSESSION_IN_BROWSER);
}
+ try {
+ fOpenDBGSessionInExternalBrowserCheckBox
+ .setSelection(configuration
+ .getAttribute(
+ PHPLaunchConfigurationAttribute.OPEN_DBGSESSION_IN_EXTERNAL_BROWSER,
+ DEFAULT_OPEN_DBGSESSION_IN_EXTERNAL_BROWSER));
+ } catch (CoreException ce) {
+ fOpenDBGSessionInExternalBrowserCheckBox
+ .setSelection(DEFAULT_OPEN_DBGSESSION_IN_EXTERNAL_BROWSER);
+ }
+
setRemoteTabEnableState();
+
try {
fRemoteSourcePath.setText(configuration.getAttribute(
PHPLaunchConfigurationAttribute.REMOTE_PATH, ""));
// }
// }
- protected void setUseLoadPathDefaults(boolean useDefaults) {
- loadPathListViewer.getList().setEnabled(!useDefaults);
- // loadPathDefaultButton.setSelection(useDefaults);
- }
+// protected void setUseLoadPathDefaults(boolean useDefaults) {
+// loadPathListViewer.getList().setEnabled(!useDefaults);
+// // loadPathDefaultButton.setSelection(useDefaults);
+// }
protected void initializeInterpreterSelection(
ILaunchConfiguration configuration) {
} 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) {
configuration.setAttribute(
PHPLaunchConfigurationAttribute.OPEN_DBGSESSION_IN_BROWSER,
fOpenDBGSessionInBrowserCheckBox.getSelection());
+ configuration
+ .setAttribute(
+ PHPLaunchConfigurationAttribute.OPEN_DBGSESSION_IN_EXTERNAL_BROWSER,
+ fOpenDBGSessionInExternalBrowserCheckBox.getSelection());
}
protected Composite createPageRoot(Composite parent) {
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);