use of io.jmix.core.Messages in project jmix by jmix-framework.
the class ShowLinkAction method actionPerform.
@Override
public void actionPerform(io.jmix.ui.component.Component component) {
if (ds == null) {
return;
}
Messages messages = AppBeans.get(Messages.class);
Dialogs dialogs = AppUI.getCurrent().getDialogs();
dialogs.createMessageDialog().withCaption(messages.getMessage("table.showLinkAction")).withMessage(compileLink(ds)).show();
}
use of io.jmix.core.Messages in project jmix by jmix-framework.
the class WebSearchPickerField method initComponent.
@Override
protected void initComponent(JmixPickerField<V> component) {
Messages messages = applicationContext.getBean(Messages.class);
setInputPrompt(messages.getMessage("searchPickerField.inputPrompt"));
getComponent().setItemCaptionGenerator(this::generateItemCaption);
getComponent().setFilterHandler(this::executeSearch);
}
use of io.jmix.core.Messages in project jmix by jmix-framework.
the class WebSearchPickerField method createSearchNotifications.
protected SearchNotifications createSearchNotifications() {
return new SearchNotifications() {
@Override
public void notFoundSuggestions(String filterString) {
Messages messages = applicationContext.getBean(Messages.class);
String message = messages.formatMessage("", "searchSelect.notFound", filterString);
// TODO: legacy-ui
// App.getInstance().getWindowManager().showNotification(message, defaultNotificationType);
}
@Override
public void needMinSearchStringLength(String filterString, int minSearchStringLength) {
Messages messages = applicationContext.getBean(Messages.class);
String message = messages.formatMessage("", "searchSelect.minimumLengthOfFilter", minSearchStringLength);
// TODO: legacy-ui
// App.getInstance().getWindowManager().showNotification(message, defaultNotificationType);
}
};
}
use of io.jmix.core.Messages in project jmix by jmix-framework.
the class RoleAssignmentScreen method initScreenActions.
protected void initScreenActions() {
Window window = getWindow();
Messages messages = getApplicationContext().getBean(Messages.class);
Icons icons = getApplicationContext().getBean(Icons.class);
String commitShortcut = getApplicationContext().getBean(UiScreenProperties.class).getCommitShortcut();
Action commitAndCloseAction = new BaseAction(Window.COMMIT_ACTION_ID).withCaption(messages.getMessage("actions.Ok")).withIcon(icons.get(JmixIcon.EDITOR_OK)).withPrimary(true).withShortcut(commitShortcut).withHandler(actionPerformedEvent -> {
// noinspection ConstantConditions
getScreenData().getDataContext().commit();
close(new StandardCloseAction(Window.COMMIT_ACTION_ID));
});
window.addAction(commitAndCloseAction);
Action closeAction = new BaseAction(Window.CLOSE_ACTION_ID).withIcon(icons.get(JmixIcon.EDITOR_CANCEL)).withCaption(messages.getMessage("actions.Cancel")).withHandler(actionPerformedEvent -> {
if (dataContext.hasChanges()) {
screenValidation.showUnsavedChangesDialog(this, WINDOW_CLOSE_ACTION).onDiscard(() -> close(WINDOW_CLOSE_ACTION));
} else {
close(WINDOW_CLOSE_ACTION);
}
});
window.addAction(closeAction);
}
use of io.jmix.core.Messages 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);
}
Aggregations