private boolean needsLoading(final FSTreeItem item) { return item.getChildCount() == 1 && LAZY_LOAD.equals(item.getChild(0).getText()); }
private boolean needsLoading(final FSTreeItem item) { return item.getChildCount() == 1 && LAZY_LOAD.equals(item.getChild(0).getText()); }
boolean needsLoading(final FSTreeItem item) { return item.getUserObject() instanceof Path && item.getFSType() == FSTreeItem.FSType.FOLDER && item.getChildCount() == 1 && constants.Loading().equals(item.getChild(0).getText()); } }
boolean needsLoading(final FSTreeItem item) { return item.getUserObject() instanceof Path && item.getFSType() == FSTreeItem.FSType.FOLDER && item.getChildCount() == 1 && constants.Loading().equals(item.getChild(0).getText()); } }
@Test public void checkFoldersWithLazyFlagAreLazyLoaded() { item = spy(newTreeItem(new TreeItemData(FSTreeItem.FSType.FOLDER, "folder", mock(Path.class)), new TreeItemData(FSTreeItem.FSType.ITEM, CommonConstants.INSTANCE.Loading(), mock(Path.class)))); final FSTreeItem child = mock(FSTreeItem.class); when(item.getChild(eq(0))).thenReturn(child); when(child.getText()).thenReturn(CommonConstants.INSTANCE.Loading()); assertTrue(view.needsLoading(item)); }
@Test public void checkFoldersWithLazyFlagAreLazyLoaded() { item = spy(newTreeItem(new TreeItemData(FSTreeItem.FSType.FOLDER, "folder", mock(Path.class)), new TreeItemData(FSTreeItem.FSType.ITEM, CommonConstants.INSTANCE.Loading(), mock(Path.class)))); final FSTreeItem child = mock(FSTreeItem.class); when(item.getChild(eq(0))).thenReturn(child); when(child.getText()).thenReturn(CommonConstants.INSTANCE.Loading()); assertTrue(view.needsLoading(item)); }
item.getChild(0).getElement().getStyle().setDisplay(Style.Display.NONE);