]> git.argeo.org Git - lgpl/argeo-commons.git/blobdiff - eclipse/org.argeo.cms.swt/src/org/argeo/cms/swt/osgi/BundleCmsSwtTheme.java
Improve ACR / JCR integration.
[lgpl/argeo-commons.git] / eclipse / org.argeo.cms.swt / src / org / argeo / cms / swt / osgi / BundleCmsSwtTheme.java
index b9b2751a7f55dd3772a1bf494a6cdd25ac897aff..c37a5b74476fdd361e951813270914dfcd9096ae 100644 (file)
@@ -17,7 +17,7 @@ public class BundleCmsSwtTheme extends BundleCmsTheme implements CmsSwtTheme {
 
        private Map<String, Map<Integer, String>> iconPaths = new HashMap<>();
 
-       public Image getImage(String path) {
+       protected Image getImage(String path) {
                if (!imageCache.containsKey(path)) {
                        try (InputStream in = getResourceAsStream(path)) {
                                if (in == null)
@@ -55,11 +55,18 @@ public class BundleCmsSwtTheme extends BundleCmsTheme implements CmsSwtTheme {
                        paths: for (String p : getImagesPaths()) {
                                int lastSlash = p.lastIndexOf('/');
                                String fileName = p;
+                               String ext = "";
                                if (lastSlash >= 0)
                                        fileName = p.substring(lastSlash + 1);
                                int lastDot = fileName.lastIndexOf('.');
-                               if (lastDot >= 0)
+                               if (lastDot >= 0) {
+                                       ext = fileName.substring(lastDot + 1);
                                        fileName = fileName.substring(0, lastDot);
+                               }
+
+                               if ("svg".equals(ext))
+                                       continue paths;
+
                                if (fileName.equals(name)) {// matched
                                        Image img = getImage(p);
                                        int width = img.getBounds().width;