org.apache.batik.apps.svgbrowser

Class NodePickerPanel

public class NodePickerPanel extends JPanel implements ActionMap

Used to preview and edit nodes.
Nested Class Summary
protected classNodePickerPanel.AddButtonAction
The action associated with the 'Add' button.
protected classNodePickerPanel.ApplyButtonAction
The action associated with the 'Apply' button.
static classNodePickerPanel.AttributesTableModel
The attributesTable model.
protected classNodePickerPanel.AttributesTableModelListener
Listens for the changes in the table and updates this node picker panel if needed.
static classNodePickerPanel.NameEditorDialog
Dialog for choosing element name.
static classNodePickerPanel.NodePickerAdapter
The adapter for the NodePicker listener.
protected classNodePickerPanel.NodePickerEditListener
Manages the edits on focus events.
static classNodePickerPanel.NodePickerEvent
Event to pass to listener.
static interfaceNodePickerPanel.NodePickerListener
Node picker listener.
protected classNodePickerPanel.RemoveButtonAction
The action associated with the 'Remove' button.
protected classNodePickerPanel.ResetButtonAction
The action associated with the 'Reset' button.
protected classNodePickerPanel.SVGInputPanel
The panel to view and edit the elements xml representation.
protected classNodePickerPanel.XMLAreaListener
Listens for the changes in the xml text area and updates this node picker panel if needed.
Constructor Summary
NodePickerPanel(NodePickerController controller)
Constructor.
Method Summary
voidaddListener(NodePickerPanel.NodePickerListener listener)
Adds the listener to the listener list.
voidenterAddNewElementMode(Element newElement, Node parent)
Enters the add new element mode.
voidenterEditMode()
Enters the edit mode.
voidenterViewMode()
Enters the view mode.
voidfireAddNewElement(NodePickerPanel.NodePickerEvent event)
Fires the AddNewElement event.
voidfireUpdateElement(NodePickerPanel.NodePickerEvent event)
Fires the updateElement event.
ActiongetAction(String key)
Returns the action associated with the given string or null on error
StringgetResults()
Gets the results of this node picker panel - gets the contents of the xml text area.
booleanpromptForChanges()
Shows a dialog to save changes.
voidsetEditable(boolean editable)
Sets the node picker components to be editable / uneditable.
voidsetPreviewElement(Element elem)
Sets the preview element.
voidupdateOnDocumentChange(String mutationEventType, Node targetNode)
Updates the panel when DOM Mutation event occures.

Constructor Detail

NodePickerPanel

public NodePickerPanel(NodePickerController controller)
Constructor.

Parameters: controller The node picker panel controller

Method Detail

addListener

public void addListener(NodePickerPanel.NodePickerListener listener)
Adds the listener to the listener list.

Parameters: listener The listener to add

enterAddNewElementMode

public void enterAddNewElementMode(Element newElement, Node parent)
Enters the add new element mode.

Parameters: newElement The element to be added parent The parent node of the element to be added

enterEditMode

public void enterEditMode()
Enters the edit mode.

enterViewMode

public void enterViewMode()
Enters the view mode.

fireAddNewElement

public void fireAddNewElement(NodePickerPanel.NodePickerEvent event)
Fires the AddNewElement event.

Parameters: event The associated NodePickerEvent event

fireUpdateElement

public void fireUpdateElement(NodePickerPanel.NodePickerEvent event)
Fires the updateElement event.

Parameters: event The associated NodePickerEvent event

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

getResults

public String getResults()
Gets the results of this node picker panel - gets the contents of the xml text area.

promptForChanges

public boolean promptForChanges()
Shows a dialog to save changes.

setEditable

public void setEditable(boolean editable)
Sets the node picker components to be editable / uneditable.

Parameters: editable Whether to enable or disable edit

setPreviewElement

public void setPreviewElement(Element elem)
Sets the preview element. Enters the view mode and updates the associated components.

Parameters: elem the element to set

updateOnDocumentChange

public void updateOnDocumentChange(String mutationEventType, Node targetNode)
Updates the panel when DOM Mutation event occures.
Copyright B) 2008 Apache Software Foundation. All Rights Reserved.