Package org.jdesktop.swingx
Class JXTreeTable.TreeTableHacker
- java.lang.Object
-
- org.jdesktop.swingx.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:
- hitHandleDetection triggeredn in editCellAt
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
expansionChangedFlag
-
Constructor Summary
Constructors Constructor Description TreeTableHacker()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
completeEditing()
Complete editing if collapsed/expanded.protected boolean
expandOrCollapseNode(int column, EventObject e)
Tricksery to make the tree expand/collapse.protected void
expansionChanged()
called from the renderer's setExpandedPath after all expansion-related updates happend.void
hitHandleDetectionFromEditCell(int column, EventObject e)
Entry point for hit handle detection called from editCellAt, does nothing if isHitDetectionFromProcessMouse is true;boolean
hitHandleDetectionFromProcessMouse(MouseEvent e)
Entry point for hit handle detection called from processMouse.protected boolean
isHitDetectionFromProcessMouse()
Decision whether the handle hit detection should be done in processMouseEvent or editCellAt.protected boolean
mightBeExpansionTrigger(EventObject e)
-
-
-
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:
- 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.
- 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.
-
-