public interface UIService
Through the UIService all modules can add their own components in different menus, toolbars, etc. within the ui. Each UIService implementation should export its supported "pluggable" containers - a set of Containers corresponding to different "places" in the application, where a module can add a component.
The UIService provides also methods that would allow to other modules to control the visibility, size and position of the main application window. Some of these methods are: setVisible, minimize, maximize, resize, move, etc.
A way to show different types of simple windows is provided to allow other modules to show different simple messages, like warning or error messages. In order to show a simple warning message, a module should invoke the getPopupDialog method and then one of the showXXX methods, which corresponds best to the required dialog.
Certain components within the GUI, like "AddContact" window for example,
could be also shown from outside the UI bundle. To make one of these
component exportable, the UIService implementation should attach to
it an WindowID. A window then could be shown, by invoking
getExportedWindow(WindowID)
and then show
. The
WindowID above should be obtained from
getSupportedExportedWindows
.
Modifier and Type | Method and Description |
---|---|
void |
addChatListener(ChatListener listener)
Registers a NewChatListener to be informed when new
Chats are created.
|
void |
addWindowListener(java.awt.event.WindowListener l)
Adds the given WindowListener listening for events triggered
by the main UIService component.
|
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()
Returns the WizardContainer for the current UIService
implementation.
|
java.util.Collection<Chat> |
getAllChats()
Provides all currently instantiated Chats.
|
Chat |
getChat(ChatRoom chatRoom)
Returns the Chat corresponding to the given ChatRoom.
|
Chat |
getChat(Contact contact)
Returns the Chat corresponding to the given Contact.
|
Chat |
getChat(Contact contact,
java.lang.String escapedMessageID)
Returns the Chat corresponding to the given Contact.
|
MetaContact |
getChatContact(Chat chat)
Get the MetaContact corresponding to the chat.
|
java.util.List<Chat> |
getChats()
Returns a list of all open Chats
|
ConfigurationContainer |
getConfigurationContainer()
Returns the ConfigurationContainer associated with this
UIService.
|
CreateAccountWindow |
getCreateAccountWindow()
Returns the create account window.
|
Chat |
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)
Returns an exported window given by the WindowID.
|
ExportedWindow |
getExportedWindow(WindowID windowID,
java.lang.Object[] params)
Returns an exported window given by the WindowID.
|
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 login manager used by the current UI implementation.
|
PopupDialog |
getPopupDialog()
Returns a configurable popup dialog, that could be used to show either a
warning message, error message, information message, etc.
|
java.awt.Dimension |
getSize()
Returns the size of the main application window.
|
java.util.Iterator<Container> |
getSupportedContainers()
Returns an iterator over a set containing containerID-s pointing to
containers supported by the current UI implementation.
|
java.util.Iterator<WindowID> |
getSupportedExportedWindows()
Returns an iterator over a set of windowID-s.
|
boolean |
isContainerSupported(Container containderID)
Checks if the container with the given Container is supported
from the current UI implementation.
|
boolean |
isExportedWindowSupported(WindowID windowID)
Checks if a window with the given WindowID is contained in the
current UI implementation.
|
boolean |
isVisible()
Returns TRUE if the application is visible and FALSE otherwise.
|
void |
maximize()
Maximizes the main application window.
|
void |
minimize()
Minimizes the main application window.
|
void |
move(int x,
int y)
Moves the main application window to the given coordinates.
|
void |
openChatRoomWindow(ChatRoomWrapper chatRoom)
Opens a chat room window for the given ChatRoomWrapper instance.
|
void |
removeChatListener(ChatListener listener)
Removes the registration of a NewChatListener.
|
void |
removeWindowListener(java.awt.event.WindowListener l)
Removes the given WindowListener from the list of registered
listener.
|
void |
repaintUI()
Repaints and revalidates the whole UI.
|
void |
resize(int width,
int height)
Resizes the main application window with the given width and height.
|
void |
restore()
Restores the main application window.
|
void |
setCurrentPhoneNumber(java.lang.String phoneNumber)
Sets the phone number 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 exitOnClose)
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 visible)
Shows or hides the main application window depending on the value of
parameter
visible . |
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.
|
boolean |
useMacOSXScreenMenuBar()
Determines whether the Mac OS X screen menu bar is being used by the UI
for its main menu instead of the Windows-like menu bars at the top of the
windows.
|
boolean isVisible()
true
if the application is visible and
false
otherwise.setVisible(boolean)
void setVisible(boolean visible)
visible
. Meant to be used by the systray when it
needs to show or hide the application.visible
- if true
, shows the main application window;
otherwise, hides the main application window.isVisible()
java.awt.Point getLocation()
void setLocation(int x, int y)
x
- The new x coordinate.y
- The new y coordinate.java.awt.Dimension getSize()
void setSize(int width, int height)
width
- The width of the window.height
- The height of the window.void minimize()
void maximize()
void restore()
void resize(int width, int height)
width
- The new width.height
- The new height.void move(int x, int y)
x
- The x coordinate.y
- The y coordinate.void bringToFront()
void setMainWindowCanHide(boolean exitOnClose)
true
- if a tray icon was loaded.ExportedWindow getExportedWindow(WindowID windowID) throws java.lang.IllegalArgumentException
windowID
- One of the WINDOW_XXX WindowID-s.java.lang.IllegalArgumentException
- if the specified windowID is
not recognized by the implementation (note that
implementations MUST properly handle all WINDOW_XXX ID-s.ExportedWindow getExportedWindow(WindowID windowID, java.lang.Object[] params) throws java.lang.IllegalArgumentException
windowID
- One of the WINDOW_XXX WindowID-s.params
- The parameters to be passed to the returned exported
window.java.lang.IllegalArgumentException
- if the specified windowID is
not recognized by the implementation (note that
implementations MUST properly handle all WINDOW_XXX ID-s.PopupDialog getPopupDialog()
PopupDialog
.PopupDialog
Chat getChat(Contact contact)
contact
- the Contact for which the searched chat is about.Chat getChat(Contact contact, java.lang.String escapedMessageID)
contact
- the Contact for which the searched chat is about.escapedMessageID
- the message ID of the message that should be
excluded from the history when the last one is loaded in the chatChat getChat(ChatRoom chatRoom)
chatRoom
- the ChatRoom for which the searched chat is
about.java.util.List<Chat> getChats()
MetaContact getChatContact(Chat chat)
chat
- The chat to get the MetaContact fromChat getCurrentChat()
java.lang.String getCurrentPhoneNumber()
void setCurrentPhoneNumber(java.lang.String phoneNumber)
phoneNumber
- the phone number to enter.SecurityAuthority getDefaultSecurityAuthority(ProtocolProviderService protocolProvider)
protocolProvider
- the ProtocolProviderService for which
the authentication window is about.java.util.Iterator<WindowID> getSupportedExportedWindows()
boolean isExportedWindowSupported(WindowID windowID)
windowID
- one of the WindowID-s, defined in the
ExportedWindow interface.true
if the component with the given
WindowID is contained in the current UI implementation,
false
otherwise.WizardContainer getAccountRegWizardContainer()
java.util.Iterator<Container> getSupportedContainers()
boolean isContainerSupported(Container containderID)
containderID
- One of the CONTAINER_XXX Container-s.true
if the container with the given
Container is supported from the current UI
implementation, false
otherwise.boolean useMacOSXScreenMenuBar()
A common use of the returned indicator is for the purposes of platform-sensitive UI since Mac OS X employs a single screen menu bar, Windows and Linux/GTK+ use per-window menu bars and it is inconsistent on Mac OS X to have the Window-like menu bars.
ConfigurationContainer getConfigurationContainer()
CreateAccountWindow getCreateAccountWindow()
void addWindowListener(java.awt.event.WindowListener l)
l
- the WindowListener to addvoid removeWindowListener(java.awt.event.WindowListener l)
l
- the WindowListener to removejava.util.Collection<Chat> getAllChats()
void addChatListener(ChatListener listener)
listener
- listener to be registeredvoid removeChatListener(ChatListener listener)
listener
- listener to be unregisteredvoid repaintUI()
void createCall(java.lang.String[] participants)
participants
- an array of String values specifying the
participants to be included into the newly created Callvoid startChat(java.lang.String[] participants)
participants
- an array of String values specifying the
participants to be included into the newly created Chatvoid startChat(java.lang.String[] participants, boolean isSmsEnabled)
participants
- an array of String values specifying the
participants to be included into the newly created ChatisSmsEnabled
- whether sms option should be enabled if possibleContactList createContactListComponent(ContactListContainer clContainer)
clContainer
- the parent contact list containerjava.util.Collection<Call> getInProgressCalls()
LoginManager getLoginManager()
void openChatRoomWindow(ChatRoomWrapper chatRoom)
chatRoom
- the chat room associated with the chat room windowvoid closeChatRoomWindow(ChatRoomWrapper chatRoom)
chatRoom
- the chat room associated with the chat room windowvoid showAddChatRoomDialog()
void showChatRoomAutoOpenConfigDialog(ProtocolProviderService pps, java.lang.String chatRoomId)
chatRoomId
- the chat room id of the chat room associated with the
dialogpps
- the protocol provider service of the chat room
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.