Package hudson.widgets
Class Widget
- java.lang.Object
-
- hudson.widgets.Widget
-
- Direct Known Subclasses:
BuildQueueWidget
,ExecutorsWidget
,HistoryWidget
public abstract class Widget extends Object
Box to be rendered in the side panel.Views
TODO: - make Widget describable and provide the UI to let admin configure widgets? - backward compatibility implications?- Since:
- 1.146
- Author:
- Kohsuke Kawaguchi
- See Also:
Jenkins.getWidgets()
-
-
Constructor Summary
Constructors Constructor Description Widget()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
getOwnerUrl()
String
getUrl()
String
getUrlName()
Gets the URL path name.
-
-
-
Method Detail
-
getUrlName
public String getUrlName()
Gets the URL path name.For example, if this method returns "xyz", and if the parent object (that this widget is associated with) is bound to /foo/bar/zot, then this widget object will be exposed to /foo/bar/zot/widget/xyz.
This method is useful when the widget needs to expose additional URLs, for example for serving AJAX requests.
This method should return a string that's unique among other
Widget
s. The default implementation returns the unqualified class name.
-
getOwnerUrl
@CheckForNull protected String getOwnerUrl()
- Returns:
- The URL of the owner of this widget relative to context path. Always ends with a trailing slash.
Can be
null
for backward compatibility with widgets annotated with @Extension.
-
getUrl
public String getUrl()
- Returns:
- the URL relative to the context path. Always ends with a trailing '/'.
-
-