Temporarily disable recognition of standard Map layer.
[gpl/argeo-suite.git] / org.argeo.app.ui / src / org / argeo / app / ui / SuiteApp.java
index 0d898f5e22b0dbc6bb1239d3434bd67125e11f73..4c4f1bb968b1bf8e012575216256c1bbb147d8e9 100644 (file)
@@ -70,10 +70,9 @@ public class SuiteApp extends AbstractCmsApp implements EventHandler {
        private String adminLeadPanePid;
        private String loginScreenPid;
 
-
        private String defaultUiName = "app";
        private String adminUiName = "admin";
-       
+
        // FIXME such default names make refactoring more dangerous
        @Deprecated
        private String defaultLayerPid = "argeo.suite.ui.dashboardLayer";
@@ -92,7 +91,6 @@ public class SuiteApp extends AbstractCmsApp implements EventHandler {
 
        private Repository repository;
 
-
        public void init(Map<String, Object> properties) {
                if (log.isDebugEnabled())
                        log.info("Argeo Suite App started");
@@ -141,8 +139,9 @@ public class SuiteApp extends AbstractCmsApp implements EventHandler {
 
        @Override
        public CmsUi initUi(Object parent) {
-               Composite uiParent =(Composite) parent;
-               String uiName = uiParent.getData(UI_NAME_PROPERTY) != null ? uiParent.getData(UI_NAME_PROPERTY).toString() : null;
+               Composite uiParent = (Composite) parent;
+               String uiName = uiParent.getData(UI_NAME_PROPERTY) != null ? uiParent.getData(UI_NAME_PROPERTY).toString()
+                               : null;
                CmsView cmsView = CmsSwtUtils.getCmsView(uiParent);
                if (cmsView == null)
                        throw new IllegalStateException("No CMS view is registered.");
@@ -162,6 +161,9 @@ public class SuiteApp extends AbstractCmsApp implements EventHandler {
 
        @Override
        public String getThemeId(String uiName) {
+               String themeId = System.getProperty("org.argeo.app.theme.default");
+               if (themeId != null)
+                       return themeId;
                return defaultThemeId;
        }
 
@@ -319,6 +321,7 @@ public class SuiteApp extends AbstractCmsApp implements EventHandler {
                        if (types.size() == 0)
                                throw new IllegalArgumentException("No type found for " + context + " (" + listTypes(context) + ")");
                        String type = types.iterator().next();
+                       // FIXME deals with multiple types
                        if (!byType.containsKey(type))
                                throw new IllegalArgumentException("No component found for " + context + " with type " + type);
                        return byType.get(type).get();
@@ -637,5 +640,4 @@ public class SuiteApp extends AbstractCmsApp implements EventHandler {
                this.repository = repository;
        }
 
-       
 }