Package org.opencms.gwt
Class CmsIconUtil
- java.lang.Object
-
- org.opencms.gwt.CmsIconUtil
-
- All Implemented Interfaces:
I_CmsEventListener
public final class CmsIconUtil extends java.lang.Object implements I_CmsEventListener
Utility class to generate the resource icon CSS.- Since:
- 8.0.0
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ICON_MODEL_GROUP_BIG
Pseudo type icon.static java.lang.String
ICON_MODEL_GROUP_COPY_BIG
Pseudo type icon.static java.lang.String
ICON_MODEL_GROUP_COPY_SMALL
Pseudo type icon.static java.lang.String
ICON_NAV_LEVEL_BIG
Pseudo type icon.static java.lang.String
ICON_NAV_LEVEL_SMALL
Pseudo type icon.static java.lang.String
NOT_FOUND_ICON_BIG
The big resource not found icon name.static java.lang.String
NOT_FOUND_ICON_SMALL
The small resource not found icon name.static java.lang.String
SMALL_SUFFIX
The suffix for the CSS classes for small icons.static java.lang.String
TYPE_RESOURCE_NOT_FOUND
Type for resource not found.-
Fields inherited from interface org.opencms.main.I_CmsEventListener
EVENT_BEFORE_PUBLISH_PROJECT, EVENT_CLEAR_CACHES, EVENT_CLEAR_OFFLINE_CACHES, EVENT_CLEAR_ONLINE_CACHES, EVENT_CLEAR_PRINCIPAL_CACHES, EVENT_FLEX_CACHE_CLEAR, EVENT_FLEX_PURGE_JSP_REPOSITORY, EVENT_FULLSTATIC_EXPORT, EVENT_GROUP_MODIFIED, EVENT_LOGIN_USER, EVENT_OU_MODIFIED, EVENT_PROJECT_MODIFIED, EVENT_PROPERTY_DEFINITION_CREATED, EVENT_PROPERTY_DEFINITION_MODIFIED, EVENT_PROPERTY_MODIFIED, EVENT_PUBLISH_PROJECT, EVENT_REBUILD_SEARCHINDEXES, EVENT_REINDEX_OFFLINE, EVENT_REINDEX_ONLINE, EVENT_RESOURCE_AND_PROPERTIES_MODIFIED, EVENT_RESOURCE_COPIED, EVENT_RESOURCE_CREATED, EVENT_RESOURCE_DELETED, EVENT_RESOURCE_MODIFIED, EVENT_RESOURCE_MOVED, EVENT_RESOURCES_AND_PROPERTIES_MODIFIED, EVENT_RESOURCES_MODIFIED, EVENT_SITEMAP_CHANGED, EVENT_UPDATE_EXPORTS, EVENT_USER_MODIFIED, KEY_CHANGE, KEY_DBCONTEXT, KEY_GROUP_ID, KEY_GROUP_NAME, KEY_INDEX_NAMES, KEY_IS_ONLINE, KEY_OU_ID, KEY_OU_NAME, KEY_PROJECTID, KEY_PUBLISHID, KEY_PUBLISHLIST, KEY_REINDEX_RELATED, KEY_REPORT, KEY_RESOURCE, KEY_RESOURCES, KEY_SKIPINDEX, KEY_USER_ACTION, KEY_USER_CHANGES, KEY_USER_ID, KEY_USER_NAME, LISTENERS_FOR_ALL_EVENTS, VALUE_CREATE_SIBLING, VALUE_GROUP_MODIFIED_ACTION_CREATE, VALUE_GROUP_MODIFIED_ACTION_DELETE, VALUE_GROUP_MODIFIED_ACTION_WRITE, VALUE_OU_MODIFIED_ACTION_CREATE, VALUE_OU_MODIFIED_ACTION_DELETE, VALUE_USER_MODIFIED_ACTION_ADD_USER_TO_GROUP, VALUE_USER_MODIFIED_ACTION_CREATE_USER, VALUE_USER_MODIFIED_ACTION_DELETE_USER, VALUE_USER_MODIFIED_ACTION_REMOVE_USER_FROM_GROUP, VALUE_USER_MODIFIED_ACTION_RESET_PASSWORD, VALUE_USER_MODIFIED_ACTION_SET_OU, VALUE_USER_MODIFIED_ACTION_WRITE_USER
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.lang.String
buildResourceIconCss()
Builds the CSS for all resource types.void
cmsEvent(CmsEvent event)
Acknowledge the occurrence of the specified event, implement this method to check for CmsEvents in your class.static java.lang.String
getDisplayType(CmsObject cms, CmsResource resource)
Returns the resource type name used to display the resource icon.static java.util.Map<java.lang.String,java.lang.String>
getExtensionIconMapping()
Returns the extension icon mapping used when uploading files.static java.lang.String
getIconClasses(java.lang.String resourceType, java.lang.String resourceName, boolean small)
Returns the resource type icon CSS classes for the given type.static java.lang.String
getIconClasses(CmsExplorerTypeSettings typeSettings, java.lang.String resourceName, boolean small)
Returns the resource type icon CSS classes for the given type.
-
-
-
Field Detail
-
ICON_MODEL_GROUP_BIG
public static final java.lang.String ICON_MODEL_GROUP_BIG
Pseudo type icon.- See Also:
- Constant Field Values
-
ICON_MODEL_GROUP_COPY_BIG
public static final java.lang.String ICON_MODEL_GROUP_COPY_BIG
Pseudo type icon.- See Also:
- Constant Field Values
-
ICON_MODEL_GROUP_COPY_SMALL
public static final java.lang.String ICON_MODEL_GROUP_COPY_SMALL
Pseudo type icon.- See Also:
- Constant Field Values
-
ICON_NAV_LEVEL_BIG
public static final java.lang.String ICON_NAV_LEVEL_BIG
Pseudo type icon.- See Also:
- Constant Field Values
-
ICON_NAV_LEVEL_SMALL
public static final java.lang.String ICON_NAV_LEVEL_SMALL
Pseudo type icon.- See Also:
- Constant Field Values
-
NOT_FOUND_ICON_BIG
public static final java.lang.String NOT_FOUND_ICON_BIG
The big resource not found icon name.- See Also:
- Constant Field Values
-
NOT_FOUND_ICON_SMALL
public static final java.lang.String NOT_FOUND_ICON_SMALL
The small resource not found icon name.- See Also:
- Constant Field Values
-
SMALL_SUFFIX
public static final java.lang.String SMALL_SUFFIX
The suffix for the CSS classes for small icons.- See Also:
- Constant Field Values
-
TYPE_RESOURCE_NOT_FOUND
public static final java.lang.String TYPE_RESOURCE_NOT_FOUND
Type for resource not found.- See Also:
- Constant Field Values
-
-
Method Detail
-
buildResourceIconCss
public static java.lang.String buildResourceIconCss()
Builds the CSS for all resource types.- Returns:
- a string containing the CSS rules for all resource types
-
getDisplayType
public static java.lang.String getDisplayType(CmsObject cms, CmsResource resource)
Returns the resource type name used to display the resource icon. This may differ from the actual resource type in case of navigation level folders and model groups.- Parameters:
cms
- the cms contextresource
- the resource- Returns:
- the display type name
-
getExtensionIconMapping
public static java.util.Map<java.lang.String,java.lang.String> getExtensionIconMapping()
Returns the extension icon mapping used when uploading files.- Returns:
- the extension icon mapping
-
getIconClasses
public static java.lang.String getIconClasses(CmsExplorerTypeSettings typeSettings, java.lang.String resourceName, boolean small)
Returns the resource type icon CSS classes for the given type.Use within ADE context only.
- Parameters:
typeSettings
- the explorer type settingsresourceName
- the resource namesmall
-true
to get the small icon classes- Returns:
- the icon CSS classes
-
getIconClasses
public static java.lang.String getIconClasses(java.lang.String resourceType, java.lang.String resourceName, boolean small)
Returns the resource type icon CSS classes for the given type.Use within ADE context only.
- Parameters:
resourceType
- the resource type nameresourceName
- the resource namesmall
-true
to get the small icon classes- Returns:
- the icon CSS classes
-
cmsEvent
public void cmsEvent(CmsEvent event)
Description copied from interface:I_CmsEventListener
Acknowledge the occurrence of the specified event, implement this method to check for CmsEvents in your class.- Specified by:
cmsEvent
in interfaceI_CmsEventListener
- Parameters:
event
- CmsEvent that has occurred- See Also:
I_CmsEventListener.cmsEvent(org.opencms.main.CmsEvent)
-
-