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;
}
}