Class JXTreeTable.TreeTableHacker

  • Direct Known Subclasses:
    JXTreeTable.TreeTableHackerExt
    Enclosing class:
    JXTreeTable

    public class JXTreeTable.TreeTableHacker
    extends Object
    Temporary class to have all the hacking at one place. Naturally, it will change a lot. The base class has the "stable" behaviour as of around jun2006 (before starting the fix for 332-swingx).

    specifically:

    1. hitHandleDetection triggeredn in editCellAt
    • Field Detail

      • expansionChangedFlag

        protected boolean expansionChangedFlag
    • Constructor Detail

      • TreeTableHacker

        public TreeTableHacker()
    • Method Detail

      • isHitDetectionFromProcessMouse

        protected boolean isHitDetectionFromProcessMouse()
        Decision whether the handle hit detection should be done in processMouseEvent or editCellAt. Here: returns false.
        Returns:
        true for handle hit detection in processMouse, false for editCellAt.
      • hitHandleDetectionFromEditCell

        public void hitHandleDetectionFromEditCell​(int column,
                                                   EventObject e)
        Entry point for hit handle detection called from editCellAt, does nothing if isHitDetectionFromProcessMouse is true;
        See Also:
        isHitDetectionFromProcessMouse()
      • hitHandleDetectionFromProcessMouse

        public boolean hitHandleDetectionFromProcessMouse​(MouseEvent e)
        Entry point for hit handle detection called from processMouse. Does nothing if isHitDetectionFromProcessMouse is false.
        Returns:
        true if the mouseEvent triggered an expand/collapse in the renderer, false otherwise.
        See Also:
        isHitDetectionFromProcessMouse()
      • completeEditing

        protected void completeEditing()
        Complete editing if collapsed/expanded.

        Is: first try to stop editing before falling back to cancel.

        This is part of fix for #730-swingx - editingStopped not always called. The other part is to call this from the renderer before expansion related state has changed.

        Was: any editing is always cancelled.

        This is a rude fix to #120-jdnc: data corruption on collapse/expand if editing. This is called from the renderer after expansion related state has changed.

      • expandOrCollapseNode

        protected boolean expandOrCollapseNode​(int column,
                                               EventObject e)
        Tricksery to make the tree expand/collapse.

        This might be - indirectly - called from one of two places:

        1. editCellAt: original, stable but buggy (#332, #222) the table's own selection had been changed due to the click before even entering into editCellAt so all tree selection state is lost.
        2. processMouseEvent: the idea is to catch the mouseEvent, check if it triggered an expanded/collapsed, consume and return if so or pass to super if not.

        widened access for testing ...

        Parameters:
        column - the column index under the event, if any.
        e - the event which might trigger a expand/collapse.
        Returns:
        this methods evaluation as to whether the event triggered a expand/collaps
      • mightBeExpansionTrigger

        protected boolean mightBeExpansionTrigger​(EventObject e)
      • expansionChanged

        protected void expansionChanged()
        called from the renderer's setExpandedPath after all expansion-related updates happend.