*/
InputStream getResourceAsStream(String resourceName) throws IOException;
+ /** Relative paths to standard web CSS. */
+ Set<String> getWebCssPaths();
+
/** Relative paths to RAP specific CSS. */
Set<String> getRapCssPaths();
+ /** Relative paths to SWT specific CSS. */
+ Set<String> getSwtCssPaths();
+
/** Relative paths to images such as icons. */
Set<String> getImagesPaths();
/** The default icon size (typically the smallest). */
Integer getDefaultIconSize();
+ /** Loads one of the relative path provided by the other methods. */
+ InputStream loadPath(String path) throws IOException;
+
/**
* And icon with this file name (without the extension), with a best effort to
* find the appropriate size, or <code>null</code> if not found.
Image getIcon(String name, Integer preferredSize);
static CmsTheme getCmsTheme(Composite parent) {
- // find parent shell
- Shell topShell = parent.getShell();
- while (topShell.getParent() != null)
- topShell = (Shell) topShell.getParent();
- return (CmsTheme) topShell.getData(CmsTheme.class.getName());
+ CmsTheme theme = (CmsTheme) parent.getData(CmsTheme.class.getName());
+ if (theme == null) {
+ // find parent shell
+ Shell topShell = parent.getShell();
+ while (topShell.getParent() != null)
+ topShell = (Shell) topShell.getParent();
+ theme = (CmsTheme) topShell.getData(CmsTheme.class.getName());
+ parent.setData(CmsTheme.class.getName(), theme);
+ }
+ return theme;
}
static void registerCmsTheme(Shell shell, CmsTheme theme) {