X-Git-Url: http://secure.phpeclipse.com diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPSourceViewerConfiguration.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPSourceViewerConfiguration.java index 360da1e..7406714 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPSourceViewerConfiguration.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPSourceViewerConfiguration.java @@ -59,6 +59,7 @@ import org.eclipse.jface.text.source.ISourceViewer; import org.eclipse.jface.text.source.SourceViewerConfiguration; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.IEditorInput; import org.eclipse.ui.IFileEditorInput; /** @@ -417,11 +418,14 @@ public class PHPSourceViewerConfiguration extends SourceViewerConfiguration { * Method declared on SourceViewerConfiguration */ public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType) { - try { - IFile f = ((IFileEditorInput) fEditor.getEditorInput()).getFile(); - return new PHPTextHover(f.getProject()); - } catch (NullPointerException e) { - // this exception occurs, if getTextHover is called by preference pages ! + IEditorInput editorInput = fEditor.getEditorInput(); + if (editorInput instanceof IFileEditorInput) { + try { + IFile f = ((IFileEditorInput) editorInput).getFile(); + return new PHPTextHover(f.getProject()); + } catch (NullPointerException e) { + // this exception occurs, if getTextHover is called by preference pages ! + } } return new PHPTextHover(null); }