From: Godin Date: Thu, 2 Dec 2010 23:02:07 +0000 (+0000) Subject: SONAR-1829: Replace "Priority" by "Severity" in Hotspots service X-Git-Tag: 2.6~441 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=52c5150f264fd1f20151caf663c497f53410ed8c;p=sonarqube.git SONAR-1829: Replace "Priority" by "Severity" in Hotspots service --- diff --git a/plugins/sonar-core-gwt/src/main/java/org/sonar/plugins/core/hotspots/client/I18nConstants.java b/plugins/sonar-core-gwt/src/main/java/org/sonar/plugins/core/hotspots/client/I18nConstants.java index 799b8267175..4abcd8f2b12 100644 --- a/plugins/sonar-core-gwt/src/main/java/org/sonar/plugins/core/hotspots/client/I18nConstants.java +++ b/plugins/sonar-core-gwt/src/main/java/org/sonar/plugins/core/hotspots/client/I18nConstants.java @@ -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(); diff --git a/plugins/sonar-core-gwt/src/main/java/org/sonar/plugins/core/hotspots/client/widget/MostViolatedResources.java b/plugins/sonar-core-gwt/src/main/java/org/sonar/plugins/core/hotspots/client/widget/MostViolatedResources.java index e79398ba063..6017b205060 100644 --- a/plugins/sonar-core-gwt/src/main/java/org/sonar/plugins/core/hotspots/client/widget/MostViolatedResources.java +++ b/plugins/sonar-core-gwt/src/main/java/org/sonar/plugins/core/hotspots/client/widget/MostViolatedResources.java @@ -97,20 +97,20 @@ public class MostViolatedResources extends AbstractHotspot { Measure debt = resource.getMeasures().get(0); if (debt != null && debt.getData() != null) { Map 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 map, int column, String priority) { - grid.setWidget(row, column, Icons.forPriority(priority).createImage()); + private void renderSeverity(Grid grid, int row, Map 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")); } diff --git a/plugins/sonar-core-gwt/src/main/java/org/sonar/plugins/core/hotspots/client/widget/MostViolatedRules.java b/plugins/sonar-core-gwt/src/main/java/org/sonar/plugins/core/hotspots/client/widget/MostViolatedRules.java index 1255c1e5a63..a8af7097d74 100644 --- a/plugins/sonar-core-gwt/src/main/java/org/sonar/plugins/core/hotspots/client/widget/MostViolatedRules.java +++ b/plugins/sonar-core-gwt/src/main/java/org/sonar/plugins/core/hotspots/client/widget/MostViolatedRules.java @@ -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; }