use of io.jmix.ui.AppUI in project jmix by jmix-framework.
the class TablePresentationsLayout method createActionButton.
protected JmixButton createActionButton(Action action) {
JmixButton actionBtn = new JmixButton();
actionBtn.setWidth("100%");
actionBtn.setPrimaryStyleName(CONTEXT_MENU_BUTTON_STYLENAME);
setPopupButtonAction(actionBtn, action);
AppUI ui = AppUI.getCurrent();
if (ui != null) {
if (ui.isTestMode()) {
actionBtn.setJTestId(action.getId());
}
if (ui.isPerformanceTestMode()) {
String debugId = getDebugId();
if (debugId != null) {
TestIdManager testIdManager = ui.getTestIdManager();
actionBtn.setId(testIdManager.getTestId(debugId + "_" + action.getId()));
}
}
}
return actionBtn;
}
use of io.jmix.ui.AppUI in project jmix by jmix-framework.
the class UserIndicatorImpl method createUserIndicator.
protected HasValue<UserDetails> createUserIndicator(UserDetails user) {
Label<UserDetails> userNameLabel = uiComponents.create(Label.of(UserDetails.class));
userNameLabel.setStyleName("jmix-user-select-label");
userNameLabel.setFormatter(this::generateUserCaption);
userNameLabel.setValue(user);
AppUI ui = AppUI.getCurrent();
if (ui != null && ui.isTestMode()) {
userNameLabel.unwrap(Component.class).setJTestId("currentUserLabel");
}
return userNameLabel;
}
use of io.jmix.ui.AppUI in project jmix by jmix-framework.
the class WebFieldGroup method setDebugId.
@Override
public void setDebugId(String id) {
super.setDebugId(id);
AppUI ui = AppUI.getCurrent();
if (ui != null && id != null) {
for (final FieldConfig fc : fields.values()) {
com.vaadin.ui.Component composition = ComponentsHelper.getComposition(fc.getComponentNN());
composition.setId(ui.getTestIdManager().getTestId(id + "_" + fc.getId()));
}
}
}
use of io.jmix.ui.AppUI in project jmix by jmix-framework.
the class WebFilterHelper method openFolderEditWindow.
@Override
public void openFolderEditWindow(boolean isAppFolder, AbstractSearchFolder folder, TablePresentations presentations, Runnable commitHandler) {
FolderEditWindow window = AppFolderEditWindow.create(isAppFolder, false, folder, presentations, commitHandler);
AppUI appUI = AppUI.getCurrent();
if (appUI != null) {
appUI.addWindow(window);
}
}
use of io.jmix.ui.AppUI in project jmix by jmix-framework.
the class CompositeComponent method enableEventListeners.
@Internal
protected void enableEventListeners() {
List<ApplicationListener> listeners = getUiEventListeners();
if (CollectionUtils.isNotEmpty(listeners)) {
AppUI ui = AppUI.getCurrent();
UiEventsMulticaster multicaster = ui.getUiEventsMulticaster();
for (ApplicationListener listener : uiEventListeners) {
multicaster.addApplicationListener(listener);
}
}
}
Aggregations