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

Commit

Permalink
Browse files Browse the repository at this point in the history
[JENKINS-12186] Add selection of analysis plug-ins for table portlet.
  • Loading branch information
uhafner committed Feb 7, 2012
1 parent ad5751b commit e17a8bc
Show file tree
Hide file tree
Showing 11 changed files with 252 additions and 214 deletions.
4 changes: 2 additions & 2 deletions .classpath
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
<classpathentry kind="src" output="target/classes" path="src/main/resources"/>
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
<classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="src" output="target/classes" path="target/generated-sources/localizer">
Expand Down
@@ -0,0 +1,73 @@
package hudson.plugins.analysis.collector.dashboard;

import hudson.model.Descriptor;
import hudson.plugins.analysis.collector.AnalysisDescriptor;
import hudson.plugins.view.dashboard.DashboardPortlet;

/**
* Descriptor with convenience methods for accessing the installed plug-ins.
*
* @author Ulli Hafner
*/
public abstract class AnalysisGraphDescriptor 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();
}
}

@@ -1,15 +1,12 @@
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 @@ -145,71 +142,11 @@ protected BuildResultGraph getGraphType() {
* Extension point registration.
*/
@Extension(optional = true)
public static class WarningsGraphDescriptor extends Descriptor<DashboardPortlet> {
public static class WarningsGraphDescriptor extends AnalysisGraphDescriptor {
@Override
public String getDisplayName() {
return Messages.Portlet_WarningsOriginGraph();
}

/**
* 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 static 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 static 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 static 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 static 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 static boolean isWarningsInstalled() {
return AnalysisDescriptor.isWarningsInstalled();
}
}
}

0 comments on commit e17a8bc

Please sign in to comment.