org.opencms.gwt.shared
Class CmsIconUtil

java.lang.Object
  extended by org.opencms.gwt.shared.CmsIconUtil
Direct Known Subclasses:
CmsIconUtil

public class CmsIconUtil
extends Object

Utility class for the resource icon CSS.

Since:
8.0.0

Field Summary
static String SMALL_SUFFIX
          The suffix for the CSS classes for small icons.
static String TYPE_ICON_CLASS
          The resource icon CSS class prefix.
 
Constructor Summary
protected CmsIconUtil()
          Constructor.
 
Method Summary
protected static String getFileTypeIconClass(String resourceTypeName, String fileName, boolean small)
          Returns the CSS class for the given filename.
static String getResourceIconClasses(String resourceTypeName, boolean small)
          Returns the CSS classes of the resource icon for the given resource type name.
static String getResourceIconClasses(String resourceTypeName, String fileName, boolean small)
          Returns the CSS classes of the resource icon for the given resource type and filename.
static String getResourceSubTypeIconClass(String resourceTypeName, String suffix, boolean small)
          Returns the CSS class for a given resource type name and file name extension.
static String getResourceTypeIconClass(String resourceTypeName, boolean small)
          Returns the CSS class for the given resource type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SMALL_SUFFIX

public static final String SMALL_SUFFIX
The suffix for the CSS classes for small icons.

See Also:
Constant Field Values

TYPE_ICON_CLASS

public static final String TYPE_ICON_CLASS
The resource icon CSS class prefix.

See Also:
Constant Field Values
Constructor Detail

CmsIconUtil

protected CmsIconUtil()
Constructor.

Method Detail

getResourceIconClasses

public static String getResourceIconClasses(String resourceTypeName,
                                            boolean small)
Returns the CSS classes of the resource icon for the given resource type name.

Use this function, if the resource type is known, but not the filename. If the filename is available use getResourceIconClasses(String, String, boolean)

Parameters:
resourceTypeName - the resource type name
small - if true, get the icon classes for the small icon, else for the biggest one available
Returns:
the CSS classes

getResourceIconClasses

public static String getResourceIconClasses(String resourceTypeName,
                                            String fileName,
                                            boolean small)
Returns the CSS classes of the resource icon for the given resource type and filename.

Use this the resource type and filename is known. Otherwise use getResourceIconClasses(String,boolean)

Parameters:
resourceTypeName - the resource type name
fileName - the filename
small - if true, get the icon classes for the small icon, else for the biggest one available
Returns:
the CSS classes

getResourceSubTypeIconClass

public static String getResourceSubTypeIconClass(String resourceTypeName,
                                                 String suffix,
                                                 boolean small)
Returns the CSS class for a given resource type name and file name extension.

Parameters:
resourceTypeName - the resource type name
suffix - the file name extension
small - if true, get the icon class for the small icon, else for the biggest one available
Returns:
the CSS class for the type and extension

getResourceTypeIconClass

public static String getResourceTypeIconClass(String resourceTypeName,
                                              boolean small)
Returns the CSS class for the given resource type.

Parameters:
resourceTypeName - the resource type name
small - if true, get the icon class for the small icon, else for the biggest one available
Returns:
the CSS class

getFileTypeIconClass

protected static String getFileTypeIconClass(String resourceTypeName,
                                             String fileName,
                                             boolean small)
Returns the CSS class for the given filename.

Parameters:
resourceTypeName - the resource type name
fileName - the filename
small - if true, get the CSS class for the small icon, else for the biggest one available
Returns:
the CSS class