01: package fr.aliacom.common.ui;
02:
03: import fr.aliacom.form.common.Toolkit;
04: import fr.aliacom.form.common.ToolkitManager;
05:
06: public class IconFactory {
07:
08: private static Toolkit tk;
09:
10: static {
11: tk = ToolkitManager.getToolkit();
12: }
13:
14: /**
15: * Note: icon caching should be provided at the toolkit level
16: * @param iconName
17: * @return the icon
18: */
19: public static final IIcon get(String iconName) {
20: if (iconName == null) {
21: return tk.getBrokenIcon();
22: }
23: IIcon ret = tk.getIcon(iconName);
24: if (ret == null) {
25: ret = tk.getBrokenIcon();
26: }
27: return ret;
28: }
29:
30: }
|