@Test public void shouldCreateChildFolderNodeForFolderItem() { ItemReference folderItem = mock(ItemReference.class); when(folderItem.getType()).thenReturn("folder"); folderNode.createChildNode(folderItem); verify(treeStructure).newFolderNode(eq(folderNode), eq(folderItem)); }
@Nullable protected AbstractTreeNode<?> createChildNode(ItemReference item) { if ("file".equals(item.getType())) { return getTreeStructure().newFileNode(this, item); } else if ("folder".equals(item.getType()) || "project".equals(item.getType())) { return getTreeStructure().newFolderNode(this, item); } return null; }
FolderNode extends ItemNode { @Nullable protected AbstractTreeNode<?> createChildNode(ItemReference item) { if ("file".equals(item.getType())) { return getTreeStructure().newFileNode(this, item); } else if ("folder".equals(item.getType()) || "project".equals(item.getType())) { return getTreeStructure().newFolderNode(this, item); } return null; } }
FolderNode extends ItemNode { @Nullable protected AbstractTreeNode<?> createChildNode(ItemReference item) { if ("file".equals(item.getType())) { return getTreeStructure().newFileNode(this, item); } else if ("folder".equals(item.getType()) || "project".equals(item.getType())) { return getTreeStructure().newFolderNode(this, item); } return null; } @Inject  FolderNode(@Assisted TreeNode<?> parent,
                      @Assisted ItemReference data,
                      @Assisted GenericTreeStructure treeStructure,
                      EventBus eventBus,
                      ProjectServiceClient projectServiceClient,
                      DtoUnmarshallerFactory dtoUnmarshallerFactory); }
FolderNode extends ItemNode { @Nullable protected AbstractTreeNode<?> createChildNode(ItemReference item) { if ("file".equals(item.getType())) { return getTreeStructure().newFileNode(this, item); } else if ("folder".equals(item.getType()) || "project".equals(item.getType())) { return getTreeStructure().newFolderNode(this, item); } return null; } @Inject  FolderNode(@Assisted TreeNode<?> parent,
                      @Assisted ItemReference data,
                      @Assisted GenericTreeStructure treeStructure,
                      EventBus eventBus,
                      ProjectServiceClient projectServiceClient,
                      DtoUnmarshallerFactory dtoUnmarshallerFactory); @Override boolean isLeaf(); @Override void refreshChildren(final AsyncCallback<TreeNode<?>> callback); @Nonnull @Override GenericTreeStructure getTreeStructure(); @Override boolean canContainsFolder(); }
FolderNode extends ItemNode { @Nullable protected AbstractTreeNode<?> createChildNode(ItemReference item) { if ("file".equals(item.getType())) { return getTreeStructure().newFileNode(this, item); } else if ("folder".equals(item.getType()) || "project".equals(item.getType())) { return getTreeStructure().newFolderNode(this, item); } return null; } @Inject  FolderNode(@Assisted TreeNode<?> parent,
                      @Assisted ItemReference data,
                      @Assisted GenericTreeStructure treeStructure,
                      EventBus eventBus,
                      ProjectServiceClient projectServiceClient,
                      DtoUnmarshallerFactory dtoUnmarshallerFactory); @Override boolean isLeaf(); @Override void refreshChildren(final AsyncCallback<TreeNode<?>> callback); @Nonnull @Override GenericTreeStructure getTreeStructure(); @Override boolean canContainsFolder();  }