Package org.teamapps.ux.session
Klasse SessionContext
java.lang.Object
org.teamapps.ux.session.SessionContext
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibungfinal ExecutionDecoratorStackDecorators around all executions inside this SessionContext.final Event<UiSessionActivityState>final Event<org.teamapps.dto.UiSessionClosingReason>final Event<KeyboardEvent>final Event<NavigationStateChangeEvent> -
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungSessionContext(UiSession uiSession, CloseableExecutor sessionExecutor, ClientInfo clientInfo, SessionConfiguration sessionConfiguration, jakarta.servlet.http.HttpSession httpSession, UxServerContext serverContext, org.teamapps.icons.SessionIconProvider iconProvider, String navigationPathPrefix, jakarta.ws.rs.ext.ParamConverterProvider navigationParamConverterProvider) -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidaddClientToken(String token) voidaddExecutionDecorator(ExecutionDecorator decorator, boolean outer) Adds a decorator that gets invoked whenever a Thread is bound to this SessionContext.voidaddIconBundle(IconBundle iconBundle) voidaddRootComponent(String containerElementSelector, Component component) addRootPanel(String containerElementSelector) voidaddRootPanel(String containerElementSelector, Component rootPanel) voidchangeNavigationHistoryState(String pathWithQueryParams, boolean fireEvent, NavigationHistoryOperation operation) voidvoidRemoves all decorators.static WindowcreateDefaultSessionMessageWindow(String title, String message, String refreshButtonCaption, String cancelButtonCaption) createFileLink(File file) createResourceLink(Resource resource) createResourceLink(Resource resource, String uniqueIdentifier) static SessionContextcurrent()static SessionContextvoiddestroy()voidvoidvoidvoidvoidgetBinaryResource(int resourceId) getClientObject(String clientObjectId) jakarta.servlet.http.HttpSessionorg.teamapps.icons.Icon<?,?> org.teamapps.icons.SessionIconProvidergetLocalized(String key, Object... parameters) getName()jakarta.ws.rs.ext.ParamConverterProvidergetState()getTemplate(String id) com.ibm.icu.util.ULocalegetUploadedFileByUuid(String uuid) voidvoidhandleStaticEvent(org.teamapps.dto.UiEvent event) booleanisActive()booleanvoidnavigateBack(int steps) voidnavigateForward(int steps) Event<org.teamapps.dto.UiSessionClosingReason>Same asonDestroyedbut mockable.voidpushNavigationHistoryState(String pathWithQueryParams, boolean fireEvent) Pushes a new entry (URL) to the browser's navigation history without reloading the site.voidqueueCommand(org.teamapps.dto.UiCommand<?> command) <RESULT> voidqueueCommand(org.teamapps.dto.UiCommand<RESULT> command, Consumer<RESULT> resultCallback) voidregisterBackgroundImage(String id, String image, String blurredImage) voidregisterClientObject(ClientObject clientObject) registerTemplate(String id, Template template) voidregisterTemplates(Map<String, Template> templates) voidremoveClientToken(String token) voidremoveExecutionDecorator(ExecutionDecorator decorator) Removes the specified execution decorator.voidreplaceNavigationHistoryState(String pathWithQueryParams, boolean fireEvent) Same aspushNavigationHistoryState(String, boolean), except that it replaces the current browser history entry (URL).resolveIcon(org.teamapps.icons.Icon icon) voidroute()runWithContext(Runnable runnable) runWithContext(Runnable runnable, boolean forceEnqueue) <R> CompletableFuture<R>runWithContext(Callable<R> runnable) <R> CompletableFuture<R>runWithContext(Callable<R> callable, boolean forceEnqueue) voidsetBackgroundColor(org.teamapps.common.format.Color color, int animationDuration) voidsetBackgroundImage(String id, int animationDuration) voidsetConfiguration(SessionConfiguration config) <I extends org.teamapps.icons.Icon<I,S>, S>
voidsetDefaultStyleForIconClass(Class<I> iconClass, S defaultStyle) voidsetFavicon(String url) voidsetFavicon(org.teamapps.icons.Icon<?, ?> icon) voidsetFavicon(Resource resource) voidsetGlobalKeyEventsEnabled(boolean unmodified, boolean modifiedWithAltKey, boolean modifiedWithCtrlKey, boolean modifiedWithMetaKey, boolean includeRepeats, boolean keyDown, boolean keyUp) voidvoidvoidsetRoutingMode(RoutingMode routingMode) voidsetSessionErrorWindow(Window sessionErrorWindow) voidsetSessionExpiredWindow(Window sessionExpiredWindow) voidsetSessionTerminatedWindow(Window sessionTerminatedWindow) voidvoidsetTranslationProvider(TranslationProvider translationProvider) voidsetULocale(com.ibm.icu.util.ULocale locale) voidshowDefaultBackground(int animationDuration) voidshowNotification(org.teamapps.icons.Icon icon, String caption) voidshowNotification(org.teamapps.icons.Icon icon, String caption, String description) voidshowNotification(org.teamapps.icons.Icon icon, String caption, String description, boolean dismissable, int displayTimeInMillis, boolean showProgress) voidshowNotification(Notification notification, NotificationPosition position) voidshowNotification(Notification notification, NotificationPosition position, EntranceAnimation entranceAnimation, ExitAnimation exitAnimation) voidvoidvoidshowWindow(Window window, int animationDuration) toString()voidunregisterClientObject(ClientObject clientObject) void
-
Felddetails
-
onGlobalKeyEventOccurred
-
onActivityStateChanged
-
onDestroyed
-
executionDecorators
Decorators around all executions inside this SessionContext. These will be invoked when the Thread is already bound to the SessionContext, so SessionContext.current() will return this instance.
-
-
Konstruktordetails
-
SessionContext
public SessionContext(UiSession uiSession, CloseableExecutor sessionExecutor, ClientInfo clientInfo, SessionConfiguration sessionConfiguration, jakarta.servlet.http.HttpSession httpSession, UxServerContext serverContext, org.teamapps.icons.SessionIconProvider iconProvider, String navigationPathPrefix, jakarta.ws.rs.ext.ParamConverterProvider navigationParamConverterProvider)
-
-
Methodendetails
-
getCurrentLocation
-
getBaseRouter
-
getRouter
-
current
-
currentOrNull
-
setTranslationProvider
-
getTranslationProvider
-
addIconBundle
-
getIcon
-
getULocale
public com.ibm.icu.util.ULocale getULocale() -
getLocale
-
setLocale
-
setULocale
public void setULocale(com.ibm.icu.util.ULocale locale) -
getLocalized
-
isActive
public boolean isActive() -
getState
-
isDestroyed
public boolean isDestroyed() -
destroy
public void destroy() -
queueCommand
public <RESULT> void queueCommand(org.teamapps.dto.UiCommand<RESULT> command, Consumer<RESULT> resultCallback) -
queueCommand
public void queueCommand(org.teamapps.dto.UiCommand<?> command) -
getClientInfo
-
getHttpSession
public jakarta.servlet.http.HttpSession getHttpSession() -
getClientBackPressureInfo
-
createFileLink
-
createResourceLink
-
getBinaryResource
-
getUploadedFileByUuid
-
registerTemplate
-
registerTemplates
-
getTemplate
-
runWithContext
-
runWithContext
- Parameter:
runnable-forceEnqueue- No synchronous execution! Enqueue this at the end of this SessionContext's work queue.
-
runWithContext
-
runWithContext
-
addExecutionDecorator
Adds a decorator that gets invoked whenever a Thread is bound to this SessionContext. The decorator will be called right after the Thread is bound to this SessionContext, so SessionContext.current() will return this instance.- Parameter:
decorator-outer- Whether to add this decorator as outermost or innermost execution wrapper.
-
removeExecutionDecorator
Removes the specified execution decorator. -
clearExecutionDecorators
public void clearExecutionDecorators()Removes all decorators. -
getConfiguration
-
setConfiguration
-
showPopupAtCurrentMousePosition
-
showPopup
-
getTimeZone
-
getIconProvider
public org.teamapps.icons.SessionIconProvider getIconProvider() -
setDefaultStyleForIconClass
public <I extends org.teamapps.icons.Icon<I,S>, void setDefaultStyleForIconClassS> (Class<I> iconClass, S defaultStyle) -
resolveIcon
-
registerClientObject
-
unregisterClientObject
-
getClientObject
-
createResourceLink
-
showWindow
-
download
-
download
-
download
-
download
-
registerBackgroundImage
-
setBackgroundImage
-
showDefaultBackground
public void showDefaultBackground(int animationDuration) -
setBackgroundColor
public void setBackgroundColor(org.teamapps.common.format.Color color, int animationDuration) -
exitFullScreen
public void exitFullScreen() -
addRootComponent
-
addRootPanel
-
addRootPanel
-
addRootPanel
-
addClientToken
-
removeClientToken
-
clearClientTokens
public void clearClientTokens() -
showNotification
public void showNotification(Notification notification, NotificationPosition position, EntranceAnimation entranceAnimation, ExitAnimation exitAnimation) -
showNotification
-
showNotification
-
showNotification
-
showNotification
-
setSessionExpiredWindow
-
setSessionErrorWindow
-
setSessionTerminatedWindow
-
createDefaultSessionMessageWindow
-
requestWakeLock
-
goToUrl
-
setFavicon
public void setFavicon(org.teamapps.icons.Icon<?, ?> icon) -
setFavicon
-
setFavicon
-
setTitle
-
setGlobalKeyEventsEnabled
public void setGlobalKeyEventsEnabled(boolean unmodified, boolean modifiedWithAltKey, boolean modifiedWithCtrlKey, boolean modifiedWithMetaKey, boolean includeRepeats, boolean keyDown, boolean keyUp) -
getSessionId
-
handleStaticEvent
public void handleStaticEvent(org.teamapps.dto.UiEvent event) -
route
public void route() -
getAsUiSessionListenerInternal
-
setName
-
getName
-
getRoutingParamConverterProvider
public jakarta.ws.rs.ext.ParamConverterProvider getRoutingParamConverterProvider() -
getUiSessionStats
-
toString
-
getRoutingMode
-
setRoutingMode
-
onDestroyed
Same asonDestroyedbut mockable.
-