org.apache.batik.util.gui

Class LanguageDialog.Panel

public static class LanguageDialog.Panel extends JPanel implements ActionMap

The language selection panel.
Nested Class Summary
protected classLanguageDialog.Panel.AddLanguageButtonAction
The action associated with the 'add' button
protected classLanguageDialog.Panel.ClearLanguageButtonAction
The action associated with the 'clear' button
protected classLanguageDialog.Panel.DownLanguageButtonAction
The action associated with the 'down' button
protected classLanguageDialog.Panel.IconAndTextCellRenderer
To display icons and text in the lists.
protected classLanguageDialog.Panel.LanguageListSelectionListener
To manage selection modifications
protected classLanguageDialog.Panel.RemoveLanguageButtonAction
The action associated with the 'remove' button
protected classLanguageDialog.Panel.UpLanguageButtonAction
The action associated with the 'up' button
protected classLanguageDialog.Panel.UserListSelectionListener
To manage selection modifications
Field Summary
protected JButtonaddLanguageButton
The AddLanguageButton.
protected JButtonclearLanguageButton
The ClearLanguageButton.
protected JButtondownLanguageButton
The DownLanguageButton.
protected JListlanguageList
The languages list
protected DefaultListModellanguageListModel
The language list model
protected Maplisteners
The map that contains the listeners
protected JButtonremoveLanguageButton
The RemoveLanguageButton.
protected JButtonupLanguageButton
The UpLanguageButton.
protected JListuserList
The user languages list
protected DefaultListModeluserListModel
The user list model
Constructor Summary
Panel()
Creates a new Panel object.
Method Summary
ActiongetAction(String key)
Returns the action associated with the given string or null on error
protected IcongetCountryIcon(String code)
returns the icon associated with a country code.
protected StringgetCountryText(String code)
returns the full string associated with a country code.
StringgetLanguages()
Returns the selected user languages.
static voidinitCountryIcons()
Allows to pre-initialize icons used by the Panel constructor.
voidsetLanguages(String str)
Sets the user languages.
protected voidupdateButtons()
Updates the state of the buttons

Field Detail

addLanguageButton

protected JButton addLanguageButton
The AddLanguageButton.

clearLanguageButton

protected JButton clearLanguageButton
The ClearLanguageButton.

downLanguageButton

protected JButton downLanguageButton
The DownLanguageButton.

languageList

protected JList languageList
The languages list

languageListModel

protected DefaultListModel languageListModel
The language list model

listeners

protected Map listeners
The map that contains the listeners

removeLanguageButton

protected JButton removeLanguageButton
The RemoveLanguageButton.

upLanguageButton

protected JButton upLanguageButton
The UpLanguageButton.

userList

protected JList userList
The user languages list

userListModel

protected DefaultListModel userListModel
The user list model

Constructor Detail

Panel

public Panel()
Creates a new Panel object.

Method Detail

getAction

public Action getAction(String key)
Returns the action associated with the given string or null on error

Parameters: key the key mapped with the action to get

Throws: MissingListenerException if the action is not found

getCountryIcon

protected Icon getCountryIcon(String code)
returns the icon associated with a country code.

getCountryText

protected String getCountryText(String code)
returns the full string associated with a country code.

getLanguages

public String getLanguages()
Returns the selected user languages.

initCountryIcons

public static void initCountryIcons()
Allows to pre-initialize icons used by the Panel constructor. It is not neccessary to call it and it should be called only once. This method is safe to be called by another thread than the event thread as it doesn't manipulate Swing JComponent instances.

setLanguages

public void setLanguages(String str)
Sets the user languages.

updateButtons

protected void updateButtons()
Updates the state of the buttons
Copyright B) 2007 Apache Software Foundation. All Rights Reserved.