Class DOMViewer

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

public class DOMViewer extends JFrame implements ActionMap
The components of this class are used to view a DOM tree.
See Also:
  • Field Details

    • RESOURCE

      protected static final String RESOURCE
      The resource file name
      See Also:
    • bundle

      protected static ResourceBundle bundle
      The resource bundle
    • resources

      protected static ResourceManager resources
      The resource manager
    • listeners

      protected Map listeners
      The map that contains the listeners
    • buttonFactory

      protected ButtonFactory buttonFactory
      The button factory.
    • panel

      protected DOMViewer.Panel panel
      The panel.
    • showWhitespace

      protected boolean showWhitespace
      Whether to show text nodes that contain only whitespace in the tree.
    • isCapturingClickEnabled

      protected boolean isCapturingClickEnabled
      Whether "capturing click" tool is enabled. If enabled, the element being clicked on is found and selected in the DOMViewer's document tree
    • domViewerController

      protected DOMViewerController domViewerController
      The DOMViewer controller.
    • elementOverlayManager

      protected ElementOverlayManager elementOverlayManager
      Manages the element selection on the canvas.
    • isElementOverlayEnabled

      protected boolean isElementOverlayEnabled
      Whether painting the overlay on the canvas is enabled.
    • historyBrowserInterface

      protected HistoryBrowserInterface historyBrowserInterface
      The history browsing manager. Manages undo / redo.
    • canEdit

      protected boolean canEdit
      Whether the DOMViewer can be used for editing the document.
    • overlayButton

      protected JToggleButton overlayButton
      The button for enabling and disabling the overlay.
  • Constructor Details

  • Method Details

    • setShowWhitespace

      public void setShowWhitespace(boolean state)
      Sets whether to show text nodes that contain only whitespace in the tree.
    • setDocument

      public void setDocument(Document doc)
      Sets the document to display.
    • setDocument

      public void setDocument(Document doc, org.w3c.dom.css.ViewCSS view)
      Sets the document to display and its ViewCSS.
    • canEdit

      public boolean canEdit()
      Whether the document can be edited using the DOMViewer.
      Returns:
      True if the document can be edited throught the DOMViewer
    • setEditable

      public void setEditable(boolean canEdit)
      Enables / disables the DOMViewer to be used to edit the documents.
      Parameters:
      canEdit - True - The DOMViewer can be used to edit the documents
    • selectNode

      public void selectNode(Node node)
      Selects and scrolls to the given node in the document tree.
      Parameters:
      node - The node to be selected
    • resetHistory

      public void resetHistory()
      Resets the history.
    • 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
    • toggleOverlay

      protected void toggleOverlay()
      Toggles the element highlighting overlay.