class contains various utility methods used internally
by the web console implementation and the build-in plugins.
Return a display name for the given
- If the bundle has a non-empty
header that value is returned.
- Otherwise the symbolic name is returned if set
- Otherwise the bundle's location is returned if defined
- Finally, as a last resort, the bundles id is returned
bundle the bundle which name to retrieve
locale the locale, in which the bundle name is requested
- the bundle name - see the description of the method for more details.
if ( name == null || name.length() == 0 )
Returns the value of the header or the empty string if the header
is not available.
bundle the bundle which header to retrieve
headerName the name of the header to retrieve
- the header or empty string if it is not set
Orders the bundles according to their name as returned by
, with the exception that the system bundle is
always place as the first entry. If two bundles have the same name, they
are ordered according to their version. If they have the same version,
the bundle with the lower bundle id comes before the other.
bundles the bundles to sort
locale the locale, used to obtain the localized bundle name
This method is the same as Collections#list(Enumeration). The reason to
duplicate it here, is that it is missing in OSGi/Minimum execution
e the enumeration which to convert
- the list containing all enumeration entries.
This method expects a locale string in format language_COUNTRY, or
language. The method will determine which is the correct form of locale
string and construct a
locale the locale string, if
null - default locale is
- a locale object
- See also:
int last = locale.indexOf('_', idx);
return new Locale(language, country);
Writes a key-value pair in a JSON writer. Write is performed only if both key and
value are not null.
jw the writer, where to write the data
key the key value, stored under 'key'
value the value stored under 'value'
org.json.JSONException if the value cannot be serialized.
if (key != null && value != null)