Class JenkinsWidgetFactory

java.lang.Object
jenkins.widgets.WidgetFactory<View,Widget>
jenkins.widgets.JenkinsWidgetFactory
All Implemented Interfaces:
ExtensionPoint

@Extension @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) @Deprecated @Symbol("jenkins") public final class JenkinsWidgetFactory extends WidgetFactory<View,Widget>
Deprecated.
New widgets should provide a WidgetFactory instead of relying on this legacy lookup.
Add widgets annotated with @Extension, or added manually to Jenkins via Jenkins.get().getWidgets().add(...)
  • Constructor Details

    • JenkinsWidgetFactory

      public JenkinsWidgetFactory()
      Deprecated.
  • Method Details

    • type

      public Class<View> type()
      Deprecated.
      Description copied from class: WidgetFactory
      The type of object this factory cares about. Declared separately, rather than by having WidgetFactory.createFor(T) do a check-cast, so that method bodies are not loaded until actually needed.
      Specified by:
      type in class WidgetFactory<View,Widget>
      Returns:
      the type of WidgetFactory
    • widgetType

      public Class<Widget> widgetType()
      Deprecated.
      Description copied from class: WidgetFactory
      A supertype of any widgets this factory might produce. Defined so that factories which produce irrelevant widgets need not be consulted. If your implementation was returning multiple disparate kinds of widgets, it is best to split it into two factories.

      If an API defines an abstract Widget subtype, and you are providing a concrete implementation, you may return the API type here to delay class loading.

      Specified by:
      widgetType in class WidgetFactory<View,Widget>
      Returns:
      a bound for the result of WidgetFactory.createFor(T)
    • createFor

      @NonNull public Collection<Widget> createFor(@NonNull View target)
      Deprecated.
      Description copied from class: WidgetFactory
      Creates widgets for a given object. This may be called frequently for the same object, so if your implementation is expensive, do your own caching.
      Specified by:
      createFor in class WidgetFactory<View,Widget>
      Parameters:
      target - a widgetable object
      Returns:
      a possible empty set of widgets (typically either using Set.of()).