org.sonar.api.web.gwt.client
Class Utils

java.lang.Object
  extended by org.sonar.api.web.gwt.client.Utils

public final class Utils
extends Object

A class of web utility

Since:
1.10

Method Summary
static String escapeHtml(String maybeHtml)
           
static String formatNumber(double number)
           
static String formatNumber(String number)
           
static String formatPercent(double percentage)
           
static String formatPercent(String percentage)
           
static String getConfiguration(String key)
           
static String getConfiguration(String key, String defaultValue)
           
static Set<String> getConfigurationKeys()
           
static String getRequestParameter(String key)
           
static Set<String> getRequestParameterNames()
           
static String getServerApiUrl()
           
static String getServerUrl()
           
static String getUrlToRuleDescription(String ruleKey, boolean showLayout)
           
static void openResourcePopup(Resource resource, String metricKey)
          Display the resource in a popup.
static void setConfiguration(String key, String val)
           
static void showError(String message)
           
static void showInfo(String message)
           
static void showWarning(String message)
           
static String widgetGWTIdJSEncode(String widgetGWTId)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getConfiguration

public static String getConfiguration(String key)

getConfiguration

public static String getConfiguration(String key,
                                      String defaultValue)

setConfiguration

public static void setConfiguration(String key,
                                    String val)

getRequestParameter

public static String getRequestParameter(String key)

getConfigurationKeys

public static Set<String> getConfigurationKeys()

getRequestParameterNames

public static Set<String> getRequestParameterNames()

widgetGWTIdJSEncode

public static String widgetGWTIdJSEncode(String widgetGWTId)

getServerUrl

public static String getServerUrl()

getServerApiUrl

public static String getServerApiUrl()

escapeHtml

public static String escapeHtml(String maybeHtml)

formatPercent

public static String formatPercent(String percentage)

formatPercent

public static String formatPercent(double percentage)

formatNumber

public static String formatNumber(String number)

formatNumber

public static String formatNumber(double number)

showError

public static void showError(String message)

showWarning

public static void showWarning(String message)

showInfo

public static void showInfo(String message)

openResourcePopup

public static void openResourcePopup(Resource resource,
                                     String metricKey)
Display the resource in a popup.

Parameters:
resource - the resource to display, not null
metricKey - the metric to highlight (optional : can be null)

getUrlToRuleDescription

public static String getUrlToRuleDescription(String ruleKey,
                                             boolean showLayout)


Copyright © 2009-2011 SonarSource. All Rights Reserved.