Search in sources :

Example 1 with PaletteButton

use of io.jmix.dashboardsui.component.impl.PaletteButton in project jmix by jmix-framework.

the class PaletteComponentsFactoryImpl method createCssLayoutButton.

@Override
public PaletteButton createCssLayoutButton() {
    PaletteButton button = createCommonButton();
    button.setCaption(messages.getMessage(PaletteComponentsFactoryImpl.class, "cssLayout"));
    button.setIconFromSet(DashboardIcon.CSS_LAYOUT_ICON);
    button.setLayout(metadata.create(CssLayout.class));
    button.getLayout().setId(null);
    button.setDescription(messages.getMessage(PaletteComponentsFactoryImpl.class, "cssLayout"));
    return button;
}
Also used : PaletteButton(io.jmix.dashboardsui.component.impl.PaletteButton)

Example 2 with PaletteButton

use of io.jmix.dashboardsui.component.impl.PaletteButton in project jmix by jmix-framework.

the class PaletteComponentsFactoryImpl method createGridLayoutButton.

public PaletteButton createGridLayoutButton() {
    PaletteButton button = createCommonButton();
    button.setCaption(messages.getMessage(PaletteComponentsFactoryImpl.class, "gridLayout"));
    button.setIconFromSet(DashboardIcon.GRID_LAYOUT_ICON);
    button.setLayout(metadata.create(GridLayout.class));
    button.getLayout().setId(null);
    button.setDescription(messages.getMessage(PaletteComponentsFactoryImpl.class, "gridLayout"));
    return button;
}
Also used : PaletteButton(io.jmix.dashboardsui.component.impl.PaletteButton)

Example 3 with PaletteButton

use of io.jmix.dashboardsui.component.impl.PaletteButton in project jmix by jmix-framework.

the class PaletteComponentsFactoryImpl method createWidgetButton.

public PaletteButton createWidgetButton(Widget widget) {
    WidgetLayout layout = metadata.create(WidgetLayout.class);
    layout.setWidget(widget);
    PaletteButton button = createCommonButton();
    button.setCaption(widgetRepository.getLocalizedWidgetName(widget));
    button.setDescription(widget.getDescription());
    button.setLayout(layout);
    button.getLayout().setId(null);
    return button;
}
Also used : PaletteButton(io.jmix.dashboardsui.component.impl.PaletteButton)

Example 4 with PaletteButton

use of io.jmix.dashboardsui.component.impl.PaletteButton in project jmix by jmix-framework.

the class PaletteComponentsFactoryImpl method createHorizontalLayoutButton.

public PaletteButton createHorizontalLayoutButton() {
    PaletteButton button = createCommonButton();
    button.setCaption(messages.getMessage(PaletteComponentsFactoryImpl.class, "horizontalLayout"));
    button.setIconFromSet(DashboardIcon.HORIZONTAL_LAYOUT_ICON);
    button.setLayout(metadata.create(HorizontalLayout.class));
    button.getLayout().setId(null);
    button.setDescription(messages.getMessage(PaletteComponentsFactoryImpl.class, "horizontalLayout"));
    return button;
}
Also used : PaletteButton(io.jmix.dashboardsui.component.impl.PaletteButton)

Example 5 with PaletteButton

use of io.jmix.dashboardsui.component.impl.PaletteButton in project jmix by jmix-framework.

the class PaletteComponentsFactoryImpl method createWidgetTemplateButton.

public PaletteButton createWidgetTemplateButton(WidgetTemplate wt) {
    Widget widget = converter.widgetFromJson(wt.getWidgetModel());
    widget.setName(widgetUtils.getWidgetType(widget.getFragmentId()));
    WidgetTemplateLayout layout = metadata.create(WidgetTemplateLayout.class);
    layout.setWidget(widget);
    PaletteButton button = createCommonButton();
    button.setCaption(String.format("%s (%s)", wt.getName(), widgetRepository.getLocalizedWidgetName(widget)));
    button.setLayout(layout);
    button.getLayout().setId(null);
    return button;
}
Also used : PaletteButton(io.jmix.dashboardsui.component.impl.PaletteButton) Widget(io.jmix.dashboards.model.Widget)

Aggregations

PaletteButton (io.jmix.dashboardsui.component.impl.PaletteButton)10 Widget (io.jmix.dashboards.model.Widget)2 DragSourceExtension (com.vaadin.ui.dnd.DragSourceExtension)1 WidgetTemplate (io.jmix.dashboards.entity.WidgetTemplate)1 JmixButton (io.jmix.ui.widget.JmixButton)1