aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/sip/communicator/plugin/contactinfo
diff options
context:
space:
mode:
authorYana Stamcheva <yana@jitsi.org>2008-02-21 13:36:42 +0000
committerYana Stamcheva <yana@jitsi.org>2008-02-21 13:36:42 +0000
commita097a8ce3aa9fd70b383178649224575e398c95b (patch)
tree5f67db19c3f059897027a9a5b71b08b2b102b817 /src/net/java/sip/communicator/plugin/contactinfo
parent3cb59430a692014ec11de0494b19b59c33eae10b (diff)
downloadjitsi-a097a8ce3aa9fd70b383178649224575e398c95b.zip
jitsi-a097a8ce3aa9fd70b383178649224575e398c95b.tar.gz
jitsi-a097a8ce3aa9fd70b383178649224575e398c95b.tar.bz2
Remove i18n resources from the contactinfo bundle.
Move image resources to the main resources folder.
Diffstat (limited to 'src/net/java/sip/communicator/plugin/contactinfo')
-rw-r--r--src/net/java/sip/communicator/plugin/contactinfo/Resources.java79
-rw-r--r--src/net/java/sip/communicator/plugin/contactinfo/resources.properties24
2 files changed, 46 insertions, 57 deletions
diff --git a/src/net/java/sip/communicator/plugin/contactinfo/Resources.java b/src/net/java/sip/communicator/plugin/contactinfo/Resources.java
index 18910c8..77fda90 100644
--- a/src/net/java/sip/communicator/plugin/contactinfo/Resources.java
+++ b/src/net/java/sip/communicator/plugin/contactinfo/Resources.java
@@ -15,32 +15,57 @@ import javax.imageio.*;
import javax.swing.*;
import net.java.sip.communicator.util.*;
+
/**
- * The Messages class manages the access to the internationalization
- * properties files.
+ * The <tt>Resources</tt> 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 Logger log = Logger.getLogger(Resources.class);
- private static final String BUNDLE_NAME
+ /**
+ * The name of the resource, where internationalization strings for this
+ * plugin are stored.
+ */
+ private static final String STRING_RESOURCE_NAME
+ = "resources.languages.plugin.contactinfo.resources";
+
+ /**
+ * The name of the resource, where paths to images used in this bundle are
+ * stored.
+ */
+ private static final String IMAGE_RESOURCE_NAME
= "net.java.sip.communicator.plugin.contactinfo.resources";
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
- .getBundle(BUNDLE_NAME);
+ /**
+ * The string resource bundle.
+ */
+ private static final ResourceBundle STRING_RESOURCE_BUNDLE
+ = ResourceBundle.getBundle(STRING_RESOURCE_NAME);
+
+ /**
+ * The image resource bundle.
+ */
+ private static final ResourceBundle IMAGE_RESOURCE_BUNDLE
+ = ResourceBundle.getBundle(IMAGE_RESOURCE_NAME);
/**
* 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) {
- try {
- return RESOURCE_BUNDLE.getString(key);
-
- } catch (MissingResourceException e) {
+ public static String getString(String key)
+ {
+ try
+ {
+ return STRING_RESOURCE_BUNDLE.getString(key);
+ }
+ catch (MissingResourceException e)
+ {
return '!' + key + '!';
}
}
@@ -50,38 +75,22 @@ public class Resources {
* @param imageID The identifier of the image.
* @return The image for the given identifier.
*/
- public static ImageIcon getImage(String imageID) {
+ public static ImageIcon getImage(String imageID)
+ {
BufferedImage image = null;
- String path = Resources.getString(imageID);
- try {
+ String path = IMAGE_RESOURCE_BUNDLE.getString(imageID);
+
+ try
+ {
image = ImageIO.read(Resources.class.getClassLoader()
.getResourceAsStream(path));
-
- } catch (IOException e) {
- log.error("Failed to load image:" + path, e);
}
-
- return new ImageIcon(image);
- }
-
- /**
- * Loads an image from a given image identifier.
- * @param imageID The identifier of the image.
- * @return The image for the given identifier.
- */
- public static byte[] getImageInBytes(String imageID) {
- byte[] image = new byte[100000];
-
- String path = Resources.getString(imageID);
- try {
- Resources.class.getClassLoader()
- .getResourceAsStream(path).read(image);
-
- } catch (IOException e) {
+ catch (IOException e)
+ {
log.error("Failed to load image:" + path, e);
}
- return image;
+ return new ImageIcon(image);
}
}
diff --git a/src/net/java/sip/communicator/plugin/contactinfo/resources.properties b/src/net/java/sip/communicator/plugin/contactinfo/resources.properties
index f010002..01fc264 100644
--- a/src/net/java/sip/communicator/plugin/contactinfo/resources.properties
+++ b/src/net/java/sip/communicator/plugin/contactinfo/resources.properties
@@ -1,22 +1,2 @@
-contactInfo=Contact details
-contacts=Contacts
-selectUser=Select a user
-summary=Summary
-summaryDesc=Summary of contact info for
-extended=Extended
-extendedDesc=Extended contact info for
-notSupported=This protocol doesn't support server stored details for now. Try one of the other protocols.
-clickWeb=Click for Web Info
-webInfo=Web Info
-firstNameNS=First Name:
-middleNameNS=Middle Name:
-lastNameNS=Last Name:
-ageNS=Age:
-bdayNS=Birth Date:
-genderNS=Gender:
-emailNS=E-mail:
-phoneNS=Phone:
-userPictures=User Pictures
-notSpecified=[Not specified]
-infoIcon=net/java/sip/communicator/plugin/contactinfo/resources/userInfo16x16.png
-defaultPersonIcon=net/java/sip/communicator/plugin/contactinfo/resources/personPhoto.png \ No newline at end of file
+infoIcon=resources/images/plugin/contactinfo/userInfo16x16.png
+defaultPersonIcon=resources/images/plugin/contactinfo/personPhoto.png \ No newline at end of file