|
QJCC homepage | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JPanel biz.chitec.quarterback.swing.LocaleSelector
Locale selection widget Shows available locales as buttons with name and flag (if available). Allows selection by button. Sends selection as property event. Contains static methods which show selection dialogs in a convenient way.
Nested Class Summary | |
private static class |
LocaleSelector.LSButtonPanel
|
private static class |
LocaleSelector.LSComboBox
|
Nested classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
Nested classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
Nested classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary |
Fields inherited from class javax.swing.JPanel |
|
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.Container |
|
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 |
Constructor Summary | |
private |
LocaleSelector()
|
Method Summary | |
static java.util.List |
getAllLanguageLocalesList()
Returns a sorted list of all known languages as list of locales |
static javax.swing.JComboBox |
getComboBox(java.util.List locales)
Creates a combo box widget which shows the given locales with name and flag. |
static javax.swing.JComboBox |
getComboBox(java.util.List locales,
int flagmode,
int flagheight,
boolean showisocode)
Create a combo box which shows the given locales. |
static javax.swing.JComboBox |
getComboBox(java.util.List locales,
java.lang.String defaultlocale)
Creates a combo box widget which shows the given locales with name and flag. |
static javax.swing.JComboBox |
getComboBox(java.util.List locales,
java.lang.String defaultlocale,
int flagmode,
int flagheight,
boolean showisocode)
Create a combo box which shows the given locales. |
static java.lang.String |
getLocaleDescription(java.util.Locale locale,
boolean showisocode)
Return a textual description of the given locale The text contains language, country if given, variant if given, and ISO code if showisocode is true. |
static java.util.List |
getSortedAvailableLocales()
Return a sorted list of all known locales. |
static void |
handleLocaleSelection(java.awt.Frame anchor,
java.lang.String title,
java.util.List availablelocales,
java.util.Properties props,
boolean warn)
"All-inclusive" stand-alone dialog. |
static java.util.Locale |
iDToLocale(java.lang.String id)
Converts a locale ID to a locale instance. |
static java.lang.String |
localeToID(java.util.Locale locale)
Converts a locale instance into its id representation The returned id is given in the usual "_" notation. |
static void |
showLocaleSelection(java.awt.Frame owner,
java.lang.String title,
java.util.List locales,
java.lang.String currlocale,
java.beans.PropertyChangeListener pcl)
"Do-it-yourself" stand-alone dialog. |
Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, 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, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, 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 |
Constructor Detail |
private LocaleSelector()
Method Detail |
public static java.util.List getAllLanguageLocalesList()
public static java.util.List getSortedAvailableLocales()
public static java.lang.String getLocaleDescription(java.util.Locale locale, boolean showisocode)
locale
- Locale to evaluateshowisocode
- Flag whether the ISO code should be appended
public static javax.swing.JComboBox getComboBox(java.util.List locales, java.lang.String defaultlocale, int flagmode, int flagheight, boolean showisocode)
locales
- List of locales, either Locale objects or Stings in the lang_COUNTRY_VARIANT writing, e.g. "de_DE"defaultlocale
- default locale to be selected in the beginning. Null to ignore.flagmode
- Mode to show flags for the localesflagheight
- Height of the flagsshowisocode
- Flag whether the ISO codes of the locales should be shown additionally to the natural language name
public static javax.swing.JComboBox getComboBox(java.util.List locales, int flagmode, int flagheight, boolean showisocode)
locales
- List of locales, either Locale objects or Stings in the lang_COUNTRY_VARIANT writing, e.g. "de_DE"flagmode
- Mode to show flags for the localesflagheight
- Height of the flagsshowisocode
- Flag whether the ISO codes of the locales should be shown additionally to the natural language name
public static javax.swing.JComboBox getComboBox(java.util.List locales, java.lang.String defaultlocale)
locales
- List of locales, either Locale objects or Stings in the lang_COUNTRY_VARIANT writing, e.g. "de_DE"defaultlocale
- default locale to be selected in the beginning
public static javax.swing.JComboBox getComboBox(java.util.List locales)
locales
- List of locales, either Locale objects or Stings in the lang_COUNTRY_VARIANT writing, e.g. "de_DE"
public static void showLocaleSelection(java.awt.Frame owner, java.lang.String title, java.util.List locales, java.lang.String currlocale, java.beans.PropertyChangeListener pcl)
owner
- The owner frame. Dialog will show itself relatively centered to that onetitle
- Title of the Frame. Should be locale-independant (e.g. program name)locales
- List of available locales. Those will be presented.currlocale
- Current locale. This will be preselectedpcl
- PropertyChangeListener which gets the information that a new locale has been selectedpublic static void handleLocaleSelection(java.awt.Frame anchor, java.lang.String title, java.util.List availablelocales, java.util.Properties props, boolean warn)
anchor
- The anchor frame. Dialog will show itself relatively centered to that onetitle
- Title of the Frame. Should be locale-independant (e.g. program name)availablelocales
- List of available locales. Those will be presented.props
- Properties bundle to real default from and write selection to.warn
- Flag to indicate that a warning message should be shown after the selection
telling the user that for a complete takeover of the new locale selection, the program
has to be restarted. The message will be printed in the just-selected locale.public static java.util.Locale iDToLocale(java.lang.String id)
id
- Locale id
public static java.lang.String localeToID(java.util.Locale locale)
locale
- A locale instance
|
QJCC homepage | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |