Search in sources :

Example 1 with IsToolboxActionDraggable

use of org.kie.workbench.common.stunner.core.client.components.toolbox.actions.IsToolboxActionDraggable 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);
            });
        }
    }
}
Also used : ToolboxAction(org.kie.workbench.common.stunner.core.client.components.toolbox.actions.ToolboxAction) ButtonItem(com.ait.lienzo.client.core.shape.toolbox.items.ButtonItem) IsToolboxActionDraggable(org.kie.workbench.common.stunner.core.client.components.toolbox.actions.IsToolboxActionDraggable)

Aggregations

ButtonItem (com.ait.lienzo.client.core.shape.toolbox.items.ButtonItem)1 IsToolboxActionDraggable (org.kie.workbench.common.stunner.core.client.components.toolbox.actions.IsToolboxActionDraggable)1 ToolboxAction (org.kie.workbench.common.stunner.core.client.components.toolbox.actions.ToolboxAction)1