use of com.ait.lienzo.client.core.shape.toolbox.items.ButtonItem in project kie-wb-common by kiegroup.
the class CommonActionsToolboxViewTest method testAddButtonIntoParent.
@Test
@SuppressWarnings("unchecked")
public void testAddButtonIntoParent() {
doInit();
final ButtonItem buttonItem = mock(ButtonItem.class);
tested.addButton(buttonItem);
verify(toolboxView, times(1)).add(eq(buttonItem));
}
use of com.ait.lienzo.client.core.shape.toolbox.items.ButtonItem in project kie-wb-common by kiegroup.
the class FlowActionsToolboxViewTest method testAddButtonIntoParent.
@Test
@SuppressWarnings("unchecked")
public void testAddButtonIntoParent() {
doInit();
final ButtonItem buttonItem = mock(ButtonItem.class);
tested.addButton(buttonItem);
verify(toolboxView, times(1)).add(eq(buttonItem));
}
use of com.ait.lienzo.client.core.shape.toolbox.items.ButtonItem in project kie-wb-common by kiegroup.
the class MorphActionsToolboxViewTest method testAddButtonIntoParent.
@Test
@SuppressWarnings("unchecked")
public void testAddButtonIntoParent() {
doInit();
final ButtonItem buttonItem = mock(ButtonItem.class);
tested.addButton(buttonItem);
verify(toolboxView, times(1)).add(eq(buttonGridItem));
verify(buttonGridItem, times(1)).add(buttonItem);
}
use of com.ait.lienzo.client.core.shape.toolbox.items.ButtonItem in project kie-wb-common by kiegroup.
the class AbstractActionsToolboxView method addButton.
ButtonItem addButton(final Glyph glyph, final String title) {
final ButtonItem button = toolboxFactory.buttons().button(renderGlyph(glyph, getGlyphSize())).decorate(createDecorator()).tooltip(tooltip.createItem(title)).onMouseEnter(event -> onMouseEnter()).onMouseExit(event -> onMouseExit());
addButton(button);
return button;
}
use of com.ait.lienzo.client.core.shape.toolbox.items.ButtonItem in project kie-wb-common by kiegroup.
the class AbstractActionsToolboxView method initButtons.
@SuppressWarnings("unchecked")
private void initButtons(final ActionsToolbox<ActionsToolboxView<?>> toolbox) {
for (ToolboxAction toolboxAction : toolbox) {
final ButtonItem button = addButton(toolbox.getGlyph(toolboxAction), toolbox.getTitle(toolboxAction));
button.onClick(event -> {
onButtonClick(toolbox, toolboxAction, button, event);
});
if (toolboxAction instanceof IsToolboxActionDraggable) {
button.onMoveStart(event -> {
onButtonMoveStart(toolbox, (IsToolboxActionDraggable) toolboxAction, button, event);
});
}
}
}
Aggregations