public class PHPEntryPointTab extends AbstractLaunchConfigurationTab {
protected String originalFileName, originalProjectName;
+
protected PHPProjectSelector projectSelector;
+
protected PHPFileSelector fileSelector;
public PHPEntryPointTab() {
new Label(composite, SWT.NONE).setText(PHPDebugUiMessages.getString("LaunchConfigurationTab.PHPEntryPoint.projectLabel"));
projectSelector = new PHPProjectSelector(composite);
- projectSelector.setBrowseDialogMessage(PHPDebugUiMessages.getString("LaunchConfigurationTab.PHPEntryPoint.projectSelectorMessage"));
+ projectSelector.setBrowseDialogMessage(PHPDebugUiMessages
+ .getString("LaunchConfigurationTab.PHPEntryPoint.projectSelectorMessage"));
projectSelector.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
projectSelector.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent evt) {
if (part != null) {
IEditorInput input = part.getEditorInput();
IResource file = (IResource) input.getAdapter(IResource.class);
- return file.getProject();
+ if (file != null) {
+ return file.getProject();
+ }
}
}
return null;
public void performApply(ILaunchConfigurationWorkingCopy configuration) {
configuration.setAttribute(PHPLaunchConfigurationAttribute.PROJECT_NAME, projectSelector.getSelectionText());
IFile file = fileSelector.getSelection();
- configuration.setAttribute(PHPLaunchConfigurationAttribute.FILE_NAME, file == null ? "" : file.getProjectRelativePath().toString());
+ configuration.setAttribute(PHPLaunchConfigurationAttribute.FILE_NAME, file == null ? "" : file.getProjectRelativePath()
+ .toString());
}
protected Composite createPageRoot(Composite parent) {
public boolean isValid(ILaunchConfiguration launchConfig) {
try {
-
+
String projectName = launchConfig.getAttribute(PHPLaunchConfigurationAttribute.PROJECT_NAME, "");
if (projectName.length() == 0) {
setErrorMessage(PHPDebugUiMessages.getString("LaunchConfigurationTab.PHPEntryPoint.invalidProjectSelectionMessage"));
} catch (CoreException e) {
log(e);
}
-
+
setErrorMessage(null);
return true;
}
public Image getImage() {
return PHPUiImages.get(PHPUiImages.IMG_CTOOLS_PHP_PAGE);
- }
+ }
}
\ No newline at end of file