| /******************************************************************************* |
| * Copyright (c) 2001, 2004 IBM Corporation and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * IBM Corporation - initial API and implementation |
| * |
| *******************************************************************************/ |
| package org.eclipse.wst.sse.ui.tests; |
| |
| import org.eclipse.jface.action.Action; |
| import org.eclipse.jface.action.IAction; |
| import org.eclipse.jface.dialogs.MessageDialog; |
| import org.eclipse.jface.resource.ImageDescriptor; |
| import org.eclipse.jface.viewers.ISelection; |
| import org.eclipse.ui.IEditorActionDelegate; |
| import org.eclipse.ui.IEditorPart; |
| |
| /** |
| * @author nsd |
| * |
| */ |
| public class TestActionDelegate extends Action implements IEditorActionDelegate { |
| IEditorPart editor = null; |
| IAction faction = null; |
| |
| /** |
| * |
| */ |
| public TestActionDelegate() { |
| super(); |
| } |
| |
| /** |
| * @param text |
| */ |
| public TestActionDelegate(String text) { |
| super(text); |
| } |
| |
| /** |
| * @param text |
| * @param image |
| */ |
| public TestActionDelegate(String text, ImageDescriptor image) { |
| super(text, image); |
| } |
| |
| /** |
| * @param text |
| * @param style |
| */ |
| public TestActionDelegate(String text, int style) { |
| super(text, style); |
| } |
| |
| /* |
| * (non-Javadoc) |
| * |
| * @see org.eclipse.ui.IEditorActionDelegate#setActiveEditor(org.eclipse.jface.action.IAction, |
| * org.eclipse.ui.IEditorPart) |
| */ |
| public void setActiveEditor(IAction targetAction, IEditorPart targetEditor) { |
| editor = targetEditor; |
| faction = targetAction; |
| } |
| |
| /* |
| * (non-Javadoc) |
| * |
| * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) |
| */ |
| public void run(IAction runAction) { |
| MessageDialog.openInformation(editor.getEditorSite().getShell(), "Test", "Completed"); |
| } |
| |
| /* |
| * (non-Javadoc) |
| * |
| * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, |
| * org.eclipse.jface.viewers.ISelection) |
| */ |
| public void selectionChanged(IAction action, ISelection selection) { |
| // do nothing |
| } |
| } |