From aa2153d3566a0eff8917c74bdc0f150024bbddd7 Mon Sep 17 00:00:00 2001 From: khartlage Date: Sun, 8 Jun 2003 17:25:21 +0000 Subject: [PATCH] Fixed "textEditor==null" bug --- .../phpeclipse/phpeditor/PHPActionContributor.java | 38 +++++++++++--------- 1 files changed, 21 insertions(+), 17 deletions(-) diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPActionContributor.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPActionContributor.java index 5a35c88..66656e2 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPActionContributor.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPActionContributor.java @@ -178,30 +178,34 @@ public class PHPActionContributor extends BasicTextEditorActionContributor { ActionGroup group = cuEditor.getActionGroup(); if (group != null) group.fillActionBars(bars); - } + } // fTogglePresentation.setEditor(editor); // fTogglePresentation.update(); - IFile file = null; - IEditorInput editorInput = textEditor.getEditorInput(); + if (textEditor != null) { - if (editorInput instanceof IFileEditorInput) { - file = ((IFileEditorInput) editorInput).getFile(); - } + IFile file = null; + IEditorInput editorInput = textEditor.getEditorInput(); + + if (editorInput instanceof IFileEditorInput) { + file = ((IFileEditorInput) editorInput).getFile(); + } - PHPeclipsePlugin.getDefault().setLastEditorFile(file); - fParserAction.setEditor(textEditor); - fParserAction.update(); - if (SWT.getPlatform().equals("win32") && textEditor instanceof AbstractTextEditor) { - fShowExternalPreviewAction.setEditor(textEditor); - fShowExternalPreviewAction.update(); - IPreferenceStore store = PHPeclipsePlugin.getDefault().getPreferenceStore(); - if (store.getBoolean(PHPeclipsePlugin.SHOW_EXTERNAL_PREVIEW_PREF)) { - IAction a = ShowExternalPreviewAction.getInstance(); - if (a != null) - a.run(); + PHPeclipsePlugin.getDefault().setLastEditorFile(file); + fParserAction.setEditor(textEditor); + fParserAction.update(); + if (SWT.getPlatform().equals("win32") && textEditor instanceof AbstractTextEditor) { + fShowExternalPreviewAction.setEditor(textEditor); + fShowExternalPreviewAction.update(); + IPreferenceStore store = PHPeclipsePlugin.getDefault().getPreferenceStore(); + if (store.getBoolean(PHPeclipsePlugin.SHOW_EXTERNAL_PREVIEW_PREF)) { + IAction a = ShowExternalPreviewAction.getInstance(); + if (a != null) + a.run(); + } } } + } /* -- 1.7.1