@Test public void testMakeTreeListItems() { final DataType item1 = makeDataType("item1", "iITem1"); final DataType item2 = makeDataType("item2", "iITem2"); final DataType item3 = makeDataType("item", "iITem", item1, item2); final List<DataTypeListItem> listItems = dataTypeList.makeTreeListItems(item3, 1); verify(dataTypeList).makeTreeListItems(item3, 1); verify(dataTypeList).makeTreeListItems(item1, 2); verify(dataTypeList).makeTreeListItems(item2, 2); assertEquals(3, listItems.size()); }
List<DataTypeListItem> makeTreeListItems(final DataType dataType, final int level) { final DataTypeListItem listItem = makeListItem(); final List<DataType> subDataTypes = dataType.getSubDataTypes(); final List<DataTypeListItem> gridItems = new ArrayList<>(); listItem.setupDataType(dataType, level); gridItems.add(listItem); for (final DataType subDataType : subDataTypes) { gridItems.addAll(makeTreeListItems(subDataType, level + 1)); } return gridItems; }
DataTypeList { List<DataTypeListItem> makeTreeListItems(final DataType dataType, final int level) { final DataTypeListItem listItem = makeListItem(); final List<DataType> subDataTypes = dataType.getSubDataTypes(); final List<DataTypeListItem> gridItems = new ArrayList<>(); listItem.setupDataType(dataType, level); gridItems.add(listItem); for (final DataType subDataType : subDataTypes) { gridItems.addAll(makeTreeListItems(subDataType, level + 1)); } return gridItems; } }
DataTypeList { List<DataTypeListItem> makeTreeListItems(final DataType dataType, final int level) { final DataTypeListItem listItem = makeListItem(); final List<DataType> subDataTypes = dataType.getSubDataTypes(); final List<DataTypeListItem> gridItems = new ArrayList<>(); listItem.setupDataType(dataType, level); gridItems.add(listItem); for (final DataType subDataType : subDataTypes) { gridItems.addAll(makeTreeListItems(subDataType, level + 1)); } return gridItems; } @Inject  DataTypeList(final View view,
                        final ManagedInstance<DataTypeListItem> listItems,
                        final DataTypeManager dataTypeManager,
                        final DataTypeSearchBar searchBar,
                        final DNDListComponent dndListComponent,
                        final DataTypeStackHash dataTypeStackHash,
                        final DNDDataTypesHandler dndDataTypesHandler,
                        final DataTypeListHighlightHelper highlightHelper,
                        final IsKogito isKogito); }
DataTypeList { List<DataTypeListItem> makeTreeListItems(final DataType dataType, final int level) { final DataTypeListItem listItem = makeListItem(); final List<DataType> subDataTypes = dataType.getSubDataTypes(); final List<DataTypeListItem> gridItems = new ArrayList<>(); listItem.setupDataType(dataType, level); gridItems.add(listItem); for (final DataType subDataType : subDataTypes) { gridItems.addAll(makeTreeListItems(subDataType, level + 1)); } return gridItems; } @Inject  DataTypeList(final View view,
                        final ManagedInstance<DataTypeListItem> listItems,
                        final DataTypeManager dataTypeManager,
                        final DataTypeSearchBar searchBar,
                        final DNDListComponent dndListComponent,
                        final DataTypeStackHash dataTypeStackHash,
                        final DNDDataTypesHandler dndDataTypesHandler,
                        final DataTypeListHighlightHelper highlightHelper,
                        final IsKogito isKogito); HTMLElement getElement(); void setupItems(final List<DataType> dataTypes); Optional<DataTypeListItem> findItem(final DataType dataType); DNDListComponent getDNDListComponent(); List<DataTypeListItem> getItems(); void showNoDataTypesFound(); void showListItems(); void collapseAll(); void enableEditMode(final String dataTypeHash); void registerDataTypeListItemUpdateCallback(final Consumer<DataTypeListItem> onDataTypeListItemUpdate); Optional<DataTypeListItem> findItemByDataTypeHash(final String dataTypeHash); String calculateHash(final DataType dataType); void onDataTypeEditModeToggle(final @Observes DataTypeEditModeToggleEvent event); HTMLElement getListItems(); void importDataObjects(final List<DataObject> selectedDataObjects); void disableEditModeForChildren(final DataTypeListItem dataTypeListItem); List<String> getExistingDataTypesNames(); void highlightLevel(final DataType dataType); void highlightLevel(final Element element); void highlight(final Element element); void cleanLevelHighlightClass(); void cleanHighlightClass(); }
DataTypeList { List<DataTypeListItem> makeTreeListItems(final DataType dataType, final int level) { final DataTypeListItem listItem = makeListItem(); final List<DataType> subDataTypes = dataType.getSubDataTypes(); final List<DataTypeListItem> gridItems = new ArrayList<>(); listItem.setupDataType(dataType, level); gridItems.add(listItem); for (final DataType subDataType : subDataTypes) { gridItems.addAll(makeTreeListItems(subDataType, level + 1)); } return gridItems; } @Inject  DataTypeList(final View view,
                        final ManagedInstance<DataTypeListItem> listItems,
                        final DataTypeManager dataTypeManager,
                        final DataTypeSearchBar searchBar,
                        final DNDListComponent dndListComponent,
                        final DataTypeStackHash dataTypeStackHash,
                        final DNDDataTypesHandler dndDataTypesHandler,
                        final DataTypeListHighlightHelper highlightHelper,
                        final IsKogito isKogito); HTMLElement getElement(); void setupItems(final List<DataType> dataTypes); Optional<DataTypeListItem> findItem(final DataType dataType); DNDListComponent getDNDListComponent(); List<DataTypeListItem> getItems(); void showNoDataTypesFound(); void showListItems(); void collapseAll(); void enableEditMode(final String dataTypeHash); void registerDataTypeListItemUpdateCallback(final Consumer<DataTypeListItem> onDataTypeListItemUpdate); Optional<DataTypeListItem> findItemByDataTypeHash(final String dataTypeHash); String calculateHash(final DataType dataType); void onDataTypeEditModeToggle(final @Observes DataTypeEditModeToggleEvent event); HTMLElement getListItems(); void importDataObjects(final List<DataObject> selectedDataObjects); void disableEditModeForChildren(final DataTypeListItem dataTypeListItem); List<String> getExistingDataTypesNames(); void highlightLevel(final DataType dataType); void highlightLevel(final Element element); void highlight(final Element element); void cleanLevelHighlightClass(); void cleanHighlightClass();  }