Class EnvProps
- All Implemented Interfaces:
- EventListener,- IGProp<GProp<?>[]>,- IPropCnr,- Cloneable
The property also handles the capabilities of the client.
The environment has at least the following properties:
- $client - StringMapProp
- $server - StringMapProp
- $geo - GeoProps
- ...other capabilities such as Speech...
- Author:
- Christopher Mindus
- Nested Class SummaryNested Classes
- Field SummaryFieldsModifier and TypeFieldDescription- protected StringMapPropThe client environment properties.- protected GeoPropsThe Geolocation properties.- protected StringMapPropThe server environment properties.- Fields inherited from class com.iizix.prop.PropCnr- EMPTY, EMPTY_CLASSES, EMPTY_CNRS, EXTENDS_FRAMEWORK_ERROR_ID, nameTable- Fields inherited from class com.iizix.prop.GProp- GPDEBUG, PROP_ATTR_STRING_EDITOR_PROP, PROP_ATTR_STRING_ERRORED_NAME, PROP_ATTR_STRING_EXTENDS, PROP_ATTR_STRING_EXTENDS_FINAL, PROP_ATTR_STRING_EXTENDS_PRIVATE, PROP_ATTR_STRING_NULLABLE, PROP_ATTR_STRING_PRIVATE, PROP_ATTR_STRING_PRIVATE_CHANGE_EVENT, PROP_ATTR_STRING_READ_ONLY, PROP_USER_1, PROP_USER_2- Fields inherited from interface com.iizix.prop.IGProp- EQC_ERROR_IGNORE_ALL, EQC_ERROR_IGNORE_REFERENCES, EQC_IGNORE_ARRAY, EQC_IGNORE_VOLATILE_OR_EDITOR, EQC_PRIVATE, EQC_SAVE_FILE, EXT_CONTAINER_EXTENDS, EXT_CONTAINER_EXTENDS_VALID, EXT_EXTENDED, EXT_FINAL, EXT_OVERRIDES, EXT_OVERRIDES_FINAL_ERR, EXT_PRIVATE
- Constructor SummaryConstructors
- Method SummaryModifier and TypeMethodDescription- protected voidAdds the predefined properties for this container.- booleanAdds a screen orientation listener for the client session.- boolean- addScreenSizeListener- (IScreenSizeListener listener) Adds a screen size listener for the client session.- boolean- addStatusBarTapListener- (IStatusBarTapListener listener) Adds a status bar tap listener for the client session.- clone()Clones the environment properties.- boolean- configureStatusBar- (StatusBarConfig config) Sets the client sessions status bar to the configuration specified.- <TYPE> TYPE- getCachedValue- (String name, Class<TYPE> valueClass) Gets a cached property of a certain type.Gets the client environment properties.Gets the client session gyro instance.- io.github.mngsk.devicedetector.DetectionGets the cached device detection instance based on the parsed user agent.Gets the device UUID.- getDeviceUUID- (boolean mustBeValid) Gets the device UUID.- double- getDPR()The device pixel ratio of the client.Gets the Geolocation properties.Gets the language code to use.Gets the client local info class instance.- ua_parser.ClientGets the parsed user agent instance.- protected voidGets potential references to predefined properties for this container.- intGets the current screen height.Gets the current screen orientation.Gets the current screen size.- intGets the current screen width.Gets the server environment properties.Gets the speech recognition instance.Gets the speech synthesis instance.- boolean- hasClientCapabilities- (EnvProps.ClientCapability capability) Checks if a client has the specified capabilities.- booleanChecks if iiziRun is present.- booleanChecks if screen orientation locking is supported or not.- void- onEventSelf- (GEvent event) Called when a property event is send to this property.- void- onRemoteEvent- (RemoteEvent event) Called when a remote property event should be processed by this property.- registerSession- (IClientSessionGyro clientGyro, IRemoteSessionControlListener listener) Assigns the application session control listener.- booleanRemoves a screen orientation listener for the client session.- boolean- removeScreenSizeListener- (IScreenSizeListener listener) Removes a screen size listener for the client session.- booleanRemoves a status bar tap listener for the client session.- void- setCachedValue- (String name, Object value) Sets a cached property by name.- setLocale- (LocaleInfo locale) Changes or sets the LocaleInfo for the environment.- boolean- setScreenOrientation- (ScreenOrientation orientation) Locks the screen orientation.- protected boolean- shouldSerializeToXML- (int programType) The EnvProps are never written to XML.- booleanUnlocks the screen orientation.- Methods inherited from class com.iizix.prop.PropCnr- __transferChildProps, addProp, addProp, addProp2, addProp2, appendPropValue, canRequestFocus, completeVirtualize, containsProp, containsProp, convertLoadedProp, couldRequestFocusIfVirtualized, createCopyOfAtom, createUniqueAtom, createUniqueAtom, createUniqueAtom, createVSReference, doPropEqualsArrayValues, enablePropCommunication, enablePropHashMap, equalsTree, equalsTree, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getBool, getBool, getBool, getBool, getChildPropError, getChildPropError, getChildPropErrorSeverity, getChildPropErrorSeverity, getErrorsProp, getExtendsContainer, getExtendsError, getExtendsName, getExtendsOverride, getExtendsPossibleClasses, getFirstProp, getFirstProp, getFocusEngine, getInt, getInt, getInt, getInt, getLong, getLong, getLong, getLong, getNumber, getNumber, getNumber, getNumber, getPossibleChildren, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getPropBaseReference, getPropCnr, getPropCount, getPropCount, getPropIndex, getPropIndex, getPropIndexes, getProps, getProps, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue0, getRetargetedVerifyContainer, getString, getString, getString, getString, getValueClasses, getVSReference, hasFocus, hasSendData, initializeElement, initializeExtendsFramework, initializeProp, initializeValue, initPropCnr, insertProp, insertProp2, isChild, isExtendsOverriden, isExtendsPropertyValid, isExtendsRoot, isPropAddRemoveAllowed, isPropCommunicating, isPropExtended, isSibling, list, list, logPropNotFound, maybeAddProp, onInsertProp, onPropDispose, onPropRemoved, onPropTreeInitialized, onReferenceEvent, onVirtualContainerCreated, onVirtualizationCompleted, paramString, prepare, removeAllProps, removeAllProps2, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp2, removeProp2, removeProp2, removeProp2, removeProp2, removeProp2, removeProp2, reorderProps, replaceProps, requestFocus, requestFocus, requestFocusEx, requestFocusEx, resolveReferences, resolveRuntimeReferences, setBool, setBool, setBool, setBool, setCreateRequiredProp, setExtendsName, setExtendsOverride, setInt, setInt, setInt, setLong, setLong, setLong, setLong, setNumber, setNumber, setNumber, setNumber, setProp, setProp, setProp, setProp2, setProp2, setPropValue, setPropValue, setPropValue, setPropValue, setPropValue, setPropValue, setString, setString, setString, setString, shouldCreateProps, shouldSerializeToXML, toElementString, toNativeValue0, usePropHashMap, usesPropIndex, validateChildPropInValue, validateClassInstances, validatePropType, validatePropValue, verify, verifyInternalUseOnly, verifyTree, virtualize- Methods inherited from class com.iizix.prop.GProp- addPropError, addPropListener, convertPropError, dispose, equals, equals, equalsErrors, equalsObj, equalsPropValue, equalValues, extendsClone, finalize, fine, fine, finer, finer, finest, finest, fromElementString, getAliasName, getAppSessionGyro, getAppWorker, getAtomPath, getAttribute, getChildReferencePropName, getClientWorker, getConstraints, getEnvironment, getErroredPropItems, getErroredProps, getErrorsProp, getExtendsRootContainer, getFullPropName, getFullPropName, getFullPropNameDebug, getFullPropNameDebug, getListeners, getModuleFolder, getModuleFolder, getParent, getParent, getProjectName, getPropAtom, getPropError, getPropError, getPropErroredName, getPropErrorSeverity, getPropExtendsFlags, getPropFromPath, getPropFromPath, getPropFromReference, getPropFromReference, getPropIndex, getPropName, getPropPath, getPropPath, getPropReferenceTarget, getPropRootPropMgr, getPropTreeErrorSeverity, getPropValue, getPropValue, getPropValueObject, getReferencePropName, getReferencePropNameNoAssert, getRelativePropName, getRootFromName, getRootName, getRootParent, getRootParentNoAssert, getTreeLock, hasChanged, hasCircularReferencesError, hasPrivateChangeEventProp, hasPropError, hasPropTreeError, info, info, initializeGElement, initializeGProp, isDisposed, isPropChildOf, isPropClientCreated, isPropCreateRequired, isPropExtended, isPropExtendsFinal, isPropExtendsPrivate, isPropExtendsPrivateInRoot, isPropExtendsPrivateInRoot, isPropFile, isPropFolder, isPropForEditor, isPropNullable, isPropPrivate, isPropPrivateAtCreation, isPropReadOnly, isPropReferenceTreeValid, isPropRoot, isPropRootLoading, isPropRootTreeModificationsAllowed, isPropUSER, isPropValueTreeLockNeeded, isPropVirtualized, isPropVirtualizing, isPropVolatile, isPropVolatileOrEditorOnly, isProxied, list, list, list, mapAliasToReference, mapAliasToReference, mapReferenceToAlias, mapReferenceToAlias, mapReferenceToProjectRelative, modifyPropValue, moveProp, moveProp, moveProp, onEvent, onPrepare, onPropInvalidateCache, onPropParentChanged, onPropValueSet, paramString, paramValue, post, post, removePropError, removePropListener, removePropUSER, renameProp, renameProp2, resetChangedTree, setChanged, setConstraints, setConstraints, setParent, setPrivateChangeEventProp, setPrivateCreateRequiredProp, setPropError, setPropErroredName, setPropExtended, setPropExtendsFinal, setPropExtendsPrivate, setPropForEditor, setPropNullable, setPropPrivate, setPropReadOnly, setPropUSER, setPropValue, setPropValue, setPropValue, setPropValueIncognito, setPropVolatile, severe, severe, severe, throwIfReadOnly, toNativeValue, toString, toString, triggerRemoteEvent, triggerRemoteEvent, validateProp, warning, warning, warning- Methods inherited from class java.lang.Object- getClass, hashCode, notify, notifyAll, wait, wait, wait- Methods inherited from interface com.iizix.prop.IGProp- addPropError, addPropListener, dispose, equals, fine, fine, finer, finer, finest, finest, fromElementString, getAppSessionGyro, getAtomPath, getConstraints, getEnvironment, getErroredPropItems, getErroredProps, getErrorsProp, getExtendsRootContainer, getFullPropName, getFullPropNameDebug, getModuleFolder, getModuleFolder, getParent, getParent, getPropAtom, getPropError, getPropError, getPropErrorSeverity, getPropExtendsFlags, getPropFromPath, getPropFromReference, getPropIndex, getPropName, getPropPath, getPropPath, getPropRootPropMgr, getPropTreeErrorSeverity, getPropValue, getPropValue, getReferencePropName, getRelativePropName, getRootParent, getTreeLock, hasChanged, hasCircularReferencesError, hasPrivateChangeEventProp, hasPropError, hasPropTreeError, info, info, initializeGElement, initializeGProp, isDisposed, isPropChildOf, isPropClientCreated, isPropCreateRequired, isPropExtended, isPropExtendsFinal, isPropExtendsPrivate, isPropExtendsPrivateInRoot, isPropExtendsPrivateInRoot, isPropFile, isPropFolder, isPropNullable, isPropPrivate, isPropReadOnly, isPropReferenceTreeValid, isPropRoot, isPropVirtualized, list, list, list, mapAliasToReference, mapReferenceToAlias, mapReferenceToProjectRelative, moveProp, moveProp, moveProp, onEvent, removePropError, removePropListener, renameProp, setChanged, setConstraints, setConstraints, setParent, setPrivateChangeEventProp, setPropError, setPropExtendsFinal, setPropExtendsPrivate, setPropNullable, setPropPrivate, setPropReadOnly, setPropValue, setPropValue, severe, severe, severe, toNativeValue, triggerRemoteEvent, triggerRemoteEvent, validateProp, warning, warning, warning- Methods inherited from interface com.iizix.prop.IPropCnr- canRequestFocus, canRequestFocus, couldRequestFocusIfVirtualized, couldRequestFocusIfVirtualized
- Field Details- clientEnvThe client environment properties.
- geoPropsThe Geolocation properties.
- serverEnvThe server environment properties.
 
- Constructor Details- EnvPropsprotected EnvProps()Creates the environment properties without a name.
- EnvPropsCreates the environment properties with a name.- Parameters:
- atom- The atom name.
 
 
- Method Details- getClientSessionGyroGets the client session gyro instance.- Specified by:
- getClientSessionGyroin interface- IGProp<GProp<?>[]>
- Overrides:
- getClientSessionGyroin class- GProp<GProp<?>[]>
- Returns:
- The instance, or null if not found.
 
- shouldSerializeToXMLprotected boolean shouldSerializeToXML- (int programType) The EnvProps are never written to XML.- Overrides:
- shouldSerializeToXMLin class- GProp<GProp<?>[]>
- Parameters:
- programType- From PropFactory.getProgramType(): 0=- PropFactory.CLIENT, 1=- PropFactory.SERVERor 2=- PropFactory.EDITOR.
- Returns:
- true (default if not VOLATILE) to save to XML, false to avoid writing the property to XML.
 
- addPredefinedPropsAdds the predefined properties for this container. This method is called once just after construction of the property container.- Properties added: - - client environment StringMapProp Atom.A_CLIENT - server environment StringMapProp Atom.A_SERVER - Overrides:
- addPredefinedPropsin class- PropCnr
- Throws:
- PropException- for property exceptions.
 
- getPredefinedPropsprotected void getPredefinedProps()Gets potential references to predefined properties for this container. This method is called once just after cloning of the property container.- The method should get reference to using the - getProp(...)methods. This allows the subclass to be able to retrieve the new instances to the properties created during- addPredefinedProps()if stored in instance variables.- Overrides:
- getPredefinedPropsin class- PropCnr
 
- cloneClones the environment properties.
- getServerEnvGets the server environment properties.- Returns:
- StringMapProp for the server environment.
 
- getClientEnvGets the client environment properties.- Returns:
- StringMapProp for the client environment.
 
- iiziRunPresentpublic boolean iiziRunPresent()Checks if iiziRun is present.- Returns:
- true if present, false otherwise.
 
- getGeolocationGets the Geolocation properties.
- getSpeechSynthesisGets the speech synthesis instance.- Returns:
- The instance, or null if not supported.
 
- getSpeechRecognitionGets the speech recognition instance.- Returns:
- The instance, or null if not supported.
 
- getLocaleGets the client local info class instance.- Returns:
- The client locale info class instance when the client environment has been set, otherwise the default client locale info instance specified for the server.
 
- setLocaleChanges or sets the LocaleInfo for the environment. This method is intended to be used to change the language setting of a client session.- Note that this change does not fire any refresh to the client property tree, use the - IClientSessionGyro.setLocale(LocaleInfo)- Parameters:
- locale- localeInfo The locale information to use.
- Returns:
- The old LocaleInfo, or null if not set.
- Throws:
- PropTypeException- If the property is read-only.
 
- getDPRpublic double getDPR()The device pixel ratio of the client.- Returns:
- The Device Pixel Ratio, or 1.0 if not found.
 
- getLanguageCodeGets the language code to use.- Returns:
- The language code, or null for default (not defined by the client).
 
- setCachedValueSets a cached property by name. This is set for this instance only.- Parameters:
- name- The name.
- value- An object.
 
- getCachedValueGets a cached property of a certain type.- Parameters:
- name- The name.
- valueClass- The value class to retrieve.
- Returns:
- The cached value, or null if not found or class mismatch.
 
- hasClientCapabilitiesChecks if a client has the specified capabilities. It is important to use the appropriate EnvProps instance, i.e. the client session EnvProps and not e.g. the server's.- Parameters:
- capability- The capability to query.
- Returns:
- true for support, false when client doesn't have the capability.
 
- getParsedUserAgentGets the parsed user agent instance.- Returns:
- The parsed user agent for the client, a cached value (i.e. parsed once only).
- Throws:
- Exception- An exception due to failure in performing the test, with a message why it failed.
 
- getDeviceDetectionFromUserAgentGets the cached device detection instance based on the parsed user agent.- Returns:
- The cached device detection instance based on the parsed user agent (i.e. parsed once only).
- Throws:
- Exception- An exception due to failure in performing the test, with a message why it failed.
 
- registerSessionpublic IRemoteSessionControl registerSession- (IClientSessionGyro clientGyro, IRemoteSessionControlListener listener) Assigns the application session control listener.- This method is only intended for the framework and will throw an error if called. - Parameters:
- clientGyro- The client gyro instance.
- listener- The control listener.
- Throws:
- IllegalStateException- If not called from the framework.
 
- onRemoteEventCalled when a remote property event should be processed by this property.- A subclass can override this method to perform appropriate processing and is not required to call - super.onRemoteEvent(e).- The onRemoteEvent is NOT called when in a proxied property container, but rather the normal onEventSelf method. - Specified by:
- onRemoteEventin interface- IGProp<GProp<?>[]>
- Overrides:
- onRemoteEventin class- GProp<GProp<?>[]>
- Parameters:
- event- The remote event.
 
- onEventSelfCalled when a property event is send to this property.- A subclass can override this method to perform appropriate processing and is not required to call - super.onEventSelf(e).- Specified by:
- onEventSelfin interface- IGProp<GProp<?>[]>
- Overrides:
- onEventSelfin class- GProp<GProp<?>[]>
- Parameters:
- event- The property event.
 
- addScreenSizeListenerAdds 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).- Parameters:
- listener- The listener to add.
- Returns:
- true if the listener was added, false otherwise.
- Throws:
- NullPointerException- If the listener is- null.
 
- removeScreenSizeListenerRemoves a screen size listener for the client session.- Parameters:
- listener- The listener to remove.
- Returns:
- true if listener is successfully removed, false otherwise.
 
- getScreenWidthpublic int getScreenWidth()Gets the current screen width.- Returns:
- The current screen width, or zero if not initialized.
 
- getScreenHeightpublic int getScreenHeight()Gets the current screen height.- Returns:
- The current screen height, or zero if not initialized.
 
- getScreenSizeGets the current screen size.- Returns:
- The current screen size, or zero width and/or height if not initialized.
 
- addScreenOrientationListenerAdds 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).- Parameters:
- listener- The listener to add.
- Returns:
- true if the listener was added, false otherwise.
- Throws:
- NullPointerException- If the listener is- null.
 
- removeScreenOrientationListenerRemoves a screen orientation listener for the client session.- Parameters:
- listener- The listener to remove.
- Returns:
- true if listener is successfully removed, false otherwise.
 
- isScreenOrientationLockSupportedpublic boolean isScreenOrientationLockSupported()Checks if screen orientation locking is supported or not.- Returns:
- true if the functions to lock or unlock screen orientation are supported, false otherwise.
 
- getScreenOrientationGets the current screen orientation.- Returns:
- The orientation, ScreenOrientation.unknownif not supported.
 
- setScreenOrientationLocks 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. - Parameters:
- orientation- The orientation.
- Returns:
- true for success, false for not supported.
- Throws:
- IllegalArgumentException- If- orientationis- ScreenOrientation.unknown.
 
- unlockScreenOrientationpublic 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. - Returns:
- true for success, false for not supported.
 
- getDeviceUUIDGets the device UUID.- Returns:
- The device's UUID if iiziRun is used and has been initialized, unknownotherwise. It is always "browser" for browsers.
 
- getDeviceUUIDGets the device UUID.- Parameters:
- mustBeValid- Flag requiring device UUID to be from a valid device, otherwise null is returned. When flag is false,
- Returns:
- The device's UUID if iiziRun is used and has been initialized, when mustBeValidis falseunknownotherwise. It is always "browser" for browsers whenmustBeValidis false. WhenmustBeValidis true, null is returned.
 
- configureStatusBarSets the client sessions status bar to the configuration specified.- Note: this only works on devices using iiziRun. - Parameters:
- config- The configuration.
- Returns:
- true for ch
 
- addStatusBarTapListenerAdds a status bar tap listener for the client session. Calling this method multiple times with the same listener will have no effect (but to return false).- Status bar tap events are only fired for devices using iiziRun with status bars available, using iOS devices. - Parameters:
- listener- The listener to add.
- Returns:
- true if the listener was added, false otherwise.
- Throws:
- NullPointerException- If the listener is- null.
 
- removeStatusBarTapListenerRemoves a status bar tap listener for the client session.- Parameters:
- listener- The listener to remove.
- Returns:
- true if listener is successfully removed, false otherwise.