]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-2197 Be able to display Design/Libraries tab for any languages
authorFabrice Bellingard <bellingard@gmail.com>
Fri, 23 Mar 2012 11:42:22 +0000 (12:42 +0100)
committerFabrice Bellingard <bellingard@gmail.com>
Fri, 23 Mar 2012 11:42:22 +0000 (12:42 +0100)
Also modified to be displayed only when required measures are
available:
- the Dependencies tab
- the LCOM4 tab

plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/web/Lcom4Viewer.java
plugins/sonar-design-plugin/src/main/java/org/sonar/plugins/design/ui/dependencies/GwtDependenciesTab.java
plugins/sonar-design-plugin/src/main/java/org/sonar/plugins/design/ui/libraries/GwtLibrariesPage.java
plugins/sonar-design-plugin/src/main/java/org/sonar/plugins/design/ui/page/GwtDesignPage.java

index b4cb02c2a0a711b9e55357e27200bbadd39e5e06..c0a042e0fe59e4979deaa2b6cfc85771fb19938d 100644 (file)
  */
 package org.sonar.plugins.core.web;
 
-import org.sonar.api.resources.Java;
+import org.sonar.api.measures.CoreMetrics;
 import org.sonar.api.resources.Qualifiers;
-import org.sonar.api.web.*;
+import org.sonar.api.web.AbstractRubyTemplate;
+import org.sonar.api.web.DefaultTab;
+import org.sonar.api.web.NavigationSection;
+import org.sonar.api.web.RequiredMeasures;
+import org.sonar.api.web.ResourceQualifier;
+import org.sonar.api.web.RubyRailsPage;
+import org.sonar.api.web.UserRole;
 
+@RequiredMeasures(mandatory = {CoreMetrics.LCOM4_KEY})
 @NavigationSection(NavigationSection.RESOURCE_TAB)
 @UserRole(UserRole.CODEVIEWER)
-@ResourceLanguage(Java.KEY)
 @ResourceQualifier(Qualifiers.CLASS)
 @DefaultTab(metrics = {"lcom4", "lcom4_blocks"})
 public class Lcom4Viewer extends AbstractRubyTemplate implements RubyRailsPage {
@@ -42,4 +48,4 @@ public class Lcom4Viewer extends AbstractRubyTemplate implements RubyRailsPage {
   protected String getTemplatePath() {
     return "/org/sonar/plugins/core/web/lcom4_viewer.html.erb";
   }
-}
\ No newline at end of file
+}
index 4ca4bdce4ab8e4e79ab18df32f7d087225b6ae81..a4a20028ba4dbc746bb8004a1f8f08c2eca4b213 100644 (file)
 package org.sonar.plugins.design.ui.dependencies;
 
 import org.sonar.api.measures.CoreMetrics;
-import org.sonar.api.resources.Java;
-
 import org.sonar.api.resources.Resource;
-import org.sonar.api.web.*;
+import org.sonar.api.web.DefaultTab;
+import org.sonar.api.web.GwtPage;
+import org.sonar.api.web.NavigationSection;
+import org.sonar.api.web.RequiredMeasures;
+import org.sonar.api.web.ResourceQualifier;
+import org.sonar.api.web.UserRole;
 import org.sonar.plugins.design.ui.dependencies.client.DependenciesTab;
 
-@ResourceLanguage({Java.KEY, "web"}) // 'web' is a temporary workaround. See http://sonar-dev.787459.n3.nabble.com/sonar-dev-Dependencies-in-Web-Plugin-td822980.html#a822980
+@RequiredMeasures(mandatory = {CoreMetrics.AFFERENT_COUPLINGS_KEY, CoreMetrics.EFFERENT_COUPLINGS_KEY})
 @ResourceQualifier({Resource.QUALIFIER_FILE, Resource.QUALIFIER_CLASS, Resource.QUALIFIER_PACKAGE, Resource.QUALIFIER_PROJECT, Resource.QUALIFIER_MODULE})
-@DefaultTab(metrics={CoreMetrics.AFFERENT_COUPLINGS_KEY, CoreMetrics.EFFERENT_COUPLINGS_KEY})
+@DefaultTab(metrics = {CoreMetrics.AFFERENT_COUPLINGS_KEY, CoreMetrics.EFFERENT_COUPLINGS_KEY})
 @NavigationSection({NavigationSection.RESOURCE_TAB})
-@UserRole(UserRole.USER) 
+@UserRole(UserRole.USER)
 public class GwtDependenciesTab extends GwtPage {
 
   public String getTitle() {
@@ -41,5 +44,3 @@ public class GwtDependenciesTab extends GwtPage {
     return DependenciesTab.GWT_ID;
   }
 }
-
-
index 93cca8575115ec0f791b8fd099966928bb1714b5..b117dad68586c73528ae8a9d1631fbca95327beb 100644 (file)
  */
 package org.sonar.plugins.design.ui.libraries;
 
-import org.sonar.api.resources.Java;
 import org.sonar.api.resources.Resource;
-import org.sonar.api.web.*;
+import org.sonar.api.web.GwtPage;
+import org.sonar.api.web.NavigationSection;
+import org.sonar.api.web.ResourceQualifier;
+import org.sonar.api.web.UserRole;
 import org.sonar.plugins.design.ui.libraries.client.LibrariesPage;
 
-@ResourceLanguage(Java.KEY)
 @ResourceQualifier({Resource.QUALIFIER_PROJECT, Resource.QUALIFIER_MODULE})
 @NavigationSection(NavigationSection.RESOURCE)
 @UserRole(UserRole.USER)
index 6109e4b769129e1f17d5e7e16e919030178f389a..602dd93720b9d6f108d7dba569592faa8ff2ee06 100644 (file)
 package org.sonar.plugins.design.ui.page;
 
 import org.sonar.api.measures.CoreMetrics;
-import org.sonar.api.resources.Java;
 import org.sonar.api.resources.Qualifiers;
-import org.sonar.api.web.*;
+import org.sonar.api.web.DefaultTab;
+import org.sonar.api.web.GwtPage;
+import org.sonar.api.web.NavigationSection;
+import org.sonar.api.web.RequiredMeasures;
+import org.sonar.api.web.ResourceQualifier;
+import org.sonar.api.web.UserRole;
 import org.sonar.plugins.design.ui.page.client.DesignPage;
 
-@ResourceLanguage(Java.KEY)
+@RequiredMeasures(mandatory = {CoreMetrics.DEPENDENCY_MATRIX_KEY})
 @ResourceQualifier({Qualifiers.PROJECT, Qualifiers.MODULE, Qualifiers.PACKAGE, Qualifiers.DIRECTORY})
 @DefaultTab(metrics = {
   CoreMetrics.DEPENDENCY_MATRIX_KEY, CoreMetrics.PACKAGE_FEEDBACK_EDGES_KEY, CoreMetrics.PACKAGE_CYCLES_KEY,