use of io.jmix.ui.action.BaseAction in project jmix by jmix-framework.
the class StandardLookup method initActions.
protected void initActions(@SuppressWarnings("unused") InitEvent event) {
Messages messages = getApplicationContext().getBean(Messages.class);
Icons icons = getApplicationContext().getBean(Icons.class);
BaseAction selectAction = (BaseAction) getWindowActionOptional(LOOKUP_SELECT_ACTION_ID).orElseGet(() -> addDefaultSelectAction(messages, icons));
selectAction.addActionPerformedListener(this::select);
BaseAction cancelAction = (BaseAction) getWindowActionOptional(LOOKUP_CANCEL_ACTION_ID).orElseGet(() -> addDefaultCancelAction(messages, icons));
cancelAction.addActionPerformedListener(this::cancel);
}
use of io.jmix.ui.action.BaseAction in project jmix by jmix-framework.
the class StandardLookup method addDefaultCancelAction.
protected Action addDefaultCancelAction(Messages messages, Icons icons) {
Action action = new BaseAction(LOOKUP_CANCEL_ACTION_ID).withCaption(messages.getMessage("actions.Cancel")).withIcon(icons.get(JmixIcon.LOOKUP_CANCEL));
getWindow().addAction(action);
return action;
}
use of io.jmix.ui.action.BaseAction in project jmix by jmix-framework.
the class AbstractScreenFacet method subscribeOnAction.
protected void subscribeOnAction(Frame owner) {
Action action = ComponentsHelper.findAction(owner, actionId);
if (!(action instanceof BaseAction)) {
throw new GuiDevelopmentException(String.format("Unable to find Screen target action with id '%s'", actionId), owner.getId());
}
((BaseAction) action).addActionPerformedListener(e -> show());
}
use of io.jmix.ui.action.BaseAction in project jmix by jmix-framework.
the class RegionEditor method initEntityTree.
protected void initEntityTree() {
entityTree.setSelectionMode(Tree.SelectionMode.MULTI);
BaseAction doubleClickAction = new BaseAction("doubleClick").withHandler(event -> addProperty());
doubleClickAction.addEnabledRule(this::isUpdatePermitted);
entityTree.setItemClickAction(doubleClickAction);
ListAction addPropertyAction = actions.create(ItemTrackingAction.class, "addItemAction").withHandler(event -> addProperty());
addPropertyAction.addEnabledRule(this::isUpdatePermitted);
entityTree.addAction(addPropertyAction);
addItem.setAction(addPropertyAction);
}
use of io.jmix.ui.action.BaseAction in project jmix by jmix-framework.
the class MessageDialogFacetImpl method subscribeOnAction.
protected void subscribeOnAction(Frame owner) {
Action action = ComponentsHelper.findAction(owner, actionId);
if (!(action instanceof BaseAction)) {
throw new GuiDevelopmentException(String.format("Unable to find Dialog target button with id '%s'", actionId), owner.getId());
}
((BaseAction) action).addActionPerformedListener(e -> show());
}
Aggregations