]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-1829: Replace "Priority" by "Severity" in Hotspots service
authorGodin <mandrikov@gmail.com>
Thu, 2 Dec 2010 23:02:07 +0000 (23:02 +0000)
committerGodin <mandrikov@gmail.com>
Thu, 2 Dec 2010 23:02:07 +0000 (23:02 +0000)
plugins/sonar-core-gwt/src/main/java/org/sonar/plugins/core/hotspots/client/I18nConstants.java
plugins/sonar-core-gwt/src/main/java/org/sonar/plugins/core/hotspots/client/widget/MostViolatedResources.java
plugins/sonar-core-gwt/src/main/java/org/sonar/plugins/core/hotspots/client/widget/MostViolatedRules.java

index 799b8267175e9b0e2e7af9387633748efab7e667..4abcd8f2b12968c6ea9a0f100bc9314a5efdc4a2 100644 (file)
@@ -52,8 +52,8 @@ public interface I18nConstants extends com.google.gwt.i18n.client.Constants {
   @DefaultStringValue("No measures")
   String noMeasures();
 
-  @DefaultStringValue("Any priority")
-  String anyPriority();
+  @DefaultStringValue("Any severity")
+  String anySeverity();
 
   @DefaultStringValue("more")
   String moreDetails();
index e79398ba063b7a9383fbbb2a76b91e234d7c80fa..6017b205060a7c80d088f78b9654cdd98e617d6e 100644 (file)
@@ -97,20 +97,20 @@ public class MostViolatedResources extends AbstractHotspot {
     Measure debt = resource.getMeasures().get(0);
     if (debt != null && debt.getData() != null) {
       Map<String, String> map = debt.getDataAsMap(";");
-      renderPriority(grid, row, map, 1, "BLOCKER");
-      renderPriority(grid, row, map, 3, "CRITICAL");
-      renderPriority(grid, row, map, 5, "MAJOR");
-      renderPriority(grid, row, map, 7, "MINOR");
-      renderPriority(grid, row, map, 9, "INFO");
+      renderSeverity(grid, row, map, 1, "BLOCKER");
+      renderSeverity(grid, row, map, 3, "CRITICAL");
+      renderSeverity(grid, row, map, 5, "MAJOR");
+      renderSeverity(grid, row, map, 7, "MINOR");
+      renderSeverity(grid, row, map, 9, "INFO");
     }
   }
 
-  private void renderPriority(Grid grid, int row, Map<String, String> map, int column, String priority) {
-    grid.setWidget(row, column, Icons.forPriority(priority).createImage());
+  private void renderSeverity(Grid grid, int row, Map<String, String> map, int column, String severity) {
+    grid.setWidget(row, column, Icons.forPriority(severity).createImage());
     grid.getCellFormatter().setStyleName(row, column, getRowCssClass(row) + " small right");
 
-    if (map.containsKey(priority)) {
-      grid.setWidget(row, column + 1, new HTML(map.get(priority)));
+    if (map.containsKey(severity)) {
+      grid.setWidget(row, column + 1, new HTML(map.get(severity)));
     } else {
       grid.setWidget(row, column + 1, new HTML("0"));
     }
index 1255c1e5a6317a8732d88da25df30010b1bc1583..a8af7097d74095dcb51633162ca78c89362ee858 100644 (file)
@@ -37,7 +37,7 @@ import org.sonar.wsclient.services.ResourceQuery;
 
 public class MostViolatedRules extends AbstractHotspot {
 
-  private ListBox priorities;
+  private ListBox severity;
 
   public MostViolatedRules(Resource resource) {
     super("rules-hotspot", resource);
@@ -45,15 +45,15 @@ public class MostViolatedRules extends AbstractHotspot {
 
   @Override
   Widget createHeader() {
-    priorities = new ListBox(false);
-    priorities.addItem(I18nConstants.INSTANCE.anyPriority(), "");
-    priorities.addItem("Blocker", "BLOCKER");
-    priorities.addItem("Critical", "CRITICAL");
-    priorities.addItem("Major", "MAJOR");
-    priorities.addItem("Minor", "MINOR");
-    priorities.addItem("Info", "INFO");
-    priorities.setStyleName("small");
-    priorities.addChangeHandler(new ChangeHandler() {
+    severity = new ListBox(false);
+    severity.addItem(I18nConstants.INSTANCE.anySeverity(), "");
+    severity.addItem("Blocker", "BLOCKER");
+    severity.addItem("Critical", "CRITICAL");
+    severity.addItem("Major", "MAJOR");
+    severity.addItem("Minor", "MINOR");
+    severity.addItem("Info", "INFO");
+    severity.setStyleName("small");
+    severity.addChangeHandler(new ChangeHandler() {
       public void onChange(ChangeEvent event) {
         loadData();
       }
@@ -74,10 +74,10 @@ public class MostViolatedRules extends AbstractHotspot {
     horizontal.setVerticalAlignment(HasAlignment.ALIGN_MIDDLE);
     horizontal.setWidth("98%");
     horizontal.add(label);
-    horizontal.add(priorities);
+    horizontal.add(severity);
     horizontal.add(moreLink);
     horizontal.setCellHorizontalAlignment(label, HorizontalPanel.ALIGN_LEFT);
-    horizontal.setCellHorizontalAlignment(priorities, HorizontalPanel.ALIGN_LEFT);
+    horizontal.setCellHorizontalAlignment(severity, HorizontalPanel.ALIGN_LEFT);
     horizontal.setCellHorizontalAlignment(moreLink, HorizontalPanel.ALIGN_RIGHT);
 
     return horizontal;
@@ -140,7 +140,7 @@ public class MostViolatedRules extends AbstractHotspot {
   }
 
   private String getSelectedPriority() {
-    String priority = priorities.getValue(priorities.getSelectedIndex());
+    String priority = severity.getValue(severity.getSelectedIndex());
     if ("".equals(priority) || priority == null) {
       return null;
     }