public class MainFrame extends SIPCommFrame implements ContactListContainer, ExportedWindow, PluginComponentListener, Skinnable
SIPCommFrame.MainContentPane
javax.swing.JFrame.AccessibleJFrame
java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
Modifier and Type | Field and Description |
---|---|
(package private) java.awt.KeyboardFocusManager |
keyManager
The keyboard focus manager.
|
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABOUT_WINDOW, ADD_CONTACT_WINDOW, CHAT_WINDOW, MAIN_WINDOW
Constructor and Description |
---|
MainFrame()
Creates an instance of MainFrame.
|
Modifier and Type | Method and Description |
---|---|
void |
addAccount(ProtocolProviderService protocolProvider)
Adds an account to the application.
|
void |
addNativePlugins()
Adds all native plugins to this container.
|
void |
addProtocolProvider(ProtocolProviderService protocolProvider)
Adds a protocol provider.
|
void |
addProtocolSupportedOperationSets(ProtocolProviderService protocolProvider)
Adds all protocol supported operation sets.
|
void |
addProviderContactHandler(ProtocolProviderService protocolProvider,
ContactEventHandler contactHandler)
Adds the given contactHandler to handle contact events for the
given protocolProvider.
|
void |
addSearchFieldListener(TextFieldChangeListener l)
Adds the given TextFieldChangeListener to listen for any changes
that occur in the search field.
|
void |
bringToFront()
Brings this window to front.
|
void |
clearCurrentSearchText()
Clears the current text in the search field.
|
protected void |
close(boolean isEscaped)
Overwrites the SIPCommFrame close method.
|
void |
ctrlEnterKeyTyped()
Called when the CTRL-ENTER or CMD-ENTER keys were typed when this window
was the focused window.
|
void |
enableUnknownContactView(boolean isEnabled)
Enters or exits the "unknown contact" view.
|
void |
enterKeyTyped()
Called when the ENTER key was typed when this window was the focused
window.
|
java.lang.String |
getAccountAddress(ProtocolProviderService protocolProvider)
Returns the account user id for the given protocol provider.
|
java.lang.String |
getAccountDisplayName(ProtocolProviderService protocolProvider)
Returns the account user display name for the given protocol provider.
|
AccountStatusPanel |
getAccountStatusPanel()
Returns the account status panel.
|
OperationSetAdHocMultiUserChat |
getAdHocMultiUserChatOpSet(ProtocolProviderService protocolProvider)
Returns the multi user chat operation set for the given protocol provider.
|
ContactEventHandler |
getContactHandler(ProtocolProviderService protocolProvider)
Returns the ContactEventHandler registered for this protocol
provider.
|
ContactListPane |
getContactListPanel()
Returns the panel containing the ContactList.
|
java.lang.String |
getCurrentSearchText()
Returns the text currently shown in the search field.
|
WindowID |
getIdentifier()
Returns the identifier of this window.
|
MainMenu |
getMainMenu()
Returns the main menu in the application window.
|
ProtocolProviderService |
getProtocolProviderForAccount(java.lang.String accountName)
Returns the protocol provider associated to the account given
by the account user identifier.
|
java.util.Iterator<ProtocolProviderService> |
getProtocolProviders()
Returns a set of all protocol providers.
|
int |
getProviderIndex(ProtocolProviderService protocolProvider)
Returns the index of the given protocol provider.
|
java.lang.Object |
getSource()
Returns this window.
|
OperationSetBasicTelephony<?> |
getTelephonyOpSet(ProtocolProviderService protocolProvider)
Returns the telephony operation set for the given protocol provider.
|
OperationSetWebContactInfo |
getWebContactInfoOpSet(ProtocolProviderService protocolProvider)
Returns the Web Contact Info operation set for the given
protocol provider.
|
boolean |
hasOperationSet(java.lang.Class<? extends OperationSet> opSet)
Checks whether we have the operation set in already loaded
protocol providers.
|
boolean |
hasProtocolProvider(ProtocolProviderService protocolProvider)
Checks whether we have already loaded the protocol provider.
|
void |
initBounds()
Sets frame size and position.
|
boolean |
isFrameVisible()
Implements
isVisible in the UIService interface. |
boolean |
isMenuSelected()
Returns true if there's any currently selected menu related to
this ContactListContainer, false - otherwise.
|
void |
loadSkin()
Reloads skin information
|
void |
maximize()
Maximizes this window.
|
void |
minimize()
Minimizes this window.
|
void |
pluginComponentAdded(PluginComponentEvent event)
Adds the associated with this PluginComponentEvent component to
the appropriate container.
|
void |
pluginComponentRemoved(PluginComponentEvent event)
Removes the associated with this PluginComponentEvent component
from this container.
|
void |
removeProtocolProvider(ProtocolProviderService protocolProvider)
Adds an account to the application.
|
void |
removeProtocolSupportedOperationSets(ProtocolProviderService protocolProvider)
Removes all protocol supported operation sets.
|
void |
removeProviderContactHandler(ProtocolProviderService protocolProvider)
Removes the ContactEventHandler corresponding to the given
protocolProvider.
|
void |
removeSearchFieldListener(TextFieldChangeListener l)
Removes the given TextFieldChangeListener that listens for any
changes that occur in the search field.
|
void |
requestFocusInContactList()
Requests the focus in the center panel, which contains either the
contact list or the unknown contact panel.
|
void |
setContactList(MetaContactListService contactList)
Initializes the contact list panel.
|
void |
setFrameVisible(boolean isVisible)
Implements
setVisible in the UIService interface. |
void |
setParams(java.lang.Object[] windowParams)
Implementation of
ExportedWindow.setParams(Object[]) . |
void |
updateCloseAction(boolean canHide)
If hiding is possible and the option to minimize is not selected, the
application gets hidden on clicking 'X'.
|
protected void |
windowClosed(java.awt.event.WindowEvent event) |
protected void |
windowClosing(java.awt.event.WindowEvent event)
Overrides SIPCommFrame#windowClosing(WindowEvent).
|
addKeybindingAction, dispose, setKeybindingInput, setSizeAndLocation, setVisible, setVisible, update, updateIconImages, windowDispose
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecorated
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, show, toBack, toFront
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
isFocused
isFocused, isVisible, setLocation, setSize, setVisible
public void requestFocusInContactList()
public void updateCloseAction(boolean canHide)
true
- if hiding is possible, i.e. a tray icon is loadedpublic void initBounds()
public void enableUnknownContactView(boolean isEnabled)
isEnabled
- true to enable the "unknown contact" view,
false - otherwise.public void setContactList(MetaContactListService contactList)
contactList
- The MetaContactListService containing
the contact list data.public void addProtocolSupportedOperationSets(ProtocolProviderService protocolProvider)
protocolProvider
- The protocol provider.public void removeProtocolSupportedOperationSets(ProtocolProviderService protocolProvider)
protocolProvider
- The protocol provider.public java.util.Iterator<ProtocolProviderService> getProtocolProviders()
public ProtocolProviderService getProtocolProviderForAccount(java.lang.String accountName)
accountName
- The account user identifier.public void addProtocolProvider(ProtocolProviderService protocolProvider)
protocolProvider
- The protocol provider to add.public boolean hasProtocolProvider(ProtocolProviderService protocolProvider)
protocolProvider
- the provider to check.public boolean hasOperationSet(java.lang.Class<? extends OperationSet> opSet)
opSet
- the operation set to check.public void removeProtocolProvider(ProtocolProviderService protocolProvider)
protocolProvider
- The protocol provider of the account.public int getProviderIndex(ProtocolProviderService protocolProvider)
protocolProvider
- the protocol provider to search forpublic void addAccount(ProtocolProviderService protocolProvider)
protocolProvider
- The protocol provider of the account.public java.lang.String getAccountAddress(ProtocolProviderService protocolProvider)
protocolProvider
- the protocol provider corresponding to the
account to addpublic java.lang.String getAccountDisplayName(ProtocolProviderService protocolProvider)
protocolProvider
- the protocol provider corresponding to the
account to addpublic OperationSetWebContactInfo getWebContactInfoOpSet(ProtocolProviderService protocolProvider)
protocolProvider
- The protocol provider for which the TN
is searched.public OperationSetBasicTelephony<?> getTelephonyOpSet(ProtocolProviderService protocolProvider)
protocolProvider
- The protocol provider for which the telephony
operation set is about.public OperationSetAdHocMultiUserChat getAdHocMultiUserChatOpSet(ProtocolProviderService protocolProvider)
protocolProvider
- The protocol provider for which the multi user
chat operation set is about.public boolean isMenuSelected()
isMenuSelected
in interface ContactListContainer
public ContactListPane getContactListPanel()
public java.lang.String getCurrentSearchText()
getCurrentSearchText
in interface ContactListContainer
public void clearCurrentSearchText()
clearCurrentSearchText
in interface ContactListContainer
public void addSearchFieldListener(TextFieldChangeListener l)
l
- the TextFieldChangeListener to addpublic void removeSearchFieldListener(TextFieldChangeListener l)
l
- the TextFieldChangeListener to removeprotected void close(boolean isEscaped)
close
in class SIPCommFrame
isEscaped
- indicates if this window has been closed by pressing
the escape keypublic MainMenu getMainMenu()
public void addProviderContactHandler(ProtocolProviderService protocolProvider, ContactEventHandler contactHandler)
protocolProvider
- the ProtocolProviderService, which
contacts should be handled by the given contactHandlercontactHandler
- the ContactEventHandler that would handle
events coming from the UI for any contacts belonging to the given
providerpublic void removeProviderContactHandler(ProtocolProviderService protocolProvider)
protocolProvider
- the protocol provider, which contact handler
we would like to removepublic ContactEventHandler getContactHandler(ProtocolProviderService protocolProvider)
protocolProvider
- the ProtocolProviderService for which
we are searching a ContactEventHandler.public void pluginComponentAdded(PluginComponentEvent event)
pluginComponentAdded
in interface PluginComponentListener
event
- the PluginComponentEvent that has notified us of
the add of a plugin componentpublic void pluginComponentRemoved(PluginComponentEvent event)
pluginComponentRemoved
in interface PluginComponentListener
event
- the PluginComponentEvent that notified us of the
remove of a plugin componentpublic void addNativePlugins()
public void bringToFront()
bringToFront
in interface ExportedWindow
public WindowID getIdentifier()
getIdentifier
in interface ExportedWindow
public java.lang.Object getSource()
getSource
in interface ExportedWindow
public void maximize()
maximize
in interface ExportedWindow
public void minimize()
minimize
in interface ExportedWindow
public boolean isFrameVisible()
isVisible
in the UIService interface. Checks if
the main application window is visible.true
if main application window is visible,
false
otherwiseUIService.isVisible()
public void setFrameVisible(boolean isVisible)
setVisible
in the UIService interface. Shows or
hides the main application window depending on the parameter
visible
.isVisible
- true if we are to show the main application frame and
false otherwise.UIService.setVisible(boolean)
public AccountStatusPanel getAccountStatusPanel()
public void setParams(java.lang.Object[] windowParams)
ExportedWindow.setParams(Object[])
.setParams
in interface ExportedWindow
windowParams
- the parameters to pass.protected void windowClosed(java.awt.event.WindowEvent event)
event
- Currently not usedprotected void windowClosing(java.awt.event.WindowEvent event)
windowClosing
in class SIPCommFrame
event
- the WindowEvent that notified uspublic void enterKeyTyped()
enterKeyTyped
in interface ContactListContainer
public void ctrlEnterKeyTyped()
ctrlEnterKeyTyped
in interface ContactListContainer
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.