/* * Copyright (c) 2012 European Synchrotron Radiation Facility, * Diamond Light Source Ltd. * * 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 */ package fable.python.actions; import org.eclipse.jface.action.Action; import org.eclipse.jface.action.IAction; import org.eclipse.jface.viewers.ISelection; import org.eclipse.ui.IWorkbenchWindow; import org.eclipse.ui.IWorkbenchWindowActionDelegate; import org.eclipse.ui.PlatformUI; import fable.python.jep.PythonInfoDialog; public class InfoPythonAction extends Action implements IWorkbenchWindowActionDelegate { private final static String ID = "fable.python.actions.info"; /* * (non-Javadoc) * * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose() */ @Override public void dispose() { // TODO Auto-generated method stub } /* * (non-Javadoc) * * @seeorg.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui. * IWorkbenchWindow) */ @Override public void init(IWorkbenchWindow window) { // TODO Auto-generated method stub } /* * (non-Javadoc) * * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) */ @Override public void run(IAction action) { IWorkbenchWindow window = PlatformUI.getWorkbench() .getActiveWorkbenchWindow(); PythonInfoDialog dialog = new PythonInfoDialog(window.getShell()); dialog.open(); } /* * (non-Javadoc) * * @see * org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action * .IAction, org.eclipse.jface.viewers.ISelection) */ @Override public void selectionChanged(IAction action, ISelection selection) { // TODO Auto-generated method stub } /** * Get the ID of this action. * * @return */ public static String getID() { return ID; } }