Search in sources :

Example 1 with RenderReportsCmd

use of net.sourceforge.pmd.eclipse.runtime.cmd.RenderReportsCmd in project pmd-eclipse-plugin by pmd.

the class GenerateReportAction method run.

/**
 * @see org.eclipse.ui.IActionDelegate#run(IAction)
 */
public final void run(final IAction action) {
    LOG.info("Generation Report action requested");
    final ISelection sel = targetSelection();
    if (sel instanceof IStructuredSelection) {
        try {
            IProject project = getProject((IStructuredSelection) sel);
            if (project != null) {
                if (!checkRenderers()) {
                    return;
                }
                RenderReportsCmd cmd = new RenderReportsCmd();
                cmd.setProject(project);
                cmd.setUserInitiated(true);
                registerRenderers(cmd);
                cmd.performExecute();
            }
        } catch (CommandException e) {
            showErrorById(StringKeys.ERROR_PMD_EXCEPTION, e);
        }
    }
}
Also used : RenderReportsCmd(net.sourceforge.pmd.eclipse.runtime.cmd.RenderReportsCmd) ISelection(org.eclipse.jface.viewers.ISelection) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) CommandException(name.herlin.command.CommandException) IProject(org.eclipse.core.resources.IProject)

Aggregations

CommandException (name.herlin.command.CommandException)1 RenderReportsCmd (net.sourceforge.pmd.eclipse.runtime.cmd.RenderReportsCmd)1 IProject (org.eclipse.core.resources.IProject)1 ISelection (org.eclipse.jface.viewers.ISelection)1 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)1