Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.gui.utils
Class ConfigurationManager

java.lang.Object
  extended by net.java.sip.communicator.impl.gui.utils.ConfigurationManager

public class ConfigurationManager
extends Object

Cares about all common configurations. Storing and retrieving configuration values.

Author:
Yana Stamcheva, Damian Minkov

Constructor Summary
ConfigurationManager()
           
 
Method Summary
static Color getChatDefaultFontColor()
          Returns the default chat font color.
static String getChatDefaultFontFamily()
          Returns the default chat font family.
static int getChatDefaultFontSize()
          Returns the default chat font size.
static int getChatHistorySize()
          Returns the number of messages from chat history that would be shown in the chat window.
static String getChatRoomProperty(ProtocolProviderService protocolProvider, String chatRoomId, String property)
          Returns the chat room property, saved through the ConfigurationService.
static String getChatRoomStatus(ProtocolProviderService protocolProvider, String chatRoomId)
          Returns the last chat room status, saved through the ConfigurationService.
static int getChatWriteAreaSize()
          Returns the preferred height of the chat write area.
static String getFactoryImplPackageName(ProtocolProviderFactory factory)
          Returns the package name under which we would store information for the given factory.
static ProtocolProviderService getLastCallConferenceProvider()
          Returns the call conference provider used for the last conference call.
static String getLastContactParent()
          Return the "lastContactParent" property that was saved previously through the ConfigurationService.
static String getSendFileLastDir()
          Returns the last opened directory of the send file file chooser.
static String getSendMessageCommand()
          Return the "sendMessageCommand" property that was saved previously through the ConfigurationService.
static int getWindowTransparency()
          Returns the transparency value for all transparent windows.
static boolean isAddContactDisabled()
          Returns true if the "ADD_CONTACT_DISABLED" property is true, otherwise - returns false..
static boolean isAdvancedAccountConfigDisabled()
          Returns true if the "ADVANCED_CONFIG_DISABLED" property is true, otherwise - returns false..
static boolean isApplicationVisible()
          Return TRUE if "showApplication" property is true, otherwise - return FALSE.
static boolean isAutoPopupNewMessage()
          Return TRUE if "autoPopupNewMessage" property is true, otherwise - return FALSE.
static boolean isCallPanelShown()
          Return TRUE if "showCallPanel" property is true, otherwise - return FALSE.
static boolean isChatFontBold()
          Returns the default chat font bold.
static boolean isChatFontItalic()
          Returns the default chat font italic.
static boolean isChatFontUnderline()
          Returns the default chat font underline.
static boolean isChatStylebarVisible()
          Returns true if the "isChatStylebarVisible" property is true, otherwise - returns false..
static boolean isChatToolbarVisible()
          Returns true if the "isChatToolbarVisible" property is true, otherwise - returns false..
static boolean isContactListGroupCollapsed(String groupID)
          Returns true if the group given by groupID is collapsed or false otherwise.
static boolean isCreateGroupDisabled()
          Returns true if the "CREATE_GROUP_DISABLED" property is true, otherwise - returns false..
static boolean isGoToChatroomDisabled()
          Returns true if the "GO_TO_CHATROOM_DISABLED" property is true, otherwise - returns false..
static boolean isHistoryLoggingEnabled()
          Returns true if the "isHistoryLoggingEnabled" property is true, otherwise - returns false.
static boolean isHistoryShown()
          Returns true if the "isHistoryShown" property is true, otherwise - returns false.
static boolean isLeaveChatRoomOnWindowCloseEnabled()
          Returns true if the "isLeaveChatRoomOnWindowCloseEnabled" property is true, otherwise - returns false.
static boolean isMoveContactConfirmationRequested()
          Returns TRUE if the "isMoveContactConfirmationRequested" property is true, otherwise - returns FALSE.
static boolean isMultiChatWindowEnabled()
          Returns true if the "isMultiChatWindowEnabled" property is true, otherwise - returns false.
static boolean isNormalizePhoneNumber()
          Returns true if phone numbers should be normalized, false otherwise.
static boolean isQuitWarningShown()
          Return TRUE if "quitWarningShown" property is true, otherwise - return FALSE.
static boolean isRemoveContactDisabled()
          Returns true if the "REMOVE_CONTACT_DISABLED" property is true, otherwise - returns false.
static boolean isSendTypingNotifications()
          Return TRUE if "sendTypingNotifications" property is true, otherwise - return FALSE.
static boolean isShowOffline()
          Return TRUE if "showOffline" property is true, otherwise - return FALSE.
static boolean isShowSmileys()
          Returns true if the "isShowSmileys" property is true, otherwise - returns false..
static boolean isTransparentWindowEnabled()
          Returns true if transparent windows are enabled, false otherwise.
static boolean isWindowDecorated()
          Returns true if the "isWindowDecorated" property is true, otherwise - returns false..
static void loadGuiConfigurations()
          Loads all user interface configurations.
static void saveChatRoom(ProtocolProviderService protocolProvider, String oldChatRoomId, String newChatRoomId, String newChatRoomName)
          Saves a chat room through the ConfigurationService.
static void setAdvancedAccountConfigDisabled(boolean disabled)
          Sets the advanced account config disabled property.
static void setApplicationVisible(boolean isVisible)
          Updates the "showApplication" property through the ConfigurationService.
static void setChatDefaultFontColor(Color fontColor)
          Sets the default font color.
static void setChatDefaultFontFamily(String fontFamily)
          Sets the default font family.
static void setChatDefaultFontSize(int fontSize)
          Sets the default font size.
static void setChatFontIsBold(boolean isBold)
          Sets the default isBold property.
static void setChatFontIsItalic(boolean isItalic)
          Sets the default isItalic property.
static void setChatFontIsUnderline(boolean isUnderline)
          Sets the default isUnderline property.
static void setChatStylebarVisible(boolean isVisible)
          Updates the "isChatStylebarVisible" property through the ConfigurationService.
static void setChatToolbarVisible(boolean isVisible)
          Updates the "isChatToolbarVisible" property through the ConfigurationService.
static void setChatWriteAreaSize(int size)
          Updates the "net.java.sip.communicator.impl.gui.CHAT_WRITE_AREA_SIZE" property through the ConfigurationService.
static void setContactListGroupCollapsed(String groupID, boolean isCollapsed)
          Stores the last group status for the given groupID.
static void setLastCallConferenceProvider(ProtocolProviderService protocolProvider)
          Sets the call conference provider used for the last conference call.
static void setLastContactParent(String groupName)
          Updates the "lastContactParent" property through the ConfigurationService.
static void setMoveContactConfirmationRequested(boolean isRequested)
          Updates the "isMoveContactQuestionEnabled" property through the ConfigurationService.
static void setQuitWarningShown(boolean isWarningShown)
          Updates the "showAppQuitWarning" property through the ConfigurationService.
static void setSendFileLastDir(String lastDir)
          Updates the "SEND_FILE_LAST_DIR" property through the ConfigurationService.
static void setShowCallPanel(boolean isCallPanelShown)
          Updates the "showCallPanel" property through the ConfigurationService.
static void setShowOffline(boolean isShowOffline)
          Updates the "showOffline" property through the ConfigurationService.
static void setShowSmileys(boolean isVisible)
          Updates the "isShowSmileys" property through the ConfigurationService.
static void setTransparentWindowEnabled(boolean isTransparent)
          Updates the "isTransparentWindowEnabled" property through the ConfigurationService.
static void setWindowTransparency(int transparency)
          Sets the transparency value for all transparent windows.
static void updateChatRoomProperty(ProtocolProviderService protocolProvider, String chatRoomId, String property, String value)
          Updates the value of a chat room property through the ConfigurationService.
static void updateChatRoomStatus(ProtocolProviderService protocolProvider, String chatRoomId, String chatRoomStatus)
          Updates the status of the chat room through the ConfigurationService.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigurationManager

public ConfigurationManager()
Method Detail

loadGuiConfigurations

public static void loadGuiConfigurations()
Loads all user interface configurations.


isAutoPopupNewMessage

public static boolean isAutoPopupNewMessage()
Return TRUE if "autoPopupNewMessage" property is true, otherwise - return FALSE. Indicates to the user interface whether new messages should be opened and bring to front.

Returns:
TRUE if "autoPopupNewMessage" property is true, otherwise - return FALSE.

isCallPanelShown

public static boolean isCallPanelShown()
Return TRUE if "showCallPanel" property is true, otherwise - return FALSE. Indicates to the user interface whether the panel containing the call and hangup buttons should be shown.

Returns:
TRUE if "showCallPanel" property is true, otherwise - return FALSE.

isShowOffline

public static boolean isShowOffline()
Return TRUE if "showOffline" property is true, otherwise - return FALSE. Indicates to the user interface whether offline user should be shown in the contact list or not.

Returns:
TRUE if "showOffline" property is true, otherwise - return FALSE.

isApplicationVisible

public static boolean isApplicationVisible()
Return TRUE if "showApplication" property is true, otherwise - return FALSE. Indicates to the user interface whether the main application window should shown or hidden on startup.

Returns:
TRUE if "showApplication" property is true, otherwise - return FALSE.

isQuitWarningShown

public static boolean isQuitWarningShown()
Return TRUE if "quitWarningShown" property is true, otherwise - return FALSE. Indicates to the user interface whether the quit warning dialog should be shown when user clicks on the X button.

Returns:
TRUE if "quitWarningShown" property is true, otherwise - return FALSE. Indicates to the user interface whether the quit warning dialog should be shown when user clicks on the X button.

isSendTypingNotifications

public static boolean isSendTypingNotifications()
Return TRUE if "sendTypingNotifications" property is true, otherwise - return FALSE. Indicates to the user interface whether typing notifications are enabled or disabled.

Returns:
TRUE if "sendTypingNotifications" property is true, otherwise - return FALSE.

isMoveContactConfirmationRequested

public static boolean isMoveContactConfirmationRequested()
Returns TRUE if the "isMoveContactConfirmationRequested" property is true, otherwise - returns FALSE. Indicates to the user interface whether the confirmation window during the move contact process is enabled or not.

Returns:
TRUE if the "isMoveContactConfirmationRequested" property is true, otherwise - returns FALSE

isMultiChatWindowEnabled

public static boolean isMultiChatWindowEnabled()
Returns true if the "isMultiChatWindowEnabled" property is true, otherwise - returns false. Indicates to the user interface whether the chat window could contain multiple chats or just one chat.

Returns:
true if the "isMultiChatWindowEnabled" property is true, otherwise - returns false.

isLeaveChatRoomOnWindowCloseEnabled

public static boolean isLeaveChatRoomOnWindowCloseEnabled()
Returns true if the "isLeaveChatRoomOnWindowCloseEnabled" property is true, otherwise - returns false. Indicates to the user interface whether when closing the chat window we would leave the chat room.

Returns:
true if the "isLeaveChatRoomOnWindowCloseEnabled" property is true, otherwise - returns false.

isHistoryLoggingEnabled

public static boolean isHistoryLoggingEnabled()
Returns true if the "isHistoryLoggingEnabled" property is true, otherwise - returns false. Indicates to the user interface whether the history logging is enabled.

Returns:
true if the "isHistoryLoggingEnabled" property is true, otherwise - returns false.

isHistoryShown

public static boolean isHistoryShown()
Returns true if the "isHistoryShown" property is true, otherwise - returns false. Indicates to the user whether the history is shown in the chat window.

Returns:
true if the "isHistoryShown" property is true, otherwise - returns false.

isWindowDecorated

public static boolean isWindowDecorated()
Returns true if the "isWindowDecorated" property is true, otherwise - returns false..

Returns:
true if the "isWindowDecorated" property is true, otherwise - returns false.

isChatToolbarVisible

public static boolean isChatToolbarVisible()
Returns true if the "isChatToolbarVisible" property is true, otherwise - returns false..

Returns:
true if the "isChatToolbarVisible" property is true, otherwise - returns false.

isChatStylebarVisible

public static boolean isChatStylebarVisible()
Returns true if the "isChatStylebarVisible" property is true, otherwise - returns false..

Returns:
true if the "isChatStylebarVisible" property is true, otherwise - returns false.

isShowSmileys

public static boolean isShowSmileys()
Returns true if the "isShowSmileys" property is true, otherwise - returns false..

Returns:
true if the "isShowSmileys" property is true, otherwise - returns false.

isAddContactDisabled

public static boolean isAddContactDisabled()
Returns true if the "ADD_CONTACT_DISABLED" property is true, otherwise - returns false..

Returns:
true if the "ADD_CONTACT_DISABLED" property is true, otherwise - returns false.

isCreateGroupDisabled

public static boolean isCreateGroupDisabled()
Returns true if the "CREATE_GROUP_DISABLED" property is true, otherwise - returns false..

Returns:
true if the "CREATE_GROUP_DISABLED" property is true, otherwise - returns false.

isGoToChatroomDisabled

public static boolean isGoToChatroomDisabled()
Returns true if the "GO_TO_CHATROOM_DISABLED" property is true, otherwise - returns false..

Returns:
true if the "GO_TO_CHATROOM_DISABLED" property is true, otherwise - returns false.

isRemoveContactDisabled

public static boolean isRemoveContactDisabled()
Returns true if the "REMOVE_CONTACT_DISABLED" property is true, otherwise - returns false.

Returns:
true if the "REMOVE_CONTACT_DISABLED" property is true, otherwise - returns false.

isAdvancedAccountConfigDisabled

public static boolean isAdvancedAccountConfigDisabled()
Returns true if the "ADVANCED_CONFIG_DISABLED" property is true, otherwise - returns false..

Returns:
true if the "ADVANCED_CONFIG_DISABLED" property is true, otherwise - returns false.

getChatDefaultFontFamily

public static String getChatDefaultFontFamily()
Returns the default chat font family.

Returns:
the default chat font family

getChatDefaultFontSize

public static int getChatDefaultFontSize()
Returns the default chat font size.

Returns:
the default chat font size

getChatDefaultFontColor

public static Color getChatDefaultFontColor()
Returns the default chat font color.

Returns:
the default chat font color

isChatFontBold

public static boolean isChatFontBold()
Returns the default chat font bold.

Returns:
the default chat font bold

isChatFontItalic

public static boolean isChatFontItalic()
Returns the default chat font italic.

Returns:
the default chat font italic

isChatFontUnderline

public static boolean isChatFontUnderline()
Returns the default chat font underline.

Returns:
the default chat font underline

setAdvancedAccountConfigDisabled

public static void setAdvancedAccountConfigDisabled(boolean disabled)
Sets the advanced account config disabled property.

Parameters:
disabled - the new value to set

getSendMessageCommand

public static String getSendMessageCommand()
Return the "sendMessageCommand" property that was saved previously through the ConfigurationService. Indicates to the user interface whether the default send message command is Enter or CTRL-Enter.

Returns:
"Enter" or "CTRL-Enter" message commands.

getLastContactParent

public static String getLastContactParent()
Return the "lastContactParent" property that was saved previously through the ConfigurationService. Indicates the last selected group on adding new contact

Returns:
group name of the last selected group when adding contact.

getLastCallConferenceProvider

public static ProtocolProviderService getLastCallConferenceProvider()
Returns the call conference provider used for the last conference call.

Returns:
the call conference provider used for the last conference call

getChatHistorySize

public static int getChatHistorySize()
Returns the number of messages from chat history that would be shown in the chat window.

Returns:
the number of messages from chat history that would be shown in the chat window.

getChatWriteAreaSize

public static int getChatWriteAreaSize()
Returns the preferred height of the chat write area.

Returns:
the preferred height of the chat write area.

isTransparentWindowEnabled

public static boolean isTransparentWindowEnabled()
Returns true if transparent windows are enabled, false otherwise.

Returns:
true if transparent windows are enabled, false otherwise.

getWindowTransparency

public static int getWindowTransparency()
Returns the transparency value for all transparent windows.

Returns:
the transparency value for all transparent windows.

getSendFileLastDir

public static String getSendFileLastDir()
Returns the last opened directory of the send file file chooser.

Returns:
the last opened directory of the send file file chooser

isNormalizePhoneNumber

public static boolean isNormalizePhoneNumber()
Returns true if phone numbers should be normalized, false otherwise.

Returns:
true if phone numbers should be normalized, false otherwise.

setWindowTransparency

public static void setWindowTransparency(int transparency)
Sets the transparency value for all transparent windows.

Parameters:
transparency - the transparency value for all transparent windows.

setShowOffline

public static void setShowOffline(boolean isShowOffline)
Updates the "showOffline" property through the ConfigurationService.

Parameters:
isShowOffline - true to indicate that the offline users should be shown, false otherwise.

setShowCallPanel

public static void setShowCallPanel(boolean isCallPanelShown)
Updates the "showCallPanel" property through the ConfigurationService.

Parameters:
isCallPanelShown - true to indicate that the call panel should be shown, false otherwise.

setApplicationVisible

public static void setApplicationVisible(boolean isVisible)
Updates the "showApplication" property through the ConfigurationService.

Parameters:
isVisible - true to indicate that the application should be shown, false otherwise.

setQuitWarningShown

public static void setQuitWarningShown(boolean isWarningShown)
Updates the "showAppQuitWarning" property through the ConfigurationService.

Parameters:
isWarningShown - indicates if the message warning the user that the application would not be closed if she clicks the X button would be shown again.

setLastContactParent

public static void setLastContactParent(String groupName)
Updates the "lastContactParent" property through the ConfigurationService.

Parameters:
groupName - the group name of the selected group when adding last contact

setMoveContactConfirmationRequested

public static void setMoveContactConfirmationRequested(boolean isRequested)
Updates the "isMoveContactQuestionEnabled" property through the ConfigurationService.

Parameters:
isRequested - indicates if a confirmation would be requested from user during the move contact process.

setTransparentWindowEnabled

public static void setTransparentWindowEnabled(boolean isTransparent)
Updates the "isTransparentWindowEnabled" property through the ConfigurationService.

Parameters:
isTransparent - indicates if the transparency is enabled in the application.

setChatToolbarVisible

public static void setChatToolbarVisible(boolean isVisible)
Updates the "isChatToolbarVisible" property through the ConfigurationService.

Parameters:
isVisible - indicates if the chat toolbar is visible.

setShowSmileys

public static void setShowSmileys(boolean isVisible)
Updates the "isShowSmileys" property through the ConfigurationService.

Parameters:
isVisible - indicates if the smileys are visible

setChatStylebarVisible

public static void setChatStylebarVisible(boolean isVisible)
Updates the "isChatStylebarVisible" property through the ConfigurationService.

Parameters:
isVisible - indicates if the chat stylebar is visible.

setChatWriteAreaSize

public static void setChatWriteAreaSize(int size)
Updates the "net.java.sip.communicator.impl.gui.CHAT_WRITE_AREA_SIZE" property through the ConfigurationService.

Parameters:
size - the new size to set

setSendFileLastDir

public static void setSendFileLastDir(String lastDir)
Updates the "SEND_FILE_LAST_DIR" property through the ConfigurationService.

Parameters:
lastDir - last download directory

setLastCallConferenceProvider

public static void setLastCallConferenceProvider(ProtocolProviderService protocolProvider)
Sets the call conference provider used for the last conference call.

Parameters:
protocolProvider - the call conference provider used for the last conference call

setChatDefaultFontFamily

public static void setChatDefaultFontFamily(String fontFamily)
Sets the default font family.

Parameters:
fontFamily - the default font family name

setChatDefaultFontSize

public static void setChatDefaultFontSize(int fontSize)
Sets the default font size.

Parameters:
fontSize - the default font size

setChatFontIsBold

public static void setChatFontIsBold(boolean isBold)
Sets the default isBold property.

Parameters:
isBold - indicates if the default chat font is bold

setChatFontIsItalic

public static void setChatFontIsItalic(boolean isItalic)
Sets the default isItalic property.

Parameters:
isItalic - indicates if the default chat font is italic

setChatFontIsUnderline

public static void setChatFontIsUnderline(boolean isUnderline)
Sets the default isUnderline property.

Parameters:
isUnderline - indicates if the default chat font is underline

setChatDefaultFontColor

public static void setChatDefaultFontColor(Color fontColor)
Sets the default font color.

Parameters:
fontColor - the default font color

saveChatRoom

public static void saveChatRoom(ProtocolProviderService protocolProvider,
                                String oldChatRoomId,
                                String newChatRoomId,
                                String newChatRoomName)
Saves a chat room through the ConfigurationService.

Parameters:
protocolProvider - the protocol provider to which the chat room belongs
oldChatRoomId - the old identifier of the chat room
newChatRoomId - the new identifier of the chat room
newChatRoomName - the new chat room name

updateChatRoomStatus

public static void updateChatRoomStatus(ProtocolProviderService protocolProvider,
                                        String chatRoomId,
                                        String chatRoomStatus)
Updates the status of the chat room through the ConfigurationService.

Parameters:
protocolProvider - the protocol provider to which the chat room belongs
chatRoomId - the identifier of the chat room to update
chatRoomStatus - the new status of the chat room

updateChatRoomProperty

public static void updateChatRoomProperty(ProtocolProviderService protocolProvider,
                                          String chatRoomId,
                                          String property,
                                          String value)
Updates the value of a chat room property through the ConfigurationService.

Parameters:
protocolProvider - the protocol provider to which the chat room belongs
chatRoomId - the identifier of the chat room to update
property - the name of the property of the chat room
value - the value of the property if null, property will be removed

getChatRoomProperty

public static String getChatRoomProperty(ProtocolProviderService protocolProvider,
                                         String chatRoomId,
                                         String property)
Returns the chat room property, saved through the ConfigurationService.

Parameters:
protocolProvider - the protocol provider, to which the chat room belongs
chatRoomId - the identifier of the chat room
property - the property name, saved through the ConfigurationService.
Returns:
the value of the property, saved through the ConfigurationService.

getChatRoomStatus

public static String getChatRoomStatus(ProtocolProviderService protocolProvider,
                                       String chatRoomId)
Returns the last chat room status, saved through the ConfigurationService.

Parameters:
protocolProvider - the protocol provider, to which the chat room belongs
chatRoomId - the identifier of the chat room
Returns:
the last chat room status, saved through the ConfigurationService.

setContactListGroupCollapsed

public static void setContactListGroupCollapsed(String groupID,
                                                boolean isCollapsed)
Stores the last group status for the given groupID.

Parameters:
groupID - the identifier of the group
isCollapsed - indicates if the group is collapsed or expanded

isContactListGroupCollapsed

public static boolean isContactListGroupCollapsed(String groupID)
Returns true if the group given by groupID is collapsed or false otherwise.

Parameters:
groupID - the identifier of the group
Returns:
true if the group given by groupID is collapsed or false otherwise

getFactoryImplPackageName

public static String getFactoryImplPackageName(ProtocolProviderFactory factory)
Returns the package name under which we would store information for the given factory.

Parameters:
factory - the ProtocolProviderFactory, which package name we're looking for
Returns:
the package name under which we would store information for the given factory

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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