james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nor...@apache.org
Subject svn commit: r880698 - in /james/hupa/trunk/client: src/main/java/org/apache/hupa/client/gin/ src/main/java/org/apache/hupa/client/mvp/ src/main/java/org/apache/hupa/client/mvp/place/ war/
Date Mon, 16 Nov 2009 10:26:23 GMT
Author: norman
Date: Mon Nov 16 10:26:09 2009
New Revision: 880698

URL: http://svn.apache.org/viewvc?rev=880698&view=rev
Log:
Start to add navigation for switching between Email and Addressbook ( coming soon)

Added:
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/ContainerPresenter.java
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/ContainerView.java
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/NameAwareWidgetContainerDisplay.java
Modified:
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/gin/HupaClientModule.java
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/AppPresenter.java
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MainPresenter.java
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MainView.java
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/place/MainPresenterPlace.java
    james/hupa/trunk/client/war/Hupa.css

Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/gin/HupaClientModule.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/gin/HupaClientModule.java?rev=880698&r1=880697&r2=880698&view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/gin/HupaClientModule.java
(original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/gin/HupaClientModule.java
Mon Nov 16 10:26:09 2009
@@ -23,11 +23,14 @@
 import net.customware.gwt.presenter.client.EventBus;
 import net.customware.gwt.presenter.client.gin.AbstractPresenterModule;
 import net.customware.gwt.presenter.client.place.PlaceManager;
+import net.customware.gwt.presenter.client.widget.WidgetContainerDisplay;
 
 import org.apache.hupa.client.CachingDispatchAsync;
 import org.apache.hupa.client.dnd.PagingScrollTableRowDragController;
 import org.apache.hupa.client.mvp.AppPresenter;
 import org.apache.hupa.client.mvp.AppView;
+import org.apache.hupa.client.mvp.ContainerPresenter;
+import org.apache.hupa.client.mvp.ContainerView;
 import org.apache.hupa.client.mvp.IMAPMessageListPresenter;
 import org.apache.hupa.client.mvp.IMAPMessageListView;
 import org.apache.hupa.client.mvp.IMAPMessagePresenter;
@@ -58,6 +61,7 @@
         bindPresenter(MainPresenter.class,MainPresenter.Display.class,MainView.class);
         bindPresenter(MessageSendPresenter.class, MessageSendPresenter.Display.class, MessageSendView.class);
         bindPresenter(AppPresenter.class, AppPresenter.Display.class, AppView.class);
+        bindPresenter(ContainerPresenter.class, WidgetContainerDisplay.class, ContainerView.class);
         bind(CachingDispatchAsync.class);
         bind(PagingScrollTableRowDragController.class).in(Singleton.class);
         bind(MessageTableModel.class).in(Singleton.class);

Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/AppPresenter.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/AppPresenter.java?rev=880698&r1=880697&r2=880698&view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/AppPresenter.java (original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/AppPresenter.java Mon
Nov 16 10:26:09 2009
@@ -76,20 +76,20 @@
     private DispatchAsync dispatcher;
     private User user;
     private ServerStatus serverStatus = ServerStatus.Available;
-    private MainPresenter mainPresenter;
+    private ContainerPresenter containerPresenter;
     private LoginPresenter loginPresenter;
     
     @Inject
-    public AppPresenter(Display display, DispatchAsync dispatcher,final EventBus bus, LoginPresenter
loginPresenter, MainPresenter mainPresenter) {
-        super(display,bus, loginPresenter, mainPresenter);
-        this.mainPresenter = mainPresenter;
+    public AppPresenter(Display display, DispatchAsync dispatcher,final EventBus bus, LoginPresenter
loginPresenter, ContainerPresenter containerPresenter) {
+        super(display,bus, loginPresenter, containerPresenter);
+        this.containerPresenter = containerPresenter;
         this.loginPresenter = loginPresenter;
         this.dispatcher = dispatcher;  
     }
 
     private void showMain(User user) {
         display.showTopNavigation(true);
-        mainPresenter.revealDisplay(user);
+        containerPresenter.revealDisplay(user);
     }
     
     

Added: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/ContainerPresenter.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/ContainerPresenter.java?rev=880698&view=auto
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/ContainerPresenter.java
(added)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/ContainerPresenter.java
Mon Nov 16 10:26:09 2009
@@ -0,0 +1,28 @@
+package org.apache.hupa.client.mvp;
+
+import org.apache.hupa.shared.data.User;
+
+import com.google.inject.Inject;
+
+import net.customware.gwt.presenter.client.EventBus;
+import net.customware.gwt.presenter.client.widget.WidgetContainerDisplay;
+import net.customware.gwt.presenter.client.widget.WidgetContainerPresenter;
+
+public class ContainerPresenter extends WidgetContainerPresenter<WidgetContainerDisplay>{
+
+    private MainPresenter presenter;
+    
+    @Inject
+    public ContainerPresenter(WidgetContainerDisplay display, EventBus eventBus, MainPresenter
presenter) {
+        super(display, eventBus, presenter);
+        this.presenter = presenter;
+        // TODO Auto-generated constructor stub
+    }
+
+    public void revealDisplay(User user) {
+        revealDisplay();
+        presenter.revealDisplay(user);
+        
+    }
+
+}

Added: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/ContainerView.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/ContainerView.java?rev=880698&view=auto
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/ContainerView.java (added)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/ContainerView.java Mon
Nov 16 10:26:09 2009
@@ -0,0 +1,81 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.hupa.client.mvp;
+
+import net.customware.gwt.presenter.client.widget.WidgetContainerDisplay;
+
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.TabPanel;
+import com.google.gwt.user.client.ui.Widget;
+
+/**
+ * The View which acts as container for Hupa sub parts
+ * 
+ *
+ */
+public class ContainerView extends Composite implements WidgetContainerDisplay {
+
+    private TabPanel tabPanel = new TabPanel();
+    
+    public ContainerView () {
+        tabPanel.getDeckPanel().setStyleName("hupa-Container-Navigation");
+        initWidget(tabPanel);
+    }
+    
+    /**
+     * Widgets which should get add to the Container needs to implements the NameAwareWidgetContainerDisplay
interface
+     * 
+     * (non-Javadoc)
+     * @see net.customware.gwt.presenter.client.widget.WidgetContainerDisplay#addWidget(com.google.gwt.user.client.ui.Widget)
+     */
+    public void addWidget(Widget widget) {
+        if (widget instanceof NameAwareWidgetContainerDisplay) {
+            tabPanel.add(widget,((NameAwareWidgetContainerDisplay) widget).getName());
+        } else {
+            throw new IllegalArgumentException("Given widget must implement NameAwareWidgetContainerDisplay");
+        }
+    }
+
+    /*
+     * (non-Javadoc)
+     * @see net.customware.gwt.presenter.client.widget.WidgetContainerDisplay#removeWidget(com.google.gwt.user.client.ui.Widget)
+     */
+    public void removeWidget(Widget widget) {
+        tabPanel.remove(widget);
+    }
+
+    /*
+     * (non-Javadoc)
+     * @see net.customware.gwt.presenter.client.widget.WidgetContainerDisplay#showWidget(com.google.gwt.user.client.ui.Widget)
+     */
+    public void showWidget(Widget widget) {
+        int index = tabPanel.getWidgetIndex(widget);
+        tabPanel.selectTab(index);
+    }
+
+    /*
+     * (non-Javadoc)
+     * @see net.customware.gwt.presenter.client.widget.WidgetDisplay#asWidget()
+     */
+    public Widget asWidget() {
+        return this;
+    }
+
+}

Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MainPresenter.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MainPresenter.java?rev=880698&r1=880697&r2=880698&view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MainPresenter.java (original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MainPresenter.java Mon
Nov 16 10:26:09 2009
@@ -24,7 +24,6 @@
 import java.util.Comparator;
 
 import net.customware.gwt.presenter.client.EventBus;
-import net.customware.gwt.presenter.client.widget.WidgetContainerDisplay;
 import net.customware.gwt.presenter.client.widget.WidgetContainerPresenter;
 
 import org.apache.hupa.client.CachingDispatchAsync;
@@ -92,7 +91,7 @@
  */
 public class MainPresenter extends WidgetContainerPresenter<MainPresenter.Display>
{
 
-    public interface Display extends WidgetContainerDisplay {
+    public interface Display extends NameAwareWidgetContainerDisplay {
         
         public HasClickHandlers getSearchClick();
 

Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MainView.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MainView.java?rev=880698&r1=880697&r2=880698&view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MainView.java (original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MainView.java Mon Nov
16 10:26:09 2009
@@ -630,4 +630,13 @@
         centerWidget = widget;
         center.setWidget(centerWidget); 
     }
+
+
+    /*
+     * (non-Javadoc)
+     * @see org.apache.hupa.client.mvp.NameAwareDisplay#getName()
+     */
+    public String getName() {
+        return "Email";
+    }
 }

Added: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/NameAwareWidgetContainerDisplay.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/NameAwareWidgetContainerDisplay.java?rev=880698&view=auto
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/NameAwareWidgetContainerDisplay.java
(added)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/NameAwareWidgetContainerDisplay.java
Mon Nov 16 10:26:09 2009
@@ -0,0 +1,32 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.hupa.client.mvp;
+
+import net.customware.gwt.presenter.client.widget.WidgetContainerDisplay;
+
+public interface NameAwareWidgetContainerDisplay extends WidgetContainerDisplay{
+
+    /**
+     * Return the name for the Display to show
+     * 
+     * @return name
+     */
+    public String getName();
+}

Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/place/MainPresenterPlace.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/place/MainPresenterPlace.java?rev=880698&r1=880697&r2=880698&view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/place/MainPresenterPlace.java
(original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/place/MainPresenterPlace.java
Mon Nov 16 10:26:09 2009
@@ -19,10 +19,8 @@
 package org.apache.hupa.client.mvp.place;
 
 import org.apache.hupa.client.mvp.MainPresenter;
-import org.eclipse.swt.widgets.Display;
 
 import com.google.gwt.core.client.GWT;
-import com.google.gwt.event.dom.client.ClickEvent;
 import com.google.inject.Inject;
 import com.google.inject.Provider;
 

Modified: james/hupa/trunk/client/war/Hupa.css
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/war/Hupa.css?rev=880698&r1=880697&r2=880698&view=diff
==============================================================================
--- james/hupa/trunk/client/war/Hupa.css (original)
+++ james/hupa/trunk/client/war/Hupa.css Mon Nov 16 10:26:09 2009
@@ -8,6 +8,18 @@
     border-color:					#E0ECFF;
 }
 
+.gwt-TabBar .gwt-TabBarItem-selected {
+    background-color:				#E0ECFF;
+}
+
+.gwt-TabBar .gwt-TabBarItem {
+    background-color:				#E0ECFF;
+}
+
+.hupa-Container-Navigation { 
+	border: 2px solid #E0ECFF;
+} 
+
 .cbg-Button, .gwt-HTML, .gwt-Label, .gwt-Tree .gwt-TreeItem, .gwt-SuggestBoxPopup .item,
hupa-LoginForm, .hupa-IMAPMessageWidget-Header-Content, .hupa-ToolTip, .hupa-IMAPFolder, .gwt-ListBox,
.gwt-HyperLink, .gwt-TextBox{
     font-size:						12px;
 	font-family: 					Arial, Helvetica, sans-serif;



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message