diff options
author | Yana Stamcheva <yana@jitsi.org> | 2008-07-20 22:04:13 +0000 |
---|---|---|
committer | Yana Stamcheva <yana@jitsi.org> | 2008-07-20 22:04:13 +0000 |
commit | 730688e4504537374bd6af0525daa082dd99b561 (patch) | |
tree | 78b5337279b171b55cff384f8d61940c7100822f /src/net/java/sip/communicator/plugin/notificationconfiguration | |
parent | 4751944d62c4519a6ee9e05b9e5b206de4fba7a3 (diff) | |
download | jitsi-730688e4504537374bd6af0525daa082dd99b561.zip jitsi-730688e4504537374bd6af0525daa082dd99b561.tar.gz jitsi-730688e4504537374bd6af0525daa082dd99b561.tar.bz2 |
Remove resources.properties, where not used any more.
Diffstat (limited to 'src/net/java/sip/communicator/plugin/notificationconfiguration')
13 files changed, 68 insertions, 72 deletions
diff --git a/src/net/java/sip/communicator/plugin/notificationconfiguration/NotificationConfigurationActivator.java b/src/net/java/sip/communicator/plugin/notificationconfiguration/NotificationConfigurationActivator.java index d4e4592..dcd3944 100644 --- a/src/net/java/sip/communicator/plugin/notificationconfiguration/NotificationConfigurationActivator.java +++ b/src/net/java/sip/communicator/plugin/notificationconfiguration/NotificationConfigurationActivator.java @@ -10,6 +10,7 @@ import net.java.sip.communicator.service.configuration.*; import net.java.sip.communicator.service.audionotifier.*; import net.java.sip.communicator.service.notification.*; import net.java.sip.communicator.service.gui.*; +import net.java.sip.communicator.util.*; import org.osgi.framework.*; @@ -19,14 +20,17 @@ import org.osgi.framework.*; */ public class NotificationConfigurationActivator implements BundleActivator { + private Logger logger + = Logger.getLogger(NotificationConfigurationActivator.class); + public static BundleContext bundleContext; - + private static ConfigurationService configService; - + private static AudioNotifierService audioService; - + private static NotificationService notificationService; - + /** * Starts this bundle and adds the <tt>AudioConfigurationConfigForm</tt> * contained in it to the configuration window obtained from the @@ -35,13 +39,15 @@ public class NotificationConfigurationActivator implements BundleActivator public void start(BundleContext bc) throws Exception { bundleContext = bc; - + NotificationConfigurationConfigForm notificationconfiguration = new NotificationConfigurationConfigForm(); bundleContext.registerService( ConfigurationForm.class.getName(), notificationconfiguration, null); + + logger.trace("Notification Configuration: [ STARTED ]"); } /** diff --git a/src/net/java/sip/communicator/plugin/notificationconfiguration/NotificationConfigurationConfigForm.java b/src/net/java/sip/communicator/plugin/notificationconfiguration/NotificationConfigurationConfigForm.java index 427f990..7246435 100644 --- a/src/net/java/sip/communicator/plugin/notificationconfiguration/NotificationConfigurationConfigForm.java +++ b/src/net/java/sip/communicator/plugin/notificationconfiguration/NotificationConfigurationConfigForm.java @@ -7,26 +7,20 @@ package net.java.sip.communicator.plugin.notificationconfiguration; -import java.io.*; -import java.lang.String.*; -import java.net.MalformedURLException; -import java.util.*; - import java.awt.*; import java.awt.event.*; +import java.io.*; +import java.net.*; +import java.util.*; import javax.swing.*; -import javax.swing.event.*; -import javax.swing.ImageIcon.*; import javax.swing.border.*; -import javax.swing.JPanel.*; -import javax.swing.BoxLayout.*; +import javax.swing.event.*; -import net.java.sip.communicator.service.gui.*; import net.java.sip.communicator.service.audionotifier.*; +import net.java.sip.communicator.service.gui.*; import net.java.sip.communicator.service.notification.*; import net.java.sip.communicator.service.notification.event.*; - import net.java.sip.communicator.util.*; /** @@ -159,7 +153,7 @@ public class NotificationConfigurationConfigForm activate.setMinimumSize(new Dimension(150,30)); activate.setPreferredSize(new Dimension(150,30)); activate.addActionListener(this); - desactivate = new JButton(Resources.getString("desactivate")); + desactivate = new JButton(Resources.getString("deactivate")); desactivate.setMinimumSize(new Dimension(150,30)); desactivate.setPreferredSize(new Dimension(150,30)); desactivate.addActionListener(this); @@ -386,7 +380,7 @@ public class NotificationConfigurationConfigForm programFileTextField.setText(tmpNTE.getProgramFile()); playSoundCheckBox.setSelected(tmpNTE.getSound()); playSoundButton.setEnabled(tmpNTE.getSound()); - soundFileChooser.setEnabled(tmpNTE.getSound()); + soundFileChooser.setEnabled(tmpNTE.getSound()); soundFileTextField.setEnabled(tmpNTE.getSound()); soundFileTextField.setText(tmpNTE.getSoundFile()); popupCheckBox.setSelected(tmpNTE.getPopup()); @@ -399,7 +393,7 @@ public class NotificationConfigurationConfigForm */ public String getTitle() { - return Resources.getString("notification"); + return Resources.getString("notifications"); } /** diff --git a/src/net/java/sip/communicator/plugin/notificationconfiguration/Resources.java b/src/net/java/sip/communicator/plugin/notificationconfiguration/Resources.java index 9648c33..5618e38 100644 --- a/src/net/java/sip/communicator/plugin/notificationconfiguration/Resources.java +++ b/src/net/java/sip/communicator/plugin/notificationconfiguration/Resources.java @@ -7,15 +7,17 @@ package net.java.sip.communicator.plugin.notificationconfiguration; -import java.awt.image.*; import java.io.*; +import java.net.*; import java.util.*; -import javax.imageio.*; import javax.swing.*; +import net.java.sip.communicator.service.resources.*; import net.java.sip.communicator.util.*; +import org.osgi.framework.*; + /** * The Messages class manages the access to the internationalization * properties files. @@ -25,23 +27,20 @@ public class Resources { private static Logger log = Logger.getLogger(Resources.class); - private static final String BUNDLE_NAME - = "net.java.sip.communicator.plugin.notificationconfiguration.resources"; - - private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle - .getBundle(BUNDLE_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 getResources().getI18NString(key); + } + catch (MissingResourceException e) + { return '!' + key + '!'; } } @@ -51,19 +50,15 @@ public class Resources { * @param imageID The identifier of the image. * @return The image for the given identifier. */ - public static ImageIcon getImage(String imageID) { - BufferedImage image = null; - - String path = Resources.getString(imageID); - try { - image = ImageIO.read(Resources.class.getClassLoader() - .getResourceAsStream(path)); + public static ImageIcon getImage(String imageID) + { + URL imageURL = + getResources().getImageURL(imageID); - } catch (IOException e) { - log.error("Failed to load image:" + path, e); - } + if(imageURL == null) + return null; - return new ImageIcon(image); + return new ImageIcon(imageURL); } /** @@ -71,18 +66,39 @@ public class Resources { * @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]; + public static byte[] getImageInBytes(String imageID) + { + InputStream in = + getResources().getImageInputStream(imageID); - String path = Resources.getString(imageID); - try { - Resources.class.getClassLoader() - .getResourceAsStream(path).read(image); + if(in == null) + return null; - } catch (IOException e) { - log.error("Failed to load image:" + path, e); + byte[] image = null; + + try + { + image = new byte[in.available()]; + in.read(image); + } + catch (IOException e) + { + log.error("Failed to load image:" + imageID, e); } return image; } + + private static ResourceManagementService getResources() + { + ServiceReference serviceReference = NotificationConfigurationActivator + .bundleContext.getServiceReference( + ResourceManagementService.class.getName()); + + if(serviceReference == null) + return null; + + return (ResourceManagementService) NotificationConfigurationActivator + .bundleContext.getService(serviceReference); + } } diff --git a/src/net/java/sip/communicator/plugin/notificationconfiguration/notificationconfiguration.manifest.mf b/src/net/java/sip/communicator/plugin/notificationconfiguration/notificationconfiguration.manifest.mf index b7bd9ea..43618fb 100644 --- a/src/net/java/sip/communicator/plugin/notificationconfiguration/notificationconfiguration.manifest.mf +++ b/src/net/java/sip/communicator/plugin/notificationconfiguration/notificationconfiguration.manifest.mf @@ -12,6 +12,7 @@ Import-Package: org.osgi.framework, net.java.sip.communicator.service.audionotifier, net.java.sip.communicator.service.notification, net.java.sip.communicator.service.notification.event, + net.java.sip.communicator.service.resources, javax.swing, javax.swing.event, javax.swing.table, diff --git a/src/net/java/sip/communicator/plugin/notificationconfiguration/resources.properties b/src/net/java/sip/communicator/plugin/notificationconfiguration/resources.properties deleted file mode 100644 index 4020846..0000000 --- a/src/net/java/sip/communicator/plugin/notificationconfiguration/resources.properties +++ /dev/null @@ -1,21 +0,0 @@ -notification=Notifications -play=Play -activate=Activate -desactivate=Desactivate -turnonall=Turn On All -turnoffall=Turn Off All -actions=Actions -quickcontrols=Quick Controls -apply=Apply -restore=Restore Defaults -playsound=Play a sound : -execprog=Execute a program : -displaypopup=Show a message in a pop-up window -notificationIcon=net/java/sip/communicator/plugin/notificationconfiguration/resources/notificationIcon.png -playIcon=net/java/sip/communicator/plugin/notificationconfiguration/resources/playIcon.png -progIcon=net/java/sip/communicator/plugin/notificationconfiguration/resources/progIcon.png -popupIcon=net/java/sip/communicator/plugin/notificationconfiguration/resources/popupIcon.png -soundIcon=net/java/sip/communicator/plugin/notificationconfiguration/resources/soundIcon.png -activatedIcon=net/java/sip/communicator/plugin/notificationconfiguration/resources/activeIcon.png -desactivatedIcon=net/java/sip/communicator/plugin/notificationconfiguration/resources/desactivatedIcon.png -foldericon=net/java/sip/communicator/plugin/notificationconfiguration/resources/folder.png
\ No newline at end of file diff --git a/src/net/java/sip/communicator/plugin/notificationconfiguration/resources/activeIcon.png b/src/net/java/sip/communicator/plugin/notificationconfiguration/resources/activeIcon.png Binary files differdeleted file mode 100644 index e8632f8..0000000 --- a/src/net/java/sip/communicator/plugin/notificationconfiguration/resources/activeIcon.png +++ /dev/null diff --git a/src/net/java/sip/communicator/plugin/notificationconfiguration/resources/desactivatedIcon.png b/src/net/java/sip/communicator/plugin/notificationconfiguration/resources/desactivatedIcon.png Binary files differdeleted file mode 100644 index 33db9c2..0000000 --- a/src/net/java/sip/communicator/plugin/notificationconfiguration/resources/desactivatedIcon.png +++ /dev/null diff --git a/src/net/java/sip/communicator/plugin/notificationconfiguration/resources/folder.png b/src/net/java/sip/communicator/plugin/notificationconfiguration/resources/folder.png Binary files differdeleted file mode 100644 index 35cf94f..0000000 --- a/src/net/java/sip/communicator/plugin/notificationconfiguration/resources/folder.png +++ /dev/null diff --git a/src/net/java/sip/communicator/plugin/notificationconfiguration/resources/notificationIcon.png b/src/net/java/sip/communicator/plugin/notificationconfiguration/resources/notificationIcon.png Binary files differdeleted file mode 100644 index ede0d8e..0000000 --- a/src/net/java/sip/communicator/plugin/notificationconfiguration/resources/notificationIcon.png +++ /dev/null diff --git a/src/net/java/sip/communicator/plugin/notificationconfiguration/resources/playIcon.png b/src/net/java/sip/communicator/plugin/notificationconfiguration/resources/playIcon.png Binary files differdeleted file mode 100644 index ae438d1..0000000 --- a/src/net/java/sip/communicator/plugin/notificationconfiguration/resources/playIcon.png +++ /dev/null diff --git a/src/net/java/sip/communicator/plugin/notificationconfiguration/resources/popupIcon.png b/src/net/java/sip/communicator/plugin/notificationconfiguration/resources/popupIcon.png Binary files differdeleted file mode 100644 index 0232fde..0000000 --- a/src/net/java/sip/communicator/plugin/notificationconfiguration/resources/popupIcon.png +++ /dev/null diff --git a/src/net/java/sip/communicator/plugin/notificationconfiguration/resources/progIcon.png b/src/net/java/sip/communicator/plugin/notificationconfiguration/resources/progIcon.png Binary files differdeleted file mode 100644 index b25bb08..0000000 --- a/src/net/java/sip/communicator/plugin/notificationconfiguration/resources/progIcon.png +++ /dev/null diff --git a/src/net/java/sip/communicator/plugin/notificationconfiguration/resources/soundIcon.png b/src/net/java/sip/communicator/plugin/notificationconfiguration/resources/soundIcon.png Binary files differdeleted file mode 100644 index c1c9c8f..0000000 --- a/src/net/java/sip/communicator/plugin/notificationconfiguration/resources/soundIcon.png +++ /dev/null |