diff options
author | simonbrandhof <simon.brandhof@gmail.com> | 2010-11-05 12:48:07 +0000 |
---|---|---|
committer | simonbrandhof <simon.brandhof@gmail.com> | 2010-11-05 12:48:07 +0000 |
commit | 8257d999859de4fd4148f7d142cfd1ee5c908db6 (patch) | |
tree | 0870937396cebe44b8d9a42dd221959b1a57a4f1 /sonar-plugin-api | |
parent | 753e2a00b148b90ca0dab158db374ff8294c2d44 (diff) | |
download | sonarqube-8257d999859de4fd4148f7d142cfd1ee5c908db6.tar.gz sonarqube-8257d999859de4fd4148f7d142cfd1ee5c908db6.zip |
custom dashboards: add the annotation @WidgetLayout with values DEFAULT (gray border + padding) or NONE (no padding, no border)
Diffstat (limited to 'sonar-plugin-api')
3 files changed, 68 insertions, 2 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/web/AbstractDashboardWidget.java b/sonar-plugin-api/src/main/java/org/sonar/api/web/AbstractDashboardWidget.java index be9d0415405..dcc5ca2179f 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/web/AbstractDashboardWidget.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/web/AbstractDashboardWidget.java @@ -27,10 +27,10 @@ package org.sonar.api.web; public abstract class AbstractDashboardWidget extends AbstractRubyTemplate implements RubyRailsWidget { public String getId() { - return getClass().toString(); + return getClass().getSimpleName(); } public String getTitle() { - return getClass().toString(); + return getClass().getSimpleName(); } } diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/web/WidgetLayout.java b/sonar-plugin-api/src/main/java/org/sonar/api/web/WidgetLayout.java new file mode 100644 index 00000000000..81a0b872605 --- /dev/null +++ b/sonar-plugin-api/src/main/java/org/sonar/api/web/WidgetLayout.java @@ -0,0 +1,34 @@ +/* + * 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; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * @since 2.4 + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +public @interface WidgetLayout { + WidgetLayoutType value(); +} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/web/WidgetLayoutType.java b/sonar-plugin-api/src/main/java/org/sonar/api/web/WidgetLayoutType.java new file mode 100644 index 00000000000..dc542cb750c --- /dev/null +++ b/sonar-plugin-api/src/main/java/org/sonar/api/web/WidgetLayoutType.java @@ -0,0 +1,32 @@ +/* + * 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; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * @since 2.4 + */ +public enum WidgetLayoutType { + DEFAULT, NONE +}
\ No newline at end of file |