X-Git-Url: http://git.phpeclipse.com diff --git a/net.sourceforge.phpeclipse.xml.ui/src/net/sourceforge/phpeclipse/xml/ui/internal/editor/XMLEditorActionContributor.java b/net.sourceforge.phpeclipse.xml.ui/src/net/sourceforge/phpeclipse/xml/ui/internal/editor/XMLEditorActionContributor.java index 67a706e..95c2f5c 100644 --- a/net.sourceforge.phpeclipse.xml.ui/src/net/sourceforge/phpeclipse/xml/ui/internal/editor/XMLEditorActionContributor.java +++ b/net.sourceforge.phpeclipse.xml.ui/src/net/sourceforge/phpeclipse/xml/ui/internal/editor/XMLEditorActionContributor.java @@ -23,29 +23,31 @@ import org.eclipse.ui.texteditor.ITextEditor; * Common base class for action contributors for Java editors. */ public class XMLEditorActionContributor extends BasicTextEditorActionContributor { - - /* (non-Javadoc) - * @see org.eclipse.ui.IEditorActionBarContributor#setActiveEditor(org.eclipse.ui.IEditorPart) - */ - public void setActiveEditor(IEditorPart part) { - super.setActiveEditor(part); - ITextEditor textEditor = null; - if (part instanceof ITextEditor) - textEditor = (ITextEditor) part; - if (textEditor != null) { - IFile file = null; - IEditorInput editorInput = textEditor.getEditorInput(); + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.IEditorActionBarContributor#setActiveEditor(org.eclipse.ui.IEditorPart) + */ + public void setActiveEditor(IEditorPart part) { + super.setActiveEditor(part); + ITextEditor textEditor = null; + if (part instanceof ITextEditor) + textEditor = (ITextEditor) part; - if (editorInput instanceof IFileEditorInput) { - file = ((IFileEditorInput) editorInput).getFile(); - } + if (textEditor != null) { + IFile file = null; + IEditorInput editorInput = textEditor.getEditorInput(); - ShowExternalPreviewAction fShowExternalPreviewAction = ShowExternalPreviewAction.getInstance(); - fShowExternalPreviewAction.setEditor(textEditor); - fShowExternalPreviewAction.update(); - if (fShowExternalPreviewAction != null) - fShowExternalPreviewAction.doRun(ShowExternalPreviewAction.PHP_TYPE); - } - } + if (editorInput instanceof IFileEditorInput) { + file = ((IFileEditorInput) editorInput).getFile(); + } + + ShowExternalPreviewAction fShowExternalPreviewAction = ShowExternalPreviewAction.getInstance(); + fShowExternalPreviewAction.setEditor(textEditor); + fShowExternalPreviewAction.update(); + if (fShowExternalPreviewAction != null) + fShowExternalPreviewAction.doRun(ShowExternalPreviewAction.PHP_TYPE); + } + } }