fDebuggers.setVisible(false);
fDebuggersLabel.setVisible(false);
}
public void validate() {
PHPexeItem phpExeItem = getPHPExeItem();
// Let's reset previous state
setComplete(true);
setMessage(PHPDebugUIMessages.PHPExeCompositeFragment_0,
IMessageProvider.INFORMATION);
/* MESSAGES */
// Check if PHP executable location is empty
if (phpExeItem.getExecutable() == null
|| phpExeItem.getExecutable().getPath().length() == 0) {
setComplete(false);
setMessage(PHPDebugUIMessages.addPHPexeDialog_enterLocation,
IMessageProvider.INFORMATION);
return;
}
// Check if name is empty
if (phpExeItem.getName().isEmpty()) {
setComplete(false);
setMessage(PHPDebugUIMessages.addPHPexeDialog_enterName,
IMessageProvider.INFORMATION);
return;
}
/* ERRORS */
// Check PHP executable
if (phpExeItem.getExecutable() == null) {
setMessage(PHPDebugUIMessages.PHPExeCompositeFragment_13,
IMessageProvider.ERROR);
return;
}
if (!phpExeItem.getExecutable().exists()) {
setMessage(PHPDebugUIMessages.addPHPexeDialog_locationNotExists,
IMessageProvider.ERROR);
return;
}
PHPExeInfo phpExecInfo = getPHPInfo(phpExeItem.getExecutable());
if (phpExecInfo == null) {
setMessage(PHPDebugUIMessages.PHPExeCompositeFragment_13,
IMessageProvider.ERROR);
return;
}
// Check whether the name already exists:
if (existingItems != null) {
for (PHPexeItem item : existingItems) {
if (!item.getName().equals(initialName)
&& item.getName().equals(phpExeItem.getName())) {
setMessage(
PHPDebugUIMessages.addPHPexeDialog_duplicateName,
IMessageProvider.ERROR);
return;
}
}
}
// Check if SAPI type is provided
if (phpExeItem.getSapiType().isEmpty()) {
setMessage(PHPDebugUIMessages.PHPExeCompositeFragment_15,
IMessageProvider.ERROR);
return;
}
if (phpExecInfo.getSapiType() != null
&& !phpExeItem.getSapiType().equals(phpExecInfo.getSapiType())) {
setMessage(MessageFormat.format(
PHPDebugUIMessages.addPHPexeDialog_wrongSAPItype,
phpExecInfo.getSapiType()), IMessageProvider.ERROR);
return;
}
// Check INI file location
if (phpExeItem.getINILocation() != null) {
String iniLocationName = phpExeItem.getINILocation().getPath();
File iniFile = null;
if (iniLocationName.trim().length() > 0) {
iniFile = new File(iniLocationName);
if (!iniFile.exists()) {
setMessage(