100 101 @Override 102 public Point getClickPoint() { 103 return TableUtils.getClickPoint(listViewWrap, this); 104 } 105 106 @Override 107 public Rectangle getScreenBounds() { 108 return cellWrap().getScreenBounds(); 109 } 110 111 @Override 112 public Show shower() { 113 return this; 114 } 115 116 @Override 117 public void show() { 118 final List<DATA> items = listViewWrap.getItems(); 119 120 AbstractScroll scroll1 = Utils.getContainerScroll(listViewWrap.as(Parent.class, Node.class), listViewWrap.getControl().getOrientation() == Orientation.VERTICAL); 121 if (scroll1 != null) { 122 TableUtils.scrollToInSingleDimension((Wrap<? extends Control>) viewWrap, ListCell.class, p -> items.indexOf(p.getItem()), listViewWrap.getItems().indexOf(getControl()), 123 scroll1.caret(), listViewWrap.vertical()); 124 } 125 AbstractScroll scroll2 = Utils.getContainerScroll(listViewWrap.as(Parent.class, Node.class), listViewWrap.getControl().getOrientation() != Orientation.VERTICAL); 126 Utils.makeCenterVisible(getClippedContainerWrap(), this, scroll2); 127 128 } 129 /** 130 * @return wrap of parent container that contains TableCells 131 */ 132 private Wrap<? extends javafx.scene.Parent> clippedContainer; 133 134 private Wrap<? extends javafx.scene.Parent> getClippedContainerWrap() { 135 if (clippedContainer == null) { 136 clippedContainer = ((Parent<Node>) listViewWrap.as(Parent.class, Node.class)).lookup(javafx.scene.Parent.class, control -> control.getClass().getName().endsWith("VirtualFlow$ClippedContainer")).wrap(); 137 } 138 return clippedContainer; 139 } 140 141 /** 142 * Identifies which elements are shown in the list currently. 143 * 144 * @return list of indices of all elements that are fully visible in the 145 * list. | 100 101 @Override 102 public Point getClickPoint() { 103 return TableUtils.getClickPoint(listViewWrap, this); 104 } 105 106 @Override 107 public Rectangle getScreenBounds() { 108 return cellWrap().getScreenBounds(); 109 } 110 111 @Override 112 public Show shower() { 113 return this; 114 } 115 116 @Override 117 public void show() { 118 final List<DATA> items = listViewWrap.getItems(); 119 120 AbstractScroll scroll1 = Utils.getContainerScroll((Parent <Node>)listViewWrap.as(Parent.class, Node.class), listViewWrap.getControl().getOrientation() == Orientation.VERTICAL); 121 if (scroll1 != null) { 122 TableUtils.scrollToInSingleDimension((Wrap<? extends Control>) viewWrap, ListCell.class, p -> items.indexOf(p.getItem()), listViewWrap.getItems().indexOf(getControl()), 123 scroll1.caret(), listViewWrap.vertical()); 124 } 125 AbstractScroll scroll2 = Utils.getContainerScroll((Parent <Node>)listViewWrap.as(Parent.class, Node.class), listViewWrap.getControl().getOrientation() != Orientation.VERTICAL); 126 Utils.makeCenterVisible(getClippedContainerWrap(), this, scroll2); 127 128 } 129 /** 130 * @return wrap of parent container that contains TableCells 131 */ 132 private Wrap<? extends javafx.scene.Parent> clippedContainer; 133 134 private Wrap<? extends javafx.scene.Parent> getClippedContainerWrap() { 135 if (clippedContainer == null) { 136 clippedContainer = ((Parent<Node>) listViewWrap.as(Parent.class, Node.class)).lookup(javafx.scene.Parent.class, control -> control.getClass().getName().endsWith("VirtualFlow$ClippedContainer")).wrap(); 137 } 138 return clippedContainer; 139 } 140 141 /** 142 * Identifies which elements are shown in the list currently. 143 * 144 * @return list of indices of all elements that are fully visible in the 145 * list. |