Package io.jenkins.plugins.monitoring
Class MonitorPortlet
java.lang.Object
io.jenkins.plugins.monitoring.MonitorPortlet
- Direct Known Subclasses:
DemoPortlet
Defines a single portlet for the pull request monitoring dashboard.
The id must be unique. Please make sure that the id is related to the plugin so that
there are no conflicts with other plugins. It is recommended to use the artifact id
of the plugin or parts of it as prefix. If several portlets of the same class are created in the
MonitorPortletFactory, it must be ensured that getId() is always unique for each portlet!
- Since:
- 1.6.0
- Author:
- Simon Symhoven
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionDefines the relative url to a detail view of the portlet.Defines the icon to show in the dropdown list of available portlets.abstract StringgetId()Defines the id for the portlet.abstract intDefines the preferred height of the portlet.abstract intDefines the preferred width of the portlet.abstract StringgetTitle()Defines the title to be shown.booleanDefines whether the portlet is shown per default in the dashboard or not.toString()
-
Constructor Details
-
MonitorPortlet
public MonitorPortlet()
-
-
Method Details
-
getTitle
Defines the title to be shown.- Returns:
- the title.
-
getId
Defines the id for the portlet.- Returns:
- the id.
-
isDefault
public boolean isDefault()Defines whether the portlet is shown per default in the dashboard or not. The functionality for this is not yet given and the flag is ignored, but the API for it is already prepared.- Returns:
- true if portlet should be shown, false else.
- Since:
- 1.6.0
-
getPreferredWidth
public abstract int getPreferredWidth()Defines the preferred width of the portlet.- Returns:
- the width in pixels.
-
getPreferredHeight
public abstract int getPreferredHeight()Defines the preferred height of the portlet.- Returns:
- the height in pixels.
-
getIconUrl
Defines the icon to show in the dropdown list of available portlets.- Returns:
- the app relative icon url depending on ${resURL} (/static/cache-id),
or
Optional.empty(), if a default icon should be added. Supported file formats (depending on browser): jpeg, gif, png, apng, svg, bmp, bmp ico, png ico.
-
getDetailViewUrl
Defines the relative url to a detail view of the portlet.- Returns:
- the relative link to the detail view depending on the current build url,
e.g. current build url: "http://localhost:8080/jenkins/job/job-name/view/change-requests/job/PR-1/1/",
then the relative url could be "pull-request-monitoring".
or
Optional.empty(), if no link should be added to portlet.
-
toString
-