Description#
The ProgressBarPlugin creates a graphical representation of a percentage number. Setting the percentage to "X" will create a bar with the left X% of its width draw in green and the remaining (1 - X)% in red. The bar is implemented as two "img" entries aligned inside a table cell, with the same height, and with the width calculated based on the "width" and "percentage" parameters.The typical usage is to indicate how close to completion a given task is in a project management situation; other uses include representing the number of testcases succesfully executed, the percentage of code covered by unit tests, and so on.
This plugin is a very simple extension of the Image plugin created by JanneJalkanen. Most of the parameters are the same. For simplicity I am also using the same package name as the other standard JSPWiki plugins.
Parameters#
- percentage = 'Percentage'
- The percentage number that the bar should reflect[1].
- src_left = 'Image source(left)'
- This can either be a full URL (http://.
.) or a WikiAttachment. name. If not provided, "images/green.png" will be used. Copy the attached file to the "images" directory under you wiki installation.
- src_right = 'Image source(right)'
- This can either be a full URL (http://.
.) or a WikiAttachment. name. If not provided, "images/red.png" will be used. See above.
- align = 'left|right|center'
- The image alignment.
- height = 'integer'
- The height of the image. If not provided a default value will be used.
- width = 'integer'
- The combined width of the bar. If not provided a default value will be used[1].
- caption = 'caption text'
- The text that should be shown as a caption under the image.
- link = 'hyperlink'
- A hyperlink (http://.
.)..
- border = 'integer'
- Size of the image border.
- style = 'style info'
- Any style markup you would like to apply to the table surrounding the image.
- class = 'class name'
- Redefine the default class for this image, which is "imageplugin".
The alt text of the image is always set to reflect the percentage number.
Examples#
[{ProgressBar percentage=30 }]
Shows a progress bar reflecting a 30% completion rate.
CSS#
- .imageplugin
- The table that encompasses the image. It consists of two subcategories:
- img = IMG tag that gets embedded.
- caption = caption that is embedded.
[#1] Use only an integer number; in particular, do not attach a '%' character.
I recompiled against 2.4 and changed the package from com.ecyrd.jspwiki to something else ot fix the problem with it not being signed and JSPWiki being signed. See more here|http://blog.jspwiki.org/wiki/Main_blogentry_260106_1}. The new uploaded Jar should now work in both versions. Joseph Schmigel - 15.09.06 ContributedPlugins
Add new attachment
List of attachments
Kind | Attachment Name | Size | Version | Date Modified | Author | Change note |
---|---|---|---|---|---|---|
java |
ProgressBar.java | 7.4 kB | 1 | 04-Aug-2004 22:14 | NascifAbousalhNeto | |
jar |
ProgressBarPlugin.jar | 3.0 kB | 3 | 15-Sep-2006 21:54 | Joseph Schmigel | |
zip |
bal.zip | 303.6 kB | 1 | 12-May-2005 12:56 | 61.11.79.234 | |
png |
green.png | 0.2 kB | 1 | 04-Aug-2004 22:13 | NascifAbousalhNeto | |
png |
red.png | 0.2 kB | 1 | 04-Aug-2004 22:13 | NascifAbousalhNeto |