X-Git-Url: http://secure.phpeclipse.com diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPEclipseShowContextHelp.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPEclipseShowContextHelp.java new file mode 100644 index 0000000..9a638e2 --- /dev/null +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPEclipseShowContextHelp.java @@ -0,0 +1,47 @@ +/********************************************************************** +Copyright (c) 2000, 2002 IBM Corp. and others. +All rights reserved. This program and the accompanying materials +are made available under the terms of the Common Public License v1.0 +which accompanies this distribution, and is available at +http://www.eclipse.org/legal/cpl-v10.html + +Contributors: + IBM Corporation - Initial implementation + Klaus Hartlage - www.eclipseproject.de +**********************************************************************/ +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.internal.EditorPluginAction; + +public class PHPEclipseShowContextHelp + extends ActionDelegate + implements IEditorActionDelegate { + +private IEditorPart editor; + /** + * @see ActionDelegate#run(IAction) + */ + public void run(IAction action) { + EditorPluginAction editorPluginAction = (EditorPluginAction) action; + IEditorInput input = editor.getEditorInput(); + // Add your code here to perform the action + MessageDialog.openInformation( + editor.getSite().getShell(), + "Context Help: ", + input.toString()); + } + + /** + * @see IEditorActionDelegate#setActiveEditor(IAction, IEditorPart) + */ + public void setActiveEditor(IAction action, IEditorPart targetEditor) { + this.editor = targetEditor; + } + +}