Search in sources :

Example 1 with AbstractAction

use of io.jmix.ui.action.AbstractAction in project jmix by jmix-framework.

the class ActionsProviderImpl method createEditAction.

private AbstractAction createEditAction(WidgetLayout widgetLayout) {
    AbstractAction editAction = new AbstractAction("edit") {

        @Override
        public void actionPerform(io.jmix.ui.component.Component component) {
            uiEventPublisher.publishEvent(new WidgetEditEvent(widgetLayout));
        }
    };
    editAction.setIcon(DashboardIcon.GEAR_ICON.source());
    editAction.setCaption(messages.getMessage("edit"));
    return editAction;
}
Also used : Component(org.springframework.stereotype.Component) AbstractAction(io.jmix.ui.action.AbstractAction)

Example 2 with AbstractAction

use of io.jmix.ui.action.AbstractAction in project jmix by jmix-framework.

the class ActionsProviderImpl method createWeightAction.

private AbstractAction createWeightAction(DashboardLayout layout) {
    AbstractAction weightAction = new AbstractAction("weight") {

        @Override
        public void actionPerform(io.jmix.ui.component.Component component) {
            uiEventPublisher.publishEvent(new WeightChangedEvent(layout));
        }
    };
    weightAction.setCaption(messages.getMessage("weight"));
    weightAction.setIcon(ARROWS.source());
    return weightAction;
}
Also used : Component(org.springframework.stereotype.Component) AbstractAction(io.jmix.ui.action.AbstractAction)

Example 3 with AbstractAction

use of io.jmix.ui.action.AbstractAction in project jmix by jmix-framework.

the class ActionsProviderImpl method createExpandAction.

private AbstractAction createExpandAction(DashboardLayout layout) {
    AbstractAction expandAction = new AbstractAction("expand") {

        @Override
        public void actionPerform(io.jmix.ui.component.Component component) {
            uiEventPublisher.publishEvent(new ExpandChangedEvent(layout));
        }
    };
    expandAction.setIcon(EXPAND.source());
    expandAction.setCaption(messages.getMessage("expand"));
    return expandAction;
}
Also used : Component(org.springframework.stereotype.Component) AbstractAction(io.jmix.ui.action.AbstractAction)

Example 4 with AbstractAction

use of io.jmix.ui.action.AbstractAction in project jmix by jmix-framework.

the class AddConditionWindow method init.

@Override
public void init(Map<String, Object> params) {
    super.init(params);
    ThemeConstants theme = themeConstantsManager.getConstants();
    getDialogOptions().setHeight(theme.get("cuba.gui.addFilterCondition.dialog.height")).setWidth(theme.get("cuba.gui.addFilterCondition.dialog.width")).setResizable(true);
    conditionDescriptorsDs.refresh(params);
    expandTreeRoots();
    tree.setItemClickAction(new AbstractAction("select") {

        @Override
        public void actionPerform(Component component) {
            select();
        }
    });
    FilterHelper filterHelper = AppBeans.get(FilterHelper.class);
    filterHelper.addTextChangeListener(treeFilter, this::_search);
    filterHelper.addShortcutListener(treeFilter, new FilterHelper.ShortcutListener("search", new KeyCombination(KeyCombination.Key.ENTER)) {

        @Override
        public void handleShortcutPressed() {
            search();
        }
    });
}
Also used : ThemeConstants(io.jmix.ui.theme.ThemeConstants) FilterHelper(com.haulmont.cuba.gui.components.filter.FilterHelper) AbstractAction(io.jmix.ui.action.AbstractAction)

Example 5 with AbstractAction

use of io.jmix.ui.action.AbstractAction in project jmix by jmix-framework.

the class FilterSelectWindow method init.

@SuppressWarnings("unchecked")
@Override
public void init(Map<String, Object> params) {
    ThemeConstants theme = themeConstantsManager.getConstants();
    getDialogOptions().setHeight(theme.get("cuba.gui.filterSelect.dialog.height")).setWidth(theme.get("cuba.gui.filterSelect.dialog.width")).setResizable(true);
    filterEntitiesTable.addGeneratedColumn("name", entity -> {
        Label<String> label = componentsFactory.createComponent(Label.class);
        String caption;
        if (Strings.isNullOrEmpty(entity.getCode())) {
            caption = AppBeans.get(MetadataTools.class).getInstanceName(entity);
        } else {
            caption = messages.getMessage(entity.getCode());
        }
        label.setValue(caption);
        captionsMap.put(entity, caption);
        return label;
    });
    filterEntities = (List<FilterEntity>) params.get("filterEntities");
    fillDatasource(null);
    filterEntitiesTable.setItemClickAction(new AbstractAction("selectByDblClk") {

        @Override
        public void actionPerform(Component component) {
            select();
        }

        @Override
        public String getCaption() {
            return messages.getMessage("filter.filterSelect.select");
        }
    });
    FilterHelper filterHelper = AppBeans.get(FilterHelper.class);
    filterHelper.addTextChangeListener(nameFilterField, new FilterHelper.TextChangeListener() {

        @Override
        public void textChanged(String text) {
            fillDatasource(text);
        }
    });
}
Also used : ThemeConstants(io.jmix.ui.theme.ThemeConstants) FilterEntity(com.haulmont.cuba.security.entity.FilterEntity) Component(io.jmix.ui.component.Component) FilterHelper(com.haulmont.cuba.gui.components.filter.FilterHelper) AbstractAction(io.jmix.ui.action.AbstractAction)

Aggregations

AbstractAction (io.jmix.ui.action.AbstractAction)19 Component (org.springframework.stereotype.Component)7 Component (io.jmix.ui.component.Component)5 ArrayList (java.util.ArrayList)3 ListComponent (com.haulmont.cuba.gui.components.ListComponent)2 FilterHelper (com.haulmont.cuba.gui.components.filter.FilterHelper)2 Dialogs (io.jmix.ui.Dialogs)2 Action (io.jmix.ui.action.Action)2 DialogAction (io.jmix.ui.action.DialogAction)2 ThemeConstants (io.jmix.ui.theme.ThemeConstants)2 List (java.util.List)2 AppBeans (com.haulmont.cuba.core.global.AppBeans)1 WindowManager (com.haulmont.cuba.gui.WindowManager)1 OpenType (com.haulmont.cuba.gui.WindowManager.OpenType)1 WindowManagerProvider (com.haulmont.cuba.gui.WindowManagerProvider)1 ComponentsFactory (com.haulmont.cuba.gui.xml.layout.ComponentsFactory)1 FilterEntity (com.haulmont.cuba.security.entity.FilterEntity)1 CreateWidgetTemplateEvent (io.jmix.dashboardsui.dashboard.event.CreateWidgetTemplateEvent)1 SendingMessage (io.jmix.email.entity.SendingMessage)1 AbstractPrintFormAction (io.jmix.reportsui.action.AbstractPrintFormAction)1