01: /*******************************************************************************
02: * Copyright (c) 2000, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.ui.examples.readmetool;
11:
12: import org.eclipse.jface.dialogs.MessageDialog;
13: import org.eclipse.ui.IViewActionDelegate;
14: import org.eclipse.ui.IViewPart;
15:
16: /**
17: * This class is used to demonstrate view action extensions.
18: * An extension should be defined in the readme plugin.xml.
19: */
20: public class ViewActionDelegate implements IViewActionDelegate {
21: public IViewPart view;
22:
23: /**
24: * Creates a new ViewActionDelegate.
25: */
26: public ViewActionDelegate() {
27: super ();
28: }
29:
30: /* (non-Javadoc)
31: * Method declared on IViewActionDelegate
32: */
33: public void init(IViewPart view) {
34: this .view = view;
35: }
36:
37: /* (non-Javadoc)
38: * Method declared on IActionDelegate
39: */
40: public void run(org.eclipse.jface.action.IAction action) {
41: MessageDialog.openInformation(view.getSite().getShell(),
42: MessageUtil.getString("Readme_Editor"), //$NON-NLS-1$
43: MessageUtil.getString("View_Action_executed")); //$NON-NLS-1$
44: }
45:
46: /* (non-Javadoc)
47: * Method declared on IActionDelegate
48: */
49: public void selectionChanged(
50: org.eclipse.jface.action.IAction action,
51: org.eclipse.jface.viewers.ISelection selection) {
52: // do nothing
53: }
54: }
|