X-Git-Url: https://git.argeo.org/?p=lgpl%2Fargeo-commons.git;a=blobdiff_plain;f=swt%2Frcp%2Forg.argeo.cms.swt.rcp%2Fsrc%2Forg%2Fargeo%2Fcms%2Fui%2Frcp%2FCmsRcpApp.java;fp=swt%2Frcp%2Forg.argeo.cms.swt.rcp%2Fsrc%2Forg%2Fargeo%2Fcms%2Fui%2Frcp%2FCmsRcpApp.java;h=7af1456b7dad68905d30986101ef50781a8033bd;hp=77aeae061fc780a80786477864f8a0391760fe18;hb=b95462873703848193e56fcbe997693630db6121;hpb=55d88fba80cec198a0f11ba7545e19878c51fc5e diff --git a/swt/rcp/org.argeo.cms.swt.rcp/src/org/argeo/cms/ui/rcp/CmsRcpApp.java b/swt/rcp/org.argeo.cms.swt.rcp/src/org/argeo/cms/ui/rcp/CmsRcpApp.java index 77aeae061..7af1456b7 100644 --- a/swt/rcp/org.argeo.cms.swt.rcp/src/org/argeo/cms/ui/rcp/CmsRcpApp.java +++ b/swt/rcp/org.argeo.cms.swt.rcp/src/org/argeo/cms/ui/rcp/CmsRcpApp.java @@ -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);