/*******************************************************************************
* Copyright (c) 2011 Fabian Steeg. 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
* <p/>
* Contributors: Fabian Steeg - initial API and implementation
*******************************************************************************/
package org.eclipse.mylyn.docs.intent.markup.ui.popup.actions;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.mylyn.docs.intent.markup.gen.files.Latex;
import org.eclipse.ui.IObjectActionDelegate;
import org.eclipse.ui.IWorkbenchPart;
/**
* Generate LaTeX from a WikiText file.
*
* @author Fabian Steeg (fsteeg)
*/
public class GenerateLatexAction implements IObjectActionDelegate {
/**
* The current selection.
*/
private ISelection currentSelection;
/**
* Constructor for GenerateLatexAction.
*/
public GenerateLatexAction() {
super();
}
/**
* {@inheritDoc}
*
* @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction,
* org.eclipse.ui.IWorkbenchPart)
*/
public void setActivePart(IAction action, IWorkbenchPart targetPart) {
}
/**
* {@inheritDoc}
*
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
public void run(IAction action) {
GenerateActions.run(currentSelection, Latex.class);
}
/**
* {@inheritDoc}
*
* @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction,
* org.eclipse.jface.viewers.ISelection)
*/
public void selectionChanged(IAction action, ISelection selection) {
this.currentSelection = selection;
}
}