304 protected void removeItem(String itemName) {
305 setText(findTextField(REMOVE_ITEM_TEXT_FIELD_ID), itemName);
306 clickButtonForTestPurpose(REMOVE_ITEM_BUTTON_ID);
307 }
308
309 protected HashSet<Point> getSelected() {
310 return TreeViewCommonFunctionality.getSelected(testedControl);
311 }
312
313 protected Point getSelectedItem() {
314 return TreeViewCommonFunctionality.getSelectedItem(testedControl);
315 }
316
317 protected void checkSelection() {
318 TreeViewCommonFunctionality.checkSelection(testedControl, selectionHelper, DATA_ITEMS_NUM);
319 }
320
321 protected void checkScrollingState(final double scrollValue, boolean beginVisible, boolean endVisible, int size) {
322 testedControl.waitState(new State() {
323 public Object reached() {
324 Wrap<? extends ScrollBar> sb = findScrollBar(testedControl.as(Parent.class, Node.class), Orientation.VERTICAL, true);
325 if (Math.abs(sb.getControl().getValue() - scrollValue) < 0.01) {
326 return true;
327 } else {
328 return null;
329 }
330 }
331 });
332
333 if (beginVisible) {
334 assertTrue(isCellShown(0));
335 }
336 if (endVisible) {
337 assertTrue(isCellShown(size - 1));
338 }
339 }
340
341 /**
342 * This function will find all arrows, and check, that their orientation
343 * corresponds to the expanded/collapsed value of TreeItem
344 */
|
304 protected void removeItem(String itemName) {
305 setText(findTextField(REMOVE_ITEM_TEXT_FIELD_ID), itemName);
306 clickButtonForTestPurpose(REMOVE_ITEM_BUTTON_ID);
307 }
308
309 protected HashSet<Point> getSelected() {
310 return TreeViewCommonFunctionality.getSelected(testedControl);
311 }
312
313 protected Point getSelectedItem() {
314 return TreeViewCommonFunctionality.getSelectedItem(testedControl);
315 }
316
317 protected void checkSelection() {
318 TreeViewCommonFunctionality.checkSelection(testedControl, selectionHelper, DATA_ITEMS_NUM);
319 }
320
321 protected void checkScrollingState(final double scrollValue, boolean beginVisible, boolean endVisible, int size) {
322 testedControl.waitState(new State() {
323 public Object reached() {
324 Wrap<? extends ScrollBar> sb = findScrollBar((Parent<Node>)testedControl.as(Parent.class, Node.class), Orientation.VERTICAL, true);
325 if (Math.abs(sb.getControl().getValue() - scrollValue) < 0.01) {
326 return true;
327 } else {
328 return null;
329 }
330 }
331 });
332
333 if (beginVisible) {
334 assertTrue(isCellShown(0));
335 }
336 if (endVisible) {
337 assertTrue(isCellShown(size - 1));
338 }
339 }
340
341 /**
342 * This function will find all arrows, and check, that their orientation
343 * corresponds to the expanded/collapsed value of TreeItem
344 */
|