import org.argeo.cms.Localized;
import org.argeo.cms.ui.CmsTheme;
import org.argeo.cms.ui.CmsUiProvider;
import org.argeo.cms.Localized;
import org.argeo.cms.ui.CmsTheme;
import org.argeo.cms.ui.CmsUiProvider;
/** Side pane listing various perspectives. */
public class DefaultLeadPane implements CmsUiProvider {
/** Side pane listing various perspectives. */
public class DefaultLeadPane implements CmsUiProvider {
- // private final static Log log = LogFactory.getLog(DefaultLeadPane.class);
+ private final static Log log = LogFactory.getLog(DefaultLeadPane.class);
+
+ public static enum Property {
+ defaultLayers;
+ }
+
+ private String[] defaultLayers;
- Button dashboardB = createButton(parent, SuiteMsg.dashboard.name(), SuiteMsg.dashboard, SuiteIcon.dashboard);
+ Button first = null;
+ for (String layerId : defaultLayers) {
+ Button b = createButton(parent, layerId, SuiteMsg.dashboard, SuiteIcon.dashboard);
+ if (first == null)
+ first = b;
+ }
+
+// Button dashboardB = createButton(parent, SuiteMsg.dashboard.name(), SuiteMsg.dashboard, SuiteIcon.dashboard);
if (!cmsView.isAnonymous()) {
// createButton(parent, SuiteMsg.documents.name(), SuiteMsg.documents, SuiteIcon.documents);
// createButton(parent, SuiteMsg.people.name(), SuiteMsg.people, SuiteIcon.people);
// createButton(parent, SuiteMsg.locations.name(), SuiteMsg.locations, SuiteIcon.location);
}
if (!cmsView.isAnonymous()) {
// createButton(parent, SuiteMsg.documents.name(), SuiteMsg.documents, SuiteIcon.documents);
// createButton(parent, SuiteMsg.people.name(), SuiteMsg.people, SuiteIcon.people);
// createButton(parent, SuiteMsg.locations.name(), SuiteMsg.locations, SuiteIcon.location);
}
}
protected Button createButton(Composite parent, String layer, Localized msg, CmsIcon icon) {
}
protected Button createButton(Composite parent, String layer, Localized msg, CmsIcon icon) {
- public void init(Map<String, String> properties) {
-
+ public void init(Map<String, Object> properties) {
+ defaultLayers = (String[]) properties.get(Property.defaultLayers.toString());
+ if (defaultLayers == null)
+ throw new IllegalArgumentException("Default layers must be set.");
+ if (log.isDebugEnabled())
+ log.debug("Default layers: " + defaultLayers);