aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/sonar-core-plugin/src/main
diff options
context:
space:
mode:
authorDavid Gageot <david@gageot.net>2012-07-04 18:02:37 +0200
committerDavid Gageot <david@gageot.net>2012-07-04 19:14:10 +0200
commitb547f32a3de0381e41b2da6cfab1545f7447b315 (patch)
tree774cd48198c1789b13fb431e2bc16bb07c6b04cd /plugins/sonar-core-plugin/src/main
parentd9ec502ee20a45003ab3d55884cd95e1adfc22f2 (diff)
downloadsonarqube-b547f32a3de0381e41b2da6cfab1545f7447b315.tar.gz
sonarqube-b547f32a3de0381e41b2da6cfab1545f7447b315.zip
SONAR-3529 First baby step in providing property sets
Diffstat (limited to 'plugins/sonar-core-plugin/src/main')
-rw-r--r--plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java3
-rw-r--r--plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/CustomMeasuresWidget.java28
-rw-r--r--plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/DemoWidget.java60
-rw-r--r--plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/HotspotMetricWidget.java16
-rw-r--r--plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/HotspotMostViolatedResourcesWidget.java12
-rw-r--r--plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/HotspotMostViolatedRulesWidget.java12
-rw-r--r--plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/TimeMachineWidget.java2
-rw-r--r--plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/TimelineWidget.java22
-rw-r--r--plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/reviews/FalsePositiveReviewsWidget.java14
-rw-r--r--plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/reviews/MyReviewsWidget.java14
-rw-r--r--plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/reviews/PlannedReviewsWidget.java14
-rw-r--r--plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/reviews/ProjectReviewsWidget.java14
-rw-r--r--plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/reviews/UnplannedReviewsWidget.java14
-rw-r--r--plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/demo.html.erb4
14 files changed, 138 insertions, 91 deletions
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java
index 86cb29c81a7..a9fb669fcd1 100644
--- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java
+++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java
@@ -19,6 +19,8 @@
*/
package org.sonar.plugins.core;
+import org.sonar.plugins.core.widgets.DemoWidget;
+
import com.google.common.collect.ImmutableList;
import org.sonar.api.CoreProperties;
import org.sonar.api.Extension;
@@ -336,6 +338,7 @@ public final class CorePlugin extends SonarPlugin {
ReviewsMetricsWidget.class,
TreemapWidget.class,
FilterWidget.class,
+ DemoWidget.class,
// dashboards
DefaultDashboard.class,
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/CustomMeasuresWidget.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/CustomMeasuresWidget.java
index e1c8cdde530..274e77f926c 100644
--- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/CustomMeasuresWidget.java
+++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/CustomMeasuresWidget.java
@@ -21,20 +21,18 @@ package org.sonar.plugins.core.widgets;
import org.sonar.api.web.*;
-@WidgetProperties(
- {
- @WidgetProperty(key = "metric1", type = WidgetPropertyType.METRIC),
- @WidgetProperty(key = "metric2", type = WidgetPropertyType.METRIC),
- @WidgetProperty(key = "metric3", type = WidgetPropertyType.METRIC),
- @WidgetProperty(key = "metric4", type = WidgetPropertyType.METRIC),
- @WidgetProperty(key = "metric5", type = WidgetPropertyType.METRIC),
- @WidgetProperty(key = "metric6", type = WidgetPropertyType.METRIC),
- @WidgetProperty(key = "metric7", type = WidgetPropertyType.METRIC),
- @WidgetProperty(key = "metric8", type = WidgetPropertyType.METRIC),
- @WidgetProperty(key = "metric9", type = WidgetPropertyType.METRIC),
- @WidgetProperty(key = "metric10", type = WidgetPropertyType.METRIC)
- }
-)
+@WidgetProperties({
+ @WidgetProperty(key = "metric1", type = WidgetPropertyType.METRIC),
+ @WidgetProperty(key = "metric2", type = WidgetPropertyType.METRIC),
+ @WidgetProperty(key = "metric3", type = WidgetPropertyType.METRIC),
+ @WidgetProperty(key = "metric4", type = WidgetPropertyType.METRIC),
+ @WidgetProperty(key = "metric5", type = WidgetPropertyType.METRIC),
+ @WidgetProperty(key = "metric6", type = WidgetPropertyType.METRIC),
+ @WidgetProperty(key = "metric7", type = WidgetPropertyType.METRIC),
+ @WidgetProperty(key = "metric8", type = WidgetPropertyType.METRIC),
+ @WidgetProperty(key = "metric9", type = WidgetPropertyType.METRIC),
+ @WidgetProperty(key = "metric10", type = WidgetPropertyType.METRIC)
+})
public class CustomMeasuresWidget extends AbstractRubyTemplate implements RubyRailsWidget {
public String getId() {
return "custom_measures";
@@ -48,4 +46,4 @@ public class CustomMeasuresWidget extends AbstractRubyTemplate implements RubyRa
protected String getTemplatePath() {
return "/org/sonar/plugins/core/widgets/custom_measures.html.erb";
}
-} \ No newline at end of file
+}
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/DemoWidget.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/DemoWidget.java
new file mode 100644
index 00000000000..48549921bef
--- /dev/null
+++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/DemoWidget.java
@@ -0,0 +1,60 @@
+/*
+ * Sonar, open source software quality management tool.
+ * Copyright (C) 2008-2012 SonarSource
+ * mailto:contact AT sonarsource DOT com
+ *
+ * Sonar is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * Sonar is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Sonar; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
+ */
+package org.sonar.plugins.core.widgets;
+
+import org.sonar.api.web.WidgetPropertySet;
+
+import org.sonar.api.web.AbstractRubyTemplate;
+import org.sonar.api.web.RubyRailsWidget;
+import org.sonar.api.web.WidgetCategory;
+import org.sonar.api.web.WidgetProperties;
+import org.sonar.api.web.WidgetProperty;
+import org.sonar.api.web.WidgetPropertyType;
+import org.sonar.api.web.WidgetScope;
+
+import static org.sonar.api.web.WidgetScope.*;
+
+@WidgetCategory("Global")
+@WidgetScope(GLOBAL)
+@WidgetProperties(sets = {
+ @WidgetPropertySet(key = "set1",
+ value = {
+ @WidgetProperty(key = "key1", type = WidgetPropertyType.STRING),
+ @WidgetProperty(key = "key2", type = WidgetPropertyType.STRING)
+ }), @WidgetPropertySet(key = "set2",
+ value = {
+ @WidgetProperty(key = "key3", type = WidgetPropertyType.STRING)
+ })}, value = {
+ @WidgetProperty(key = "key4", type = WidgetPropertyType.STRING)
+})
+public class DemoWidget extends AbstractRubyTemplate implements RubyRailsWidget {
+ public String getId() {
+ return "demo";
+ }
+
+ public String getTitle() {
+ return "Demo";
+ }
+
+ @Override
+ protected String getTemplatePath() {
+ return "/org/sonar/plugins/core/widgets/demo.html.erb";
+ }
+}
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/HotspotMetricWidget.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/HotspotMetricWidget.java
index f69f6ad46bb..a4a447679d4 100644
--- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/HotspotMetricWidget.java
+++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/HotspotMetricWidget.java
@@ -26,14 +26,12 @@ import org.sonar.api.web.WidgetProperties;
import org.sonar.api.web.WidgetProperty;
import org.sonar.api.web.WidgetPropertyType;
-@WidgetCategory({ "Hotspots" })
-@WidgetProperties(
- {
- @WidgetProperty(key = "title", type = WidgetPropertyType.STRING),
- @WidgetProperty(key = "metric", type = WidgetPropertyType.METRIC, defaultValue = "ncloc"),
- @WidgetProperty(key = "numberOfLines", type = WidgetPropertyType.INTEGER, defaultValue = "5")
- }
-)
+@WidgetCategory("Hotspots")
+@WidgetProperties({
+ @WidgetProperty(key = "title", type = WidgetPropertyType.STRING),
+ @WidgetProperty(key = "metric", type = WidgetPropertyType.METRIC, defaultValue = "ncloc"),
+ @WidgetProperty(key = "numberOfLines", type = WidgetPropertyType.INTEGER, defaultValue = "5")
+})
public class HotspotMetricWidget extends AbstractRubyTemplate implements RubyRailsWidget {
public String getId() {
return "hotspot_metric";
@@ -47,4 +45,4 @@ public class HotspotMetricWidget extends AbstractRubyTemplate implements RubyRai
protected String getTemplatePath() {
return "/org/sonar/plugins/core/widgets/hotspots/hotspot_metric.html.erb";
}
-} \ No newline at end of file
+}
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/HotspotMostViolatedResourcesWidget.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/HotspotMostViolatedResourcesWidget.java
index 6c78fb9c14c..383cfcecf16 100644
--- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/HotspotMostViolatedResourcesWidget.java
+++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/HotspotMostViolatedResourcesWidget.java
@@ -26,12 +26,10 @@ import org.sonar.api.web.WidgetProperties;
import org.sonar.api.web.WidgetProperty;
import org.sonar.api.web.WidgetPropertyType;
-@WidgetCategory({ "Hotspots" })
-@WidgetProperties(
- {
- @WidgetProperty(key = "numberOfLines", type = WidgetPropertyType.INTEGER, defaultValue = "5")
- }
-)
+@WidgetCategory("Hotspots")
+@WidgetProperties({
+ @WidgetProperty(key = "numberOfLines", type = WidgetPropertyType.INTEGER, defaultValue = "5")
+})
public class HotspotMostViolatedResourcesWidget extends AbstractRubyTemplate implements RubyRailsWidget {
public String getId() {
@@ -46,4 +44,4 @@ public class HotspotMostViolatedResourcesWidget extends AbstractRubyTemplate imp
protected String getTemplatePath() {
return "/org/sonar/plugins/core/widgets/hotspots/hotspot_most_violated_resources.html.erb";
}
-} \ No newline at end of file
+}
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/HotspotMostViolatedRulesWidget.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/HotspotMostViolatedRulesWidget.java
index b58ed0cd89a..7fff488beb6 100644
--- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/HotspotMostViolatedRulesWidget.java
+++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/HotspotMostViolatedRulesWidget.java
@@ -22,12 +22,10 @@ package org.sonar.plugins.core.widgets;
import org.sonar.api.web.*;
@WidgetCategory("Hotspots")
-@WidgetProperties(
- {
- @WidgetProperty(key = "numberOfLines", type = WidgetPropertyType.INTEGER, defaultValue = "5"),
- @WidgetProperty(key = "defaultSeverity", type = WidgetPropertyType.STRING, description = "Values: BLOCKER, CRITICAL, MAJOR, MINOR, INFO")
- }
-)
+@WidgetProperties({
+ @WidgetProperty(key = "numberOfLines", type = WidgetPropertyType.INTEGER, defaultValue = "5"),
+ @WidgetProperty(key = "defaultSeverity", type = WidgetPropertyType.STRING, description = "Values: BLOCKER, CRITICAL, MAJOR, MINOR, INFO")
+})
public class HotspotMostViolatedRulesWidget extends AbstractRubyTemplate implements RubyRailsWidget {
public String getId() {
return "hotspot_most_violated_rules";
@@ -41,4 +39,4 @@ public class HotspotMostViolatedRulesWidget extends AbstractRubyTemplate impleme
protected String getTemplatePath() {
return "/org/sonar/plugins/core/widgets/hotspots/hotspot_most_violated_rules.html.erb";
}
-} \ No newline at end of file
+}
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/TimeMachineWidget.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/TimeMachineWidget.java
index 47f2f63c562..be8a76ab3d7 100644
--- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/TimeMachineWidget.java
+++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/TimeMachineWidget.java
@@ -26,7 +26,7 @@ import org.sonar.api.web.WidgetProperties;
import org.sonar.api.web.WidgetProperty;
import org.sonar.api.web.WidgetPropertyType;
-@WidgetCategory({"History"})
+@WidgetCategory("History")
@WidgetProperties({
@WidgetProperty(key = "title", type = WidgetPropertyType.STRING),
@WidgetProperty(key = "numberOfColumns", type = WidgetPropertyType.INTEGER, defaultValue = "3"),
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/TimelineWidget.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/TimelineWidget.java
index 7ecc27de672..6a2857d7839 100644
--- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/TimelineWidget.java
+++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/TimelineWidget.java
@@ -26,17 +26,15 @@ import org.sonar.api.web.WidgetProperties;
import org.sonar.api.web.WidgetProperty;
import org.sonar.api.web.WidgetPropertyType;
-@WidgetCategory({ "History" })
-@WidgetProperties(
- {
- @WidgetProperty(key = "chartTitle", type = WidgetPropertyType.STRING),
- @WidgetProperty(key = "metric1", type = WidgetPropertyType.METRIC, defaultValue = "ncloc"),
- @WidgetProperty(key = "metric2", type = WidgetPropertyType.METRIC),
- @WidgetProperty(key = "metric3", type = WidgetPropertyType.METRIC),
- @WidgetProperty(key = "hideEvents", type = WidgetPropertyType.BOOLEAN),
- @WidgetProperty(key = "chartHeight", type = WidgetPropertyType.INTEGER, defaultValue = "80")
- }
-)
+@WidgetCategory("History")
+@WidgetProperties({
+ @WidgetProperty(key = "chartTitle", type = WidgetPropertyType.STRING),
+ @WidgetProperty(key = "metric1", type = WidgetPropertyType.METRIC, defaultValue = "ncloc"),
+ @WidgetProperty(key = "metric2", type = WidgetPropertyType.METRIC),
+ @WidgetProperty(key = "metric3", type = WidgetPropertyType.METRIC),
+ @WidgetProperty(key = "hideEvents", type = WidgetPropertyType.BOOLEAN),
+ @WidgetProperty(key = "chartHeight", type = WidgetPropertyType.INTEGER, defaultValue = "80")
+})
public class TimelineWidget extends AbstractRubyTemplate implements RubyRailsWidget {
public String getId() {
return "timeline";
@@ -50,4 +48,4 @@ public class TimelineWidget extends AbstractRubyTemplate implements RubyRailsWid
protected String getTemplatePath() {
return "/org/sonar/plugins/core/widgets/timeline.html.erb";
}
-} \ No newline at end of file
+}
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/reviews/FalsePositiveReviewsWidget.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/reviews/FalsePositiveReviewsWidget.java
index f973ab6bf36..6e527219c16 100644
--- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/reviews/FalsePositiveReviewsWidget.java
+++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/reviews/FalsePositiveReviewsWidget.java
@@ -26,13 +26,11 @@ import org.sonar.api.web.WidgetProperties;
import org.sonar.api.web.WidgetProperty;
import org.sonar.api.web.WidgetPropertyType;
-@WidgetCategory({ "Reviews" })
-@WidgetProperties(
- {
- @WidgetProperty(key = "numberOfLines", type = WidgetPropertyType.INTEGER, defaultValue = "5",
- description="Maximum number of reviews displayed at the same time.")
- }
-)
+@WidgetCategory("Reviews")
+@WidgetProperties({
+ @WidgetProperty(key = "numberOfLines", type = WidgetPropertyType.INTEGER, defaultValue = "5",
+ description = "Maximum number of reviews displayed at the same time.")
+})
public class FalsePositiveReviewsWidget extends AbstractRubyTemplate implements RubyRailsWidget {
public String getId() {
return "false_positive_reviews";
@@ -46,4 +44,4 @@ public class FalsePositiveReviewsWidget extends AbstractRubyTemplate implements
protected String getTemplatePath() {
return "/org/sonar/plugins/core/widgets/reviews/false_positive_reviews.html.erb";
}
-} \ No newline at end of file
+}
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/reviews/MyReviewsWidget.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/reviews/MyReviewsWidget.java
index 0e3a385576a..ed95dddabeb 100644
--- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/reviews/MyReviewsWidget.java
+++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/reviews/MyReviewsWidget.java
@@ -26,13 +26,11 @@ import org.sonar.api.web.WidgetProperties;
import org.sonar.api.web.WidgetProperty;
import org.sonar.api.web.WidgetPropertyType;
-@WidgetCategory({ "Reviews" })
-@WidgetProperties(
- {
- @WidgetProperty(key = "numberOfLines", type = WidgetPropertyType.INTEGER, defaultValue = "5",
- description="Maximum number of reviews displayed at the same time.")
- }
-)
+@WidgetCategory("Reviews")
+@WidgetProperties({
+ @WidgetProperty(key = "numberOfLines", type = WidgetPropertyType.INTEGER, defaultValue = "5",
+ description = "Maximum number of reviews displayed at the same time.")
+})
public class MyReviewsWidget extends AbstractRubyTemplate implements RubyRailsWidget {
public String getId() {
return "my_reviews";
@@ -46,4 +44,4 @@ public class MyReviewsWidget extends AbstractRubyTemplate implements RubyRailsWi
protected String getTemplatePath() {
return "/org/sonar/plugins/core/widgets/reviews/my_reviews.html.erb";
}
-} \ No newline at end of file
+}
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/reviews/PlannedReviewsWidget.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/reviews/PlannedReviewsWidget.java
index eb1abe18dc0..2b80d72572e 100644
--- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/reviews/PlannedReviewsWidget.java
+++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/reviews/PlannedReviewsWidget.java
@@ -26,13 +26,11 @@ import org.sonar.api.web.WidgetProperties;
import org.sonar.api.web.WidgetProperty;
import org.sonar.api.web.WidgetPropertyType;
-@WidgetCategory({ "Action plans", "Reviews" })
-@WidgetProperties(
- {
- @WidgetProperty(key = "numberOfLines", type = WidgetPropertyType.INTEGER, defaultValue = "5",
- description="Maximum number of reviews displayed at the same time.")
- }
-)
+@WidgetCategory({"Action plans", "Reviews"})
+@WidgetProperties({
+ @WidgetProperty(key = "numberOfLines", type = WidgetPropertyType.INTEGER, defaultValue = "5",
+ description = "Maximum number of reviews displayed at the same time.")
+})
public class PlannedReviewsWidget extends AbstractRubyTemplate implements RubyRailsWidget {
public String getId() {
return "planned_reviews";
@@ -46,4 +44,4 @@ public class PlannedReviewsWidget extends AbstractRubyTemplate implements RubyRa
protected String getTemplatePath() {
return "/org/sonar/plugins/core/widgets/reviews/planned_reviews.html.erb";
}
-} \ No newline at end of file
+}
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/reviews/ProjectReviewsWidget.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/reviews/ProjectReviewsWidget.java
index 1551e84233e..c0200af47ac 100644
--- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/reviews/ProjectReviewsWidget.java
+++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/reviews/ProjectReviewsWidget.java
@@ -26,13 +26,11 @@ import org.sonar.api.web.WidgetProperties;
import org.sonar.api.web.WidgetProperty;
import org.sonar.api.web.WidgetPropertyType;
-@WidgetCategory({ "Reviews" })
-@WidgetProperties(
- {
- @WidgetProperty(key = "numberOfLines", type = WidgetPropertyType.INTEGER, defaultValue = "5",
- description="Maximum number of reviews displayed at the same time.")
- }
-)
+@WidgetCategory("Reviews")
+@WidgetProperties({
+ @WidgetProperty(key = "numberOfLines", type = WidgetPropertyType.INTEGER, defaultValue = "5",
+ description = "Maximum number of reviews displayed at the same time.")
+})
public class ProjectReviewsWidget extends AbstractRubyTemplate implements RubyRailsWidget {
public String getId() {
return "project_reviews";
@@ -46,4 +44,4 @@ public class ProjectReviewsWidget extends AbstractRubyTemplate implements RubyRa
protected String getTemplatePath() {
return "/org/sonar/plugins/core/widgets/reviews/project_reviews.html.erb";
}
-} \ No newline at end of file
+}
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/reviews/UnplannedReviewsWidget.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/reviews/UnplannedReviewsWidget.java
index 83660e87af3..014fc25acf5 100644
--- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/reviews/UnplannedReviewsWidget.java
+++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/reviews/UnplannedReviewsWidget.java
@@ -26,13 +26,11 @@ import org.sonar.api.web.WidgetProperties;
import org.sonar.api.web.WidgetProperty;
import org.sonar.api.web.WidgetPropertyType;
-@WidgetCategory({ "Action plans", "Reviews" })
-@WidgetProperties(
- {
- @WidgetProperty(key = "numberOfLines", type = WidgetPropertyType.INTEGER, defaultValue = "5",
- description="Maximum number of reviews displayed at the same time.")
- }
-)
+@WidgetCategory({"Action plans", "Reviews"})
+@WidgetProperties({
+ @WidgetProperty(key = "numberOfLines", type = WidgetPropertyType.INTEGER, defaultValue = "5",
+ description = "Maximum number of reviews displayed at the same time.")
+})
public class UnplannedReviewsWidget extends AbstractRubyTemplate implements RubyRailsWidget {
public String getId() {
return "unplanned_reviews";
@@ -46,4 +44,4 @@ public class UnplannedReviewsWidget extends AbstractRubyTemplate implements Ruby
protected String getTemplatePath() {
return "/org/sonar/plugins/core/widgets/reviews/unplanned_reviews.html.erb";
}
-} \ No newline at end of file
+}
diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/demo.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/demo.html.erb
new file mode 100644
index 00000000000..197d45b202c
--- /dev/null
+++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/demo.html.erb
@@ -0,0 +1,4 @@
+Key1: <%= widget_properties['key1'] -%>
+Key2: <%= widget_properties['key2'] -%>
+Key3: <%= widget_properties['key3'] -%>
+Key4: <%= widget_properties['key4'] -%>