diff options
author | simonbrandhof <simon.brandhof@gmail.com> | 2010-11-01 14:20:55 +0000 |
---|---|---|
committer | simonbrandhof <simon.brandhof@gmail.com> | 2010-11-01 14:20:55 +0000 |
commit | 61a84575510a2cdde57ce7b2139c52458903df52 (patch) | |
tree | 6d7f34da22a1c084b2ef3c9b4c8339ddb66d09e3 /sonar-plugin-api | |
parent | e22ca92f752d628a2371d7a95a50e71dfabcfc69 (diff) | |
download | sonarqube-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')
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 +} |