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;
}
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;
}
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;
}
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));
}
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);
}
Aggregations