import java.util.stream.Collectors;
import org.apache.commons.io.IOUtils;
-import org.argeo.api.cms.CmsTheme;
+import org.argeo.api.cms.ux.CmsTheme;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
// private String swtCssPath;
private Bundle themeBundle;
- private Integer defaultIconSize = 16;
+ private Integer smallIconSize = 16;
+ private Integer bigIconSize = 32;
public BundleCmsTheme() {
}
@Override
- public Integer getDefaultIconSize() {
- return defaultIconSize;
+ public int getSmallIconSize() {
+ return smallIconSize;
+ }
+
+ @Override
+ public int getBigIconSize() {
+ return bigIconSize;
}
@Override
public InputStream loadPath(String path) throws IOException {
URL url = themeBundle.getResource(path);
- if (url == null)
- throw new IllegalArgumentException(
- "Path " + path + " not found in bundle " + themeBundle.getSymbolicName());
- return url.openStream();
+ if (url == null) {
+ if (parentTheme != null)
+ return parentTheme.loadPath(path);
+ else
+ throw new IllegalArgumentException(
+ "Path " + path + " not found in bundle " + themeBundle.getSymbolicName());
+ } else {
+ return url.openStream();
+ }
}
private static Bundle findThemeBundle(BundleContext bundleContext, String themeId) {