use of org.kie.workbench.common.stunner.client.widgets.palette.categories.items.DefinitionPaletteItemWidget in project kie-wb-common by kiegroup.
the class DefinitionPaletteCategoryWidget method renderItems.
private void renderItems(final List<DefaultPaletteItem> items, final ShapeFactory<?, ?> shapeFactory) {
if (items != null && !items.isEmpty()) {
items.forEach(item -> {
if (item instanceof PaletteGroup) {
renderGroup((DefaultPaletteGroup) item, shapeFactory);
} else {
DefinitionPaletteItemWidget categoryItemWidget = definitionPaletteItemWidgetInstance.get();
categoryItemWidget.initialize(item, shapeFactory, itemMouseDownCallback);
view.addItem(categoryItemWidget);
}
});
}
}
use of org.kie.workbench.common.stunner.client.widgets.palette.categories.items.DefinitionPaletteItemWidget in project kie-wb-common by kiegroup.
the class DefinitionPaletteGroupWidget method loadItems.
private void loadItems(ShapeFactory<?, ?> shapeFactory) {
view.initView();
definitionPaletteItemWidgets.destroyAll();
List<DefaultPaletteItem> items = group.getItems();
for (int i = 0; i < items.size(); i++) {
DefaultPaletteItem item = items.get(i);
DefinitionPaletteItemWidget itemWidget = definitionPaletteItemWidgets.get();
itemWidget.initialize(item, shapeFactory, itemMouseDownCallback);
if (i >= COMPACT_ELEMENTS_LIST_SIZE) {
itemWidget.getElement().getStyle().setProperty("display", "none");
hiddenList.add(itemWidget);
}
view.addItem(itemWidget);
}
if (!hiddenList.isEmpty()) {
view.addAnchors();
view.showMoreAnchor();
}
}
Aggregations