Class AbstractWorkerPanel

    • Constructor Detail

      • AbstractWorkerPanel

        public AbstractWorkerPanel​(Controller controller)
    • Method Detail

      • refreshDocumentInstance

        public void refreshDocumentInstance()
        Set the current document instance. The method executed is the abstract buildWorkerTaskUI() method which kicks off the tree creation process. Check buildWorkerTaskUI() documentation for the implementing class to see what thread this work is done on.
        Specified by:
        refreshDocumentInstance in interface MutableDocument
      • disposeDocument

        public void disposeDocument()
        Description copied from interface: MutableDocument
        Swing controller is calling dispose and any post document clean up should be made.
        Specified by:
        disposeDocument in interface MutableDocument
      • buildProgressBar

        protected void buildProgressBar()
        Optionally builds the progress bar and addes to the layout container just after the JTree and parent scroll pane
      • buildUI

        protected void buildUI()
        Build the tree based on the current implementation of cellRenderer and the given worker task found by the calling implementation of buildWorkerTaskUI(). Before this method is call the following instance variables should be set:
        • nodeSelectionListener - event handler for node clicks
        • cellRenderer - cell render, implements DefaultTreeCellRenderer
        • rootNodeLabel - label for root node
      • buildWorkerTaskUI

        protected abstract void buildWorkerTaskUI()
        Builds the tree nodes for the given implementation of the worker
      • stopWorkerTask

        protected void stopWorkerTask()
      • selectTreeNodeUserObject

        public abstract void selectTreeNodeUserObject​(Object userObject)
        Travers tree model and try and select a node that has a matching user object.
        Parameters:
        userObject - user object to try and find in the tree
      • resetTree

        protected void resetTree()
        Reset the tree for a new document or a new validation.
      • expandAllNodes

        public void expandAllNodes()
      • startProgressControls

        public abstract void startProgressControls​(int lengthOfTask)
      • updateProgressControls

        public abstract void updateProgressControls​(int progress)
      • updateProgressControls

        public abstract void updateProgressControls​(int progress,
                                                    String label)
      • updateProgressControls

        public abstract void updateProgressControls​(String label)
      • endProgressControls

        public abstract void endProgressControls()
      • getDocumentTitle

        public String getDocumentTitle()
        Utility for getting the document title.
        Returns:
        document title, if no title then a simple search results label is returned;
      • addGB

        protected void addGB​(JPanel panel,
                             Component component,
                             int x,
                             int y,
                             int rowSpan,
                             int colSpan)
        GridBag constructor helper
        Parameters:
        panel - parent adding component too.
        component - component to add to grid
        x - row
        y - col
        rowSpan - rowSpan of field
        colSpan - colSpan of field.