functional/ControlsTests/test/javafx/scene/control/test/tableview/TestBaseCommon.java

Print this page




 181                                 res[1] = Math.min(res[1], row);
 182                                 res[2] = Math.max(res[2], column);
 183                                 res[3] = Math.max(res[3], row);
 184                             }
 185                         }
 186                         return false;
 187                     }
 188                 }).size();
 189 
 190                 setResult(res);
 191             }
 192         }.dispatch(testedControl.getEnvironment());
 193 
 194         return res;
 195     }
 196 
 197     /**
 198      * @return wrap of parent container that contains Cells
 199      */
 200     static Wrap<? extends javafx.scene.Parent> getContainerWrap(Wrap<? extends Control> parent) {
 201         return getParentWrap(parent.as(Parent.class, Node.class), VIRTIAL_FLOW_CLASS_NAME);
 202     }
 203 
 204     static Wrap<? extends javafx.scene.Parent> getClippedContainerWrap(Wrap<? extends Control> parent) {
 205         return getParentWrap(parent.as(Parent.class, Node.class), CLIPPED_CONTAINER_CLASS_NAME);
 206     }
 207 
 208     static private Wrap<? extends javafx.scene.Parent> getParentWrap(Parent<Node> parent, final String className) {
 209         return parent.lookup(javafx.scene.Parent.class, new LookupCriteria<javafx.scene.Parent>() {
 210             @Override
 211             public boolean check(javafx.scene.Parent control) {
 212                 return control.getClass().getName().endsWith(className);
 213             }
 214         }).wrap();
 215     }
 216 
 217     public static Wrap<Text> getCellWrap(Wrap<? extends TableView> testedControl, final String item) {
 218         return testedControl.as(Parent.class, String.class).lookup(
 219                 new LookupCriteria<String>() {
 220                     @Override
 221                     public boolean check(String cell_item) {
 222                         return cell_item.equals(item);
 223                     }
 224                 }).wrap();
 225     }




 181                                 res[1] = Math.min(res[1], row);
 182                                 res[2] = Math.max(res[2], column);
 183                                 res[3] = Math.max(res[3], row);
 184                             }
 185                         }
 186                         return false;
 187                     }
 188                 }).size();
 189 
 190                 setResult(res);
 191             }
 192         }.dispatch(testedControl.getEnvironment());
 193 
 194         return res;
 195     }
 196 
 197     /**
 198      * @return wrap of parent container that contains Cells
 199      */
 200     static Wrap<? extends javafx.scene.Parent> getContainerWrap(Wrap<? extends Control> parent) {
 201         return getParentWrap((Parent<Node>)parent.as(Parent.class, Node.class), VIRTIAL_FLOW_CLASS_NAME);
 202     }
 203 
 204     static Wrap<? extends javafx.scene.Parent> getClippedContainerWrap(Wrap<? extends Control> parent) {
 205         return getParentWrap((Parent<Node>)parent.as(Parent.class, Node.class), CLIPPED_CONTAINER_CLASS_NAME);
 206     }
 207 
 208     static private Wrap<? extends javafx.scene.Parent> getParentWrap(Parent<Node> parent, final String className) {
 209         return parent.lookup(javafx.scene.Parent.class, new LookupCriteria<javafx.scene.Parent>() {
 210             @Override
 211             public boolean check(javafx.scene.Parent control) {
 212                 return control.getClass().getName().endsWith(className);
 213             }
 214         }).wrap();
 215     }
 216 
 217     public static Wrap<Text> getCellWrap(Wrap<? extends TableView> testedControl, final String item) {
 218         return testedControl.as(Parent.class, String.class).lookup(
 219                 new LookupCriteria<String>() {
 220                     @Override
 221                     public boolean check(String cell_item) {
 222                         return cell_item.equals(item);
 223                     }
 224                 }).wrap();
 225     }