@ExportedBean public class Badge extends ObjectDefinition of a badge that can be returned by a
ManagementLinkimplementation. The badge is shown as a small overlay over the corresponding icon on the
Manage Jenkinspage, 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 Pluginsshows 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 an
AdministrativeMonitorcan be disabled, a badge will always be shown. E.g. the badge of
OldDataMonitor.ManagementLinkImplalways shows the number of old data entries.
A badge can also be used in a
<l:task .../>to show information on the right of the link in the sidepanel, e.g. to show number of available plugin updates.
Nested Class Summary
Nested Classes Modifier and Type Class Description
All Methods Instance Methods Concrete Methods Modifier and Type Method Description
getSeverity()The severity of the badge.
getText()The text to be shown in the badge.
getTooltip()The tooltip of the badge.
public Badge(@NonNull String text, @NonNull String tooltip, @NonNull Badge.Severity severity)Create a new Badge
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)
@Exported(visibility=999) public String getText()The text to be shown in the badge.
- badge text
@Exported(visibility=999) public String getTooltip()The tooltip of the badge.
public String getSeverity()The severity of the badge. Influences the background color of the badge.
- severity as String