Change localization for "qualifier.BRK" from "Module" to "Sub-project".
@Override
public List<ResourceDefinition> provide() {
return Arrays.asList(
- ResourceDefinition.builder(Qualifiers.VIEW).setName("view").build(),
- ResourceDefinition.builder(Qualifiers.SUBVIEW).setName("sub_view").build(),
- ResourceDefinition.builder(Qualifiers.PROJECT).setName("project").build(),
- ResourceDefinition.builder(Qualifiers.MODULE).setName("sub_project").build(),
- ResourceDefinition.builder(Qualifiers.DIRECTORY).setName("directory").build(),
- ResourceDefinition.builder(Qualifiers.PACKAGE).setName("package").build(),
- ResourceDefinition.builder(Qualifiers.FILE).setName("file").build(),
- ResourceDefinition.builder(Qualifiers.CLASS).setName("class").build(),
- ResourceDefinition.builder(Qualifiers.UNIT_TEST_FILE).setName("unit_test").build(),
- ResourceDefinition.builder(Qualifiers.LIBRARY).setName("library").build());
+ ResourceDefinition.builder(Qualifiers.VIEW).build(),
+ ResourceDefinition.builder(Qualifiers.SUBVIEW).build(),
+ ResourceDefinition.builder(Qualifiers.PROJECT).build(),
+ ResourceDefinition.builder(Qualifiers.MODULE).build(),
+ ResourceDefinition.builder(Qualifiers.DIRECTORY).build(),
+ ResourceDefinition.builder(Qualifiers.PACKAGE).build(),
+ ResourceDefinition.builder(Qualifiers.FILE).build(),
+ ResourceDefinition.builder(Qualifiers.CLASS).build(),
+ ResourceDefinition.builder(Qualifiers.UNIT_TEST_FILE).build(),
+ ResourceDefinition.builder(Qualifiers.LIBRARY).build());
}
}
#------------------------------------------------------------------------------
qualifier.TRK=Project
-qualifier.BRC=Module
+qualifier.BRC=Sub-project
qualifier.DIR=Directory
qualifier.PAC=Package
qualifier.VW=View
qualifier.UTS=Unit Test File
qualifiers.TRK=Projects
-qualifiers.BRC=Modules
+qualifiers.BRC=Sub-projects
qualifiers.DIR=Directories
qualifiers.PAC=Packages
qualifiers.VW=Views
public static class Builder {
private String qualifier;
- private String name;
private String iconPath;
private boolean availableForFilters = false;
this.qualifier = qualifier;
}
- /**
- * @param name name which would be used for localization
- */
- public Builder setName(String name) {
- this.name = name;
- return this;
- }
-
/**
* @param iconPath path to icon, relative to context of web-application (e.g. "/images/q/DIR.png")
*/
}
public ResourceDefinition build() {
- if (Strings.isNullOrEmpty(name)) {
- name = qualifier;
- }
if (Strings.isNullOrEmpty(iconPath)) {
iconPath = "/images/q/" + qualifier + ".png";
}
- return new ResourceDefinition(qualifier, name, iconPath, availableForFilters);
+ return new ResourceDefinition(qualifier, iconPath, availableForFilters);
}
}
}
private final String qualifier;
- private final String name;
private final String iconPath;
private final boolean availableForFilters;
- private ResourceDefinition(String qualifier, String name, String iconPath, boolean availableForFilters) {
+ private ResourceDefinition(String qualifier, String iconPath, boolean availableForFilters) {
this.qualifier = qualifier;
- this.name = name;
this.iconPath = iconPath;
this.availableForFilters = availableForFilters;
}
return qualifier;
}
- public String getName() {
- return name;
- }
-
public String getIconPath() {
return iconPath;
}
ResourceDefinition def = ResourceDefinition.builder("qualifier")
.build();
assertThat(def.getQualifier(), is("qualifier"));
- assertThat(def.getName(), is("qualifier"));
assertThat(def.getIconPath(), is("/images/q/qualifier.png"));
}
public void shouldCreate() {
ResourceDefinition def = ResourceDefinition.builder("qualifier")
.setIconPath("/custom-icon.png")
- .setName("custom-name")
.build();
assertThat(def.getQualifier(), is("qualifier"));
- assertThat(def.getName(), is("custom-name"));
assertThat(def.getIconPath(), is("/custom-icon.png"));
}
qualifier=(object.respond_to?('qualifier') ? object.qualifier : object.to_s)
if qualifier
definition = Java::OrgSonarServerUi::JRubyFacade.getInstance().getResourceDefinition(qualifier)
- image_tag(definition.getIconPath(), :alt => message(definition.getName()))
+ image_tag(definition.getIconPath(), :alt => message("qualifier.#{qualifier}"))
else
image_tag('e16.gif')
end
<% qualifiers=(@filter.criterion('qualifier') ? @filter.criterion('qualifier').text_values : []) %>
<% if controller.java_facade.hasPlugin('views') %>
- <input type="checkbox" name="qualifiers[]" value="VW" <%= 'checked' if qualifiers.include?('VW') -%> id="q-VW"></input> <label for="q-VW"><%= message('views') -%></label>
+ <input type="checkbox" name="qualifiers[]" value="VW" <%= 'checked' if qualifiers.include?('VW') -%> id="q-VW"></input> <label for="q-VW"><%= message('qualifiers.VW') -%></label>
<span class="spacer"> </span>
- <input type="checkbox" name="qualifiers[]" value="SVW" <%= 'checked' if qualifiers.include?('SVW') -%> id="q-SVW"></input> <label for="q-SVW"><%= message('sub_views') -%></label>
+ <input type="checkbox" name="qualifiers[]" value="SVW" <%= 'checked' if qualifiers.include?('SVW') -%> id="q-SVW"></input> <label for="q-SVW"><%= message('qualifiers.SVW') -%></label>
<span class="spacer"> </span>
<% end %>
- <input type="checkbox" name="qualifiers[]" value="TRK" <%= 'checked' if qualifiers.include?('TRK') -%> id="q-TRK"></input> <label for="q-TRK"><%= message('projects') -%></label>
+ <input type="checkbox" name="qualifiers[]" value="TRK" <%= 'checked' if qualifiers.include?('TRK') -%> id="q-TRK"></input> <label for="q-TRK"><%= message('qualifiers.TRK') -%></label>
<span class="spacer"> </span>
- <input type="checkbox" name="qualifiers[]" value="BRC" <%= 'checked' if qualifiers.include?('BRC') -%> id="q-BRC"></input> <label for="q-BRC"><%= message('sub_projects') -%></label>
+ <input type="checkbox" name="qualifiers[]" value="BRC" <%= 'checked' if qualifiers.include?('BRC') -%> id="q-BRC"></input> <label for="q-BRC"><%= message('qualifiers.BRC') -%></label>
<span class="spacer"> </span>
- <input type="checkbox" name="qualifiers[]" value="DIR,PAC" <%= 'checked' if qualifiers.include?('DIR') -%> id="q-DIR"></input> <label for="q-DIR"><%= message('directories') -%>/<%= message('packages') -%></label>
+ <input type="checkbox" name="qualifiers[]" value="DIR,PAC" <%= 'checked' if qualifiers.include?('DIR') -%> id="q-DIR"></input> <label for="q-DIR"><%= message('qualifiers.DIR') -%>/<%= message('qualifiers.PAC') -%></label>
<span class="spacer"> </span>
- <input type="checkbox" name="qualifiers[]" value="FIL,CLA" <%= 'checked' if qualifiers.include?('FIL') -%> id="q-FIL"></input> <label for="q-FIL"><%= message('files') -%>/<%= message('classes') -%></label>
+ <input type="checkbox" name="qualifiers[]" value="FIL,CLA" <%= 'checked' if qualifiers.include?('FIL') -%> id="q-FIL"></input> <label for="q-FIL"><%= message('qualifiers.FIL') -%></label>
<span class="spacer"> </span>
- <input type="checkbox" name="qualifiers[]" value="UTS" <%= 'checked' if qualifiers.include?('UTS') -%> id="q-UTS"></input> <label for="q-UTS"><%= message('unit_tests') -%></label>
+ <input type="checkbox" name="qualifiers[]" value="UTS" <%= 'checked' if qualifiers.include?('UTS') -%> id="q-UTS"></input> <label for="q-UTS"><%= message('qualifiers.UTS') -%></label>
<span class="spacer"> </span>
<% for desc in controller.java_facade.getResourceDefinitionsForFilter()
qualifier = desc.getQualifier() %>
<input type="checkbox" name="qualifiers[]" value="<%= qualifier -%>" <%= 'checked' if qualifiers.include?(qualifier) -%> id="q-<%= qualifier -%>"></input>
- <label for="q-<%= qualifier -%>"><%= message(desc.getName()) -%></label>
+ <label for="q-<%= qualifier -%>"><%= message("qualifiers.#{qualifier}") -%></label>
<span class="spacer"> </span>
<% end %>
</td>