Class NodePickerPanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, ActionMap

public class NodePickerPanel extends JPanel implements ActionMap
Used to preview and edit nodes.
See Also:
  • Constructor Details

    • NodePickerPanel

      public NodePickerPanel(NodePickerController controller)
      Constructor.
      Parameters:
      controller - The node picker panel controller
  • Method Details

    • getResults

      public String getResults()
      Gets the results of this node picker panel - gets the contents of the xml text area.
    • 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
    • enterViewMode

      public void enterViewMode()
      Enters the view mode.
    • enterEditMode

      public void enterEditMode()
      Enters the edit mode.
    • 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
    • updateOnDocumentChange

      public void updateOnDocumentChange(String mutationEventType, Node targetNode)
      Updates the panel when DOM Mutation event occures.
    • setEditable

      public void setEditable(boolean editable)
      Sets the node picker components to be editable / uneditable.
      Parameters:
      editable - Whether to enable or disable edit
    • promptForChanges

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

      public Action getAction(String key) throws MissingListenerException
      Returns the action associated with the given string or null on error
      Specified by:
      getAction in interface ActionMap
      Parameters:
      key - the key mapped with the action to get
      Throws:
      MissingListenerException - if the action is not found
    • fireUpdateElement

      public void fireUpdateElement(NodePickerPanel.NodePickerEvent event)
      Fires the updateElement event.
      Parameters:
      event - The associated NodePickerEvent event
    • fireAddNewElement

      public void fireAddNewElement(NodePickerPanel.NodePickerEvent event)
      Fires the AddNewElement event.
      Parameters:
      event - The associated NodePickerEvent event
    • addListener

      public void addListener(NodePickerPanel.NodePickerListener listener)
      Adds the listener to the listener list.
      Parameters:
      listener - The listener to add