Beispiel #1
0
  public String resourceUrl(ISonarResource resource) {
    String urlTemplate = resourcesUrlTemplate(resource);

    String serverUrl = properties(resource).getUrl();
    String key = resource.getKey();

    return String.format(urlTemplate, serverUrl, key);
  }
 @Override
 protected void open(ISonarResource sonarResource) {
   SonarProject sonarProject = SonarProject.getInstance(sonarResource.getProject());
   String url = new SonarUrls().resourceUrl(sonarResource);
   ISonarServer sonarServer =
       SonarCorePlugin.getServersManager().findServer(sonarProject.getUrl());
   if (sonarServer == null) {
     showMessage(
         NLS.bind(
             Messages.No_matching_server_in_configuration_for_project,
             sonarProject.getProject().getName(),
             url));
     return;
   }
   if (sonarServer.disabled()) {
     showMessage("Server is disabled.");
     return;
   }
   if (!WSClientFactory.getSonarClient(sonarServer).exists(sonarResource.getKey())) {
     showMessage("Not found.");
     return;
   }
   super.open(sonarProject, url);
 }