Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.plugin.spellcheck
Class LanguageMenuBar

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JMenuBar
                  extended by net.java.sip.communicator.util.swing.SIPCommMenuBar
                      extended by net.java.sip.communicator.plugin.spellcheck.LanguageMenuBar
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, MenuElement, PluginComponent, Skinnable

public class LanguageMenuBar
extends SIPCommMenuBar
implements PluginComponent

Combo box providing a listing of all available locales with corresponding country flags. Selecting a new field causes that locale's dictionary to be downloaded, if not available. The spell checker then use the selected language for further checking.

Author:
Damian Johnson, Yana Stamcheva
See Also:
Serialized Form

Nested Class Summary
 class LanguageMenuBar.SetSpellChecker
          The worker.
 
Nested classes/interfaces inherited from class javax.swing.JMenuBar
JMenuBar.AccessibleJMenuBar
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
 JList list
           
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Method Summary
 LanguageMenuBar.SetSpellChecker createSpellCheckerWorker(Parameters.Locale locale)
          SpellChecker worker, sets specified locale.
 String getConstraints()
          Clears any cached data used by the field so it reflects the current state of its associated spell checker.
 Container getContainer()
          Returns the identifier of the container, where we would like to add our control.
 String getName()
          Returns the name of this plugin component.
 int getPositionIndex()
          Returns the index position of this component in the container, where it will be added.
 boolean isNativeComponent()
          Returns true to indicate that this component is a native component and false otherwise.
static LanguageMenuBar makeSelectionField(SpellChecker checker)
          Provides instance of this class associated with a spell checker.
 void setCurrentContact(Contact contact)
          Sets the current contact.
 void setCurrentContact(MetaContact metaContact)
          Sets the current meta contact.
 void setCurrentContactGroup(MetaContactGroup metaGroup)
          Sets the current meta group.
 
Methods inherited from class net.java.sip.communicator.util.swing.SIPCommMenuBar
getUIClassID, loadSkin
 
Methods inherited from class javax.swing.JMenuBar
add, addNotify, getAccessibleContext, getComponent, getComponentAtIndex, getComponentIndex, getHelpMenu, getMargin, getMenu, getMenuCount, getSelectionModel, getSubElements, getUI, isBorderPainted, isSelected, menuSelectionChanged, paintBorder, paramString, processKeyBinding, processKeyEvent, processMouseEvent, removeNotify, setBorderPainted, setHelpMenu, setMargin, setSelected, setSelectionModel, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.java.sip.communicator.service.gui.PluginComponent
getComponent
 

Field Detail

list

public final JList list
Method Detail

makeSelectionField

public static LanguageMenuBar makeSelectionField(SpellChecker checker)
Provides instance of this class associated with a spell checker. If ones already been created then this instance is used.

Parameters:
checker - spell checker field is to be associated with
Returns:
spell checker locale selection field

getConstraints

public String getConstraints()
Clears any cached data used by the field so it reflects the current state of its associated spell checker.

Specified by:
getConstraints in interface PluginComponent
Returns:
the constraints, which will indicate to the container, where this component should be added.

getContainer

public Container getContainer()
Description copied from interface: PluginComponent
Returns the identifier of the container, where we would like to add our control. All possible container identifiers are defined in the Container class. If the Container returned by this method is not supported by the current UI implementation the plugin won't be added.

Specified by:
getContainer in interface PluginComponent
Returns:
the container, where we would like to add our control.

getName

public String getName()
Description copied from interface: PluginComponent
Returns the name of this plugin component. This name could be used as a label when the component is added to a container, which requires a title. A container that could request a name is for example a tabbed pane.

Specified by:
getName in interface PluginComponent
Overrides:
getName in class Component
Returns:
the name of this plugin component

getPositionIndex

public int getPositionIndex()
Description copied from interface: PluginComponent
Returns the index position of this component in the container, where it will be added. An index of 0 would mean that this component should be added before all other components. An index of -1 would mean that the position of this component is not important.

Specified by:
getPositionIndex in interface PluginComponent
Returns:
the index position of this component in the container, where it will be added.

isNativeComponent

public boolean isNativeComponent()
Description copied from interface: PluginComponent
Returns true to indicate that this component is a native component and false otherwise. This method is meant to be used by containers if a special treatment is needed for native components.

Specified by:
isNativeComponent in interface PluginComponent
Returns:
true to indicate that this component is a native component and false otherwise.

setCurrentContact

public void setCurrentContact(MetaContact metaContact)
Description copied from interface: PluginComponent
Sets the current meta contact. Meant to be used by plugin components that are interested of the current contact. The current contact could be the contact currently selected in the contact list or the contact for the currently selected chat, etc. It depends on the container, where this component is meant to be added.

Specified by:
setCurrentContact in interface PluginComponent
Parameters:
metaContact - the current meta contact

setCurrentContactGroup

public void setCurrentContactGroup(MetaContactGroup metaGroup)
Description copied from interface: PluginComponent
Sets the current meta group. Meant to be used by plugin components that are interested of the current meta group. The current group is always the currently selected group in the contact list. If the group passed here is null, this means that no group is selected.

Specified by:
setCurrentContactGroup in interface PluginComponent
Parameters:
metaGroup - the current meta contact group

setCurrentContact

public void setCurrentContact(Contact contact)
Description copied from interface: PluginComponent
Sets the current contact. Meant to be used by plugin components that are interested of the current contact. The current contact is the contact for the currently selected chat transport.

Specified by:
setCurrentContact in interface PluginComponent
Parameters:
contact - the current contact

createSpellCheckerWorker

public LanguageMenuBar.SetSpellChecker createSpellCheckerWorker(Parameters.Locale locale)
SpellChecker worker, sets specified locale.

Parameters:
locale - the locale to set.
Returns:

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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