org.jenkins.ui.icon
Class IconSet

java.lang.Object
  extended by org.jenkins.ui.icon.IconSet

public class IconSet
extends Object

An icon set.

Author:
tom.fennelly@gmail.com

Field Summary
static IconSet icons
           
 
Constructor Summary
IconSet()
           
 
Method Summary
 IconSet addIcon(Icon icon)
           
 Map<String,Icon> getCoreIcons()
           
 Icon getIconByClassSpec(Object iconClassSpec)
          Get an icon instance from a class specification.
 Icon getIconByNormalizedCSSSelector(Object cssSelector)
          Get an icon instance from it's normalized CSS selector.
 Icon getIconByUrl(Object url)
          Get an icon instance from it's url.
static void initPageVariables(org.apache.commons.jelly.JellyContext context)
           
static String toNormalizedIconNameClass(Object string)
          Normalize the supplied string to an Icon name class e.g.
static String toNormalizedIconSizeClass(Object string)
          Normalize the supplied string to an Icon size class e.g.
static String toNormalizedIconUrl(Object url)
          Normalize the supplied url.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

icons

public static final IconSet icons
Constructor Detail

IconSet

public IconSet()
Method Detail

getCoreIcons

public Map<String,Icon> getCoreIcons()

initPageVariables

public static void initPageVariables(org.apache.commons.jelly.JellyContext context)

addIcon

public IconSet addIcon(Icon icon)

getIconByNormalizedCSSSelector

public Icon getIconByNormalizedCSSSelector(Object cssSelector)
Get an icon instance from it's normalized CSS selector.

This Object based version allows the function to be resolvable e.g. from JEXL expressions that are trying to perform reflective lookup using a GString (instead of a String).

Parameters:
cssSelector - The icon's normalized CSS selector.
Returns:
The icon instance, or null if no such icon.

getIconByClassSpec

public Icon getIconByClassSpec(Object iconClassSpec)
Get an icon instance from a class specification.

This Object based version allows the function to be resolvable e.g. from JEXL expressions that are trying to perform reflective lookup using a GString (instead of a String).

Parameters:
iconClassSpec - The icon's class spec as defined on the <l:icon class> attribute.
Returns:
The icon instance, or null if no such icon.

getIconByUrl

public Icon getIconByUrl(Object url)
Get an icon instance from it's url.

This Object based version allows the function to be resolvable e.g. from JEXL expressions that are trying to perform reflective lookup using a GString (instead of a String).

Parameters:
url - The icon url.
Returns:
The icon instance, or null if no such icon.

toNormalizedIconNameClass

public static String toNormalizedIconNameClass(Object string)
Normalize the supplied string to an Icon name class e.g. "blue_anime" to "icon-blue-anime".

This Object based version allows the function to be resolvable e.g. from JEXL expressions that are trying to perform reflective lookup using a GString (instead of a String).

Parameters:
string - The string to be normalized.
Returns:
The normalized icon name class.

toNormalizedIconSizeClass

public static String toNormalizedIconSizeClass(Object string)
Normalize the supplied string to an Icon size class e.g. "16x16" to "icon-sm".

This Object based version allows the function to be resolvable e.g. from JEXL expressions that are trying to perform reflective lookup using a GString (instead of a String).

Parameters:
string - The string to be normalized.
Returns:
The normalized icon size class, or the unmodified string arg if it was an unrecognised icon size.

toNormalizedIconUrl

public static String toNormalizedIconUrl(Object url)
Normalize the supplied url.

This Object based version allows the function to be resolvable e.g. from JEXL expressions that are trying to perform reflective lookup using a GString (instead of a String).

Parameters:
url - The url to be normalized.
Returns:
The normalized url.


Copyright © 2004-2014. All Rights Reserved.