Search in sources :

Example 11 with JmixButton

use of io.jmix.ui.widget.JmixButton in project jmix by jmix-framework.

the class PaletteComponentsFactoryImpl method createCommonButton.

protected PaletteButton createCommonButton() {
    PaletteButton button = factory.create(PaletteButton.class);
    button.setWidth("100%");
    button.setHeight("50px");
    button.setStyleName(DashboardStyleConstants.DASHBOARD_BUTTON);
    DragSourceExtension<JmixButton> dragSourceExtension = new DragSourceExtension<>(button.unwrap(JmixButton.class));
    dragSourceExtension.setEffectAllowed(EffectAllowed.COPY);
    dragSourceExtension.addDragStartListener(e -> dragSourceExtension.setDragData(button.getLayout()));
    dragSourceExtension.addDragEndListener(e -> dragSourceExtension.setDragData(null));
    return button;
}
Also used : PaletteButton(io.jmix.dashboardsui.component.impl.PaletteButton) JmixButton(io.jmix.ui.widget.JmixButton) DragSourceExtension(com.vaadin.ui.dnd.DragSourceExtension)

Aggregations

JmixButton (io.jmix.ui.widget.JmixButton)11 Action (io.jmix.ui.action.Action)5 TestIdManager (io.jmix.ui.sys.TestIdManager)3 ShortcutAction (com.vaadin.event.ShortcutAction)2 CssLayout (com.vaadin.ui.CssLayout)1 DragSourceExtension (com.vaadin.ui.dnd.DragSourceExtension)1 PaletteButton (io.jmix.dashboardsui.component.impl.PaletteButton)1 AppUI (io.jmix.ui.AppUI)1 BaseAction (io.jmix.ui.action.BaseAction)1 ThemeConstants (io.jmix.ui.theme.ThemeConstants)1 UUID (java.util.UUID)1