import org.eclipse.jface.text.templates.TemplateContextType;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
+import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IFileEditorInput;
PHPEditor editor = null;
if (fEditor != null && (fEditor instanceof PHPEditor)) {
editor = (PHPEditor) fEditor;
- file = ((IFileEditorInput) editor.getEditorInput()).getFile();
- project = file.getProject();
+ IEditorInput editorInput=editor.getEditorInput();
+ if (editorInput instanceof IFileEditorInput) {
+ file = ((IFileEditorInput) editorInput).getFile();
+ project = file.getProject();
+ }
+ else {
+ return new ICompletionProposal[0];
+ }
}
}