Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.replacement.smiley
Class ReplacementServiceSmileyImpl

java.lang.Object
  extended by net.java.sip.communicator.impl.replacement.smiley.ReplacementServiceSmileyImpl
All Implemented Interfaces:
ReplacementService, SmiliesReplacementService

public class ReplacementServiceSmileyImpl
extends Object
implements SmiliesReplacementService

Implements the ReplacementService to provide smiley as replacement source.

Author:
Yana Stamcheva, Purvesh Sahoo, Adam Netocny

Field Summary
static String SMILEY_SOURCE
          Configuration label shown in the config form.
static String smileyRegex
          The regex used to match the smilies in the message.
 
Fields inherited from interface net.java.sip.communicator.service.replacement.ReplacementService
SOURCE_NAME
 
Constructor Summary
ReplacementServiceSmileyImpl()
           
 
Method Summary
 String getPattern()
          Returns the pattern of the source
 String getReplacement(String sourceString)
          Replaces the smiley strings with their corresponding smiley image.
 Collection<Smiley> getSmiliesPack()
          Returns the smileys pack to use in the user interface.
 String getSourceName()
          Returns the source name
 void reloadSmiliesPack()
          Reloads all smilies.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SMILEY_SOURCE

public static final String SMILEY_SOURCE
Configuration label shown in the config form.

See Also:
Constant Field Values

smileyRegex

public static String smileyRegex
The regex used to match the smilies in the message.

Constructor Detail

ReplacementServiceSmileyImpl

public ReplacementServiceSmileyImpl()
Method Detail

getReplacement

public String getReplacement(String sourceString)
Replaces the smiley strings with their corresponding smiley image.

Specified by:
getReplacement in interface ReplacementService
Parameters:
sourceString - the original smiley string.
Returns:
the smiley image replaced for the smiley string; the original smiley string in case of no match.

getSourceName

public String getSourceName()
Returns the source name

Specified by:
getSourceName in interface ReplacementService
Returns:
the source name

getPattern

public String getPattern()
Returns the pattern of the source

Specified by:
getPattern in interface ReplacementService
Returns:
the source pattern

getSmiliesPack

public Collection<Smiley> getSmiliesPack()
Returns the smileys pack to use in the user interface.

Specified by:
getSmiliesPack in interface SmiliesReplacementService
Returns:
a collection of all smileys available

reloadSmiliesPack

public void reloadSmiliesPack()
Reloads all smilies.

Specified by:
reloadSmiliesPack in interface SmiliesReplacementService

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.