diff options
author | Yana Stamcheva <yana@jitsi.org> | 2010-09-09 12:01:32 +0000 |
---|---|---|
committer | Yana Stamcheva <yana@jitsi.org> | 2010-09-09 12:01:32 +0000 |
commit | 32505cd1d8d9d9e1629c3d1a56da4d83ad485ba7 (patch) | |
tree | a8a92f8c28536cbd6799bc4bf7932b8e40c02598 /src/net/java/sip/communicator/impl | |
parent | be8d5479930169164e747e20d6701b44450e39c4 (diff) | |
download | jitsi-32505cd1d8d9d9e1629c3d1a56da4d83ad485ba7.zip jitsi-32505cd1d8d9d9e1629c3d1a56da4d83ad485ba7.tar.gz jitsi-32505cd1d8d9d9e1629c3d1a56da4d83ad485ba7.tar.bz2 |
Patch provided bu Purvesh Sahoo removing preview source names from the localization file and enhancing the preview config "retreive-sources" mechanism (discussed on dev on Sept. 7, 2010, subject: Re: Previews).
Diffstat (limited to 'src/net/java/sip/communicator/impl')
26 files changed, 249 insertions, 108 deletions
diff --git a/src/net/java/sip/communicator/impl/gui/GuiActivator.java b/src/net/java/sip/communicator/impl/gui/GuiActivator.java index 488ae11..c2ce4ea 100644 --- a/src/net/java/sip/communicator/impl/gui/GuiActivator.java +++ b/src/net/java/sip/communicator/impl/gui/GuiActivator.java @@ -84,8 +84,8 @@ public class GuiActivator implements BundleActivator private static final Map<Object, ProtocolProviderFactory> providerFactoriesMap = new Hashtable<Object, ProtocolProviderFactory>(); - private static final Map<Object, ReplacementService> - replacementSourcesMap = new Hashtable<Object, ReplacementService>(); + private static final Map<String, ReplacementService> + replacementSourcesMap = new Hashtable<String, ReplacementService>(); /** * Indicates if this bundle has been started. @@ -624,7 +624,7 @@ public class GuiActivator implements BundleActivator * @return all <tt>ReplacementService</tt> implementation obtained from the * bundle context */ - public static Map<Object, ReplacementService> getReplacementSources() + public static Map<String, ReplacementService> getReplacementSources() { ServiceReference[] serRefs = null; try @@ -647,7 +647,7 @@ public class GuiActivator implements BundleActivator ReplacementService replacementSources = (ReplacementService) bundleContext.getService(serRefs[i]); - replacementSourcesMap.put(serRefs[i] + replacementSourcesMap.put((String)serRefs[i] .getProperty(ReplacementService.SOURCE_NAME), replacementSources); } diff --git a/src/net/java/sip/communicator/impl/gui/main/chat/ChatConversationPanel.java b/src/net/java/sip/communicator/impl/gui/main/chat/ChatConversationPanel.java index afb57e0..588f159 100755 --- a/src/net/java/sip/communicator/impl/gui/main/chat/ChatConversationPanel.java +++ b/src/net/java/sip/communicator/impl/gui/main/chat/ChatConversationPanel.java @@ -599,15 +599,15 @@ public class ChatConversationPanel = GuiActivator.getConfigurationService().getBoolean( ReplacementProperty.REPLACEMENT_ENABLE, true); - Map<Object, ReplacementService> listSources + Map<String, ReplacementService> listSources = GuiActivator.getReplacementSources(); - Iterator<Entry<Object, ReplacementService>> entrySetIter + Iterator<Entry<String, ReplacementService>> entrySetIter = listSources.entrySet().iterator(); for (int i = 0; i < listSources.size(); i++) { - Map.Entry<Object, ReplacementService> entry + Map.Entry<String, ReplacementService> entry = entrySetIter.next(); ReplacementService source = entry.getValue(); @@ -624,7 +624,6 @@ public class ChatConversationPanel * replace the msgStore variable with the current replaced * message before next iteration */ - if (!temp.equals(msgStore)) { msgStore = temp; diff --git a/src/net/java/sip/communicator/impl/replacement/bliptv/BliptvActivator.java b/src/net/java/sip/communicator/impl/replacement/bliptv/BliptvActivator.java index 40ff265..b2a05d7 100644 --- a/src/net/java/sip/communicator/impl/replacement/bliptv/BliptvActivator.java +++ b/src/net/java/sip/communicator/impl/replacement/bliptv/BliptvActivator.java @@ -46,7 +46,8 @@ public class BliptvActivator public void start(BundleContext context) throws Exception { Hashtable<String, String> hashtable = new Hashtable<String, String>(); - hashtable.put(ReplacementService.SOURCE_NAME, "BLIPTV"); + hashtable.put(ReplacementService.SOURCE_NAME, + ReplacementServiceBliptvImpl.BLIPTV_CONFIG_LABEL); bliptvSource = new ReplacementServiceBliptvImpl(); bliptvServReg = diff --git a/src/net/java/sip/communicator/impl/replacement/bliptv/ReplacementServiceBliptvImpl.java b/src/net/java/sip/communicator/impl/replacement/bliptv/ReplacementServiceBliptvImpl.java index 70fb553..d51bd36 100644 --- a/src/net/java/sip/communicator/impl/replacement/bliptv/ReplacementServiceBliptvImpl.java +++ b/src/net/java/sip/communicator/impl/replacement/bliptv/ReplacementServiceBliptvImpl.java @@ -36,19 +36,20 @@ public class ReplacementServiceBliptvImpl "(?:[\\>])(http:\\/\\/(?:www\\.)?blip\\.tv\\/file\\/(\\d+).*(?=<))"; /** - * Configuration label property name. The label is saved in the languages - * file under this property. + * Configuration label shown in the config form. */ - public static final String BLIPTV_CONFIG_LABEL = "BLIPTV"; + public static final String BLIPTV_CONFIG_LABEL = "Blip.tv"; /** - * Constructor for <tt>ReplacementServiceBliptvImpl</tt>. The source needs - * to add itself to {@link ReplacementService} sourceList to be displayed in - * the configuration panel. + * Source name; also used as property label. + */ + public static final String SOURCE_NAME = "BLIPTV"; + + /** + * Constructor for <tt>ReplacementServiceBliptvImpl</tt>. */ public ReplacementServiceBliptvImpl() { - sourceList.add(BLIPTV_CONFIG_LABEL); logger.trace("Creating a Blip.TV Source."); } @@ -127,4 +128,14 @@ public class ReplacementServiceBliptvImpl return chatString; } + + /** + * Returns the source name + * + * @return the source name + */ + public String getSourceName() + { + return SOURCE_NAME; + } }
\ No newline at end of file diff --git a/src/net/java/sip/communicator/impl/replacement/dailymotion/DailymotionActivator.java b/src/net/java/sip/communicator/impl/replacement/dailymotion/DailymotionActivator.java index 82e2a1d..d5b7a1c 100644 --- a/src/net/java/sip/communicator/impl/replacement/dailymotion/DailymotionActivator.java +++ b/src/net/java/sip/communicator/impl/replacement/dailymotion/DailymotionActivator.java @@ -38,15 +38,16 @@ public class DailymotionActivator /** * Starts the Dailymotion replacement source bundle - * + * * @param context the <tt>BundleContext</tt> as provided from the OSGi - * framework + * framework * @throws Exception if anything goes wrong */ public void start(BundleContext context) throws Exception { Hashtable<String, String> hashtable = new Hashtable<String, String>(); - hashtable.put(ReplacementService.SOURCE_NAME, "DAILYMOTION"); + hashtable.put(ReplacementService.SOURCE_NAME, + ReplacementServiceDailymotionImpl.DAILYMOTION_CONFIG_LABEL); dailymotionSource = new ReplacementServiceDailymotionImpl(); dailymotionSourceServReg = diff --git a/src/net/java/sip/communicator/impl/replacement/dailymotion/ReplacementServiceDailymotionImpl.java b/src/net/java/sip/communicator/impl/replacement/dailymotion/ReplacementServiceDailymotionImpl.java index 99204e9..11a8ba7 100644 --- a/src/net/java/sip/communicator/impl/replacement/dailymotion/ReplacementServiceDailymotionImpl.java +++ b/src/net/java/sip/communicator/impl/replacement/dailymotion/ReplacementServiceDailymotionImpl.java @@ -32,19 +32,20 @@ public class ReplacementServiceDailymotionImpl "(http.*?(www\\.)*?dailymotion\\.com\\/video\\/([a-zA-Z0-9_\\-]+))([?#]([a-zA-Z0-9_\\-]+))*"; /** - * Configuration label property name. The label is saved in the languages - * file under this property. + * Configuration label shown in the config form. */ - public static final String DAILYMOTION_CONFIG_LABEL = "DAILYMOTION"; + public static final String DAILYMOTION_CONFIG_LABEL = "DailyMotion"; + + /** + * Source name; also used as property label. + */ + public static final String SOURCE_NAME = "DAILYMOTION"; /** - * Constructor for <tt>ReplacementServiceDailymotionImpl</tt>. The source - * needs to add itself to {@link ReplacementService} sourceList to be - * displayed in the configuration panel. + * Constructor for <tt>ReplacementServiceDailymotionImpl</tt>. */ public ReplacementServiceDailymotionImpl() { - sourceList.add(DAILYMOTION_CONFIG_LABEL); logger.trace("Creating a DailyMotion Source."); } @@ -95,4 +96,14 @@ public class ReplacementServiceDailymotionImpl return chatString; } + + /** + * Returns the source name + * + * @return the source name + */ + public String getSourceName() + { + return SOURCE_NAME; + } }
\ No newline at end of file diff --git a/src/net/java/sip/communicator/impl/replacement/directimage/DirectImageActivator.java b/src/net/java/sip/communicator/impl/replacement/directimage/DirectImageActivator.java index 2e596fe..c063333 100644 --- a/src/net/java/sip/communicator/impl/replacement/directimage/DirectImageActivator.java +++ b/src/net/java/sip/communicator/impl/replacement/directimage/DirectImageActivator.java @@ -39,15 +39,16 @@ public class DirectImageActivator /** * Starts the Direct image links replacement source bundle - * + * * @param context the <tt>BundleContext</tt> as provided from the OSGi - * framework + * framework * @throws Exception if anything goes wrong */ public void start(BundleContext context) throws Exception { Hashtable<String, String> hashtable = new Hashtable<String, String>(); - hashtable.put(ReplacementService.SOURCE_NAME, "DIRECTIMAGE"); + hashtable.put(ReplacementService.SOURCE_NAME, + ReplacementServiceDirectImageImpl.DIRECT_IMAGE_CONFIG_LABEL); directImageSource = new ReplacementServiceDirectImageImpl(); directImageSourceServReg = diff --git a/src/net/java/sip/communicator/impl/replacement/directimage/ReplacementServiceDirectImageImpl.java b/src/net/java/sip/communicator/impl/replacement/directimage/ReplacementServiceDirectImageImpl.java index 55987f1..85fe938 100644 --- a/src/net/java/sip/communicator/impl/replacement/directimage/ReplacementServiceDirectImageImpl.java +++ b/src/net/java/sip/communicator/impl/replacement/directimage/ReplacementServiceDirectImageImpl.java @@ -32,19 +32,20 @@ public class ReplacementServiceDirectImageImpl "[^<>]+\\.(?:jpg|png|gif)[^<>]*(?=</a>)"; /** - * Configuration label property name. The label is saved in the languages - * file under this property. + * Configuration label shown in the config form. */ - public static final String DIRECT_IMAGE_CONFIG_LABEL = "DIRECTIMAGE"; + public static final String DIRECT_IMAGE_CONFIG_LABEL = "Direct Image Link"; /** - * Constructor for <tt>ReplacementServiceDirectImageImpl</tt>. The source - * needs to add itself to {@link ReplacementService} sourceList to be - * displayed in the configuration panel. + * Source name; also used as property label. + */ + public static final String SOURCE_NAME = "DIRECTIMAGE"; + + /** + * Constructor for <tt>ReplacementServiceDirectImageImpl</tt>. */ public ReplacementServiceDirectImageImpl() { - sourceList.add(DIRECT_IMAGE_CONFIG_LABEL); logger.trace("Creating a Direct Image Link Source."); } @@ -87,4 +88,14 @@ public class ReplacementServiceDirectImageImpl return chatString; } + + /** + * Returns the source name + * + * @return the source name + */ + public String getSourceName() + { + return SOURCE_NAME; + } }
\ No newline at end of file diff --git a/src/net/java/sip/communicator/impl/replacement/flickr/FlickrActivator.java b/src/net/java/sip/communicator/impl/replacement/flickr/FlickrActivator.java index 1a50210..bd29512 100644 --- a/src/net/java/sip/communicator/impl/replacement/flickr/FlickrActivator.java +++ b/src/net/java/sip/communicator/impl/replacement/flickr/FlickrActivator.java @@ -46,7 +46,8 @@ public class FlickrActivator public void start(BundleContext context) throws Exception { Hashtable<String, String> hashtable = new Hashtable<String, String>(); - hashtable.put(ReplacementService.SOURCE_NAME, "FLICKR"); + hashtable.put(ReplacementService.SOURCE_NAME, + ReplacementServiceFlickrImpl.FLICKR_CONFIG_LABEL); flickrSource = new ReplacementServiceFlickrImpl(); flickrServReg = diff --git a/src/net/java/sip/communicator/impl/replacement/flickr/ReplacementServiceFlickrImpl.java b/src/net/java/sip/communicator/impl/replacement/flickr/ReplacementServiceFlickrImpl.java index bd469f7..ad5c63a 100644 --- a/src/net/java/sip/communicator/impl/replacement/flickr/ReplacementServiceFlickrImpl.java +++ b/src/net/java/sip/communicator/impl/replacement/flickr/ReplacementServiceFlickrImpl.java @@ -41,19 +41,20 @@ public class ReplacementServiceFlickrImpl public static final String API_KEY = "8b5d9cee22f0f5154bf4e9846c025484"; /** - * Configuration label property name. The label is saved in the languages - * file under this property. + * Configuration label shown in the config form. */ - public static final String FLICKR_CONFIG_LABEL = "FLICKR"; + public static final String FLICKR_CONFIG_LABEL = "Flickr Images"; + + /** + * Source name; also used as property label. + */ + public static final String SOURCE_NAME = "FLICKR"; /** - * Constructor for <tt>ReplacementServiceFlickrImpl</tt>. The source needs - * to add itself to {@link ReplacementService} sourceList to be displayed in - * the configuration panel. + * Constructor for <tt>ReplacementServiceFlickrImpl</tt>. */ public ReplacementServiceFlickrImpl() { - sourceList.add(FLICKR_CONFIG_LABEL); logger.trace("Creating a Flickr Source."); } @@ -155,4 +156,14 @@ public class ReplacementServiceFlickrImpl return chatString; } + + /** + * Returns the source name + * + * @return the source name + */ + public String getSourceName() + { + return SOURCE_NAME; + } }
\ No newline at end of file diff --git a/src/net/java/sip/communicator/impl/replacement/hulu/HuluActivator.java b/src/net/java/sip/communicator/impl/replacement/hulu/HuluActivator.java index 85ab9f1..6f8dd55 100644 --- a/src/net/java/sip/communicator/impl/replacement/hulu/HuluActivator.java +++ b/src/net/java/sip/communicator/impl/replacement/hulu/HuluActivator.java @@ -45,7 +45,8 @@ public class HuluActivator public void start(BundleContext context) throws Exception { Hashtable<String, String> hashtable = new Hashtable<String, String>(); - hashtable.put(ReplacementService.SOURCE_NAME, "HULU"); + hashtable.put(ReplacementService.SOURCE_NAME, + ReplacementServiceHuluImpl.HULU_CONFIG_LABEL); huluSource = new ReplacementServiceHuluImpl(); huluServReg = diff --git a/src/net/java/sip/communicator/impl/replacement/hulu/ReplacementServiceHuluImpl.java b/src/net/java/sip/communicator/impl/replacement/hulu/ReplacementServiceHuluImpl.java index 21223e5..5630737 100644 --- a/src/net/java/sip/communicator/impl/replacement/hulu/ReplacementServiceHuluImpl.java +++ b/src/net/java/sip/communicator/impl/replacement/hulu/ReplacementServiceHuluImpl.java @@ -35,19 +35,20 @@ public class ReplacementServiceHuluImpl "(http.*?(www\\.)*?hulu\\.com\\/watch\\/([a-zA-Z0-9_\\-]+))(\\/([^\\\"\\<]*)*)"; /** - * Configuration label property name. The label is saved in the languages - * file under this property. + * Configuration label shown in the config form. */ - public static final String HULU_CONFIG_LABEL = "HULU"; + public static final String HULU_CONFIG_LABEL = "Hulu"; /** - * Constructor for <tt>ReplacementServiceHuluImpl</tt>. The source needs to - * register itself with {@link ReplacementService} sourceList to be - * displayed in the configuration panel. + * Source name; also used as property label. + */ + public static final String SOURCE_NAME = "HULU"; + + /** + * Constructor for <tt>ReplacementServiceHuluImpl</tt>. */ public ReplacementServiceHuluImpl() { - sourceList.add(HULU_CONFIG_LABEL); logger.trace("Creating a Hulu Source."); } @@ -135,4 +136,14 @@ public class ReplacementServiceHuluImpl return chatString; } + + /** + * Returns the source name + * + * @return the source name + */ + public String getSourceName() + { + return SOURCE_NAME; + } }
\ No newline at end of file diff --git a/src/net/java/sip/communicator/impl/replacement/metacafe/MetacafeActivator.java b/src/net/java/sip/communicator/impl/replacement/metacafe/MetacafeActivator.java index b00f1c0..80948c5 100644 --- a/src/net/java/sip/communicator/impl/replacement/metacafe/MetacafeActivator.java +++ b/src/net/java/sip/communicator/impl/replacement/metacafe/MetacafeActivator.java @@ -46,7 +46,8 @@ public class MetacafeActivator public void start(BundleContext context) throws Exception { Hashtable<String, String> hashtable = new Hashtable<String, String>(); - hashtable.put(ReplacementService.SOURCE_NAME, "METACAFE"); + hashtable.put(ReplacementService.SOURCE_NAME, + ReplacementServiceMetacafeImpl.METACAFE_CONFIG_LABEL); metacafeSource = new ReplacementServiceMetacafeImpl(); metacafeServReg = diff --git a/src/net/java/sip/communicator/impl/replacement/metacafe/ReplacementServiceMetacafeImpl.java b/src/net/java/sip/communicator/impl/replacement/metacafe/ReplacementServiceMetacafeImpl.java index 77dc40a..ea8b86a 100644 --- a/src/net/java/sip/communicator/impl/replacement/metacafe/ReplacementServiceMetacafeImpl.java +++ b/src/net/java/sip/communicator/impl/replacement/metacafe/ReplacementServiceMetacafeImpl.java @@ -32,20 +32,21 @@ public class ReplacementServiceMetacafeImpl "(http.*?(www\\.)*?metacafe\\.com\\/watch\\/([a-zA-Z0-9_\\-]+))(\\/[a-zA-Z0-9_\\-\\/]+)*"; /** - * Configuration label property name. The label is saved in the languages - * file under this property. + * Configuration label shown in the config form. */ - public static final String METACAFE_CONFIG_LABEL = "METACAFE"; + public static final String METACAFE_CONFIG_LABEL = "Metacafe"; /** - * Constructor for <tt>ReplacementServiceMetacafeImpl</tt>. The source needs - * to register itself with {@link ReplacementService} sourceList to be - * displayed in the configuration panel. + * Source name; also used as property label. + */ + public static final String SOURCE_NAME = "METACAFE"; + + /** + * Constructor for <tt>ReplacementServiceMetacafeImpl</tt>. */ public ReplacementServiceMetacafeImpl() { logger.trace("Creating a Metacafe Source."); - sourceList.add(METACAFE_CONFIG_LABEL); } /** @@ -92,4 +93,14 @@ public class ReplacementServiceMetacafeImpl return chatString; } + + /** + * Returns the source name + * + * @return the source name + */ + public String getSourceName() + { + return SOURCE_NAME; + } }
\ No newline at end of file diff --git a/src/net/java/sip/communicator/impl/replacement/smiley/ReplacementServiceSmileyImpl.java b/src/net/java/sip/communicator/impl/replacement/smiley/ReplacementServiceSmileyImpl.java index 06faaa5..024b34b 100644 --- a/src/net/java/sip/communicator/impl/replacement/smiley/ReplacementServiceSmileyImpl.java +++ b/src/net/java/sip/communicator/impl/replacement/smiley/ReplacementServiceSmileyImpl.java @@ -45,8 +45,7 @@ public class ReplacementServiceSmileyImpl private static final String START_PLAINTEXT_TAG = "<PLAINTEXT>"; /** - * Configuration label property name. The label is saved in the languages - * file under this property. + * Configuration label shown in the config form. */ public static final String SMILEY_SOURCE = "SMILEY"; @@ -163,4 +162,14 @@ public class ReplacementServiceSmileyImpl return smileyPattern; } } + + /** + * Returns the source name + * + * @return the source name + */ + public String getSourceName() + { + return SMILEY_SOURCE; + } }
\ No newline at end of file diff --git a/src/net/java/sip/communicator/impl/replacement/smiley/SmileyActivator.java b/src/net/java/sip/communicator/impl/replacement/smiley/SmileyActivator.java index 71c29bf..4bbb777 100644 --- a/src/net/java/sip/communicator/impl/replacement/smiley/SmileyActivator.java +++ b/src/net/java/sip/communicator/impl/replacement/smiley/SmileyActivator.java @@ -60,7 +60,8 @@ public class SmileyActivator bundleContext = context; Hashtable<String, String> hashtable = new Hashtable<String, String>(); - hashtable.put(ReplacementService.SOURCE_NAME, "SMILEY"); + hashtable.put(ReplacementService.SOURCE_NAME, + ReplacementServiceSmileyImpl.SMILEY_SOURCE); smileySource = new ReplacementServiceSmileyImpl(); smileyServReg = diff --git a/src/net/java/sip/communicator/impl/replacement/twitpic/ReplacementServiceTwitpicImpl.java b/src/net/java/sip/communicator/impl/replacement/twitpic/ReplacementServiceTwitpicImpl.java index d62c69f..4e9d419 100644 --- a/src/net/java/sip/communicator/impl/replacement/twitpic/ReplacementServiceTwitpicImpl.java +++ b/src/net/java/sip/communicator/impl/replacement/twitpic/ReplacementServiceTwitpicImpl.java @@ -32,19 +32,20 @@ public class ReplacementServiceTwitpicImpl "http:\\/\\/(?:www\\.)?twitpic\\.com\\/([^\\/<]*)(?=<)"; /** - * Configuration label property name. The label is saved in the languages - * file under this property. + * Configuration label shown in the config form. */ - public static final String TWITPIC_CONFIG_LABEL = "TWITPIC"; + public static final String TWITPIC_CONFIG_LABEL = "Twitpic"; + + /** + * Source name; also used as property label. + */ + public static final String SOURCE_NAME = "TWITPIC"; /** - * Constructor for <tt>ReplacementServiceTwitpicImpl</tt>. The source needs - * to register itself with {@link ReplacementService} sourceList to be - * displayed in the configuration panel. + * Constructor for <tt>ReplacementServiceTwitpicImpl</tt>. */ public ReplacementServiceTwitpicImpl() { - sourceList.add(TWITPIC_CONFIG_LABEL); logger.trace("Creating a Twitpic Source."); } @@ -86,4 +87,14 @@ public class ReplacementServiceTwitpicImpl return chatString; } + + /** + * Returns the source name + * + * @return the source name + */ + public String getSourceName() + { + return SOURCE_NAME; + } }
\ No newline at end of file diff --git a/src/net/java/sip/communicator/impl/replacement/twitpic/TwitpicActivator.java b/src/net/java/sip/communicator/impl/replacement/twitpic/TwitpicActivator.java index 3737cfd..9ce2591 100644 --- a/src/net/java/sip/communicator/impl/replacement/twitpic/TwitpicActivator.java +++ b/src/net/java/sip/communicator/impl/replacement/twitpic/TwitpicActivator.java @@ -46,7 +46,8 @@ public class TwitpicActivator public void start(BundleContext context) throws Exception { Hashtable<String, String> hashtable = new Hashtable<String, String>(); - hashtable.put(ReplacementService.SOURCE_NAME, "TWITPIC"); + hashtable.put(ReplacementService.SOURCE_NAME, + ReplacementServiceTwitpicImpl.TWITPIC_CONFIG_LABEL); twitpicSource = new ReplacementServiceTwitpicImpl(); twitpicServReg = diff --git a/src/net/java/sip/communicator/impl/replacement/vbox7/ReplacementServiceVbox7Impl.java b/src/net/java/sip/communicator/impl/replacement/vbox7/ReplacementServiceVbox7Impl.java index b20ead8..0ae75de 100644 --- a/src/net/java/sip/communicator/impl/replacement/vbox7/ReplacementServiceVbox7Impl.java +++ b/src/net/java/sip/communicator/impl/replacement/vbox7/ReplacementServiceVbox7Impl.java @@ -32,19 +32,20 @@ public class ReplacementServiceVbox7Impl "(http.*?(www\\.)*?vbox7\\.com\\/play\\:([a-zA-Z0-9_\\-]+))([?&]\\w+=[\\w-]*)*"; /** - * Configuration label property name. The label is saved in the languages - * file under this property. + * Configuration label shown in the config form. */ - public static final String VBOX7_CONFIG_LABEL = "VBOX7"; + public static final String VBOX7_CONFIG_LABEL = "Vbox7"; /** - * Constructor for <tt>ReplacementServiceVbox7Impl</tt>. The source needs - * to register itself with {@link ReplacementService} sourceList to be - * displayed in the configuration panel. + * Source name; also used as property label. + */ + public static final String SOURCE_NAME = "VBOX7"; + + /** + * Constructor for <tt>ReplacementServiceVbox7Impl</tt>. */ public ReplacementServiceVbox7Impl() { - sourceList.add(VBOX7_CONFIG_LABEL); logger.trace("Creating a Vbox7 Source."); } @@ -93,4 +94,14 @@ public class ReplacementServiceVbox7Impl return chatString; } + + /** + * Returns the source name + * + * @return the source name + */ + public String getSourceName() + { + return SOURCE_NAME; + } }
\ No newline at end of file diff --git a/src/net/java/sip/communicator/impl/replacement/vbox7/Vbox7Activator.java b/src/net/java/sip/communicator/impl/replacement/vbox7/Vbox7Activator.java index 16473df..ca80d90 100644 --- a/src/net/java/sip/communicator/impl/replacement/vbox7/Vbox7Activator.java +++ b/src/net/java/sip/communicator/impl/replacement/vbox7/Vbox7Activator.java @@ -38,15 +38,16 @@ public class Vbox7Activator /** * Starts the Vbox7 replacement source bundle - * + * * @param context the <tt>BundleContext</tt> as provided from the OSGi - * framework + * framework * @throws Exception if anything goes wrong */ public void start(BundleContext context) throws Exception { Hashtable<String, String> hashtable = new Hashtable<String, String>(); - hashtable.put(ReplacementService.SOURCE_NAME, "VBOX7"); + hashtable.put(ReplacementService.SOURCE_NAME, + ReplacementServiceVbox7Impl.VBOX7_CONFIG_LABEL); vbox7Source = new ReplacementServiceVbox7Impl(); vbox7ServReg = diff --git a/src/net/java/sip/communicator/impl/replacement/viddler/ReplacementServiceViddlerImpl.java b/src/net/java/sip/communicator/impl/replacement/viddler/ReplacementServiceViddlerImpl.java index 676ac55..cda7ffb 100644 --- a/src/net/java/sip/communicator/impl/replacement/viddler/ReplacementServiceViddlerImpl.java +++ b/src/net/java/sip/communicator/impl/replacement/viddler/ReplacementServiceViddlerImpl.java @@ -46,19 +46,20 @@ public class ReplacementServiceViddlerImpl + API_KEY; /** - * Configuration label property name. The label is saved in the languages - * file under this property. + * Configuration label shown in the config form. */ - public static final String VIDDLER_CONFIG_LABEL = "VIDDLER"; - + public static final String VIDDLER_CONFIG_LABEL = "Viddler"; + + /** + * Source name; also used as property label. + */ + public static final String SOURCE_NAME = "VIDDLER"; + /** - * Constructor for <tt>ReplacementServiceViddlerImpl</tt>. The source needs - * to add itself to {@link ReplacementService} sourceList to be - * displayed in the configuration panel. + * Constructor for <tt>ReplacementServiceViddlerImpl</tt>. */ public ReplacementServiceViddlerImpl() { - sourceList.add(VIDDLER_CONFIG_LABEL); logger.trace("Creating a Viddler Source."); } @@ -142,4 +143,14 @@ public class ReplacementServiceViddlerImpl return chatString; } + + /** + * Returns the source name + * + * @return the source name + */ + public String getSourceName() + { + return SOURCE_NAME; + } }
\ No newline at end of file diff --git a/src/net/java/sip/communicator/impl/replacement/viddler/ViddlerActivator.java b/src/net/java/sip/communicator/impl/replacement/viddler/ViddlerActivator.java index 8ea3dfa..c5028b3 100644 --- a/src/net/java/sip/communicator/impl/replacement/viddler/ViddlerActivator.java +++ b/src/net/java/sip/communicator/impl/replacement/viddler/ViddlerActivator.java @@ -40,14 +40,15 @@ public class ViddlerActivator /** * Starts this bundle. - * + * * @param context bundle context. - * @throws Exception + * @throws Exception */ public void start(BundleContext context) throws Exception { Hashtable<String, String> hashtable = new Hashtable<String, String>(); - hashtable.put(ReplacementService.SOURCE_NAME, "VIDDLER"); + hashtable.put(ReplacementService.SOURCE_NAME, + ReplacementServiceViddlerImpl.VIDDLER_CONFIG_LABEL); viddlerSource = new ReplacementServiceViddlerImpl(); viddlerServReg = diff --git a/src/net/java/sip/communicator/impl/replacement/vimeo/ReplacementServiceVimeoImpl.java b/src/net/java/sip/communicator/impl/replacement/vimeo/ReplacementServiceVimeoImpl.java index b83485e..169a88d 100644 --- a/src/net/java/sip/communicator/impl/replacement/vimeo/ReplacementServiceVimeoImpl.java +++ b/src/net/java/sip/communicator/impl/replacement/vimeo/ReplacementServiceVimeoImpl.java @@ -37,19 +37,20 @@ public class ReplacementServiceVimeoImpl "(http.*?(www\\.)*?vimeo\\.com\\/([a-zA-Z0-9_\\-]+))"; /** - * Configuration label property name. The label is saved in the languages - * file under this property. + * Configuration label shown in the config form. */ - public static final String VIMEO_CONFIG_LABEL = "VIMEO"; + public static final String VIMEO_CONFIG_LABEL = "Vimeo"; + + /** + * Source name; also used as property label. + */ + public static final String SOURCE_NAME = "VIMEO"; /** - * Constructor for <tt>ReplacementServiceVimeoImpl</tt>. The source needs - * to register itself with {@link ReplacementService} sourceList to be - * displayed in the configuration panel. + * Constructor for <tt>ReplacementServiceVimeoImpl</tt>. */ public ReplacementServiceVimeoImpl() { - sourceList.add(VIMEO_CONFIG_LABEL); logger.trace("Creating a Vimeo Source."); } @@ -134,4 +135,14 @@ public class ReplacementServiceVimeoImpl return chatString; } + + /** + * Returns the source name + * + * @return the source name + */ + public String getSourceName() + { + return SOURCE_NAME; + } }
\ No newline at end of file diff --git a/src/net/java/sip/communicator/impl/replacement/vimeo/VimeoActivator.java b/src/net/java/sip/communicator/impl/replacement/vimeo/VimeoActivator.java index e5d99f6..b5f272b 100644 --- a/src/net/java/sip/communicator/impl/replacement/vimeo/VimeoActivator.java +++ b/src/net/java/sip/communicator/impl/replacement/vimeo/VimeoActivator.java @@ -45,7 +45,8 @@ public class VimeoActivator public void start(BundleContext context) throws Exception { Hashtable<String, String> hashtable = new Hashtable<String, String>(); - hashtable.put(ReplacementService.SOURCE_NAME, "VIMEO"); + hashtable.put(ReplacementService.SOURCE_NAME, + ReplacementServiceVimeoImpl.VIMEO_CONFIG_LABEL); vimeoSource = new ReplacementServiceVimeoImpl(); vimeoServReg = diff --git a/src/net/java/sip/communicator/impl/replacement/youtube/ReplacementServiceYoutubeImpl.java b/src/net/java/sip/communicator/impl/replacement/youtube/ReplacementServiceYoutubeImpl.java index 45c8c2e..faec282 100644 --- a/src/net/java/sip/communicator/impl/replacement/youtube/ReplacementServiceYoutubeImpl.java +++ b/src/net/java/sip/communicator/impl/replacement/youtube/ReplacementServiceYoutubeImpl.java @@ -36,19 +36,20 @@ public class ReplacementServiceYoutubeImpl "(http.*?(www\\.)*?youtube\\.com\\/watch\\?v=([a-zA-Z0-9_\\-]+))([?&]\\w+=[\\w-]+)*"; /** - * Configuration label property name. The label is saved in the languages - * file under this property. + * Configuration label shown in the config form. */ - public static final String YOUTUBE_CONFIG_LABEL = "YOUTUBE"; + public static final String YOUTUBE_CONFIG_LABEL = "Youtube"; /** - * Constructor for <tt>ReplacementServiceYoutubeImpl</tt>. The source needs - * to register itself with {@link ReplacementService} sourceList to be - * displayed in the configuration panel. + * Source name; also used as property label. + */ + public static final String SOURCE_NAME = "YOUTUBE"; + + /** + * Constructor for <tt>ReplacementServiceYoutubeImpl</tt>. */ public ReplacementServiceYoutubeImpl() { - sourceList.add(YOUTUBE_CONFIG_LABEL); logger.trace("Creating a Youtube Source."); } @@ -136,4 +137,14 @@ public class ReplacementServiceYoutubeImpl return chatString; } + + /** + * Returns the source name + * + * @return the source name + */ + public String getSourceName() + { + return SOURCE_NAME; + } }
\ No newline at end of file diff --git a/src/net/java/sip/communicator/impl/replacement/youtube/YoutubeActivator.java b/src/net/java/sip/communicator/impl/replacement/youtube/YoutubeActivator.java index 0b76c49..9b3785e 100644 --- a/src/net/java/sip/communicator/impl/replacement/youtube/YoutubeActivator.java +++ b/src/net/java/sip/communicator/impl/replacement/youtube/YoutubeActivator.java @@ -46,7 +46,8 @@ public class YoutubeActivator public void start(BundleContext context) throws Exception { Hashtable<String, String> hashtable = new Hashtable<String, String>(); - hashtable.put(ReplacementService.SOURCE_NAME, "YOUTUBE"); + hashtable.put(ReplacementService.SOURCE_NAME, + ReplacementServiceYoutubeImpl.YOUTUBE_CONFIG_LABEL); youtubeSource = new ReplacementServiceYoutubeImpl(); youtubeSourceServReg = |