Integrated PHP help files; Fixed some bugs
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / actions / PHPEclipseShowContextHelp.java
index 9a638e2..2b5bd88 100644 (file)
@@ -14,34 +14,30 @@ package net.sourceforge.phpeclipse.actions;
 import org.eclipse.jface.action.IAction;
 import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.ui.IEditorActionDelegate;
-import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.actions.ActionDelegate;
+import org.eclipse.ui.editors.text.TextEditor;
 import org.eclipse.ui.internal.EditorPluginAction;
+import org.eclipse.ui.part.FileEditorInput;
 
-public class PHPEclipseShowContextHelp
-  extends ActionDelegate
-  implements IEditorActionDelegate {
-    
-private IEditorPart editor;
+public class PHPEclipseShowContextHelp extends ActionDelegate implements IEditorActionDelegate {
+
+  private TextEditor editor;
   /**
    * @see ActionDelegate#run(IAction)
    */
   public void run(IAction action) {
     EditorPluginAction editorPluginAction = (EditorPluginAction) action;
-    IEditorInput input = editor.getEditorInput();
+    FileEditorInput input = (FileEditorInput) editor.getEditorInput();
     // Add your code here to perform the action
-    MessageDialog.openInformation(
-      editor.getSite().getShell(),
-      "Context Help: ", 
-      input.toString());
+    MessageDialog.openInformation(editor.getSite().getShell(), "Context Help: ", input.toString());
   }
 
   /**
    * @see IEditorActionDelegate#setActiveEditor(IAction, IEditorPart)
    */
   public void setActiveEditor(IAction action, IEditorPart targetEditor) {
-      this.editor = targetEditor;
+    this.editor = (TextEditor) targetEditor;
   }
 
 }