@Role
public interface IconRenderer
Modifier and Type | Method and Description |
---|---|
String |
render(String iconName,
IconSet iconSet)
Generate the wiki syntax to display an icon.
|
default String |
render(String iconName,
IconSet iconSet,
String renderer)
Render an icon with the specified renderer.
|
String |
renderHTML(String iconName,
IconSet iconSet)
Generate the HTML code to display an icon.
|
default void |
use(IconSet iconSet)
Pull the necessary resources to use the specified icon set.
|
String render(String iconName, IconSet iconSet) throws IconException
iconName
- name of the icon to rendericonSet
- icon set that contains the icon to displayIconException
- if problems occurdefault String render(String iconName, IconSet iconSet, String renderer) throws IconException
The renderer contains velocity code which should use the $icon variable. For instance:
String renderer = "fa fa-$icon";
iconName
- name of the icon to rendericonSet
- icon set that contains the icon to displayrenderer
- velocity code to renderIconException
- if problems occurString renderHTML(String iconName, IconSet iconSet) throws IconException
iconName
- name of the icon to rendericonSet
- icon set that contains the icon to displayIconException
- if problems occurdefault void use(IconSet iconSet) throws IconException
iconSet
- icon set to useIconException
- if problems occurCopyright © 2004–2021 XWiki. All rights reserved.