Class IconResolver
- java.lang.Object
-
- org.talend.sdk.component.server.service.IconResolver
-
@ApplicationScoped public class IconResolver extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classIconResolver.Icon
-
Constructor Summary
Constructors Constructor Description IconResolver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<IconResolver.Icon>doLoad(ClassLoader loader, String icon)protected Collection<String>getExtensionPreferences()protected voidinit()protected booleanisSupportsSvg()IconResolver.Iconresolve(org.talend.sdk.component.container.Container container, String icon)IMPORTANT: the strategy moved to the configuration, high level we want something in this spirit: The look up strategy of an icon is the following one: 1.
-
-
-
Constructor Detail
-
IconResolver
public IconResolver()
-
-
Method Detail
-
init
@PostConstruct protected void init()
-
isSupportsSvg
protected boolean isSupportsSvg()
-
getExtensionPreferences
protected Collection<String> getExtensionPreferences()
-
resolve
public IconResolver.Icon resolve(org.talend.sdk.component.container.Container container, String icon)
IMPORTANT: the strategy moved to the configuration, high level we want something in this spirit: The look up 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 enable to 1. override properly the icons (1), 2. provide them in the family (2) and 3. fallback on built-in icons if needed (3).- Parameters:
container- the component family container.icon- the icon to look up.- Returns:
- the icon if found.
-
doLoad
public Optional<IconResolver.Icon> doLoad(ClassLoader loader, String icon)
-
-