use of org.kie.workbench.common.stunner.lienzo.toolbox.items.DecoratedItem in project kie-wb-common by kiegroup.
the class ButtonGridItemImpl method add.
@Override
public ButtonGridItemImpl add(final DecoratedItem... items) {
toolbox.add(items);
for (final DecoratedItem item : items) {
try {
final AbstractDecoratedItem primitiveItem = (AbstractDecoratedItem) item;
registerItemFocusHandler(primitiveItem, itemFocusCallback);
registerItemUnFocusHandler(primitiveItem, itemUnFocusCallback);
} catch (final ClassCastException e) {
throw new UnsupportedOperationException("The button only supports subtypes " + "of " + AbstractDecoratedItem.class.getName());
}
}
return this;
}
use of org.kie.workbench.common.stunner.lienzo.toolbox.items.DecoratedItem in project kie-wb-common by kiegroup.
the class ItemGridImpl method hide.
@Override
public ItemGridImpl hide(final Command before, final Command after) {
return super.hide(before, () -> {
for (final DecoratedItem button : items) {
button.hide();
}
after.execute();
fireRefresh();
});
}
use of org.kie.workbench.common.stunner.lienzo.toolbox.items.DecoratedItem in project kie-wb-common by kiegroup.
the class ItemGridImpl method show.
@Override
public ItemGridImpl show(final Command before, final Command after) {
return super.show(() -> {
repositionItems();
for (final DecoratedItem button : items) {
button.show();
}
before.execute();
}, after);
}
use of org.kie.workbench.common.stunner.lienzo.toolbox.items.DecoratedItem in project kie-wb-common by kiegroup.
the class WiresShapeToolboxTest method testAddItem.
@Test
@SuppressWarnings("unchecked")
public void testAddItem() {
DecoratedItem item = mock(DecoratedItem.class);
tested.add(item);
verify(toolbox, times(1)).add(eq(item));
}
use of org.kie.workbench.common.stunner.lienzo.toolbox.items.DecoratedItem in project kie-wb-common by kiegroup.
the class ToolboxImplTest method testAddItem.
@Test
@SuppressWarnings("unchecked")
public void testAddItem() {
DecoratedItem item = mock(DecoratedItem.class);
tested.add(item);
verify(wrapped, times(1)).add(eq(item));
}
Aggregations