aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzzhongwei2012-09-04 22:49:49 (EDT)
committerzzhongwei2012-09-04 22:49:49 (EDT)
commitbee4500e7332b915a579d10bf60134310e3f71f4 (patch)
tree3d1874db1d4c2756c6010e8ca3a4042e0f6f3414
parent784a9089b74e9d5c9b17723d4646b868a1dcc65f (diff)
downloadorg.eclipse.pdt-bee4500e7332b915a579d10bf60134310e3f71f4.zip
org.eclipse.pdt-bee4500e7332b915a579d10bf60134310e3f71f4.tar.gz
org.eclipse.pdt-bee4500e7332b915a579d10bf60134310e3f71f4.tar.bz2
388807: when adding php executable, path to php.ini could be
automatically filled https://bugs.eclipse.org/bugs/show_bug.cgi?id=388807
-rw-r--r--plugins/org.eclipse.php.debug.ui/src/org/eclipse/php/internal/debug/ui/wizards/PHPExeCompositeFragment.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/plugins/org.eclipse.php.debug.ui/src/org/eclipse/php/internal/debug/ui/wizards/PHPExeCompositeFragment.java b/plugins/org.eclipse.php.debug.ui/src/org/eclipse/php/internal/debug/ui/wizards/PHPExeCompositeFragment.java
index caddc48..4a78b5d 100644
--- a/plugins/org.eclipse.php.debug.ui/src/org/eclipse/php/internal/debug/ui/wizards/PHPExeCompositeFragment.java
+++ b/plugins/org.eclipse.php.debug.ui/src/org/eclipse/php/internal/debug/ui/wizards/PHPExeCompositeFragment.java
@@ -15,6 +15,8 @@ import java.io.File;
import java.util.LinkedList;
import java.util.List;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IMessageProvider;
import org.eclipse.php.internal.debug.core.preferences.PHPDebuggersRegistry;
@@ -38,6 +40,7 @@ import org.eclipse.swt.widgets.Label;
public class PHPExeCompositeFragment extends CompositeFragment implements
IPHPExeCompositeFragment {
+ private static final String PHP_INI = "php.ini";
private PHPexeItem[] existingItems;
private StringDialogField fPHPexeName;
private StringButtonDialogField fPHPExePath;
@@ -48,6 +51,7 @@ public class PHPExeCompositeFragment extends CompositeFragment implements
private Label fSapiTypesLabel;
private Combo fSapiTypes;
private String initialName;
+ private boolean isIniFileSet = false;
public PHPExeCompositeFragment(Composite parent, IControlHandler handler,
boolean isForEditing) {
@@ -132,6 +136,7 @@ public class PHPExeCompositeFragment extends CompositeFragment implements
String newPath = dialog.open();
if (newPath != null) {
fPHPIni.setText(newPath);
+ isIniFileSet = true;
}
}
});
@@ -197,6 +202,19 @@ public class PHPExeCompositeFragment extends CompositeFragment implements
fPHPExePath.setDialogFieldListener(new IDialogFieldListener() {
public void dialogFieldChanged(DialogField field) {
+ String newPath = fPHPExePath.getText();
+ if (newPath != null && newPath.trim().length() > 0) {
+ if (!isIniFileSet
+ || (fPHPIni.getText() == null || fPHPIni.getText()
+ .trim().length() == 0)) {
+ IPath path = new Path(newPath);
+ path = path.removeLastSegments(1);
+ path = path.append(PHP_INI);
+ if (path.toFile().exists()) {
+ fPHPIni.setText(path.toOSString());
+ }
+ }
+ }
validate();
}
});