Package jenkins.management
Class Badge
- java.lang.Object
-
- jenkins.management.Badge
-
public class Badge extends Object
Definition of a badge that can be returned by aManagementLink
implementation. The badge is shown as a small overlay over the corresponding icon on theManage Jenkins
page, it can display additional information in a tooltip and change it's color depending on the severity.A badge mainly serves as a fast feedback for the corresponding management page. It could be used to just display some short status information or hint that some action can be taken. For example the badge on
Manage Plugins
shows information about the number of available updates and in its tooltip additionally how many updates contain incompatible changes or fix security vulnerabilities. It also changes its color when there are security fixes available.A badge might display the same information as an
AdministrativeMonitor
. While anAdministrativeMonitor
can be disabled, a badge will always be shown. E.g. the badge ofOldDataMonitor.ManagementLinkImpl
always shows the number of old data entries.- Since:
- 2.385
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Badge.Severity
-
Constructor Summary
Constructors Constructor Description Badge(String text, String tooltip, Badge.Severity severity)
Create a new Badge
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getSeverity()
The severity of the badge.String
getText()
The text to be shown in the badge.String
getTooltip()
The tooltip of the badge.
-
-
-
Constructor Detail
-
Badge
public Badge(@NonNull String text, @NonNull String tooltip, @NonNull Badge.Severity severity)
Create a new Badge- Parameters:
text
- The text to be shown in the badge. Keep it short, ideally just a number. More than 6 or 7 characters do not look good. Avoid spaces as they will lead to line breaks. as this might lead to line breaks.tooltip
- The tooltip to show for the badge. Do not include html tags.severity
- The severity of the badge (danger, warning, info)
-
-
Method Detail
-
getText
public String getText()
The text to be shown in the badge.- Returns:
- badge text
-
getTooltip
public String getTooltip()
The tooltip of the badge.- Returns:
- tooltip
-
getSeverity
public String getSeverity()
The severity of the badge. Influences the background color of the badge.- Returns:
- severity as String
-
-