Class ClientSessionGyro
- All Implemented Interfaces:
IPrivateStorage, IClientSessionGyro, IFocusEngineProvider, IMessageBox, IRuntimeImageCache, IToaster, IUIFloatHost, IVirtualizedReferenceLookup, IGyroFocusEngineOwner, ILocaleString
- Author:
- Christopher Mindus
Nested Class Summary
Nested classes/interfaces inherited from interface IMessageBox
IMessageBox.IconNested classes/interfaces inherited from interface IToaster
IToaster.Direction, IToaster.Position, IToaster.TypeField Summary
Fields inherited from interface IClientSessionGyro
STORAGE_NAMEFields inherited from interface IMessageBox
ICON_ERROR, ICON_INFORMATION, ICON_MAP, ICON_NONE, ICON_QUESTION, ICON_WARNINGFields inherited from interface IToaster
TOASTER_DEFAULT_DURATION, TOASTER_MAX_DURATION, TOASTER_MIN_DURATIONMethod Summary
Modifier and TypeMethodDescriptionbooleanAdds a dispose listener for the client session.Adds a new focus entry at the current location for this client session.booleanAdds a screen orientation listener for the client session.booleanaddScreenSizeListener(IScreenSizeListener listener) Adds a screen size listener for the client session.booleanaddUISchemeListener(IUISchemeListener listener) Adds a theme scheme listener for this client session.booleanAsks the client to show IIZI's Web Analytics consent prompt now, even when a decision is already stored.voidClears the entire cache.booleancloseFloat(UIFloat virtualFloat) Closes a Float that is open in this client session: its removal is requested, as the client session does for every panel it removes, and the cache of the panels shown is reset, so thatgetVirtualizedPanels()andgetTopmostPanel()no longer answer it.booleanTells the client that the credentials the user typed in a form container were accepted, so that the password manager of the Browser offers to save them (CC-LOGIN-L10A2-APP-CORE, T1-070): the call of this client's environment,EnvProps.credentialsAccepted(UIContainer).booleandispose()Disposes of the Gyro instance so the client session ends.voidenterClientLock(boolean isFromClient) Method called whenever the client lock state is enabled.voidReleases client lock state if the client is not in busy state.Gets the user's Web Analytics consent as the client last reported it: the value of theEnvProps.PN_ANALYTICS_CONSENTboolean of this client's environment, set by a Browser client when its connection is established and again whenever the user decides.Get the web server file provider for the client session.Gets the Gyro for the application session.getClientContextMenuReference(UIContextMenu contextMenu) Gets the reference to use for a context menu.getClientContextMenuReference(UIContextMenu contextMenu, boolean fullPropReference) Gets the reference to use for a context menu.Gets the client end point instance.Gets the client sessions information.booleangetClientStorage(DeviceParameter... params) Retrieves values from the client's storage for the current app (CC-CLIENT-STORAGE-V5): seeIClientSessionGyro.getClientStorage(DeviceParameter...).Gets the client timer engine.Gets the Client Worker.Returns the current focus in the UI.getEntryParameter(String name) Gets a parameter of the URL the client entered the application with: one of the "other" parameters of itsClientParams, the ones the server does not read itself (CC-LOGIN-L10A1-SERVER-GAPS, SignIn flow D-16).Gets the current environment properties for Selector's or Value's.Gets the file upload API of this client session: the server side of the upload channel the client created under$env.Gets the flashlight client-specific instance, currently only supported for operations on iiziRun clients for Android and iOS.getFocusEngine(IFocusComp comp) Returns the focus engine instance for the specified component.Gets the history request instance for the client session.Gets an image definition from the image container for the client session.Retrieves the IPropMgrInfoProvider for the client session.Gets the language code to use for the client session, or if not defined, the application session language code.Gets the local info class instance.getLocaleKString(String id, boolean system) Gets the KString of a particular ID from the app's text tables that are flagged to also handle LocaleString's depending on the flag.Returns an instance of the geolocation service.getMatchingPanels(VirtualSpace virtualSpace) Gets the panels that matches a VirtualSpace for this client session.intReturns the animation that will be used for next panel that replaces another panel.Gets the Float that is open in this client session: the first Float among the panels shown, topmost first.Get the open native settings interface for the client-specific instance, supported only on iiziRun clients running iiziRun-based clients for Android and iOS.Gets the locale'd texts instance for the sessions language and text tables.Gets the concurrent hash map used to store the private data.Gets the Push Notification (PN) API of this client session, created on first use (P4-04).Gets the RuntimeApp for the Gyro instance.intGets the current screen height.Gets the current screen orientation.Gets the current screen size.intGets the current screen width.static ClientSessionGyroGets the runtime application instance for the current thread in a client session.static ClientSessionGyrogetSessionInstance(SessionInfo sessionInfo) Gets the runtime application instance for the current thread in a client session.Gets the current top-most panel.Returns the UI focus engine instance for the specified component.intGets the appearance modes the application allows a client to show: the App page's "Appearance" choice (ModuleApp.getUIModes()), as read when this session was created and told to the client in$schemeModes(CC-THEME-CHOOSER-UI: the theme chooser component hides itself when one mode only is allowed).Gets the theme scheme this client shows: the family and the resolved mode, light or dark, as the client last reported it inuiSchemeof its environment.Gets the theme scheme this client was told to show, the mode as chosen (auto included), as the client last reported it inuiSchemeChoiceof its environment.Gets the cached and sorted array of panels that is currently displayed.GProp<?> getVirtualizedPropFromReference(String reference) Attempts to look up a virtualized property from a reference by searching this instance.Gets the verdict on the web engine this client runs on: whether it still receives security updates, and since when it does not.booleaninstallFont(String fontFamily) Installs the font families as specified by the font family.booleaninstallFonts(List<FontFiles> fontList) Installs the font face as specified by theFontFilesinstance for the Client Session.booleanChecks if the client session Gyro is disposed of.booleanChecks if screen orientation locking is supported or not.voidmessageBox(IMessageBoxReply reply, IMessageBox.Icon icon, KString title, KString message, KString... buttons) Displays a message box with the specified title and message.voidonFocusChanged(IFocusComp newComp, IFocusComp oldComp, IGProp<?> trigger, boolean isRemoteInduced, boolean isInternal) Called when focus changes.voidonFocusVetoChange(FocusEvent event) Called to perform veto.openFloat(UIFloat floatPanel, UIPanelBase owner, UIComp anchor) Opens a Float in this client session: the Float is virtualized and added to the panels shown, under the lock of the client session and in the way a panel is added for the VS focus (seevirtualizeAndGetFocus): a removed but not yet destroyed instance of it is destroyed first, and the cache of the panels shown is reset.booleanRemoves a dispose listener for the client session.booleanremoveImage(String name) Removes an image with a name from the client session.booleanRemoves a screen orientation listener for the client session.booleanremoveScreenSizeListener(IScreenSizeListener listener) Removes a screen size listener for the client session.booleanremoveUISchemeListener(IUISchemeListener listener) Removes a theme scheme listener for this client session.Requests a UI lock state.voidRestarts the remote client.booleansaveClientStorage(DeviceParameter... params) Saves values in the client's storage for the current app (CC-CLIENT-STORAGE-V5): seeIClientSessionGyro.saveClientStorage(DeviceParameter...).voidsendStat(String event, DeviceParameter... params) Sends statistics event to the analytics engine on the client to log the event.booleansetAnalyticsConsent(boolean granted) Sets the user's Web Analytics consent directly, when the application asked the user itself (the App page's consent choice "the application asks").voidsetApplication(RuntimeApp runtimeApp) Sets the runtime application.voidSets the UI busy state and optionally updates the message and/or progress.booleansetImage(RuntimeImageDefinition image) Adds the image definition to the image container for the client session.setLocale(LocaleInfo locale) Changes or sets the LocaleInfo for the environment.intsetNextPanelAnimation(int nextAnimation) Sets the animation that will be used for next panel that replaces another panel.voidsetPseudoActionFocusToVS(IUIFocusComp focusComp, IGProp<?> trigger) Called when a "pseudo UI action" is executed, making sure its VS counterpart has the current focus.voidsetReady()Sets the UI to "ready", i.e.booleanSets the UI to "ready", i.e.booleansetScreenOrientation(ScreenOrientation orientation) Locks the screen orientation.booleansetUIFamily(UISchemes.Family family) Sets the family of this client's theme scheme, keeping its mode.booleansetUIMode(UISchemes.Mode mode) Sets the mode of this client's theme scheme, keeping its family.booleansetUIScheme(UISchemes.Family family, UISchemes.Mode mode) Sets the theme scheme of this client: the family, the mode, or both, sent as the$schemeclient property thatiz/uischeme.jsapplies, stores on the device (a Browser's storage, iiziRun's settings) and reports back.booleanShows the user IIZI's notice that the web engine of the device no longer receives security updates, now.booleanUpdates the focus to the VS from the current focused UI component.voidtoast(KString message, IToaster.Position position, IToaster.Direction direction, IToaster.Type type, int duration) Displays a simple, unobstructive and ephemeral text message to the user.booleantriggerRemoteCloseWindow(boolean ignoreCallbackListener) Triggers closing of the window on the client that was opened with triggerRemoteOpenWindow.booleantriggerRemoteOpenWindow(String url, String target, WindowOptions options, IWindowCloseListener windowListener) Triggers opening of a browser window on the client.booleanUnlocks the screen orientation.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface IClientSessionGyro
getDeviceParameters, isUILocked, saveDeviceParameters, setNextPanelAnimation, triggerRemoteCloseWindow, triggerRemoteOpenWindow, triggerRemoteOpenWindowMethods inherited from interface ILocaleString
getLocaleKStringMethods inherited from interface IMessageBox
messageBox, messageBox, messageBoxMethods inherited from interface IPrivateStorage
getPrivateData, getPrivateData, setPrivateData
Method Details
getSessionInstance
Gets the runtime application instance for the current thread in a client session.- Returns:
- The RuntimeApp instance when called from a thread of the client session,
nullotherwise.
getSessionInstance
Gets the runtime application instance for the current thread in a client session.- Parameters:
sessionInfo- A session information instance, or null for none.- Returns:
- The RuntimeApp instance when called from a thread of the client session,
nullotherwise.
setApplication
Sets the runtime application. This method is not intended to be called by user code, it is used by the framework.- Parameters:
runtimeApp- The runtime application.- Throws:
IllegalStateException- If runtime application has been set.
addDisposeListener
Adds a dispose listener for the client session. Calling this method multiple times with the same listener will have no effect (but to return false).- Specified by:
addDisposeListenerin interfaceIClientSessionGyro- Parameters:
listener- The listener to add.- Returns:
- true if the listener was added, false otherwise.
- Throws:
NullPointerException- If the listener isnull.
removeDisposeListener
Removes a dispose listener for the client session.- Specified by:
removeDisposeListenerin interfaceIClientSessionGyro- Parameters:
listener- The listener to remove.- Returns:
- true if listener is successfully removed, false otherwise.
dispose
public boolean dispose()Disposes of the Gyro instance so the client session ends.- Specified by:
disposein interfaceIClientSessionGyro- Returns:
- true for dispose success, false if already disposed of.
isDisposed
public boolean isDisposed()Checks if the client session Gyro is disposed of.- Specified by:
isDisposedin interfaceIClientSessionGyro- Returns:
- true if disposed, false otherwise.
getPrivateStorageMap
Gets the concurrent hash map used to store the private data.- Specified by:
getPrivateStorageMapin interfaceIPrivateStorage- Returns:
- The private storage map.
getClientEndPoint
Gets the client end point instance.getEntryParameter
Gets a parameter of the URL the client entered the application with: one of the "other" parameters of itsClientParams, the ones the server does not read itself (CC-LOGIN-L10A1-SERVER-GAPS, SignIn flow D-16).- Specified by:
getEntryParameterin interfaceIClientSessionGyro- Parameters:
name- The parameter name, e.g. "prt".- Returns:
- The value, or null when the entry URL carries none with that name, and when the client has not connected.
getAppSessionGyro
Gets the Gyro for the application session.- Specified by:
getAppSessionGyroin interfaceIClientSessionGyro
getClientSessionInfo
Gets the client sessions information.- Specified by:
getClientSessionInfoin interfaceIClientSessionGyro- Returns:
- The session information instance.
getRuntimeApp
Gets the RuntimeApp for the Gyro instance.- Returns:
- The runtime app for the client session.
getVirtualizedPropFromReference
Attempts to look up a virtualized property from a reference by searching this instance.- Specified by:
getVirtualizedPropFromReferencein interfaceIClientSessionGyro- Specified by:
getVirtualizedPropFromReferencein interfaceIVirtualizedReferenceLookup- Parameters:
reference- The reference to look-up.- Returns:
- The virtualized instance of the property, null if not found.
getKStringInfoProvider
Retrieves the IPropMgrInfoProvider for the client session.- Specified by:
getKStringInfoProviderin interfaceIClientSessionGyro- Specified by:
getKStringInfoProviderin interfaceILocaleString- Returns:
- The KString information provider instance, or null if not possible. The instance also supports SVG caching and Custom CSS.
getOpenNativeSettings
Get the open native settings interface for the client-specific instance, supported only on iiziRun clients running iiziRun-based clients for Android and iOS.- Specified by:
getOpenNativeSettingsin interfaceIClientSessionGyro- Returns:
- The open native settings interface. In order to test support for open native settings operations, use
IOpenNativeSettings.isSupported(). - Throws:
NotFoundException- In case the open native settings instance is not found, typically if the client session is under creation, or it has been disposed of.
getFlashlight
Gets the flashlight client-specific instance, currently only supported for operations on iiziRun clients for Android and iOS.- Specified by:
getFlashlightin interfaceIClientSessionGyro- Returns:
- The flashlight instance. In order to test support of flashlight operations, use
IFlashlight.isSupported(). - Throws:
NotFoundException- In case the flashlight instance is not found, typically if the client session is under creation, or it has been disposed of.
getEnvironment
Gets the current environment properties for Selector's or Value's.This is NOT the same instance as the one available from the
AppSessionGyro.getEnvironment().- Specified by:
getEnvironmentin interfaceIClientSessionGyro- Returns:
- The current environment properties for selectors, null if client hasn't sent them yet.
getLanguageCode
Gets the language code to use for the client session, or if not defined, the application session language code.- Specified by:
getLanguageCodein interfaceIClientSessionGyro- Returns:
- The language code, or null for default.
getUIFocusEngine
Returns the UI focus engine instance for the specified component.- Specified by:
getUIFocusEnginein interfaceIClientSessionGyro- Returns:
- The UI focus engine instance.
getFocusEngine
Returns the focus engine instance for the specified component.- Specified by:
getFocusEnginein interfaceIFocusEngineProvider- Parameters:
comp- The component requesting the focus engine.- Returns:
- The focus engine instance, or null if not found.
getClientTimerEngine
Gets the client timer engine. All timer tasks as disposed of automatically when the client session exits.- Specified by:
getClientTimerEnginein interfaceIClientSessionGyro- Returns:
- The client session implementation of the timeout engine.
getClientWorker
Gets the Client Worker.- Specified by:
getClientWorkerin interfaceIClientSessionGyro- Returns:
- The Client worker instance.
getPushNotificationAPI
Gets the Push Notification (PN) API of this client session, created on first use (P4-04). Its callbacks run ongetClientWorker(); its client-bound calls go down the channel the client created under$env(P4-06) and fail withno_devicein a session without one.- Specified by:
getPushNotificationAPIin interfaceIClientSessionGyro- Returns:
- The API, never null in a server client session.
getFileUploadAPI
Gets the file upload API of this client session: the server side of the upload channel the client created under$env. A client's request to upload files is reserved or refused there, and its reservations are observed there.- Specified by:
getFileUploadAPIin interfaceIClientSessionGyro- Returns:
- The API, never null in a server client session; its
IClientUploadAPI.isEnabled()is false when the client has no upload channel or the server no upload service.
getPrettyLocaledTexts
Gets the locale'd texts instance for the sessions language and text tables.- Specified by:
getPrettyLocaledTextsin interfaceIClientSessionGyro- Returns:
- The instance used to create locale'd strings for e.g. duration and distances.
getAppSessionFileProvider
Get the web server file provider for the client session.- Returns:
- The web server file provider.
- Throws:
IOException- If the directory for the client session files failed to be created.IllegalStateException- If the client session is disposed of.
getNextPanelAnimation
public int getNextPanelAnimation()Returns the animation that will be used for next panel that replaces another panel.This animation only applies to full-page panels.
This value is reset to
as soon as a panel replacement has been made.IUIPanelAnimation.ANIMATION_DEFAULT- Specified by:
getNextPanelAnimationin interfaceIClientSessionGyro- Returns:
- The composite animation value, or
for none.IUIPanelAnimation.ANIMATION_DEFAULT
setNextPanelAnimation
public int setNextPanelAnimation(int nextAnimation) Sets the animation that will be used for next panel that replaces another panel.This animation only applies to full-page panels.
This value is reset to
as soon as a panel replacement has been made.IUIPanelAnimation.ANIMATION_DEFAULT- Specified by:
setNextPanelAnimationin interfaceIClientSessionGyro- Returns:
- The old "next panel animation" composite animation value, or
for none.IUIPanelAnimation.ANIMATION_DEFAULT
getVirtualizedPanels
Gets the cached and sorted array of panels that is currently displayed.The index 0 is the topmost panel and the higher the index, the more overlapped the panel is. The highest index is the top-level main panel covering the screen.
Do not modify this array!
- Specified by:
getVirtualizedPanelsin interfaceIClientSessionGyro- Returns:
- The virtualized panels.
getTopmostPanel
Gets the current top-most panel.- Specified by:
getTopmostPanelin interfaceIClientSessionGyro- Returns:
- The panel, null if none has been created.
getMatchingPanels
Gets the panels that matches a VirtualSpace for this client session. The VirtualSpace can be virtualized or not, and the client session environment properties are used to determine the panels in question (i.e. depending on their selectors).This method is quite CPU intensive and should NOT be done too often. The return value is however cached during the focus handler mappings from VirtualSpace to the UI, so only one such call is done.
The ordering is significant and can be a mix of primary and secondary panels, however the matching panel is the virtualized instance if one is present, otherwise it is the non-virtualized instance.
Note: The result from this method should not be cached because the matching panels may very well change during a client session due to e.g. a change in client capabilities or alike (that affects the result of the selectors used).
- Specified by:
getMatchingPanelsin interfaceIClientSessionGyro- Parameters:
virtualSpace- The VirtualSpace to look-up the panels for.- Returns:
- A cloned cached array of the matching panels.
The array of matching panels, can be a mix of virtualized and non-virtualized panels!
requestUILock
Requests a UI lock state. The object returned can be used to set a message below the lock spinner. It can also be used to set a progress indicator, also below the spinner. A progress indicator can also be handled using the lock object.Note: You MUST call the objects
{link @ILockState#release()}method to release the lock state.- Specified by:
requestUILockin interfaceIClientSessionGyro- Returns:
- The lock state object.
- Throws:
IllegalStateException- If the client session is disposed of.
setBusy
Sets the UI busy state and optionally updates the message and/or progress.This method is intended to be used with advanced UI programming where a message is used in conjunction with a progress.
If this functionality is not required, it is recommended to let the AppSessionGyro handle the busy state.
- Specified by:
setBusyin interfaceIClientSessionGyro- Parameters:
msg- Optional message, null for none.delay- Delay of lock spinner: -2 for default (1.5 second), -1 disabled, 0=no delay, >0 wait time in milliseconds (1-20000, i.e. 20 seconds).progress- Progress value, -1 for none, otherwise a value between 0 and 100.- Throws:
IllegalArgumentException- If progress value is not -1 or 0 to 100, or delay is smaller than -2 or larger than 20000.
setReady
public void setReady()Sets the UI to "ready", i.e. clears busy state.Note: the state is not set to ready immediately, merely the busy state. The UI is triggered to be synchronized with the VirtualSpace in the Client Worker thread, and a change of panel may be the result.
This method is intended to be used with advanced UI programming where a message is used in conjunction with a progress.
If this functionality is not required, it is recommended to let the AppSessionGyro handle the busy state.
- Specified by:
setReadyin interfaceIClientSessionGyro
setReady
Sets the UI to "ready", i.e. clears busy state.Note: the state is not set to ready immediately, merely the busy state. The UI is triggered to be synchronized with the VirtualSpace in the Client Worker thread, and a change of panel may be the result.
Specify a runnable instance if you wish to be notified when the panel is unlocked. This runnable will be called at a later stage from the Client Worker thread.
The runnable will be be called if the busy state is turned on or the client has been locked.
This method is intended to be used with advanced UI programming where a message is used in conjunction with a progress.
If this functionality is not required, it is recommended to let the AppSessionGyro handle the busy state.
- Specified by:
setReadyin interfaceIClientSessionGyro- Parameters:
runnable- The runnable to be notified, null for none.- Returns:
- true if the runnable will be called (if present), false if it will not be called.
enterClientLock
public void enterClientLock(boolean isFromClient) Method called whenever the client lock state is enabled.- Specified by:
enterClientLockin interfaceIClientSessionGyro- Parameters:
isFromClient- Flag indicating the state change is induced from client side. If this flag is false, the lock state
exitClientLock
public void exitClientLock()Releases client lock state if the client is not in busy state. The lock state will be released when the VS has been synchronized at a later stage, but very quickly.- Specified by:
exitClientLockin interfaceIClientSessionGyro
getHistoryRequest
Gets the history request instance for the client session.- Specified by:
getHistoryRequestin interfaceIClientSessionGyro- Returns:
- This client session's instance for history requests, never changes during the session's lifetime.
addHistoryEntry
Adds a new focus entry at the current location for this client session. The VirtualSpace and UI location is recorded to the previous and forward locations in the entry.The entry is added at the current index and will clear all forward operations at that point to the end, i.e.
is called before adding the entry and moving the index forward by one (1).IAppHistory.clearForwardEntries()Once added, the history entry forward and backward information can be set or adjusted.
- Specified by:
addHistoryEntryin interfaceIClientSessionGyro- Returns:
- The newly added history entry, null if history operations are currently in progress (i.e. a forward or backward history operation is running).
synchronizeCurrentFocusWithVS
public boolean synchronizeCurrentFocusWithVS()Updates the focus to the VS from the current focused UI component. This may be needed to synchronize the VS focus for a particular UI session to make sure it is synchronized.- Specified by:
synchronizeCurrentFocusWithVSin interfaceIClientSessionGyro- Returns:
- true for success, false if nothing was done.
setPseudoActionFocusToVS
Called when a "pseudo UI action" is executed, making sure its VS counterpart has the current focus. This "pseudo action" can be e.g. a MLItemProp that has a context menu, as well as an direct action such as a UIButton.This method is not intended to be called but is used internally by the framework.
- Specified by:
setPseudoActionFocusToVSin interfaceIClientSessionGyro- Parameters:
focusComp- The "pseudo action" focus component.trigger- The trigger component, null for none.
onFocusChanged
public void onFocusChanged(IFocusComp newComp, IFocusComp oldComp, IGProp<?> trigger, boolean isRemoteInduced, boolean isInternal) Called when focus changes.- Specified by:
onFocusChangedin interfaceIGyroFocusEngineOwner- Parameters:
newComp- New focus component.oldComp- Old focus component.trigger- The trigger property, null for none.isRemoteInduced- If the event is remote induced.isInternal- The internal flag as specified in thesetFocusmethod to the focus engine.
onFocusVetoChange
Called to perform veto.- Specified by:
onFocusVetoChangein interfaceIGyroFocusEngineOwner- Parameters:
event- The focus event, InternalFocusEvent perhaps.- Throws:
FocusVetoException- When the focus is veto'ed.
getCurrentFocus
Returns the current focus in the UI. If no particular component is in focus, the panel that last has focus or the topmost panel is returned.- Specified by:
getCurrentFocusin interfaceIClientSessionGyro- Returns:
- The component in focus, or null if not a single panel has yet been created.
installFonts
Installs the font face as specified by theFontFilesinstance for the Client Session. Once installed, the font family can be used.- Parameters:
fontList- The list of font files to install.- Returns:
- true for success, false if the remote part doesn't support installation, e.g. in a preview browser.
installFont
Installs the font families as specified by the font family.- Parameters:
fontFamily- The font family or families.- Returns:
- true for success, false if the remote part doesn't support installation, e.g. in a preview browser.
getClientContextMenuReference
Gets the reference to use for a context menu.- Parameters:
contextMenu- The context menu.- Returns:
- The reference to use, empty string for none (never null).
getClientContextMenuReference
Gets the reference to use for a context menu.- Specified by:
getClientContextMenuReferencein interfaceIClientSessionGyro- Parameters:
contextMenu- The context menu.fullPropReference- Flag indicating a full property reference string should be returned, false for short (used internally by the server).- Returns:
- The reference to use, empty string for none (never null).
- Throws:
IllegalArgumentException- If the context menu is not a stand-alone context menu but a child of a panel component.
getOpenFloat
Gets the Float that is open in this client session: the first Float among the panels shown, topmost first.- Specified by:
getOpenFloatin interfaceIUIFloatHost- Returns:
- The virtualized Float, or null if none is open.
openFloat
Opens a Float in this client session: the Float is virtualized and added to the panels shown, under the lock of the client session and in the way a panel is added for the VS focus (seevirtualizeAndGetFocus): a removed but not yet destroyed instance of it is destroyed first, and the cache of the panels shown is reset. Of that path, four steps are repeated here and nothing else - not the themes, not the replace loop, not the animation. The initial focus is then set as for every newly displayed panel, after the lock: the field the current VS focus maps to inside the Float, else its first focusable field, else the Float itself (IIZI-SRV-NEW-PANEL-NOBODY-FOCUSED). The themes are not set because that flips the themes of the whole client when the panel's do not fit the ones shown, and a Float is shown over a surface that must stay as it is: a Float takes the themes of the surface it is opened over, and a WARNING is logged when its own do not fit them.The owner is shown beneath the Float (ruling FL-3 of 2026-09-27). A client session that does not show the owner presents it first, the way the VS focus presents a panel - the panels it replaces are removed, its animation and OnUIConnect run - and adds the Float above it; the anchor, mapped into this session, is then found. That is one navigation: one history entry is added for the owner and the Float together, and it carries the Float, so that a history forward opens the Float again over the owner. An owner that cannot be presented here - it does not participate for this client session, has no VirtualSpace or no component - is logged as a warning, and the Float opens over what is shown, centred.
A Float must have a VirtualSpace, its own or its owner's: no panel is virtualized without one, and an open Float is an attached panel of it. A Float that has neither is refused. So is a Float that does not participate for this client session, because the VS synchronization forces a change of panels on every run while a panel shown does not participate.
The owner and the anchor are passed as the caller knows them, virtualized in any client session or not at all, and are mapped into this one. The anchor is set as the
UIFloat.PN_ANCHORproperty of the virtualized Float before it is added, so that it travels with the panel, as the path the client resolves it with: from the client root, with a leading slash. An anchor whose panel is not shown in this client session is dropped with a warning, and the Float is centred.This method is called from any thread: the worker of this client session, the application session worker, or the worker of another client session when a Float is opened in every client session. The lock is the one the VS focus takes to add or remove panels, taken in the same order as there - before the lock of the property tree, which the property operations take themselves - and the change reaches the client through its own worker, as every change of the client tree does.
- Specified by:
openFloatin interfaceIUIFloatHost- Parameters:
floatPanel- The Float to open, non-virtualized.owner- The owner panel the Float is opened for, virtualized or not.anchor- The component the Float is anchored to, virtualized or not, null to centre the Float.- Returns:
- The virtualized Float that was added, never null.
- Throws:
PropException- If the Float has no VirtualSpace, does not participate for this client session, or cannot be virtualized or added.
closeFloat
Closes a Float that is open in this client session: its removal is requested, as the client session does for every panel it removes, and the cache of the panels shown is reset, so thatgetVirtualizedPanels()andgetTopmostPanel()no longer answer it. The client closes it, with or without its animation, and disposes of it.The focus then returns to the field that had it when the Float opened, else to the owner panel (ruling FL-6 of 2026-09-27,
restoreFloatFocus(ClientSessionGyro.FloatOpening)) - when the Float still is the topmost panel: a dialog opened above it has the focus and keeps it.- Specified by:
closeFloatin interfaceIUIFloatHost- Parameters:
virtualFloat- The virtualized Float, as returned bygetOpenFloat().- Returns:
- true if the removal was requested, false if it already had been, or the Float is not a virtualized Float of this client session, which is logged.
getLocale
Gets the local info class instance.- Specified by:
getLocalein interfaceILocaleString- Returns:
- The locale info class instance when the client environment has been set, otherwise the default client locale info instance specified for the server.
setLocale
Changes or sets the LocaleInfo for the environment.- Specified by:
setLocalein interfaceIClientSessionGyro- Parameters:
locale- localeInfo The locale information to use.- Returns:
- The old LocaleInfo, or null if not set.
getLocaleKString
Gets the KString of a particular ID from the app's text tables that are flagged to also handle LocaleString's depending on the flag.- Specified by:
getLocaleKStringin interfaceILocaleString- Parameters:
id- The text ID.system- Flagged to handle system strings for LocaleString's.- Returns:
- The KString for the text ID in current locale, null if not found.
messageBox
public void messageBox(IMessageBoxReply reply, IMessageBox.Icon icon, KString title, KString message, KString... buttons) Displays a message box with the specified title and message.The callback is done in the client worker thread, except for
IMessageBoxReply.SESSION_CLOSED, which is told in the thread disposing of the client session.- Specified by:
messageBoxin interfaceIMessageBox- Parameters:
reply- The reply callback that is called when the user chooses a button or session is closed,nullfor none.icon- Icon to display, see the{link Icon}enumeration.title- The title string, must be non-null.message- The message to display, must be non-null.buttons- The strings for the buttons to display, if none, just anOKbutton is displayed. This array of buttons defined the index value returned by this method.- Throws:
NullPointerException- Ificonormessageis null, or if any of the elements inbuttonsarray is null.
toast
public void toast(KString message, IToaster.Position position, IToaster.Direction direction, IToaster.Type type, int duration) Displays a simple, unobstructive and ephemeral text message to the user.- Specified by:
toastin interfaceIToaster- Parameters:
message- The message to display, cannot be null.position- Position of toast, default value is Position.BOTTOM_CENTER if null.direction- Direction of the toast animation, default Direction.UP if null.type- Type of message style: message, warning, error of fatal, default is message if null.duration- Duration of the toast message being shown in ms. Valid values are in the interval [0, 10000], 0 for a sticky toast.
getScreenWidth
public int getScreenWidth()Gets the current screen width.- Specified by:
getScreenWidthin interfaceIClientSessionGyro- Returns:
- The current screen width, or zero if not initialized.
getScreenHeight
public int getScreenHeight()Gets the current screen height.- Specified by:
getScreenHeightin interfaceIClientSessionGyro- Returns:
- The current screen height, or zero if not initialized.
getScreenSize
Gets the current screen size.- Specified by:
getScreenSizein interfaceIClientSessionGyro- Returns:
- The current screen size, zero width and/or height if not initialized.
addScreenSizeListener
Adds a screen size listener for the client session. Calling this method multiple times with the same listener will have no effect (but to return false).- Specified by:
addScreenSizeListenerin interfaceIClientSessionGyro- Parameters:
listener- The listener to add.- Returns:
- true if the listener was added, false otherwise.
- Throws:
NullPointerException- If the listener isnull.
removeScreenSizeListener
Removes a screen size listener for the client session.- Specified by:
removeScreenSizeListenerin interfaceIClientSessionGyro- Parameters:
listener- The listener to remove.- Returns:
- true if listener is successfully removed, false otherwise.
isScreenOrientationLockSupported
public boolean isScreenOrientationLockSupported()Checks if screen orientation locking is supported or not.- Specified by:
isScreenOrientationLockSupportedin interfaceIClientSessionGyro- Returns:
- true if the functions to lock or unlock screen orientation are supported, false otherwise.
addScreenOrientationListener
Adds a screen orientation listener for the client session. Calling this method multiple times with the same listener will have no effect (but to return false).- Specified by:
addScreenOrientationListenerin interfaceIClientSessionGyro- Parameters:
listener- The listener to add.- Returns:
- true if the listener was added, false otherwise.
- Throws:
NullPointerException- If the listener isnull.
removeScreenOrientationListener
Removes a screen orientation listener for the client session.- Specified by:
removeScreenOrientationListenerin interfaceIClientSessionGyro- Parameters:
listener- The listener to remove.- Returns:
- true if listener is successfully removed, false otherwise.
getScreenOrientation
Gets the current screen orientation.- Specified by:
getScreenOrientationin interfaceIClientSessionGyro- Returns:
- The orientation,
ScreenOrientation.unknownif not supported.
setScreenOrientation
Locks the screen orientation.Note that there may be a delay in the orientation change after calling this method. This could be due to slow client connection, disconnected client or just due to device lag.
- Specified by:
setScreenOrientationin interfaceIClientSessionGyro- Parameters:
orientation- The orientation.- Returns:
- true for success, false for not supported.
- Throws:
IllegalArgumentException- IforientationisScreenOrientation.unknown.
unlockScreenOrientation
public boolean unlockScreenOrientation()Unlocks the screen orientation.Note that there may be a delay in the orientation change after calling this method. This could be due to slow client connection, disconnected client or just due to device lag.
- Specified by:
unlockScreenOrientationin interfaceIClientSessionGyro- Returns:
- true for success, false for not supported.
getImage
Gets an image definition from the image container for the client session.- Specified by:
getImagein interfaceIRuntimeImageCache- Parameters:
name- The image name.- Returns:
- The predefined image definition, or null if not found.
setImage
Adds the image definition to the image container for the client session. If the image already exists, it is replaced with the new definition.- Specified by:
setImagein interfaceIRuntimeImageCache- Parameters:
image- The image definition.- Returns:
- true if the container was changed, i.e. image was added or replaced, false for no change.
removeImage
Removes an image with a name from the client session.- Specified by:
removeImagein interfaceIRuntimeImageCache- Parameters:
name- The image to remove.- Returns:
- true for removed, false if not found.
clearImageCache
public void clearImageCache()Clears the entire cache.- Specified by:
clearImageCachein interfaceIRuntimeImageCache
getLocationService
Returns an instance of the geolocation service.- Specified by:
getLocationServicein interfaceIClientSessionGyro- Returns:
- The instance, always non-null.
sendStat
Sends statistics event to the analytics engine on the client to log the event.- Specified by:
sendStatin interfaceIClientSessionGyro- Parameters:
event- The event name.params- Parameters to send, null values and sensitive parameters are ignored.
getAnalyticsConsent
Gets the user's Web Analytics consent as the client last reported it: the value of theEnvProps.PN_ANALYTICS_CONSENTboolean of this client's environment, set by a Browser client when its connection is established and again whenever the user decides.Never a cookie wall: the server may read this value, for example to decide what to log or to offer a privacy page, but no function of the application or of IIZI may ever depend on it. A user who declined must get exactly the same application as one who accepted.
- Specified by:
getAnalyticsConsentin interfaceIClientSessionGyro- Returns:
Boolean.TRUEwhen accepted,Boolean.FALSEwhen declined, ornullwhen undecided, when the client is not a Browser running an application with a Measurement ID (iiziRun, the Designer pages), or when it has not reported yet.
askAnalyticsConsent
public boolean askAnalyticsConsent()Asks the client to show IIZI's Web Analytics consent prompt now, even when a decision is already stored. The user's answer is written on the device, applied by the client without a page reload and reported back throughgetAnalyticsConsent(); this method does not wait for it.Only a Browser client running an application with a Measurement ID shows anything; iiziRun and the Designer pages ignore the request.
- Specified by:
askAnalyticsConsentin interfaceIClientSessionGyro- Returns:
truewhen the request was sent,falsewhen the session is disposed of.
setAnalyticsConsent
public boolean setAnalyticsConsent(boolean granted) Sets the user's Web Analytics consent directly, when the application asked the user itself (the App page's consent choice "the application asks"). The client writes the decision on the device, starts or stops Analytics accordingly without a page reload, and reports the new value back throughgetAnalyticsConsent(); this method does not wait for it.Only a Browser client running an application with a Measurement ID acts on it; iiziRun and the Designer pages ignore the request.
- Specified by:
setAnalyticsConsentin interfaceIClientSessionGyro- Parameters:
granted-truewhen the user accepted,falsewhen the user declined.- Returns:
truewhen the decision was sent,falsewhen the session is disposed of.
getWebEngineStatus
Gets the verdict on the web engine this client runs on: whether it still receives security updates, and since when it does not. The server computed it when this client session connected, from what the client says about itself, and computes it again at every reconnect. IIZI never refuses or restricts a client because of it; an application may apply a policy of its own.- Specified by:
getWebEngineStatusin interfaceIClientSessionGyro- Returns:
- The verdict, never
null:WebEngineStatus.Status.NOT_ASSESSEDfor a client that is neither Android nor iOS, and when no verdict was computed.
showWebEngineWarning
public boolean showWebEngineWarning()Shows the user IIZI's notice that the web engine of the device no longer receives security updates, now. For an application whose "Unpatched web engine" choice on the App page is "the application decides"; with "IIZI warns" the notice is shown when the client session connects, and this call shows it again. The notice never blocks the application, and this method does not wait for it.- Specified by:
showWebEngineWarningin interfaceIClientSessionGyro- Returns:
truewhen the notice was sent to the client,falsewhen the engine is patched or not assessed, the choice on the App page is "never", or the session is disposed of.
getUIModes
public int getUIModes()Gets the appearance modes the application allows a client to show: the App page's "Appearance" choice (ModuleApp.getUIModes()), as read when this session was created and told to the client in$schemeModes(CC-THEME-CHOOSER-UI: the theme chooser component hides itself when one mode only is allowed).- Specified by:
getUIModesin interfaceIClientSessionGyro- Returns:
- The modes allowed:
UISchemes.MODES_BOTH,UISchemes.MODES_LIGHTorUISchemes.MODES_DARK.
getUIScheme
Gets the theme scheme this client shows: the family and the resolved mode, light or dark, as the client last reported it inuiSchemeof its environment.- Specified by:
getUISchemein interfaceIClientSessionGyro- Returns:
- The scheme shown, or
nullwhen the client has not reported one.
getUISchemeChoice
Gets the theme scheme this client was told to show, the mode as chosen (auto included), as the client last reported it inuiSchemeChoiceof its environment.- Specified by:
getUISchemeChoicein interfaceIClientSessionGyro- Returns:
- The choice, or
nullwhen the client has not reported one.
setUIScheme
Sets the theme scheme of this client: the family, the mode, or both, sent as the$schemeclient property thatiz/uischeme.jsapplies, stores on the device (a Browser's storage, iiziRun's settings) and reports back.- Specified by:
setUISchemein interfaceIClientSessionGyro- Parameters:
family- The family, ornullto keep the client's family.mode- The mode, ornullto keep the client's mode.- Returns:
truewhen sent,falsewhen disposed of or unchanged since last sent.- Throws:
IllegalArgumentException- If both arenull.
setUIMode
Sets the mode of this client's theme scheme, keeping its family.- Specified by:
setUIModein interfaceIClientSessionGyro- Parameters:
mode- The mode.- Returns:
truewhen sent,falsewhen disposed of or unchanged since last sent.- Throws:
IllegalArgumentException- If the mode isnull.
setUIFamily
Sets the family of this client's theme scheme, keeping its mode.- Specified by:
setUIFamilyin interfaceIClientSessionGyro- Parameters:
family- The family.- Returns:
truewhen sent,falsewhen disposed of or unchanged since last sent.- Throws:
IllegalArgumentException- If the family isnull.
addUISchemeListener
Adds a theme scheme listener for this client session.- Specified by:
addUISchemeListenerin interfaceIClientSessionGyro- Parameters:
listener- The listener to add.- Returns:
- true if the listener was added, false otherwise.
- Throws:
NullPointerException- If the listener isnull.
removeUISchemeListener
Removes a theme scheme listener for this client session.- Specified by:
removeUISchemeListenerin interfaceIClientSessionGyro- Parameters:
listener- The listener to remove.- Returns:
- true if listener is successfully removed, false otherwise.
credentialsAccepted
Tells the client that the credentials the user typed in a form container were accepted, so that the password manager of the Browser offers to save them (CC-LOGIN-L10A2-APP-CORE, T1-070): the call of this client's environment,EnvProps.credentialsAccepted(UIContainer).- Specified by:
credentialsAcceptedin interfaceIClientSessionGyro- Parameters:
form- The container holding the text fields of the credentials, as the client session has it.- Returns:
truewhen the signal was sent,falsewhen the session or its environment is disposed of, or the client has not sent its environment yet.- Throws:
NullPointerException- If the container is null.IllegalArgumentException- If the container is not in the property tree of this client session.
saveClientStorage
Saves values in the client's storage for the current app (CC-CLIENT-STORAGE-V5): seeIClientSessionGyro.saveClientStorage(DeviceParameter...). Possible states of an item on return areDeviceParameter.State.SUCCESS,DeviceParameter.State.UNAVAILABLE,DeviceParameter.State.NOT_FOUNDorDeviceParameter.State.ENCRYPT_ERROR.- Specified by:
saveClientStoragein interfaceIClientSessionGyro- Parameters:
params- Items to save.- Returns:
truefor success of at least one item,falseotherwise.
getClientStorage
Retrieves values from the client's storage for the current app (CC-CLIENT-STORAGE-V5): seeIClientSessionGyro.getClientStorage(DeviceParameter...).- Specified by:
getClientStoragein interfaceIClientSessionGyro- Parameters:
params- The items to retrieve.- Returns:
truefor success,falseif the client's storage is not present.
triggerRemoteOpenWindow
public boolean triggerRemoteOpenWindow(String url, String target, WindowOptions options, IWindowCloseListener windowListener) Triggers opening of a browser window on the client.- Specified by:
triggerRemoteOpenWindowin interfaceIClientSessionGyro- Parameters:
url- The URL to open.target- The target, null for _blank.options- Options to use, null for "new tab" for a browser client.windowListener- Callback to listen to blocked or user close window, null for none. When "spawn mode" is used in theoptions, this parameter is ignored, i.e. as if set tonull.- Returns:
- true for success, false if the window cannot be opened because another window already is open or that the session is disposed of. In case of failure, any callback close listener will not be invoked.
triggerRemoteCloseWindow
public boolean triggerRemoteCloseWindow(boolean ignoreCallbackListener) Triggers closing of the window on the client that was opened with triggerRemoteOpenWindow.- Specified by:
triggerRemoteCloseWindowin interfaceIClientSessionGyro- Parameters:
ignoreCallbackListener- Flag to ignore calling a potential callback listener.- Returns:
- true for success, false if no open window is present.
restartRemoteClient
public void restartRemoteClient()Restarts the remote client. This is done without asking anything: it will just restart the iiziRun or browser by disconnecting from server and reloading the page directly. For iiziRun Developer/Custom sessions, this will bring up that interface.- Specified by:
restartRemoteClientin interfaceIClientSessionGyro