diff options
author | Yana Stamcheva <yana@jitsi.org> | 2008-08-08 09:14:37 +0000 |
---|---|---|
committer | Yana Stamcheva <yana@jitsi.org> | 2008-08-08 09:14:37 +0000 |
commit | 69a5b4a823c80b63c7dd54bb7858b359e3c17b81 (patch) | |
tree | 18829f8469fb7791c67b50a299a68a210cb6831a | |
parent | 2960d558ec8ebf27abb068d109478bb4c766a1f4 (diff) | |
download | jitsi-69a5b4a823c80b63c7dd54bb7858b359e3c17b81.zip jitsi-69a5b4a823c80b63c7dd54bb7858b359e3c17b81.tar.gz jitsi-69a5b4a823c80b63c7dd54bb7858b359e3c17b81.tar.bz2 |
meta resources introduced
5 files changed, 93 insertions, 18 deletions
diff --git a/src/net/java/sip/communicator/plugin/defaultresourcepack/DefaultColorPackImpl.java b/src/net/java/sip/communicator/plugin/defaultresourcepack/DefaultColorPackImpl.java index aa6621b..3ae151d 100644 --- a/src/net/java/sip/communicator/plugin/defaultresourcepack/DefaultColorPackImpl.java +++ b/src/net/java/sip/communicator/plugin/defaultresourcepack/DefaultColorPackImpl.java @@ -9,6 +9,7 @@ package net.java.sip.communicator.plugin.defaultresourcepack; import java.util.*; import net.java.sip.communicator.service.resources.*; +import net.java.sip.communicator.util.*; /** * The default color resource pack. @@ -19,6 +20,11 @@ import net.java.sip.communicator.service.resources.*; public class DefaultColorPackImpl implements ColorPack { + private Logger logger = Logger.getLogger(DefaultColorPackImpl.class); + + private static final String META_RESOURCE_PATH + = "resources.colors.meta-colors"; + private static final String DEFAULT_RESOURCE_PATH = "resources.colors.colors"; @@ -31,10 +37,20 @@ public class DefaultColorPackImpl */ public Map<String, String> getResources() { - ResourceBundle resourceBundle - = ResourceBundle.getBundle(DEFAULT_RESOURCE_PATH); + ResourceBundle resourceBundle = null; + try + { + resourceBundle = ResourceBundle.getBundle(META_RESOURCE_PATH); + } + catch (MissingResourceException ex) + { + logger.info("Missing meta resource for colors."); + } + + if (resourceBundle == null) + resourceBundle = ResourceBundle.getBundle(DEFAULT_RESOURCE_PATH); - Map<String, String> resources = new Hashtable<String, String>(); + Map<String, String> resources = new TreeMap<String, String>(); this.initResources(resourceBundle, resources); diff --git a/src/net/java/sip/communicator/plugin/defaultresourcepack/DefaultImagePackImpl.java b/src/net/java/sip/communicator/plugin/defaultresourcepack/DefaultImagePackImpl.java index 006e62b..de51ebf 100644 --- a/src/net/java/sip/communicator/plugin/defaultresourcepack/DefaultImagePackImpl.java +++ b/src/net/java/sip/communicator/plugin/defaultresourcepack/DefaultImagePackImpl.java @@ -9,6 +9,7 @@ package net.java.sip.communicator.plugin.defaultresourcepack; import java.util.*; import net.java.sip.communicator.service.resources.*; +import net.java.sip.communicator.util.*; /** * The default image resource pack. @@ -19,6 +20,11 @@ import net.java.sip.communicator.service.resources.*; public class DefaultImagePackImpl implements ImagePack { + private Logger logger = Logger.getLogger(DefaultImagePackImpl.class); + + private static final String META_RESOURCE_PATH + = "resources.images.meta-images"; + private static final String DEFAULT_RESOURCE_PATH = "resources.images.images"; @@ -31,10 +37,20 @@ public class DefaultImagePackImpl */ public Map<String, String> getResources() { - ResourceBundle resourceBundle - = ResourceBundle.getBundle(DEFAULT_RESOURCE_PATH); + ResourceBundle resourceBundle = null; + try + { + resourceBundle = ResourceBundle.getBundle(META_RESOURCE_PATH); + } + catch (MissingResourceException ex) + { + logger.info("Missing meta resource for colors."); + } + + if (resourceBundle == null) + resourceBundle = ResourceBundle.getBundle(DEFAULT_RESOURCE_PATH); - Map<String, String> resources = new Hashtable<String, String>(); + Map<String, String> resources = new TreeMap<String, String>(); this.initResources(resourceBundle, resources); diff --git a/src/net/java/sip/communicator/plugin/defaultresourcepack/DefaultLanguagePackImpl.java b/src/net/java/sip/communicator/plugin/defaultresourcepack/DefaultLanguagePackImpl.java index 733377d..95d1cb0 100644 --- a/src/net/java/sip/communicator/plugin/defaultresourcepack/DefaultLanguagePackImpl.java +++ b/src/net/java/sip/communicator/plugin/defaultresourcepack/DefaultLanguagePackImpl.java @@ -5,10 +5,7 @@ */ package net.java.sip.communicator.plugin.defaultresourcepack; -import java.io.*; -import java.net.*; import java.util.*; -import java.util.jar.*; import net.java.sip.communicator.service.resources.*; import net.java.sip.communicator.util.*; @@ -20,6 +17,11 @@ import net.java.sip.communicator.util.*; public class DefaultLanguagePackImpl implements LanguagePack { + private Logger logger = Logger.getLogger(DefaultLanguagePackImpl.class); + + private static final String META_RESOURCE_PATH + = "resources.languages.meta-resources"; + private static final String DEFAULT_RESOURCE_PATH = "resources.languages.resources"; @@ -32,10 +34,20 @@ public class DefaultLanguagePackImpl */ public Map<String, String> getResources() { - ResourceBundle resourceBundle - = ResourceBundle.getBundle(DEFAULT_RESOURCE_PATH); + ResourceBundle resourceBundle = null; + try + { + resourceBundle = ResourceBundle.getBundle(META_RESOURCE_PATH); + } + catch (MissingResourceException ex) + { + logger.info("Missing meta resource for colors."); + } - Map<String, String> resources = new Hashtable<String, String>(); + if (resourceBundle == null) + resourceBundle = ResourceBundle.getBundle(DEFAULT_RESOURCE_PATH); + + Map<String, String> resources = new TreeMap<String, String>(); this.initResources(resourceBundle, Locale.getDefault(), resources); diff --git a/src/net/java/sip/communicator/plugin/defaultresourcepack/DefaultSettingsPackImpl.java b/src/net/java/sip/communicator/plugin/defaultresourcepack/DefaultSettingsPackImpl.java index 4b451b5..8d0ec51 100644 --- a/src/net/java/sip/communicator/plugin/defaultresourcepack/DefaultSettingsPackImpl.java +++ b/src/net/java/sip/communicator/plugin/defaultresourcepack/DefaultSettingsPackImpl.java @@ -9,6 +9,7 @@ package net.java.sip.communicator.plugin.defaultresourcepack; import java.util.*; import net.java.sip.communicator.service.resources.*; +import net.java.sip.communicator.util.*; /** * The default settings resource pack. @@ -19,6 +20,11 @@ import net.java.sip.communicator.service.resources.*; public class DefaultSettingsPackImpl implements SettingsPack { + private Logger logger = Logger.getLogger(DefaultSettingsPackImpl.class); + + private static final String META_RESOURCE_PATH + = "resources.config.meta-defaults"; + private static final String DEFAULT_RESOURCE_PATH = "resources.config.defaults"; @@ -31,10 +37,20 @@ public class DefaultSettingsPackImpl */ public Map<String, String> getResources() { - ResourceBundle resourceBundle - = ResourceBundle.getBundle(DEFAULT_RESOURCE_PATH); + ResourceBundle resourceBundle = null; + try + { + resourceBundle = ResourceBundle.getBundle(META_RESOURCE_PATH); + } + catch (MissingResourceException ex) + { + logger.info("Missing meta resource for colors."); + } + + if (resourceBundle == null) + resourceBundle = ResourceBundle.getBundle(DEFAULT_RESOURCE_PATH); - Map<String, String> resources = new Hashtable<String, String>(); + Map<String, String> resources = new TreeMap<String, String>(); this.initResources(resourceBundle, resources); diff --git a/src/net/java/sip/communicator/plugin/defaultresourcepack/DefaultSoundPackImpl.java b/src/net/java/sip/communicator/plugin/defaultresourcepack/DefaultSoundPackImpl.java index 4a07d04..9523dcb 100644 --- a/src/net/java/sip/communicator/plugin/defaultresourcepack/DefaultSoundPackImpl.java +++ b/src/net/java/sip/communicator/plugin/defaultresourcepack/DefaultSoundPackImpl.java @@ -9,6 +9,7 @@ package net.java.sip.communicator.plugin.defaultresourcepack; import java.util.*; import net.java.sip.communicator.service.resources.*; +import net.java.sip.communicator.util.*; /** * The default sound resource pack. @@ -19,6 +20,10 @@ import net.java.sip.communicator.service.resources.*; public class DefaultSoundPackImpl implements SoundPack { + private Logger logger = Logger.getLogger(DefaultSoundPackImpl.class); + + private static final String META_RESOURCE_PATH + = "resources.sounds.meta-sounds"; private static final String DEFAULT_RESOURCE_PATH = "resources.sounds.sounds"; @@ -32,10 +37,20 @@ public class DefaultSoundPackImpl */ public Map<String, String> getResources() { - ResourceBundle resourceBundle - = ResourceBundle.getBundle(DEFAULT_RESOURCE_PATH); + ResourceBundle resourceBundle = null; + try + { + resourceBundle = ResourceBundle.getBundle(META_RESOURCE_PATH); + } + catch (MissingResourceException ex) + { + logger.info("Missing meta resource for colors."); + } + + if (resourceBundle == null) + resourceBundle = ResourceBundle.getBundle(DEFAULT_RESOURCE_PATH); - Map<String, String> resources = new Hashtable<String, String>(); + Map<String, String> resources = new TreeMap<String, String>(); this.initResources(resourceBundle, resources); |