X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=org.argeo.cms%2Fsrc%2Forg%2Fargeo%2Fcms%2Fosgi%2FBundleCmsTheme.java;h=3ab799f713e1ab9e802a20654efc81426c7de5b7;hb=4e8d82137c2dce7145175eacbd225a52227b6f73;hp=6c195d45f48c742e377f92dcaf874073e843b368;hpb=b4e6fcf06206f70495298eb977694a4fdc24b47d;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.cms/src/org/argeo/cms/osgi/BundleCmsTheme.java b/org.argeo.cms/src/org/argeo/cms/osgi/BundleCmsTheme.java index 6c195d45f..3ab799f71 100644 --- a/org.argeo.cms/src/org/argeo/cms/osgi/BundleCmsTheme.java +++ b/org.argeo.cms/src/org/argeo/cms/osgi/BundleCmsTheme.java @@ -18,7 +18,7 @@ import java.util.TreeSet; 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; @@ -64,7 +64,8 @@ public class BundleCmsTheme implements CmsTheme { // private String swtCssPath; private Bundle themeBundle; - private Integer defaultIconSize = 16; + private Integer smallIconSize = 16; + private Integer bigIconSize = 32; public BundleCmsTheme() { @@ -320,17 +321,27 @@ public class BundleCmsTheme implements CmsTheme { } @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) {