org.apache.batik.util.gui

Class CSSMediaPanel

public class CSSMediaPanel extends JPanel implements ActionMap

This class represents a panel to edit/add/remove CSS media.
Nested Class Summary
protected classCSSMediaPanel.AddButtonAction
The action associated with the 'Add' button
static classCSSMediaPanel.AddMediumDialog
A dialog to add a new CSS medium.
protected classCSSMediaPanel.ClearButtonAction
The action associated with the 'Clear' button
static classCSSMediaPanel.Dialog
A dialog to edit/add/remove CSS media.
protected classCSSMediaPanel.MediaListDataListener
To manage data modifications in the media list.
protected classCSSMediaPanel.MediaListSelectionListener
To manage selection modifications
protected classCSSMediaPanel.RemoveButtonAction
The action associated with the 'Remove' button
Field Summary
protected JButtonaddButton
The button to add a CSS medium from the list.
protected static ResourceBundlebundle
The resource bundle
protected JButtonclearButton
The button to clear the CSS media list.
protected Maplisteners
The map that contains the listeners
protected DefaultListModellistModel
The list that represents the CSS media.
protected JListmediaList
The list that represents the CSS media.
protected JButtonremoveButton
The button to remove a CSS medium from the list.
protected static ResourceManagerresources
The resource manager
protected static StringRESOURCES
The resource file name
Constructor Summary
CSSMediaPanel()
Constructs a new panel to edit CSS media.
Method Summary
ActiongetAction(String key)
Returns the action associated with the given string or null on error
ListgetMedia()
Returns the list of media.
StringgetMediaAsString()
Returns the media list as a string separated by space.
static voidmain(String[] args)
Main - debug -
voidsetMedia(List mediaList)
Sets the list of media to edit.
voidsetMedia(String media)
Sets the list of media to edit to the specified media list (separated by space).
static intshowDialog(Component parent, String title)
Brings up a modal dialog to edit/add/remove CSS media.
static intshowDialog(Component parent, String title, List mediaList)
Brings up a modal dialog to edit/add/remove CSS media.
static intshowDialog(Component parent, String title, String media)
Brings up a modal dialog to edit/add/remove CSS media.
protected voidupdateButtons()
Updates the button states.

Field Detail

addButton

protected JButton addButton
The button to add a CSS medium from the list.

bundle

protected static ResourceBundle bundle
The resource bundle

clearButton

protected JButton clearButton
The button to clear the CSS media list.

listeners

protected Map listeners
The map that contains the listeners

listModel

protected DefaultListModel listModel
The list that represents the CSS media.

mediaList

protected JList mediaList
The list that represents the CSS media.

removeButton

protected JButton removeButton
The button to remove a CSS medium from the list.

resources

protected static ResourceManager resources
The resource manager

RESOURCES

protected static final String RESOURCES
The resource file name

Constructor Detail

CSSMediaPanel

public CSSMediaPanel()
Constructs a new panel to edit CSS media.

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

getMedia

public List getMedia()
Returns the list of media.

getMediaAsString

public String getMediaAsString()
Returns the media list as a string separated by space.

main

public static void main(String[] args)
Main - debug -

setMedia

public void setMedia(List mediaList)
Sets the list of media to edit.

Parameters: mediaList the list of media to edit

setMedia

public void setMedia(String media)
Sets the list of media to edit to the specified media list (separated by space).

Parameters: media the media separated by space

showDialog

public static int showDialog(Component parent, String title)
Brings up a modal dialog to edit/add/remove CSS media.

Parameters: parent the parent of this dialog title the title of this dialog

showDialog

public static int showDialog(Component parent, String title, List mediaList)
Brings up a modal dialog to edit/add/remove CSS media.

Parameters: parent the parent of this dialog title the title of this dialog mediaList the list of media

showDialog

public static int showDialog(Component parent, String title, String media)
Brings up a modal dialog to edit/add/remove CSS media.

Parameters: parent the parent of this dialog title the title of this dialog media the list of media

updateButtons

protected void updateButtons()
Updates the button states.
Copyright B) 2008 Apache Software Foundation. All Rights Reserved.