Skip to content
This repository has been archived by the owner on Apr 6, 2022. It is now read-only.

Commit

Permalink
[FIXED JENKINS-13101] Don't use dashboard classes in abstract base
Browse files Browse the repository at this point in the history
classes that do not define an extension.
  • Loading branch information
uhafner committed Apr 4, 2012
1 parent 9ab6e85 commit 9b79189
Show file tree
Hide file tree
Showing 4 changed files with 130 additions and 82 deletions.

This file was deleted.

@@ -1,12 +1,15 @@
package hudson.plugins.analysis.collector.dashboard;

import hudson.Extension;
import hudson.model.Descriptor;
import hudson.plugins.analysis.collector.AnalysisDescriptor;
import hudson.plugins.analysis.collector.AnalysisProjectAction;
import hudson.plugins.analysis.collector.Messages;
import hudson.plugins.analysis.collector.OriginGraph;
import hudson.plugins.analysis.core.AbstractProjectAction;
import hudson.plugins.analysis.dashboard.AbstractWarningsGraphPortlet;
import hudson.plugins.analysis.graph.BuildResultGraph;
import hudson.plugins.view.dashboard.DashboardPortlet;

import org.kohsuke.stapler.DataBoundConstructor;

Expand Down Expand Up @@ -142,7 +145,67 @@ protected BuildResultGraph getGraphType() {
* Extension point registration.
*/
@Extension(optional = true)
public static class WarningsGraphDescriptor extends AnalysisGraphDescriptor {
public static class WarningsGraphDescriptor extends Descriptor<DashboardPortlet> {
/**
* Returns whether the Checkstyle plug-in is installed.
*
* @return <code>true</code> if the Checkstyle plug-in is installed,
* <code>false</code> if not.
*/
public boolean isCheckStyleInstalled() {
return AnalysisDescriptor.isCheckStyleInstalled();
}

/**
* Returns whether the Dry plug-in is installed.
*
* @return <code>true</code> if the Dry plug-in is installed,
* <code>false</code> if not.
*/
public boolean isDryInstalled() {
return AnalysisDescriptor.isDryInstalled();
}

/**
* Returns whether the FindBugs plug-in is installed.
*
* @return <code>true</code> if the FindBugs plug-in is installed,
* <code>false</code> if not.
*/
public boolean isFindBugsInstalled() {
return AnalysisDescriptor.isFindBugsInstalled();
}

/**
* Returns whether the PMD plug-in is installed.
*
* @return <code>true</code> if the PMD plug-in is installed,
* <code>false</code> if not.
*/
public boolean isPmdInstalled() {
return AnalysisDescriptor.isPmdInstalled();
}

/**
* Returns whether the Open Tasks plug-in is installed.
*
* @return <code>true</code> if the Open Tasks plug-in is installed,
* <code>false</code> if not.
*/
public boolean isOpenTasksInstalled() {
return AnalysisDescriptor.isOpenTasksInstalled();
}

/**
* Returns whether the Warnings plug-in is installed.
*
* @return <code>true</code> if the Warnings plug-in is installed,
* <code>false</code> if not.
*/
public boolean isWarningsInstalled() {
return AnalysisDescriptor.isWarningsInstalled();
}

@Override
public String getDisplayName() {
return Messages.Portlet_WarningsOriginGraph();
Expand Down
@@ -1,17 +1,20 @@
package hudson.plugins.analysis.collector.dashboard;

import hudson.Extension;
import hudson.model.Descriptor;
import hudson.model.Job;
import hudson.plugins.analysis.collector.AnalysisDescriptor;
import hudson.plugins.analysis.collector.AnalysisProjectAction;
import hudson.plugins.analysis.collector.Messages;
import hudson.plugins.analysis.core.BuildResult;
import hudson.plugins.analysis.core.AbstractProjectAction;
import hudson.plugins.analysis.core.BuildResult;
import hudson.plugins.analysis.dashboard.AbstractWarningsTablePortlet;
import hudson.plugins.checkstyle.CheckStyleProjectAction;
import hudson.plugins.dry.DryProjectAction;
import hudson.plugins.findbugs.FindBugsProjectAction;
import hudson.plugins.pmd.PmdProjectAction;
import hudson.plugins.tasks.TasksProjectAction;
import hudson.plugins.view.dashboard.DashboardPortlet;
import hudson.plugins.warnings.WarningsProjectAction;

import java.util.Collection;
Expand Down Expand Up @@ -84,12 +87,6 @@ protected Class<? extends AbstractProjectAction<?>> getAction() {
return AnalysisProjectAction.class;
}

/** {@inheritDoc} */
@Override
protected String getPluginName() {
return "analysis";
}

/**
* Returns whether images should be used in the table header.
*
Expand Down Expand Up @@ -446,7 +443,67 @@ private String getWarnings(final Job<?, ?> job, final Class<? extends AbstractPr
* @author Ulli Hafner
*/
@Extension(optional = true)
public static class WarningsPerJobDescriptor extends AnalysisGraphDescriptor {
public static class WarningsPerJobDescriptor extends Descriptor<DashboardPortlet> {
/**
* Returns whether the Checkstyle plug-in is installed.
*
* @return <code>true</code> if the Checkstyle plug-in is installed,
* <code>false</code> if not.
*/
public boolean isCheckStyleInstalled() {
return AnalysisDescriptor.isCheckStyleInstalled();
}

/**
* Returns whether the Dry plug-in is installed.
*
* @return <code>true</code> if the Dry plug-in is installed,
* <code>false</code> if not.
*/
public boolean isDryInstalled() {
return AnalysisDescriptor.isDryInstalled();
}

/**
* Returns whether the FindBugs plug-in is installed.
*
* @return <code>true</code> if the FindBugs plug-in is installed,
* <code>false</code> if not.
*/
public boolean isFindBugsInstalled() {
return AnalysisDescriptor.isFindBugsInstalled();
}

/**
* Returns whether the PMD plug-in is installed.
*
* @return <code>true</code> if the PMD plug-in is installed,
* <code>false</code> if not.
*/
public boolean isPmdInstalled() {
return AnalysisDescriptor.isPmdInstalled();
}

/**
* Returns whether the Open Tasks plug-in is installed.
*
* @return <code>true</code> if the Open Tasks plug-in is installed,
* <code>false</code> if not.
*/
public boolean isOpenTasksInstalled() {
return AnalysisDescriptor.isOpenTasksInstalled();
}

/**
* Returns whether the Warnings plug-in is installed.
*
* @return <code>true</code> if the Warnings plug-in is installed,
* <code>false</code> if not.
*/
public boolean isWarningsInstalled() {
return AnalysisDescriptor.isWarningsInstalled();
}

@Override
public String getDisplayName() {
return Messages.Portlet_WarningsTable();
Expand Down
@@ -0,0 +1 @@
Analysis.ResultAction.Header=R\u00E9sultats des Analyses Statiques

0 comments on commit 9b79189

Please sign in to comment.