use of io.jmix.ui.AppUI in project jmix by jmix-framework.
the class AbstractDataGrid method setUiTestId.
protected void setUiTestId(DataGridItems<E> items) {
AppUI ui = AppUI.getCurrent();
if (ui != null && ui.isTestMode() && getComponent().getJTestId() == null) {
String testId = uiTestIdsSupport.getInferredTestId(items, "DataGrid");
if (testId != null) {
getComponent().setJTestId(testId);
componentComposition.setJTestId(testId + "_composition");
}
}
}
use of io.jmix.ui.AppUI in project jmix by jmix-framework.
the class ExceptionHandlers method handle.
/**
* Delegates exception handling to registered handlers.
*
* @param event error event generated by Vaadin
*/
public void handle(ErrorEvent event) {
for (ExceptionHandler handler : handlers) {
if (handler.handle(event, app)) {
return;
}
}
AppUI ui = AppUI.getCurrent();
if (ui != null) {
for (UiExceptionHandler handler : genericHandlers) {
if (handler.handle(event.getThrowable(), ui)) {
return;
}
}
}
defaultHandler.handle(event, app);
}
use of io.jmix.ui.AppUI in project jmix by jmix-framework.
the class JmixWindow method close.
@Override
public void close() {
AppUI ui = (AppUI) getUI();
if (!ui.isAccessibleForUser(this)) {
LoggerFactory.getLogger(JmixWindow.class).debug("Ignore close window attempt because Window is inaccessible for user");
return;
}
PreCloseEvent event = new PreCloseEvent(this);
fireEvent(event);
if (!event.isPreventClose()) {
super.close();
}
}
use of io.jmix.ui.AppUI in project jmix by jmix-framework.
the class TreeImpl method setUiTestId.
protected void setUiTestId(TreeItems<E> items) {
AppUI ui = AppUI.getCurrent();
if (ui != null && ui.isTestMode() && getComponent().getJTestId() == null) {
String testId = uiTestIdsSupport.getInferredTestId(items, "Tree");
if (testId != null) {
getComponent().setJTestId(testId);
componentComposition.setJTestId(testId + "_composition");
}
}
}
use of io.jmix.ui.AppUI in project jmix by jmix-framework.
the class TimerImpl method attachTimerToUi.
protected void attachTimerToUi(Component ownerComponent) {
AppUI appUI = (AppUI) ownerComponent.getUI();
appUI.addTimer(timerImpl);
log.trace("Timer '{}' registered in UI ", getId());
}
Aggregations