Search in sources :

Example 1 with Actions

use of io.jmix.ui.Actions in project jmix by jmix-framework.

the class AbstractComponentLoader method loadDeclarativeActionDefault.

protected Action loadDeclarativeActionDefault(ActionsHolder actionsHolder, Element element) {
    String id = loadActionId(element);
    String trackSelection = element.attributeValue("trackSelection");
    boolean shouldTrackSelection = Boolean.parseBoolean(trackSelection);
    Action targetAction;
    if (shouldTrackSelection) {
        Actions actions = getActions();
        targetAction = actions.create(ItemTrackingAction.ID, id);
        loadActionConstraint(targetAction, element);
    } else {
        targetAction = new BaseAction(id);
    }
    initAction(element, targetAction);
    return targetAction;
}
Also used : Action(io.jmix.ui.action.Action) ItemTrackingAction(io.jmix.ui.action.ItemTrackingAction) BaseAction(io.jmix.ui.action.BaseAction) Actions(io.jmix.ui.Actions) BaseAction(io.jmix.ui.action.BaseAction)

Example 2 with Actions

use of io.jmix.ui.Actions in project jmix by jmix-framework.

the class AbstractComponentLoader method loadDeclarativeActionByType.

@Nullable
protected Action loadDeclarativeActionByType(ActionsHolder actionsHolder, Element element) {
    String id = loadActionId(element);
    String actionTypeId = element.attributeValue("type");
    if (StringUtils.isNotEmpty(actionTypeId)) {
        Actions actions = applicationContext.getBean(Actions.class);
        Action instance = actions.create(actionTypeId, id);
        initAction(element, instance);
        loadActionConstraint(instance, element);
        return instance;
    }
    return null;
}
Also used : Action(io.jmix.ui.action.Action) ItemTrackingAction(io.jmix.ui.action.ItemTrackingAction) BaseAction(io.jmix.ui.action.BaseAction) Actions(io.jmix.ui.Actions) Nullable(javax.annotation.Nullable)

Example 3 with Actions

use of io.jmix.ui.Actions in project jmix by jmix-framework.

the class SelectValueDialog method createEntityPicker.

protected Field createEntityPicker(MetaClass metaClass) {
    EntityPicker<Object> entityPicker = uiComponents.create(EntityPicker.NAME);
    entityPicker.setMetaClass(metaClass);
    Actions actions = getApplicationContext().getBean(Actions.class);
    BaseAction lookupAction = (BaseAction) actions.create(EntityLookupAction.ID);
    lookupAction.addActionPerformedListener(this::lookupActionPerformed);
    entityPicker.addAction(lookupAction);
    return entityPicker;
}
Also used : Actions(io.jmix.ui.Actions) BaseAction(io.jmix.ui.action.BaseAction)

Example 4 with Actions

use of io.jmix.ui.Actions in project jmix by jmix-framework.

the class AbstractValuePickerLoader method addDefaultActions.

protected void addDefaultActions() {
    Actions actions = getActions();
    resultComponent.addAction(actions.create(ValueClearAction.ID));
}
Also used : Actions(io.jmix.ui.Actions)

Example 5 with Actions

use of io.jmix.ui.Actions in project jmix by jmix-framework.

the class PopupButtonLoader method loadDeclarativeAction.

@Override
protected Action loadDeclarativeAction(ActionsHolder actionsHolder, Element element) {
    String type = element.attributeValue("type");
    if (StringUtils.isNotEmpty(type)) {
        Actions actions = applicationContext.getBean(Actions.class);
        String id = loadActionId(element);
        Action action = actions.create(type, id);
        initAction(element, action);
        return action;
    }
    return loadDeclarativeActionDefault(actionsHolder, element);
}
Also used : Action(io.jmix.ui.action.Action) Actions(io.jmix.ui.Actions)

Aggregations

Actions (io.jmix.ui.Actions)8 Action (io.jmix.ui.action.Action)4 BaseAction (io.jmix.ui.action.BaseAction)4 ItemTrackingAction (io.jmix.ui.action.ItemTrackingAction)3 Nullable (javax.annotation.Nullable)1