aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/sip/communicator/plugin/branding
diff options
context:
space:
mode:
authorYana Stamcheva <yana@jitsi.org>2008-01-15 10:56:22 +0000
committerYana Stamcheva <yana@jitsi.org>2008-01-15 10:56:22 +0000
commit5d9923d0c5d3fc08acf7fb617b0a670cfb5653c0 (patch)
tree1e27b816682751f62b642be68690f6a6a5bd0c6b /src/net/java/sip/communicator/plugin/branding
parent6565a6b045ef92bab75172486d15100b539a589e (diff)
downloadjitsi-5d9923d0c5d3fc08acf7fb617b0a670cfb5653c0.zip
jitsi-5d9923d0c5d3fc08acf7fb617b0a670cfb5653c0.tar.gz
jitsi-5d9923d0c5d3fc08acf7fb617b0a670cfb5653c0.tar.bz2
Application main constants moved to application.properties file in the main resources directory.
Diffstat (limited to 'src/net/java/sip/communicator/plugin/branding')
-rw-r--r--src/net/java/sip/communicator/plugin/branding/AboutWindow.java8
-rw-r--r--src/net/java/sip/communicator/plugin/branding/BrandingResources.java37
-rw-r--r--src/net/java/sip/communicator/plugin/branding/Constants.java9
-rw-r--r--src/net/java/sip/communicator/plugin/branding/WelcomeWindow.java10
-rw-r--r--src/net/java/sip/communicator/plugin/branding/brandingResources.properties4
5 files changed, 31 insertions, 37 deletions
diff --git a/src/net/java/sip/communicator/plugin/branding/AboutWindow.java b/src/net/java/sip/communicator/plugin/branding/AboutWindow.java
index fa84519..d58713a 100644
--- a/src/net/java/sip/communicator/plugin/branding/AboutWindow.java
+++ b/src/net/java/sip/communicator/plugin/branding/AboutWindow.java
@@ -22,7 +22,7 @@ public class AboutWindow extends JDialog implements HyperlinkListener,
private WindowBackground mainPanel = new WindowBackground();
private JLabel titleLabel = new JLabel(
- BrandingResources.getString("productName"));
+ BrandingResources.getApplicationString("productName"));
private JLabel versionLabel = new JLabel(" "
+ System.getProperty("sip-communicator.version"));
@@ -46,7 +46,7 @@ public class AboutWindow extends JDialog implements HyperlinkListener,
this.setTitle( Resources.getString("aboutWindowTitle",
new String[]{BrandingResources
- .getString("productName")}));
+ .getApplicationString("productName")}));
this.setModal(false);
@@ -145,8 +145,8 @@ public class AboutWindow extends JDialog implements HyperlinkListener,
try
{
bgImage = ImageIO.read(WindowBackground.class.getClassLoader()
- .getResource(
- BrandingResources.getString("aboutWindowBg")));
+ .getResource(BrandingResources
+ .getResourceString("aboutWindowBg")));
}
catch (IOException e)
{
diff --git a/src/net/java/sip/communicator/plugin/branding/BrandingResources.java b/src/net/java/sip/communicator/plugin/branding/BrandingResources.java
index 8f00839..3940911 100644
--- a/src/net/java/sip/communicator/plugin/branding/BrandingResources.java
+++ b/src/net/java/sip/communicator/plugin/branding/BrandingResources.java
@@ -23,13 +23,19 @@ public class BrandingResources
private static final ResourceBundle resourceBundle
= ResourceBundle.getBundle(RESOUCRE_LOCATION);
+ private static final String APPLICATION_RESUORCE_LOCATION
+ = "resources.application";
+
+ private static final ResourceBundle applicationBundle
+ = ResourceBundle.getBundle(APPLICATION_RESUORCE_LOCATION);
+
/**
- * Returns an internationalized string corresponding to the given key.
+ * Returns the resource string corresponding to the given key.
*
* @param key The key of the string.
- * @return An internationalized string corresponding to the given key.
+ * @return the resource string corresponding to the given key
*/
- public static String getString(String key)
+ public static String getResourceString(String key)
{
try
{
@@ -40,33 +46,22 @@ public class BrandingResources
return '!' + key + '!';
}
}
-
+
/**
- * Returns an internationalized string corresponding to the given key,
- * by replacing all occurences of '?' with the given string param.
+ * Returns the application property string corresponding to the given key.
+ *
* @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 {#number} with the given string param.
+ * @return the application property string corresponding to the given key
*/
- public static String getString(String key, String[] params)
+ public static String getApplicationString(String key)
{
- String resourceString;
-
try
{
- resourceString = resourceBundle.getString(key);
-
- resourceString = MessageFormat.format(
- resourceString, (Object[]) params);
-
+ return applicationBundle.getString(key);
}
catch (MissingResourceException e)
{
- resourceString = '!' + key + '!';
+ return '!' + key + '!';
}
-
- return resourceString;
}
} \ No newline at end of file
diff --git a/src/net/java/sip/communicator/plugin/branding/Constants.java b/src/net/java/sip/communicator/plugin/branding/Constants.java
index 05e0cfe..fb417d2 100644
--- a/src/net/java/sip/communicator/plugin/branding/Constants.java
+++ b/src/net/java/sip/communicator/plugin/branding/Constants.java
@@ -42,9 +42,9 @@ public class Constants
* The default <tt>Font</tt> object used through this ui implementation.
*/
public static final Font FONT
- = new Font( BrandingResources.getString("fontName"),
- Font.PLAIN,
- new Integer(BrandingResources.getString("fontSize"))
+ = new Font( BrandingResources.getApplicationString("fontName"),
+ Font.PLAIN,
+ new Integer(BrandingResources.getApplicationString("fontSize"))
.intValue());
/**
@@ -55,7 +55,8 @@ public class Constants
public static void loadSimpleStyle(StyleSheet style)
{
InputStream is = Constants.class.getClassLoader()
- .getResourceAsStream(BrandingResources.getString("textStyle"));
+ .getResourceAsStream(
+ BrandingResources.getResourceString("textStyle"));
Reader r = new BufferedReader(new InputStreamReader(is));
try
diff --git a/src/net/java/sip/communicator/plugin/branding/WelcomeWindow.java b/src/net/java/sip/communicator/plugin/branding/WelcomeWindow.java
index 1bb98ef..5a54dc2 100644
--- a/src/net/java/sip/communicator/plugin/branding/WelcomeWindow.java
+++ b/src/net/java/sip/communicator/plugin/branding/WelcomeWindow.java
@@ -12,7 +12,7 @@ public class WelcomeWindow extends JDialog
private WindowBackground mainPanel = new WindowBackground();
private JLabel titleLabel
- = new JLabel(BrandingResources.getString("productName"));
+ = new JLabel(BrandingResources.getApplicationString("productName"));
private JLabel versionLabel = new JLabel(" "
+ System.getProperty("sip-communicator.version"));
@@ -66,8 +66,9 @@ public class WelcomeWindow extends JDialog
this.rightsArea.setContentType("text/html");
this.rightsArea.appendToEnd(Resources.getString("welcomeMessage",
- new String[]{ BrandingResources.getString("productName"),
- BrandingResources.getString("productWebSite")}));
+ new String[]{
+ BrandingResources.getApplicationString("productName"),
+ BrandingResources.getApplicationString("productWebSite")}));
this.rightsArea.setPreferredSize(new Dimension(50, 50));
this.rightsArea
@@ -177,7 +178,8 @@ public class WelcomeWindow extends JDialog
try
{
bgImage = ImageIO.read(WindowBackground.class.getClassLoader()
- .getResource(BrandingResources.getString("splashScreenBg")));
+ .getResource(
+ BrandingResources.getResourceString("splashScreenBg")));
}
catch (IOException e)
{
diff --git a/src/net/java/sip/communicator/plugin/branding/brandingResources.properties b/src/net/java/sip/communicator/plugin/branding/brandingResources.properties
index e8b547c..8ae9145 100644
--- a/src/net/java/sip/communicator/plugin/branding/brandingResources.properties
+++ b/src/net/java/sip/communicator/plugin/branding/brandingResources.properties
@@ -1,7 +1,3 @@
-productName=SIP Communicator
-productWebSite=http://sip-communicator.org
-fontName=Verdana
-fontSize=12
aboutWindowBg=resources/images/plugin/branding/aboutWindowBackground.png
splashScreenBg=resources/images/plugin/branding/splashScreenBackground.png
textStyle=resources/styles/defaultStyle.css \ No newline at end of file