Class IconResolver
java.lang.Object
org.talend.sdk.component.server.service.IconResolver
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoLoad(ClassLoader loader, String icon, String theme) protected Collection<String>protected voidinit()protected booleanIMPORTANT: the strategy moved to the configuration, high level we want something in this spirit: The lookup strategy of an icon is the following one: 1.
-
Constructor Details
-
IconResolver
public IconResolver()
-
-
Method Details
-
init
-
isSupportsSvg
-
getExtensionPreferences
-
resolve
public IconResolver.Icon resolve(org.talend.sdk.component.container.Container container, String icon, String theme) IMPORTANT: the strategy moved to the configuration, high level we want something in this spirit: The lookup strategy of an icon is the following one: 1. Check in the server classpath in icons/override/${icon}_icon32.png (optionally icons/override/${icon}.svg if in the preferences), 2. Check in the family classloader the following names ${icon}_icon32.png, icons/${icon}_icon32.png, ... 3. Check in the server classloader the following names ${icon}_icon32.png, icons/${icon}_icon32.png, ... This enables to 1. override properly the icons (1), 2. provide them in the family (2) and 3. fallback on built-in icons if needed (3). Theme and legacy icons support: If theme is activated the path will be prefixed by its theme: icons/dark/${icon}.svg, icons/light/${icon}.svg. Also, if icon is not found in theme and legacy icons support is activated, legacy icons lookup will be applied. Otherwise, theme deactivated, legacy icons lookup will be applied.- Parameters:
container- the component family container.icon- the icon to look up.theme- the theme of icon to look up.- Returns:
- the icon if found.
-
doLoad
-