Merge tag 'v2.3.28' into testing
[lgpl/argeo-commons.git] / swt / rcp / org.argeo.cms.swt.rcp / src / org / argeo / cms / ui / rcp / CmsRcpApp.java
index 77aeae061fc780a80786477864f8a0391760fe18..7af1456b7dad68905d30986101ef50781a8033bd 100644 (file)
@@ -81,20 +81,24 @@ public class CmsRcpApp extends AbstractSwtCmsView implements CmsView {
                        // Styling
                        CmsTheme theme = CmsSwtUtils.getCmsTheme(parent);
                        if (theme != null) {
-                               cssEngine = new CSSSWTEngineImpl(display);
-                               for (String path : theme.getSwtCssPaths()) {
-                                       try (InputStream in = theme.loadPath(path)) {
-                                               cssEngine.parseStyleSheet(in);
-                                       } catch (IOException e) {
-                                               throw new IllegalStateException("Cannot load stylesheet " + path, e);
+                               try {
+                                       cssEngine = new CSSSWTEngineImpl(display);
+                                       for (String path : theme.getSwtCssPaths()) {
+                                               try (InputStream in = theme.loadPath(path)) {
+                                                       cssEngine.parseStyleSheet(in);
+                                               } catch (IOException e) {
+                                                       throw new IllegalStateException("Cannot load stylesheet " + path, e);
+                                               }
                                        }
+                                       cssEngine.setErrorHandler(new CSSErrorHandler() {
+                                               public void error(Exception e) {
+                                                       log.error("SWT styling error: ", e);
+                                               }
+                                       });
+                                       applyStyles(shell);
+                               } catch (Throwable e) {// could be a class not found error
+                                       log.error("Cannot initialise RCP theming", e);
                                }
-                               cssEngine.setErrorHandler(new CSSErrorHandler() {
-                                       public void error(Exception e) {
-                                               log.error("SWT styling error: ", e);
-                                       }
-                               });
-                               applyStyles(shell);
                        }
                        shell.layout(true, true);