public abstract class App
extends java.lang.Object
VaadinSession
.
getInstance()
static method to obtain the reference to the current App instance.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
APP_THEME_COOKIE_PREFIX |
protected org.springframework.context.ApplicationContext |
applicationContext |
protected BackgroundTaskManager |
backgroundTaskManager |
static java.lang.String |
COOKIE_LOCALE |
static java.lang.String |
COOKIE_LOGIN |
static java.lang.String |
COOKIE_PASSWORD |
static java.lang.String |
COOKIE_REMEMBER_ME |
protected AppCookies |
cookies |
protected io.jmix.core.CoreProperties |
coreProperties |
static java.lang.String |
DEFAULT_THEME_NAME |
protected ExceptionHandlers |
exceptionHandlers |
protected LinkHandler |
linkHandler |
protected io.jmix.core.MessageTools |
messageTools |
protected javax.servlet.ServletContext |
servletContext |
protected UiSettingsCache |
settingsCache |
protected ThemeConstants |
themeConstants |
protected ThemeConstantsRepository |
themeConstantsRepository |
protected UiProperties |
uiProperties |
protected UiThemeProperties |
uiThemeProperties |
static java.lang.String |
USER_SESSION_ATTR |
protected WindowConfig |
windowConfig |
Constructor and Description |
---|
App() |
Modifier and Type | Method and Description |
---|---|
void |
addBackgroundTask(java.util.concurrent.Future task) |
void |
addCookie(java.lang.String name,
java.lang.String value) |
void |
addCookie(java.lang.String name,
java.lang.String value,
int maxAge) |
protected void |
applyTheme(java.lang.String appWindowTheme) |
void |
cleanupBackgroundTasks() |
protected void |
clearSettingsCache() |
void |
closeWindowsInternal(boolean fireEvent)
Removes all windows from all UIs and fires
CloseWindowsInternalEvent application event. |
void |
createTopLevelWindow() |
void |
createTopLevelWindow(AppUI ui)
Called on each browser tab initialization.
|
protected void |
forceLogout() |
void |
forceRefreshUIsExceptCurrent() |
java.util.List<AppUI> |
getAppUIs() |
protected java.lang.String |
getContextPathName() |
int |
getCookieMaxAge(java.lang.String name) |
java.lang.String |
getCookieValue(java.lang.String name) |
ExceptionHandlers |
getExceptionHandlers() |
static App |
getInstance() |
java.util.Locale |
getLocale() |
ThemeConstants |
getThemeConstants() |
ScreensImpl |
getWindowManager()
Deprecated.
Get screens API from
AppUI instead. |
protected void |
init(java.util.Locale requestLocale)
Called when the first UI of the session is initialized.
|
protected void |
initExceptionHandlers(boolean isConnected)
Initializes exception handlers immediately after login and logout.
|
static boolean |
isBound() |
protected ThemeConstants |
loadTheme() |
abstract void |
loginOnStart() |
OperationResult |
logout()
Try to perform logout.
|
void |
navigateTo(java.lang.String topLevelWindowId)
Deprecated.
|
void |
onHeartbeat()
Called from heartbeat request.
|
protected void |
performForceLogout() |
protected void |
performStandardLogout(AppUI ui) |
void |
removeAllWindows()
Removes all windows from all UIs.
|
protected void |
removeAllWindows(java.util.List<AppUI> uis)
Removes all windows in the given
uis . |
void |
removeBackgroundTask(java.util.concurrent.Future task) |
void |
removeCookie(java.lang.String name) |
protected java.util.Locale |
resolveLocale(java.util.Locale requestLocale) |
protected abstract java.lang.String |
routeTopLevelWindowId() |
void |
setLocale(java.util.Locale locale) |
void |
setUserAppTheme(java.lang.String themeName) |
public static final java.lang.String DEFAULT_THEME_NAME
public static final java.lang.String USER_SESSION_ATTR
public static final java.lang.String APP_THEME_COOKIE_PREFIX
public static final java.lang.String COOKIE_LOCALE
public static final java.lang.String COOKIE_REMEMBER_ME
public static final java.lang.String COOKIE_LOGIN
public static final java.lang.String COOKIE_PASSWORD
protected ExceptionHandlers exceptionHandlers
@Autowired protected io.jmix.core.CoreProperties coreProperties
@Autowired(required=false) protected javax.servlet.ServletContext servletContext
@Autowired protected WindowConfig windowConfig
@Autowired protected ThemeConstantsRepository themeConstantsRepository
@Autowired protected io.jmix.core.MessageTools messageTools
@Autowired(required=false) protected UiSettingsCache settingsCache
@Autowired protected org.springframework.context.ApplicationContext applicationContext
@Autowired protected UiProperties uiProperties
@Autowired protected UiThemeProperties uiThemeProperties
protected AppCookies cookies
protected LinkHandler linkHandler
protected BackgroundTaskManager backgroundTaskManager
protected ThemeConstants themeConstants
protected ThemeConstants loadTheme()
protected void applyTheme(java.lang.String appWindowTheme)
protected void initExceptionHandlers(boolean isConnected)
isConnected
- true after login, false after logoutpublic ThemeConstants getThemeConstants()
public java.util.List<AppUI> getAppUIs()
public abstract void loginOnStart()
protected void init(java.util.Locale requestLocale)
protected java.util.Locale resolveLocale(@Nullable java.util.Locale requestLocale)
public void createTopLevelWindow(AppUI ui)
protected abstract java.lang.String routeTopLevelWindowId()
public void createTopLevelWindow()
@Deprecated public void navigateTo(java.lang.String topLevelWindowId)
Screens.create(Class, OpenMode)
with OpenMode.ROOT
topLevelWindowId
- target top level window idpublic void onHeartbeat()
public static App getInstance()
java.lang.IllegalStateException
- if no application instance is bound to the current VaadinSession
public static boolean isBound()
App
instance is currently bound and can be safely obtained by getInstance()
@Deprecated @Nullable public ScreensImpl getWindowManager()
AppUI
instead.public ExceptionHandlers getExceptionHandlers()
@Nullable public java.lang.String getCookieValue(java.lang.String name)
public int getCookieMaxAge(java.lang.String name)
public void addCookie(java.lang.String name, java.lang.String value, int maxAge)
public void addCookie(java.lang.String name, java.lang.String value)
public void removeCookie(java.lang.String name)
public java.util.Locale getLocale()
public void setLocale(java.util.Locale locale)
public void setUserAppTheme(java.lang.String themeName)
public void addBackgroundTask(java.util.concurrent.Future task)
public void removeBackgroundTask(java.util.concurrent.Future task)
public void cleanupBackgroundTasks()
public void removeAllWindows()
protected void removeAllWindows(java.util.List<AppUI> uis)
uis
.uis
- AppUI
instancespublic OperationResult logout()
protected void performStandardLogout(AppUI ui)
protected void performForceLogout()
protected void forceLogout()
public void closeWindowsInternal(boolean fireEvent)
CloseWindowsInternalEvent
application event.fireEvent
- fire event or not@Nullable protected java.lang.String getContextPathName()
protected void clearSettingsCache()
public void forceRefreshUIsExceptCurrent()