james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nor...@apache.org
Subject svn commit: r880954 - in /james/hupa/trunk/client/src/main/java/org/apache/hupa/client: ./ gin/ mvp/
Date Mon, 16 Nov 2009 20:54:09 GMT
Author: norman
Date: Mon Nov 16 20:54:08 2009
New Revision: 880954

URL: http://svn.apache.org/viewvc?rev=880954&view=rev
Log:
Inject HupaMessage/HupaConstants/HupaImageBundle and add PlaceHolder for Contacs

Added:
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/ContactsPresenter.java
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/ContactsView.java
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/NameAwareWidgetDisplay.java
      - copied, changed from r880698, james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/NameAwareWidgetContainerDisplay.java
Removed:
    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/HupaConstants.java
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/HupaConstants.properties
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/HupaConstants_de.properties
    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/AppView.java
    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/IMAPMessageListView.java
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageView.java
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/LoginView.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/MessageSendView.java

Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/HupaConstants.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/HupaConstants.java?rev=880954&r1=880953&r2=880954&view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/HupaConstants.java (original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/HupaConstants.java Mon Nov
16 20:54:08 2009
@@ -113,4 +113,8 @@
     public String markUnseen();
 
     public String refresh();
+
+    public String contactsTab();
+
+    public String mailTab();
 }

Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/HupaConstants.properties
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/HupaConstants.properties?rev=880954&r1=880953&r2=880954&view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/HupaConstants.properties
(original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/HupaConstants.properties
Mon Nov 16 20:54:08 2009
@@ -67,3 +67,5 @@
 markSeen=Mark seen
 markUnseen=Mark unseen
 refresh=Refresh
+mailTab=Mail
+contactsTab=Contacts

Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/HupaConstants_de.properties
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/HupaConstants_de.properties?rev=880954&r1=880953&r2=880954&view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/HupaConstants_de.properties
(original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/HupaConstants_de.properties
Mon Nov 16 20:54:08 2009
@@ -67,3 +67,6 @@
 markSeen=Gelesen markieren
 markUnseen=Ungelesen markieren
 refresh=Aktualisieren
+mailTab=Email
+contactsTab=Kontakte
+

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=880954&r1=880953&r2=880954&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 20:54:08 2009
@@ -29,6 +29,8 @@
 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.ContactsPresenter;
+import org.apache.hupa.client.mvp.ContactsView;
 import org.apache.hupa.client.mvp.ContainerPresenter;
 import org.apache.hupa.client.mvp.ContainerView;
 import org.apache.hupa.client.mvp.IMAPMessageListPresenter;
@@ -62,6 +64,7 @@
         bindPresenter(MessageSendPresenter.class, MessageSendPresenter.Display.class, MessageSendView.class);
         bindPresenter(AppPresenter.class, AppPresenter.Display.class, AppView.class);
         bindPresenter(ContainerPresenter.class, WidgetContainerDisplay.class, ContainerView.class);
+        bindPresenter(ContactsPresenter.class, ContactsPresenter.Display.class, ContactsView.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/AppView.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/AppView.java?rev=880954&r1=880953&r2=880954&view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/AppView.java (original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/AppView.java Mon Nov
16 20:54:08 2009
@@ -22,7 +22,6 @@
 import org.apache.hupa.client.HupaConstants;
 import org.apache.hupa.shared.events.ServerStatusEvent.ServerStatus;
 
-import com.google.gwt.core.client.GWT;
 import com.google.gwt.event.dom.client.HasClickHandlers;
 import com.google.gwt.user.client.ui.Composite;
 import com.google.gwt.user.client.ui.HTML;
@@ -34,6 +33,7 @@
 import com.google.gwt.user.client.ui.SimplePanel;
 import com.google.gwt.user.client.ui.VerticalPanel;
 import com.google.gwt.user.client.ui.Widget;
+import com.google.inject.Inject;
 
 /**
  * AppView is the main WidgetContainer which show the LoginView or the MainView depending
on if 
@@ -42,9 +42,8 @@
  */
 public class AppView extends Composite implements AppPresenter.Display {
     private SimplePanel mainPanel = new SimplePanel();
-    private HupaConstants constants = GWT.create(HupaConstants.class);
     private HorizontalPanel northTop = new HorizontalPanel();
-    private Hyperlink logoutButton = new Hyperlink(constants.logoutButton(),"");
+    private Hyperlink logoutButton;
     private SimplePanel topNavigatorPanel = new SimplePanel();
     private HTML dummy = new HTML("&nbsp");
     private Label userName = new Label();
@@ -71,7 +70,10 @@
         }
     }
 
-    public AppView() {
+    @Inject
+    public AppView(HupaConstants constants) {
+        logoutButton = new Hyperlink(constants.logoutButton(),"");
+
         VerticalPanel vPanel = new VerticalPanel();
 
         vPanel.setSpacing(3);
@@ -108,6 +110,7 @@
         vPanel.setCellVerticalAlignment(header, VerticalPanel.ALIGN_MIDDLE);
 
         vPanel.add(mainPanel);
+        vPanel.setCellHorizontalAlignment(mainPanel, VerticalPanel.ALIGN_LEFT);
 
         dummy.setHeight("100%");
         showTopNavigation(false);

Added: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/ContactsPresenter.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/ContactsPresenter.java?rev=880954&view=auto
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/ContactsPresenter.java
(added)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/ContactsPresenter.java
Mon Nov 16 20:54:08 2009
@@ -0,0 +1,56 @@
+/****************************************************************
+ * 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 com.google.inject.Inject;
+
+import net.customware.gwt.presenter.client.EventBus;
+import net.customware.gwt.presenter.client.widget.WidgetDisplay;
+import net.customware.gwt.presenter.client.widget.WidgetPresenter;
+
+public class ContactsPresenter extends WidgetPresenter<ContactsPresenter.Display>{
+
+    @Inject
+    public ContactsPresenter(Display display, EventBus eventBus) {
+        super(display, eventBus);
+    }
+
+    public interface Display extends NameAwareWidgetDisplay, WidgetDisplay {
+        
+    }
+    
+    @Override
+    protected void onBind() {
+        // TODO Auto-generated method stub
+        
+    }
+
+    @Override
+    protected void onRevealDisplay() {
+        // TODO Auto-generated method stub
+        
+    }
+
+    @Override
+    protected void onUnbind() {
+        // TODO Auto-generated method stub
+        
+    }
+
+}

Added: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/ContactsView.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/ContactsView.java?rev=880954&view=auto
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/ContactsView.java (added)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/ContactsView.java Mon
Nov 16 20:54:08 2009
@@ -0,0 +1,57 @@
+/****************************************************************
+ * 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 org.apache.hupa.client.HupaConstants;
+
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.HorizontalPanel;
+import com.google.gwt.user.client.ui.Widget;
+import com.google.inject.Inject;
+
+public class ContactsView extends Composite implements ContactsPresenter.Display{
+
+    private HorizontalPanel panel = new HorizontalPanel();
+    private HupaConstants constants;
+    @Inject
+    public ContactsView(HupaConstants constants) {
+        this.constants = constants;
+        panel.setWidth("100%");
+        panel.setHeight("100");
+        initWidget(panel);
+    }
+    
+    /*
+     * (non-Javadoc)
+     * @see org.apache.hupa.client.mvp.NameAwareWidgetDisplay#getName()
+     */
+    public String getName() {
+        return constants.contactsTab();
+    }
+
+    /*
+     * (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/ContainerPresenter.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/ContainerPresenter.java?rev=880954&r1=880953&r2=880954&view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/ContainerPresenter.java
(original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/ContainerPresenter.java
Mon Nov 16 20:54:08 2009
@@ -13,8 +13,8 @@
     private MainPresenter presenter;
     
     @Inject
-    public ContainerPresenter(WidgetContainerDisplay display, EventBus eventBus, MainPresenter
presenter) {
-        super(display, eventBus, presenter);
+    public ContainerPresenter(WidgetContainerDisplay display, EventBus eventBus, MainPresenter
presenter, ContactsPresenter contactPresenter) {
+        super(display, eventBus, presenter,contactPresenter);
         this.presenter = presenter;
         // TODO Auto-generated constructor stub
     }

Modified: 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=880954&r1=880953&r2=880954&view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/ContainerView.java (original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/ContainerView.java Mon
Nov 16 20:54:08 2009
@@ -40,14 +40,14 @@
     }
     
     /**
-     * Widgets which should get add to the Container needs to implements the NameAwareWidgetContainerDisplay
interface
+     * Widgets which should get add to the Container needs to implements the NameAwareWidgetDisplay
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());
+        if (widget instanceof NameAwareWidgetDisplay) {
+            tabPanel.add(widget,((NameAwareWidgetDisplay) widget).getName());
         } else {
             throw new IllegalArgumentException("Given widget must implement NameAwareWidgetContainerDisplay");
         }

Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListView.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListView.java?rev=880954&r1=880953&r2=880954&view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListView.java
(original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListView.java
Mon Nov 16 20:54:08 2009
@@ -41,7 +41,6 @@
 import org.cobogw.gwt.user.client.ui.Button;
 import org.cobogw.gwt.user.client.ui.ButtonBar;
 
-import com.google.gwt.core.client.GWT;
 import com.google.gwt.event.dom.client.ChangeEvent;
 import com.google.gwt.event.dom.client.ChangeHandler;
 import com.google.gwt.event.dom.client.HasChangeHandlers;
@@ -92,35 +91,48 @@
 @SuppressWarnings("deprecation")
 public class IMAPMessageListView extends Composite implements Display{
 
-    private HupaConstants constants = GWT.create(HupaConstants.class);
-    private HupaMessages messages = GWT.create(HupaMessages.class);
-    private HupaImageBundle imageBundle = GWT.create(HupaImageBundle.class);
+    @SuppressWarnings("unused")
+    private HupaMessages messages;
+    private HupaImageBundle imageBundle;
 
     private PagingOptions options;
     private DragRefetchPagingScrollTable<Message> mailTable;
     private CachedTableModel<Message> cTableModel;
 
     private FixedWidthGrid dataTable = createDataTable();
-    private EnableButton deleteMailButton = new EnableButton(constants.deleteMailButton());
-    private    Button newMailButton = new Button(constants.newMailButton());
-    private Button deleteAllMailButton = new Button(constants.deleteAll());
+    private EnableButton deleteMailButton;
+    private Button newMailButton;
+    private Button deleteAllMailButton;
     private ConfirmDialogBox confirmBox = new ConfirmDialogBox();
     private ConfirmDialogBox confirmDeleteAllBox = new ConfirmDialogBox();
-    private EnableButton markSeenButton = new EnableButton(constants.markSeen());
-    private EnableButton markUnSeenButton = new EnableButton(constants.markUnseen());
+    private EnableButton markSeenButton;
+    private EnableButton markUnSeenButton;
 
     private ListBox pageBox = new ListBox();
-    private Hyperlink allLink = new Hyperlink(constants.all(),"");    
-    private Hyperlink noneLink = new Hyperlink(constants.none(),"");
-    private Hyperlink refreshLink = new Hyperlink(constants.refresh(),"");
+    private Hyperlink allLink;    
+    private Hyperlink noneLink;
+    private Hyperlink refreshLink;
     private MultiWordSuggestOracle oracle = new MultiWordSuggestOracle(" ,@");
     private SuggestBox searchBox = new SuggestBox(oracle);
-    private Button searchButton = new Button(constants.searchButton());
+    private Button searchButton;
     private Loading expandLoading = new Loading(false);
     
     @Inject
-    public IMAPMessageListView(PagingScrollTableRowDragController controller, MessageTableModel
mTableModel) {
-    	this.cTableModel = new CachedTableModel<Message>(mTableModel);
+    public IMAPMessageListView(final PagingScrollTableRowDragController controller, final
MessageTableModel mTableModel, final HupaConstants constants, final HupaMessages messages,
final HupaImageBundle imageBundle) {
+    	this.messages = messages;
+    	this.imageBundle = imageBundle;
+    	
+    	deleteMailButton = new EnableButton(constants.deleteMailButton());
+        newMailButton = new Button(constants.newMailButton());
+        deleteAllMailButton = new Button(constants.deleteAll());
+        markSeenButton = new EnableButton(constants.markSeen());
+        markUnSeenButton = new EnableButton(constants.markUnseen());
+        allLink = new Hyperlink(constants.all(),"");    
+        noneLink = new Hyperlink(constants.none(),"");
+        refreshLink = new Hyperlink(constants.refresh(),"");
+        searchButton = new Button(constants.searchButton());
+        
+        this.cTableModel = new CachedTableModel<Message>(mTableModel);
         cTableModel.setRowCount(MutableTableModel.UNKNOWN_ROW_COUNT);
         mTableModel.addRowCountChangeHandler(new RowCountChangeHandler() {
 			

Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageView.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageView.java?rev=880954&r1=880953&r2=880954&view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageView.java
(original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageView.java
Mon Nov 16 20:54:08 2009
@@ -56,11 +56,12 @@
 import com.google.gwt.user.client.ui.SimplePanel;
 import com.google.gwt.user.client.ui.VerticalPanel;
 import com.google.gwt.user.client.ui.Widget;
+import com.google.inject.Inject;
 
 public class IMAPMessageView extends Composite implements Display{
     
-    private HupaImageBundle imageBundle = GWT.create(HupaImageBundle.class);
-    private HupaConstants constants = GWT.create(HupaConstants.class);
+    private HupaImageBundle imageBundle;
+    //private HupaConstants constants = GWT.create(HupaConstants.class);
     private Grid detailGrid = new Grid(5, 2);
     private Label from = new Label();
     private Label cc = new Label();
@@ -71,8 +72,8 @@
     private Button replyMsgButton = new Button();
     private Button replyAllMsgButton = new Button();
     private Button forwardMsgButton = new Button();
-    private Hyperlink showRawButton = new Hyperlink(constants.rawButton(),"");
-    private Hyperlink backButton = new Hyperlink(constants.backButton(),"");
+    private Hyperlink showRawButton;
+    private Hyperlink backButton;
     private FlowPanel attachments = new FlowPanel();
     private MyDialogBox rawDialogBox = new MyDialogBox();
     private Iframe rawFrame = new Iframe();
@@ -81,7 +82,12 @@
     public final static int REPLY_ALL_BUTTON = 2;
     private Loading loading  = new Loading(true);
     private SimplePanel container = new SimplePanel();
-    public IMAPMessageView() {
+    
+    @Inject
+    public IMAPMessageView(HupaConstants constants, HupaImageBundle imageBundle) {
+        this.imageBundle = imageBundle;
+        showRawButton = new Hyperlink(constants.rawButton(),"");
+        backButton = new Hyperlink(constants.backButton(),"");
         final VerticalPanel mPanel = new VerticalPanel();
         mPanel.setWidth(Window.getClientWidth() -200 +"px");
         

Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/LoginView.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/LoginView.java?rev=880954&r1=880953&r2=880954&view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/LoginView.java (original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/LoginView.java Mon Nov
16 20:54:08 2009
@@ -25,12 +25,10 @@
 import org.cobogw.gwt.user.client.ui.ButtonBar;
 import org.cobogw.gwt.user.client.ui.RoundedPanel;
 
-import com.google.gwt.core.client.GWT;
 import com.google.gwt.event.dom.client.HasClickHandlers;
 import com.google.gwt.event.dom.client.KeyCodes;
 import com.google.gwt.event.dom.client.KeyUpEvent;
 import com.google.gwt.event.dom.client.KeyUpHandler;
-import com.google.gwt.user.client.ui.CheckBox;
 import com.google.gwt.user.client.ui.Composite;
 import com.google.gwt.user.client.ui.Focusable;
 import com.google.gwt.user.client.ui.Grid;
@@ -41,6 +39,7 @@
 import com.google.gwt.user.client.ui.TextBox;
 import com.google.gwt.user.client.ui.VerticalPanel;
 import com.google.gwt.user.client.ui.Widget;
+import com.google.inject.Inject;
 
 /**
  * View which shows the Login from
@@ -48,19 +47,19 @@
  */
 public class LoginView extends Composite implements KeyUpHandler,LoginPresenter.Display{
     
-    private HupaConstants constants = GWT.create(HupaConstants.class);
-    private Button loginButton = new Button(constants.loginButton());
-    private Button resetButton = new Button(constants.resetButton());
+    private Button loginButton;
+    private Button resetButton;
     private TextBox usernameTextBox = new TextBox();
     private PasswordTextBox passwordTextBox = new PasswordTextBox();
-    private CheckBox saveBox = new CheckBox(constants.saveLoginLabel());
     private Label errorLabel = new Label();
     private Loading loading = new Loading(false);
     private int minUsernameLength = 1;
     private int minPasswordLength = 1;
 
-    public LoginView() {
-    
+    @Inject
+    public LoginView(HupaConstants constants) {
+        loginButton = new Button(constants.loginButton());
+        resetButton = new Button(constants.resetButton());        
         VerticalPanel vPanel = new VerticalPanel();
         vPanel.setSpacing(5);
         vPanel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);
@@ -75,13 +74,11 @@
         grid.setWidget(0, 1, usernameTextBox);
         grid.setText(1, 0, constants.passwordLabel());
         grid.setWidget(1, 1, passwordTextBox);
-        grid.setWidget(2, 1, saveBox);
         grid.getCellFormatter().setStyleName(0, 0, "hupa-LoginForm");
         grid.getCellFormatter().setStyleName(0, 1, "hupa-LoginForm");
         grid.getCellFormatter().setStyleName(1, 0, "hupa-LoginForm");
         grid.getCellFormatter().setStyleName(1, 1, "hupa-LoginForm");
         grid.getCellFormatter().setStyleName(1, 0, "hupa-LoginForm");
-        grid.getCellFormatter().setStyleName(2, 1, "hupa-LoginForm");
         grid.getCellFormatter().setHorizontalAlignment(0,0, VerticalPanel.ALIGN_RIGHT);
         grid.getCellFormatter().setHorizontalAlignment(1,0, VerticalPanel.ALIGN_RIGHT);
 

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=880954&r1=880953&r2=880954&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 20:54:08 2009
@@ -24,6 +24,7 @@
 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;
@@ -90,7 +91,7 @@
  */
 public class MainPresenter extends WidgetContainerPresenter<MainPresenter.Display>
{
 
-    public interface Display extends NameAwareWidgetContainerDisplay {
+    public interface Display extends NameAwareWidgetDisplay, WidgetContainerDisplay {
       
         public HasSelectionHandlers<TreeItem> getTree();
 

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=880954&r1=880953&r2=880954&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 20:54:08 2009
@@ -74,7 +74,7 @@
 
     private DockPanel dockPanel;
     private VerticalPanel north;
-    private HupaConstants constants = GWT.create(HupaConstants.class);
+    private HupaConstants constants;
     private RoundedPanel west;
     private IMAPTreeImages tImages = GWT.create(IMAPTreeImages.class);
     private Tree folderTree = new Tree(tImages, true);
@@ -82,13 +82,13 @@
     private Widget centerWidget;
     private RoundedPanel center;
     private IMAPMessageListView mListView;
-    private HupaMessages messages = GWT.create(HupaMessages.class);
+    private HupaMessages messages;
     private VerticalPanel folderPanel = new VerticalPanel();
     private SimplePanel panel = new SimplePanel();
     private HorizontalPanel folderButtonBar = new HorizontalPanel();
-    private EnableHyperlink newFolderButton = new EnableHyperlink(constants.newFolder(),
"");
-    private EnableHyperlink renameFolderButton = new EnableHyperlink(constants.renameFolder(),
"");
-    private EnableHyperlink deleteFolderButton = new EnableHyperlink(constants.deleteFolder(),
"");
+    private EnableHyperlink newFolderButton;
+    private EnableHyperlink renameFolderButton;
+    private EnableHyperlink deleteFolderButton;
     private ConfirmDialogBox confirmFolderDeleteBox = new ConfirmDialogBox();
     private Loading loader = new Loading(false);
     private Loading messageLoader = new Loading(true);
@@ -98,10 +98,16 @@
     protected User user;
 
     @Inject
-    public MainView(EventBus bus, PagingScrollTableRowDragController controllerProvider)
{
+    public MainView(EventBus bus, PagingScrollTableRowDragController controllerProvider,
HupaConstants constants, HupaMessages messages) {
+        this.constants = constants;
+        this.messages = messages;
         this.controller = controllerProvider;
         this.bus = bus;
 
+        newFolderButton = new EnableHyperlink(constants.newFolder(), "");
+        renameFolderButton = new EnableHyperlink(constants.renameFolder(), "");
+        deleteFolderButton = new EnableHyperlink(constants.deleteFolder(), "");
+        
         dockPanel = new DockPanel();
 
         dockPanel.setSpacing(10);
@@ -565,6 +571,6 @@
      * @see org.apache.hupa.client.mvp.NameAwareDisplay#getName()
      */
     public String getName() {
-        return "Email";
+        return constants.mailTab();
     }
 }

Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MessageSendView.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MessageSendView.java?rev=880954&r1=880953&r2=880954&view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MessageSendView.java
(original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MessageSendView.java
Mon Nov 16 20:54:08 2009
@@ -45,6 +45,7 @@
 import com.google.gwt.user.client.ui.TextBox;
 import com.google.gwt.user.client.ui.VerticalPanel;
 import com.google.gwt.user.client.ui.Widget;
+import com.google.inject.Inject;
 
 /**
  * View which displays a form which handle sending of mails
@@ -53,7 +54,6 @@
  */
 public class MessageSendView extends Composite implements
         MessageSendPresenter.Display {
-    private HupaConstants constants = GWT.create(HupaConstants.class);
     private Grid detailGrid = new Grid(6, 3);
     private Label from = new Label();
     private TextBox to = new TextBox();
@@ -63,11 +63,14 @@
     private BaseUploadStatus uploadStatus = new BaseUploadStatus();
     private MultiUploader uploader = new MultiUploader(uploadStatus);
     private TextArea text = new TextArea();
-    private EnableButton sendButton = new EnableButton(constants.sendButton());
-    private EnableHyperlink backButton = new EnableHyperlink(constants.backButton(),"");
+    private EnableButton sendButton;
+    private EnableHyperlink backButton;
     private Loading sendProgress = new Loading(true);
 
-    public MessageSendView() {
+    @Inject
+    public MessageSendView(HupaConstants constants) {
+        sendButton = new EnableButton(constants.sendButton());
+        backButton = new EnableHyperlink(constants.backButton(),"");
         final VerticalPanel mPanel = new VerticalPanel();
         //mPanel.setWidth("100%");
         mPanel.setWidth(Window.getClientWidth() -200 +"px");

Copied: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/NameAwareWidgetDisplay.java
(from r880698, 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/NameAwareWidgetDisplay.java?p2=james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/NameAwareWidgetDisplay.java&p1=james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/NameAwareWidgetContainerDisplay.java&r1=880698&r2=880954&rev=880954&view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/NameAwareWidgetContainerDisplay.java
(original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/NameAwareWidgetDisplay.java
Mon Nov 16 20:54:08 2009
@@ -19,9 +19,7 @@
 
 package org.apache.hupa.client.mvp;
 
-import net.customware.gwt.presenter.client.widget.WidgetContainerDisplay;
-
-public interface NameAwareWidgetContainerDisplay extends WidgetContainerDisplay{
+public interface NameAwareWidgetDisplay {
 
     /**
      * Return the name for the Display to show



---------------------------------------------------------------------
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