@Component @Named(value="icon") @Singleton public class IconManagerScriptService extends Object implements org.xwiki.script.service.ScriptService
Constructor and Description |
---|
IconManagerScriptService() |
Modifier and Type | Method and Description |
---|---|
String |
getCurrentIconSetName()
Get the name of the current icon set.
|
List<String> |
getIconNames()
Get the list of the names of all available icons in the current icon set.
|
List<String> |
getIconNames(String iconSetName)
Get the list of the names of all available icons in the specified icon set.
|
List<String> |
getIconSetNames()
Get the name of all the icon sets present in the current wiki.
|
IconException |
getLastError()
Get the error generated while performing the previously called action.
|
Map<String,Object> |
getMetaData(String iconName)
Generate metadata of an icon.
|
Map<String,Object> |
getMetaData(String iconName,
String iconSetName)
Generate metadata of an icon.
|
Map<String,Object> |
getMetaData(String iconName,
String iconSetName,
boolean fallback)
Generate metadata of an icon.
|
String |
render(String iconName)
Display an icon with wiki code from the current
IconSet . |
String |
render(String iconName,
String iconSetName)
Display an icon with wiki code from the specified
IconSet . |
String |
render(String iconName,
String iconSetName,
boolean fallback)
Display an icon with wiki code from the specified
IconSet . |
String |
renderHTML(String iconName)
Display an icon with HTML code from the current
IconSet . |
String |
renderHTML(String iconName,
String iconSetName)
Display an icon with HTML code from the specified
IconSet . |
String |
renderHTML(String iconName,
String iconSetName,
boolean fallback)
Display an icon from the specified
IconSet . |
void |
use()
Pull the necessary resources to use the default icon set.
|
void |
use(String iconSetName)
Pull the necessary resources to use the specified icon set.
|
public String render(String iconName)
IconSet
.iconName
- name of the icon to displaypublic String render(String iconName, String iconSetName)
IconSet
.iconName
- name of the icon to displayiconSetName
- name of the icon setpublic String render(String iconName, String iconSetName, boolean fallback)
IconSet
.iconName
- name of the icon to displayiconSetName
- name of the icon setfallback
- enable the fallback to the default icon theme if the icon does not existpublic String renderHTML(String iconName)
IconSet
.iconName
- name of the icon to displaypublic String renderHTML(String iconName, String iconSetName)
IconSet
.iconName
- name of the icon to displayiconSetName
- name of the icon setpublic String renderHTML(String iconName, String iconSetName, boolean fallback)
IconSet
.iconName
- name of the icon to displayiconSetName
- name of the icon setfallback
- enable the fallback to the default icon theme if the icon does not existpublic void use()
public void use(String iconSetName)
iconSetName
- name of the icon setpublic List<String> getIconSetNames()
public List<String> getIconNames()
public List<String> getIconNames(String iconSetName)
iconSetName
- name of the icon setpublic String getCurrentIconSetName()
public Map<String,Object> getMetaData(String iconName) throws IconException
It can contain useful information such as:
iconName
- name of the iconIconException
- if problems occurpublic Map<String,Object> getMetaData(String iconName, String iconSetName) throws IconException
It can contain useful information such as:
iconName
- name of the iconiconSetName
- name of the icon set to useIconException
- if problems occurpublic Map<String,Object> getMetaData(String iconName, String iconSetName, boolean fallback) throws IconException
It can contain useful information such as:
iconName
- name of the iconiconSetName
- name of the icon set to usefallback
- enable the fallback to the default icon set if the icon does not existIconException
- if problems occurpublic IconException getLastError()
null
if no exception was thrownCopyright © 2004–2021 XWiki. All rights reserved.