Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-7856

Allow other plugins to contribute icons to be used.

      In the attached patch, it will allow plugins to extend a class and provide icons to also use along with the default stars. See original thread in URL. The patch here differs from there, just refactored names a little bit. Please review patch, and let me know if I can commit it?

          [JENKINS-7856] Allow other plugins to contribute icons to be used.

          I looked at the change.

          I think the abstraction of PromotionIconExtension should be modified. Instead of getPlugin()/getName(), this extension point should define a well-known view (such as icon.jelly) that's responsible for rendering the promotion icon. You can then provide a subtype that draws a static icon with the <img> tag and then have such class define abstract String getIconUrl() kind of a method.

          Also, instead of defining 7 subtypes for each color, I recommend extending ExtensionFinder and just construct 7 instances of the same class with different parameters.

          Kohsuke Kawaguchi added a comment - I looked at the change. I think the abstraction of PromotionIconExtension should be modified. Instead of getPlugin()/getName(), this extension point should define a well-known view (such as icon.jelly) that's responsible for rendering the promotion icon. You can then provide a subtype that draws a static icon with the <img> tag and then have such class define abstract String getIconUrl() kind of a method. Also, instead of defining 7 subtypes for each color, I recommend extending ExtensionFinder and just construct 7 instances of the same class with different parameters.

          Seems to me this would provide a boilerplate for using the m2release-plugin badge as the icon?

          Mattias Jiderhamn added a comment - Seems to me this would provide a boilerplate for using the m2release-plugin badge as the icon?

            Unassigned Unassigned
            lshatzer Larry Shatzer, Jr.
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: