protected File getIniLocation() {
return new File(fPHPIni.getText());
}
protected void createControl() {
PixelConverter pixelConverter = new PixelConverter(this);
GridLayout layout = new GridLayout(1, true);
setLayout(layout);
setLayoutData(new GridData(GridData.FILL_BOTH));
Composite parent = new Composite(this, SWT.NONE);
layout = new GridLayout();
layout.numColumns = 3;
parent.setLayout(layout);
parent.setLayoutData(new GridData(GridData.FILL_BOTH));
fPHPexeName = new StringDialogField();
fPHPexeName.setLabelText(PHPDebugUIMessages.addPHPexeDialog_phpName);
fPHPExePath = new StringButtonDialogField(new IStringButtonAdapter() {
public void changeControlPressed(DialogField field) {
FileDialog dialog = new FileDialog(getShell());
dialog.setFilterPath(fPHPExePath.getText());
dialog.setText(PHPDebugUIMessages.addPHPexeDialog_pickPHPRootDialog_message);
String newPath = dialog.open();
if (newPath != null) {
fPHPExePath.setText(newPath);
File executable = new File(newPath);
PHPExeInfo phpExecInfo = getPHPInfo(executable);
if (phpExecInfo != null) {
if (fPHPexeName.getText().isEmpty()
&& phpExecInfo.getName() != null)
fPHPexeName.setTextWithoutUpdate(phpExecInfo
.getName());
if (phpExecInfo.getSapiType() != null)
fSapiTypes.setText(phpExecInfo.getSapiType());
}
}
updateItem();
}
});
fPHPExePath.setLabelText(PHPDebugUIMessages.addPHPexeDialog_phpHome);
fPHPExePath.setButtonLabel(PHPDebugUIMessages.addPHPexeDialog_browse1);
fPHPIni = new StringButtonDialogField(new IStringButtonAdapter() {
public void changeControlPressed(DialogField field) {
FileDialog dialog = new FileDialog(getShell());
dialog.setFilterPath(fPHPIni.getText());
dialog.setFilterExtensions(new String[] { "*.ini", "*.*" }); //$NON-NLS-1$ //$NON-NLS-2$
dialog.setText(PHPDebugUIMessages.addPHPexeDialog_pickPHPIniDialog_message);
String newPath = dialog.open();
if (newPath != null) {
fPHPIni.setText(newPath);
isIniFileSet = true;
}
}
});
fPHPIni.setLabelText(PHPDebugUIMessages.addPHPexeDialog_phpIni);
fPHPIni.setButtonLabel(PHPDebugUIMessages.addPHPexeDialog_browse1);
fPHPexeName.doFillIntoGrid(parent, 3);
fPHPExePath.doFillIntoGrid(parent, 3);
((GridData) fPHPExePath.getTextControl(parent).getLayoutData()).widthHint = pixelConverter
.convertWidthInCharsToPixels(50);
fPHPIni.doFillIntoGrid(parent, 3);
((GridData) fPHPIni.getTextControl(parent).getLayoutData()).widthHint = pixelConverter
.convertWidthInCharsToPixels(50);
fLoadDefaultPHPIni = new Button(parent, SWT.CHECK);
fLoadDefaultPHPIni
.setText(PHPDebugUIMessages.addPHPexeDialog_loadDefaultPHPIni);