Search in sources :

Example 1 with ReviewResourceForRuleCommand

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

the class DataflowViewPage method refreshDFATable.

/**
 * Executes a command to refresh the DFA table. After execution
 * {@link #refresh(IResource)} will be called.
 *
 * @param newResource
 *            the new resource
 */
public void refreshDFATable(IResource newResource) {
    isTableRefreshed = true;
    try {
        ReviewResourceForRuleCommand cmd = new ReviewResourceForRuleCommand();
        DataflowAnomalyAnalysisRule rule = new DataflowAnomalyAnalysisRule();
        rule.setUsesDFA();
        cmd.setUserInitiated(false);
        cmd.setRule(rule);
        cmd.setResource(newResource);
        cmd.addPropertyListener(this);
        cmd.performExecute();
    } catch (CommandException e) {
        logErrorByKey(StringKeys.ERROR_PMD_EXCEPTION, e);
    }
}
Also used : DataflowAnomalyAnalysisRule(net.sourceforge.pmd.lang.java.rule.errorprone.DataflowAnomalyAnalysisRule) ReviewResourceForRuleCommand(net.sourceforge.pmd.eclipse.runtime.cmd.ReviewResourceForRuleCommand) CommandException(name.herlin.command.CommandException)

Aggregations

CommandException (name.herlin.command.CommandException)1 ReviewResourceForRuleCommand (net.sourceforge.pmd.eclipse.runtime.cmd.ReviewResourceForRuleCommand)1 DataflowAnomalyAnalysisRule (net.sourceforge.pmd.lang.java.rule.errorprone.DataflowAnomalyAnalysisRule)1