Package org.opencms.jsp.util
Class CmsJspDeviceSelectorDesktopMobileTablet
java.lang.Object
org.opencms.jsp.util.CmsJspDeviceSelectorDesktopMobileTablet
- All Implemented Interfaces:
I_CmsJspDeviceSelector
public class CmsJspDeviceSelectorDesktopMobileTablet
extends Object
implements I_CmsJspDeviceSelector
Device selector class which distinguishes between the cases "desktop", "mobile" and "tablet".
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringConstant for desktop detection.static final StringConstant for mobile detection.static final StringConstant for tablet.The list of types supported by this device selector implementation.Fields inherited from interface org.opencms.jsp.util.I_CmsJspDeviceSelector
REQUEST_ATTRIBUTE_DEVICE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetDeviceType(javax.servlet.http.HttpServletRequest req) Returns the name of the device type.Returns an array of device types that can be detected.Returns the User Agent info.protected booleanisTemplateContextCompatible(CmsTemplateContext templateContext) Checks if a template context is compatible with this device selector.
-
Field Details
-
C_DESKTOP
Constant for desktop detection.- See Also:
-
C_MOBILE
Constant for mobile detection.- See Also:
-
C_TABLET
Constant for tablet.- See Also:
-
TYPES
The list of types supported by this device selector implementation.
-
-
Constructor Details
-
CmsJspDeviceSelectorDesktopMobileTablet
-
-
Method Details
-
getDeviceType
Description copied from interface:I_CmsJspDeviceSelectorReturns the name of the device type.This will be one option in
I_CmsJspDeviceSelector.getDeviceTypes().- Specified by:
getDeviceTypein interfaceI_CmsJspDeviceSelector- Parameters:
req- the HTTP servlet request to process- Returns:
- the name of the device type
- See Also:
-
getDeviceTypes
Description copied from interface:I_CmsJspDeviceSelectorReturns an array of device types that can be detected.- Specified by:
getDeviceTypesin interfaceI_CmsJspDeviceSelector- Returns:
- an array of device types that can be detected
- See Also:
-
getUserAgentInfo
Returns the User Agent info.- Returns:
- the information about the user agent
-
isTemplateContextCompatible
Checks if a template context is compatible with this device selector.- Parameters:
templateContext- the template context to check- Returns:
- true if the template context is compatible
-