]> source.dussan.org Git - sonarqube.git/blob
f368bdadae9e141b6d9854c600fcdd91b77b3f75
[sonarqube.git] /
1 #set( $symbol_pound = '#' )
2 #set( $symbol_dollar = '$' )
3 #set( $symbol_escape = '\' )
4 package ${package};
5
6 import org.sonar.api.web.*;
7
8 @UserRole(UserRole.USER)
9 @Description("Show how to use Ruby Widget API")
10 @WidgetProperties({
11         @WidgetProperty(key="param1",
12                         description="This is a mandatory parameter",
13                         optional=false
14         ),
15         @WidgetProperty(key="max",
16                         description="max threshold",
17                         type=WidgetPropertyType.INTEGER,
18                         defaultValue="80"
19         ),
20         @WidgetProperty(key="param2",
21                         description="This is an optional parameter"
22         ),
23         @WidgetProperty(key="floatprop",
24                         description="test description"
25         )
26 })
27 public class SampleDashboardWidget extends AbstractRubyTemplate implements RubyRailsWidget {
28
29   public String getId() {
30     return "sample";
31   }
32
33   public String getTitle() {
34     return "Sample";
35   }
36
37   @Override
38   protected String getTemplatePath() {
39     return "/sample_dashboard_widget.html.erb";
40   }
41 }