Use tabbed area.
[gpl/argeo-suite.git] / org.argeo.suite.ui / src / org / argeo / suite / ui / DefaultLeadPane.java
index cbc0a7846636223bf9862fc40b941a8dacd15a6d..931f5a1ec1f8590c30de95e78ff9ac885e4e271f 100644 (file)
@@ -1,11 +1,12 @@
 package org.argeo.suite.ui;
 
-import java.util.Dictionary;
 import java.util.Map;
 
 import javax.jcr.Node;
 import javax.jcr.RepositoryException;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.argeo.cms.Localized;
 import org.argeo.cms.ui.CmsTheme;
 import org.argeo.cms.ui.CmsUiProvider;
@@ -17,11 +18,11 @@ import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
-import org.osgi.service.cm.ConfigurationException;
-import org.osgi.service.cm.ManagedService;
 
 /** Side pane listing various perspectives. */
-public class DefaultLeadPane implements CmsUiProvider, ManagedService {
+public class DefaultLeadPane implements CmsUiProvider {
+       private final static Log log = LogFactory.getLog(DefaultLeadPane.class);
+
        @Override
        public Control createUi(Composite parent, Node node) throws RepositoryException {
                CmsView cmsView = CmsView.getCmsView(parent);
@@ -32,30 +33,25 @@ public class DefaultLeadPane implements CmsUiProvider, ManagedService {
                layout.marginRight = 10;
                parent.setLayout(layout);
 
-               Button dashboardB = createButton(parent, SuiteMsg.dashboard, SuiteIcon.dashboard);
+               Button dashboardB = createButton(parent, SuiteMsg.dashboard.name(), SuiteMsg.dashboard, SuiteIcon.dashboard);
                if (!cmsView.isAnonymous()) {
-                       createButton(parent, SuiteMsg.documents, SuiteIcon.documents);
-                       createButton(parent, SuiteMsg.people, SuiteIcon.people);
-                       createButton(parent, SuiteMsg.locations, SuiteIcon.location);
+//                     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);
                }
                return dashboardB;
        }
 
-       protected Button createButton(Composite parent, Localized msg, CmsIcon icon) {
+       protected Button createButton(Composite parent, String layer, Localized msg, CmsIcon icon) {
                CmsTheme theme = CmsTheme.getCmsTheme(parent);
-               Button button = new Button(parent, SWT.FLAT);
+               Button button = new Button(parent, SWT.PUSH);
                CmsUiUtils.style(button, SuiteStyle.leadPane);
                button.setToolTipText(msg.lead());
                button.setImage(icon.getBigIcon(theme));
+               CmsUiUtils.sendEventOnSelect(button, SuiteEvent.switchLayer.topic(), SuiteEvent.LAYER, layer);
                return button;
        }
 
-       @Override
-       public void updated(Dictionary<String, ?> properties) throws ConfigurationException {
-               // TODO Auto-generated method stub
-
-       }
-
        public void init(Map<String, String> properties) {
 
        }