/*
* Jitsi, the OpenSource Java VoIP and Instant Messaging client.
*
* Distributable under LGPL license. See terms of license at gnu.org.
*/
package net.java.sip.communicator.plugin.whiteboard;
import javax.swing.*;
import net.java.sip.communicator.service.resources.*;
import org.jitsi.service.resources.*;
/**
* The Resources class manages the access to the internationalization
* properties files and the image resources used in this plugin.
*
* @author Yana Stamcheva
*/
public class Resources
{
private static ResourceManagementService resourcesService;
/**
* Returns an internationalized string corresponding to the given key.
*
* @param key The key of the string.
* @return An internationalized string corresponding to the given key.
*/
public static String getString(String key)
{
return getResources().getI18NString(key);
}
/**
* Returns an internationalized string corresponding to the given key,
* by replacing all occurences of '?' with the given string param.
* @param key The key of the string.
* @param params the params, that should replace {1}, {2}, etc. in the
* string given by the key parameter
* @return An internationalized string corresponding to the given key,
* by replacing all occurences of '?' with the given string param.
*/
public static String getString(String key, String[] params)
{
return getResources().getI18NString(key, params);
}
/**
* Returns an internationalized string corresponding to the given key.
*
* @param key The key of the string.
* @return An internationalized string corresponding to the given key.
*/
public static char getMnemonic(String key)
{
return getResources().getI18nMnemonic(key);
}
/**
* Loads an image from a given image identifier.
*
* @param imageID The identifier of the image.
* @return The image for the given identifier.
*/
public static ImageIcon getImage(String imageID)
{
return getResources().getImage(imageID);
}
/**
* Returns the ResourceManagementService.
*
* @return the ResourceManagementService.
*/
public static ResourceManagementService getResources()
{
if (resourcesService == null)
resourcesService =
ResourceManagementServiceUtils
.getService(WhiteboardActivator.bundleContext);
return resourcesService;
}
}