aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api
diff options
context:
space:
mode:
authorsimonbrandhof <simon.brandhof@gmail.com>2010-11-01 14:20:55 +0000
committersimonbrandhof <simon.brandhof@gmail.com>2010-11-01 14:20:55 +0000
commit61a84575510a2cdde57ce7b2139c52458903df52 (patch)
tree6d7f34da22a1c084b2ef3c9b4c8339ddb66d09e3 /sonar-plugin-api
parente22ca92f752d628a2371d7a95a50e71dfabcfc69 (diff)
downloadsonarqube-61a84575510a2cdde57ce7b2139c52458903df52.tar.gz
sonarqube-61a84575510a2cdde57ce7b2139c52458903df52.zip
SONAR-1643 add example of widget properties in plugin archetype + use enumeration for the type of widget property
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/web/Description.java6
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/web/WidgetProperties.java8
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/web/WidgetProperty.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/web/WidgetPropertyType.java24
4 files changed, 25 insertions, 15 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/web/Description.java b/sonar-plugin-api/src/main/java/org/sonar/api/web/Description.java
index 34d44a6f341..17baa1a731d 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/web/Description.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/web/Description.java
@@ -24,12 +24,6 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
-/**
- * Created by IntelliJ IDEA.
- * User: dreik
- * Date: 02.08.2010
- * Time: 13:00:45
- */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface Description {
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/web/WidgetProperties.java b/sonar-plugin-api/src/main/java/org/sonar/api/web/WidgetProperties.java
index 86d6d7c7706..b0d21e2aa22 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/web/WidgetProperties.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/web/WidgetProperties.java
@@ -19,17 +19,9 @@
*/
package org.sonar.api.web;
-import org.sonar.api.Property;
-
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
-/**
- * Created by IntelliJ IDEA.
- * User: dreik
- * Date: 09.08.2010
- * Time: 10:40:09
- */
@Retention(RetentionPolicy.RUNTIME)
public @interface WidgetProperties {
WidgetProperty[] value() default {};
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/web/WidgetProperty.java b/sonar-plugin-api/src/main/java/org/sonar/api/web/WidgetProperty.java
index 87e3743b8dd..37d2b1205df 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/web/WidgetProperty.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/web/WidgetProperty.java
@@ -30,7 +30,7 @@ public @interface WidgetProperty {
String key();
- String type() default "STRING";
+ WidgetPropertyType type() default WidgetPropertyType.STRING;
String defaultValue() default "";
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/web/WidgetPropertyType.java b/sonar-plugin-api/src/main/java/org/sonar/api/web/WidgetPropertyType.java
new file mode 100644
index 00000000000..6481cd552c3
--- /dev/null
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/web/WidgetPropertyType.java
@@ -0,0 +1,24 @@
+/*
+ * Sonar, open source software quality management tool.
+ * Copyright (C) 2009 SonarSource SA
+ * 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.api.web;
+
+public enum WidgetPropertyType {
+ INTEGER, BOOLEAN, FLOAT, STRING
+}