package hudson.plugins.findbugs;
import hudson.model.AbstractBuild;
import hudson.plugins.analysis.core.AbstractResultAction;
import hudson.plugins.analysis.core.HealthDescriptor;
import hudson.plugins.analysis.core.PluginDescriptor;
/**
* Controls the live cycle of the FindBugs results. This action persists the
* results of the FindBugs analysis of a build and displays the results on the
* build page. The actual visualization of the results is defined in the
* matching <code>summary.jelly</code> file.
* <p>
* Moreover, this class renders the FindBugs result trend.
* </p>
*
* @author Ulli Hafner
*/
public class FindBugsResultAction extends AbstractResultAction<FindBugsResult> {
/**
* Creates a new instance of {@link FindBugsResultAction}.
*
* @param owner
* the associated build of this action
* @param healthDescriptor
* health descriptor to use
* @param result
* the result in this build
*/
public FindBugsResultAction(final AbstractBuild<?, ?> owner, final HealthDescriptor healthDescriptor, final FindBugsResult result) {
super(owner, new FindBugsHealthDescriptor(healthDescriptor), result);
}
/**
* Creates a new instance of <code>FindBugsBuildAction</code>.
*
* @param owner
* the associated build of this action
* @param healthDescriptor
* health descriptor to use
*/
public FindBugsResultAction(final AbstractBuild<?, ?> owner, final HealthDescriptor healthDescriptor) {
super(owner, new FindBugsHealthDescriptor(healthDescriptor));
}
/** {@inheritDoc} */
public String getDisplayName() {
return Messages.FindBugs_ProjectAction_Name();
}
/** {@inheritDoc} */
@Override
protected PluginDescriptor getDescriptor() {
return new FindBugsDescriptor();
}
/** {@inheritDoc} */
@Override
public String getMultipleItemsTooltip(final int numberOfItems) {
return Messages.FindBugs_ResultAction_MultipleWarnings(numberOfItems);
}
/** {@inheritDoc} */
@Override
public String getSingleItemTooltip() {
return Messages.FindBugs_ResultAction_OneWarning();
}
}