public class UIServiceImpl extends java.lang.Object implements UIService, ShutdownService, org.osgi.framework.ServiceListener, java.beans.PropertyChangeListener, UINotificationListener
Constructor and Description |
---|
UIServiceImpl()
Creates an instance of UIServiceImpl.
|
Modifier and Type | Method and Description |
---|---|
void |
addChatListener(ChatListener listener)
Registers a NewChatListener to be informed when new
Chats are created.
|
void |
addPluginComponentListener(PluginComponentListener listener)
Adds the given PluginComponentListener to the list of component
listeners registered in this UIService implementation.
|
void |
addWindowListener(java.awt.event.WindowListener l)
Adds the given WindowListener to the main application window.
|
void |
beginShutdown()
Implements ShutdownService#beginShutdown().
|
void |
bringToFront()
Brings the focus to the main application window.
|
void |
closeChatRoomWindow(ChatRoomWrapper chatRoom)
Closes the chat room window for the given ChatRoomWrapper
instance.
|
void |
createCall(java.lang.String[] participants)
Creates a new Call with a specific set of participants.
|
ContactList |
createContactListComponent(ContactListContainer clContainer)
Creates a contact list component.
|
WizardContainer |
getAccountRegWizardContainer()
Implements the
UIService.getAccountRegWizardContainer
method. |
java.util.Collection<Chat> |
getAllChats()
Provides all currently instantiated Chats.
|
static java.lang.Object |
getBorderLayoutConstraintsFromContainer(java.lang.Object containerConstraints)
Returns the corresponding BorderLayout constraint from the given
Container constraint.
|
ChatPanel |
getChat(ChatRoom chatRoom)
Returns the Chat corresponding to the given ChatRoom.
|
ChatPanel |
getChat(Contact contact)
Implements
UIService.getChat(Contact) . |
ChatPanel |
getChat(Contact contact,
java.lang.String escapedMessageUID)
Implements
UIService.getChat(Contact) . |
MetaContact |
getChatContact(Chat chat)
Get the MetaContact corresponding to the chat.
|
java.util.List<Chat> |
getChats()
Returns a list containing all open Chats
|
ChatWindowManager |
getChatWindowManager()
Returns the chat window manager.
|
ConferenceChatManager |
getConferenceChatManager()
Returns the chat conference manager.
|
ConfigurationContainer |
getConfigurationContainer()
Returns the ConfigurationContainer associated with this
UIService.
|
CreateAccountWindow |
getCreateAccountWindow()
Returns the create account window.
|
ChatPanel |
getCurrentChat()
Returns the selected Chat.
|
java.lang.String |
getCurrentPhoneNumber()
Returns the phone number currently entered in the phone number field.
|
SecurityAuthority |
getDefaultSecurityAuthority(ProtocolProviderService protocolProvider)
Returns a default implementation of the SecurityAuthority
interface that can be used by non-UI components that would like to launch
the registration process for a protocol provider.
|
ExportedWindow |
getExportedWindow(WindowID windowID)
Implements the
getExportedWindow in the UIService
interface. |
ExportedWindow |
getExportedWindow(WindowID windowID,
java.lang.Object[] params)
Implements the
getExportedWindow in the UIService interface. |
HistoryWindowManager |
getHistoryWindowManager()
Returns the HistoryWindowManager.
|
java.util.Collection<Call> |
getInProgressCalls()
Returns a collection of all currently in progress calls.
|
java.awt.Point |
getLocation()
Returns the current location of the main application window.
|
LoginManager |
getLoginManager()
Returns the LoginManager.
|
MainFrame |
getMainFrame()
Returns the MainFrame.
|
PopupDialog |
getPopupDialog()
Implements
getPopupDialog in the UIService interface. |
SingleWindowContainer |
getSingleWindowContainer()
Returns the single window container if such one is available (i.e.
|
java.awt.Dimension |
getSize()
Returns the size of the main application window.
|
java.util.Iterator<Container> |
getSupportedContainers()
Implements
UISercie.getSupportedContainers . |
java.util.Iterator<WindowID> |
getSupportedExportedWindows()
Implements
getSupportedExportedWindows in the UIService
interface. |
void |
initExportedWindows()
Adds all ExportedWindows to the list of application windows,
which could be used from other bundles.
|
boolean |
isContainerSupported(Container containderID)
Implements the
UIService.isContainerSupported method. |
boolean |
isExportedWindowSupported(WindowID windowID)
Implements the
UIService.isExportedWindowSupported method. |
boolean |
isVisible()
Implements
isVisible in the UIService interface. |
(package private) void |
loadApplicationGui()
Initializes all frames and panels and shows the GUI.
|
void |
maximize()
Implements
maximize in the UIService interface. |
void |
minimize()
Implements
minimize in the UIService interface. |
void |
move(int x,
int y)
Implements
move in the UIService interface. |
void |
notificationCleared(UINotification notification)
Counts the number of unread notifications and forwards the sum to the
systray service.
|
void |
notificationReceived(UINotification notification)
Counts the number of unread notifications and forwards the sum to the
systray service.
|
void |
openChatRoomWindow(ChatRoomWrapper chatRoom)
Opens a chat room window for the given ChatRoomWrapper instance.
|
void |
propertyChange(java.beans.PropertyChangeEvent evt)
Indicates that a PropertyChangeEvent has occurred.
|
void |
registerExportedWindow(ExportedWindow window)
Registers the given ExportedWindow to the list of windows that
could be accessed from other bundles.
|
void |
removeChatListener(ChatListener listener)
Removes the registration of a NewChatListener.
|
void |
removePluginComponentListener(PluginComponentListener listener)
Removes the given PluginComponentListener from the list of
component listeners registered in this UIService implementation.
|
void |
removeWindowListener(java.awt.event.WindowListener l)
Removes the given WindowListener from the main application
window.
|
void |
repaintUI()
Repaints and revalidates the whole UI Tree.
|
void |
resize(int width,
int height)
Implements
resize in the UIService interface. |
void |
restore()
Implements
restore in the UIService interface. |
void |
serviceChanged(org.osgi.framework.ServiceEvent event)
Notifies all plugin containers of a PluginComponent
registration.
|
void |
setCurrentPhoneNumber(java.lang.String phoneNumber)
Changes the phone number currently entered in the phone number field.
|
void |
setLocation(int x,
int y)
Locates the main application window to the new x and y coordinates.
|
void |
setMainWindowCanHide(boolean canHide)
Called from the systray service when a tray has been initialized and
hiding (instead of minimizing or exiting) is possible).
|
void |
setSize(int width,
int height)
Sets the size of the main application window.
|
void |
setVisible(boolean isVisible)
Implements
setVisible in the UIService interface. |
void |
showAddChatRoomDialog()
Shows Add chat room dialog.
|
void |
showChatRoomAutoOpenConfigDialog(ProtocolProviderService pps,
java.lang.String chatRoomId)
Shows chat room open automatically configuration dialog.
|
void |
startChat(java.lang.String[] participants)
Starts a new Chat with a specific set of participants.
|
void |
startChat(java.lang.String[] participants,
boolean isSmsEnabled)
Starts a new Chat with a specific set of participants.
|
void |
unregisterExportedWindow(ExportedWindow window)
Unregisters the given ExportedWindow from the list of windows
that could be accessed from other bundles.
|
boolean |
useMacOSXScreenMenuBar()
Implements UIService#useMacOSXScreenMenuBar().
|
void loadApplicationGui()
public java.util.Iterator<Container> getSupportedContainers()
UISercie.getSupportedContainers
. Returns the
list of supported containers by this implementation .getSupportedContainers
in interface UIService
UIService.getSupportedContainers()
public boolean isVisible()
isVisible
in the UIService interface. Checks if
the main application window is visible.isVisible
in interface UIService
true
if main application window is visible,
false
otherwiseUIService.isVisible()
public void setVisible(boolean isVisible)
setVisible
in the UIService interface. Shows or
hides the main application window depending on the parameter
visible
.setVisible
in interface UIService
isVisible
- true if we are to show the main application frame and
false otherwise.UIService.setVisible(boolean)
public void setLocation(int x, int y)
setLocation
in interface UIService
x
- The new x coordinate.y
- The new y coordinate.public java.awt.Point getLocation()
getLocation
in interface UIService
public java.awt.Dimension getSize()
public void setSize(int width, int height)
public void minimize()
minimize
in the UIService interface. Minimizes
the main application window.minimize
in interface UIService
UIService.minimize()
public void maximize()
maximize
in the UIService interface. Maximizes
the main application window.maximize
in interface UIService
UIService.maximize()
public void restore()
restore
in the UIService interface. Restores
the main application window.restore
in interface UIService
UIService.restore()
public void resize(int width, int height)
resize
in the UIService interface. Resizes the
main application window.resize
in interface UIService
height
- the new height of tha main application frame.width
- the new width of the main application window.UIService.resize(int, int)
public void move(int x, int y)
move
in the UIService interface. Moves the main
application window to the point with coordinates - x, y.move
in interface UIService
x
- the value of X where the main application frame is to be placed.y
- the value of Y where the main application frame is to be placed.UIService.move(int, int)
public void bringToFront()
bringToFront
in interface UIService
public void setMainWindowCanHide(boolean canHide)
setMainWindowCanHide
in interface UIService
canHide
- true if a tray icon was loaded.public void initExportedWindows()
public void registerExportedWindow(ExportedWindow window)
window
- the window to be exportedpublic void unregisterExportedWindow(ExportedWindow window)
window
- the window to no longer be exportedpublic void addPluginComponentListener(PluginComponentListener listener)
listener
- the PluginComponentListener to addpublic void removePluginComponentListener(PluginComponentListener listener)
listener
- the PluginComponentListener to removepublic java.util.Iterator<WindowID> getSupportedExportedWindows()
getSupportedExportedWindows
in the UIService
interface. Returns an iterator over a set of all windows exported by
this implementation.getSupportedExportedWindows
in interface UIService
UIService.getSupportedExportedWindows()
public ExportedWindow getExportedWindow(WindowID windowID, java.lang.Object[] params)
getExportedWindow
in the UIService interface.
Returns the window corresponding to the given WindowID.getExportedWindow
in interface UIService
windowID
- the id of the window we'd like to retrieve.params
- the params to be passed to the returned window.UIService.getExportedWindow(WindowID)
public ExportedWindow getExportedWindow(WindowID windowID)
getExportedWindow
in the UIService
interface. Returns the window corresponding to the given
WindowID.getExportedWindow
in interface UIService
windowID
- the id of the window we'd like to retrieve.UIService.getExportedWindow(WindowID)
public boolean isExportedWindowSupported(WindowID windowID)
UIService.isExportedWindowSupported
method.
Checks if there's an exported component for the given
WindowID.isExportedWindowSupported
in interface UIService
windowID
- the id of the window that we're making the query for.UIService.isExportedWindowSupported(WindowID)
public PopupDialog getPopupDialog()
getPopupDialog
in the UIService interface.
Returns a PopupDialog that could be used to show simple
messages, warnings, errors, etc.getPopupDialog
in interface UIService
UIService.getPopupDialog()
public ChatPanel getChat(Contact contact)
UIService.getChat(Contact)
. If a chat for the given
contact exists already, returns it; otherwise, creates a new one.getChat
in interface UIService
contact
- the contact that we'd like to retrieve a chat window for.UIService.getChat(Contact)
public ChatPanel getChat(Contact contact, java.lang.String escapedMessageUID)
UIService.getChat(Contact)
. If a chat for the given
contact exists already, returns it; otherwise, creates a new one.getChat
in interface UIService
contact
- the contact that we'd like to retrieve a chat window for.escapedMessageUID
- the message ID of the message that should be
excluded from the history when the last one is loaded in the chatUIService.getChat(Contact)
public ChatPanel getChat(ChatRoom chatRoom)
public ChatPanel getCurrentChat()
getCurrentChat
in interface UIService
public java.lang.String getCurrentPhoneNumber()
getCurrentPhoneNumber
in interface UIService
public void setCurrentPhoneNumber(java.lang.String phoneNumber)
setCurrentPhoneNumber
in interface UIService
phoneNumber
- the phone number to enter in the phone number field.public boolean isContainerSupported(Container containderID)
UIService.isContainerSupported
method.
Checks if the plugable container with the given Container is supported
by this implementation.isContainerSupported
in interface UIService
containderID
- the id of the container that we're making the query
for.UIService.isContainerSupported(Container)
public WizardContainer getAccountRegWizardContainer()
UIService.getAccountRegWizardContainer
method. Returns the current implementation of the
AccountRegistrationWizardContainer.getAccountRegWizardContainer
in interface UIService
UIService.getAccountRegWizardContainer()
public SecurityAuthority getDefaultSecurityAuthority(ProtocolProviderService protocolProvider)
getDefaultSecurityAuthority
in interface UIService
protocolProvider
- the ProtocolProviderService for which
the authentication window is about.public LoginManager getLoginManager()
getLoginManager
in interface UIService
public ConferenceChatManager getConferenceChatManager()
public ChatWindowManager getChatWindowManager()
public HistoryWindowManager getHistoryWindowManager()
public MainFrame getMainFrame()
public void serviceChanged(org.osgi.framework.ServiceEvent event)
serviceChanged
in interface org.osgi.framework.ServiceListener
event
- the ServiceEvent that notified uspublic static java.lang.Object getBorderLayoutConstraintsFromContainer(java.lang.Object containerConstraints)
containerConstraints
- constraints defined in the Containerpublic void propertyChange(java.beans.PropertyChangeEvent evt)
propertyChange
in interface java.beans.PropertyChangeListener
evt
- the PropertyChangeEvent that notified uspublic boolean useMacOSXScreenMenuBar()
useMacOSXScreenMenuBar
in interface UIService
public void beginShutdown()
beginShutdown
in interface ShutdownService
public ConfigurationContainer getConfigurationContainer()
getConfigurationContainer
in interface UIService
public java.util.List<Chat> getChats()
public MetaContact getChatContact(Chat chat)
getChatContact
in interface UIService
chat
- The chat to get the MetaContact frompublic void addWindowListener(java.awt.event.WindowListener l)
addWindowListener
in interface UIService
l
- the WindowListener to addpublic void removeWindowListener(java.awt.event.WindowListener l)
removeWindowListener
in interface UIService
l
- the WindowListener to removepublic java.util.Collection<Chat> getAllChats()
getAllChats
in interface UIService
public SingleWindowContainer getSingleWindowContainer()
public void addChatListener(ChatListener listener)
addChatListener
in interface UIService
listener
- listener to be registeredpublic void removeChatListener(ChatListener listener)
removeChatListener
in interface UIService
listener
- listener to be unregisteredpublic void repaintUI()
SwingUtilities.updateComponentTreeUI(Component c)
for every window owned by the application which cause UI skin and
layout repaint.public CreateAccountWindow getCreateAccountWindow()
getCreateAccountWindow
in interface UIService
public void createCall(java.lang.String[] participants)
The current implementation provided by UIServiceImpl supports a single participant at the time of this writing.
createCall
in interface UIService
participants
- an array of String values specifying the
participants to be included into the newly created CallUIService.createCall(String[])
public void startChat(java.lang.String[] participants)
The current implementation provided by UIServiceImpl supports a single participant at the time of this writing.
startChat
in interface UIService
participants
- an array of String values specifying the
participants to be included into the newly created ChatUIService.startChat(String[])
public void startChat(java.lang.String[] participants, boolean isSmsEnabled)
public void openChatRoomWindow(ChatRoomWrapper chatRoom)
openChatRoomWindow
in interface UIService
chatRoom
- the chat room associated with the chat room windowpublic void closeChatRoomWindow(ChatRoomWrapper chatRoom)
closeChatRoomWindow
in interface UIService
chatRoom
- the chat room associated with the chat room window.public ContactList createContactListComponent(ContactListContainer clContainer)
createContactListComponent
in interface UIService
clContainer
- the parent contact list containerpublic java.util.Collection<Call> getInProgressCalls()
getInProgressCalls
in interface UIService
public void showAddChatRoomDialog()
showAddChatRoomDialog
in interface UIService
public void showChatRoomAutoOpenConfigDialog(ProtocolProviderService pps, java.lang.String chatRoomId)
showChatRoomAutoOpenConfigDialog
in interface UIService
chatRoomId
- the chat room id of the chat room associated with the
dialogpps
- the protocol provider service of the chat roompublic void notificationReceived(UINotification notification)
notificationReceived
in interface UINotificationListener
notification
- the notification that was receivedpublic void notificationCleared(UINotification notification)
notificationCleared
in interface UINotificationListener
notification
- the notification that was cleared.
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.