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