james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nor...@apache.org
Subject svn commit: r880970 - in /james/hupa/trunk: client/src/main/java/org/apache/hupa/client/ client/src/main/java/org/apache/hupa/client/mvp/ client/src/main/java/org/apache/hupa/client/widgets/ widgets/src/main/java/org/apache/hupa/widgets/ widgets/src/ma...
Date Mon, 16 Nov 2009 21:37:35 GMT
Author: norman
Date: Mon Nov 16 21:37:34 2009
New Revision: 880970

URL: http://svn.apache.org/viewvc?rev=880970&view=rev
Log:
move some reusable widgets to the widget module

Added:
    james/hupa/trunk/widgets/src/main/java/org/apache/hupa/widgets/PagingOptionsConstants.java
    james/hupa/trunk/widgets/src/main/java/org/apache/hupa/widgets/ui/Loading.java
      - copied, changed from r834137, james/hupa/trunk/client/src/main/java/org/apache/hupa/client/widgets/Loading.java
    james/hupa/trunk/widgets/src/main/java/org/apache/hupa/widgets/ui/PagingOptions.java
      - copied, changed from r835896, james/hupa/trunk/client/src/main/java/org/apache/hupa/client/widgets/PagingOptions.java
Removed:
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/widgets/Loading.java
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/widgets/PagingOptions.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/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/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=880970&r1=880969&r2=880970&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 21:37:34 2009
@@ -19,11 +19,13 @@
 
 package org.apache.hupa.client;
 
+import org.apache.hupa.widgets.PagingOptionsConstants;
+
 import gwtupload.client.IUploader.UploaderConstants;
 
 import com.google.gwt.i18n.client.Constants;
 
-public interface HupaConstants extends Constants, UploaderConstants {
+public interface HupaConstants extends Constants, UploaderConstants, PagingOptionsConstants
{
 
     public String usernameLabel();
 
@@ -90,14 +92,7 @@
     public String renameFolder();
     public String deleteFolder();
 
-    public String pageNext();
-
-    public String pageLast();
-
-    public String pagePrev();
-
-    public String pageFirst();
-    
+  
     public String loginAs();
 
     public String backButton();

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=880970&r1=880969&r2=880970&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 21:37:34 2009
@@ -32,12 +32,12 @@
 import org.apache.hupa.client.widgets.DragRefetchPagingScrollTable;
 import org.apache.hupa.client.widgets.EnableButton;
 import org.apache.hupa.client.widgets.HasDialog;
-import org.apache.hupa.client.widgets.Loading;
-import org.apache.hupa.client.widgets.PagingOptions;
 import org.apache.hupa.client.widgets.DragRefetchPagingScrollTable.DragHandlerFactory;
 import org.apache.hupa.shared.data.Message;
 import org.apache.hupa.shared.data.Message.IMAPFlag;
 import org.apache.hupa.widgets.ui.HasEnable;
+import org.apache.hupa.widgets.ui.Loading;
+import org.apache.hupa.widgets.ui.PagingOptions;
 import org.cobogw.gwt.user.client.ui.Button;
 import org.cobogw.gwt.user.client.ui.ButtonBar;
 
@@ -115,7 +115,7 @@
     private MultiWordSuggestOracle oracle = new MultiWordSuggestOracle(" ,@");
     private SuggestBox searchBox = new SuggestBox(oracle);
     private Button searchButton;
-    private Loading expandLoading = new Loading(false);
+    private Loading expandLoading;
     
     @Inject
     public IMAPMessageListView(final PagingScrollTableRowDragController controller, final
MessageTableModel mTableModel, final HupaConstants constants, final HupaMessages messages,
final HupaImageBundle imageBundle) {
@@ -131,7 +131,7 @@
         noneLink = new Hyperlink(constants.none(),"");
         refreshLink = new Hyperlink(constants.refresh(),"");
         searchButton = new Button(constants.searchButton());
-        
+        expandLoading = new Loading(constants.loading());
         this.cTableModel = new CachedTableModel<Message>(mTableModel);
         cTableModel.setRowCount(MutableTableModel.UNKNOWN_ROW_COUNT);
         mTableModel.addRowCountChangeHandler(new RowCountChangeHandler() {
@@ -199,7 +199,7 @@
         });
         mailTable.fillWidth();
         
-        options = new PagingOptions(mailTable);
+        options = new PagingOptions(mailTable, constants);
         
         HorizontalPanel buttonBar = new HorizontalPanel();
         buttonBar.setSpacing(5);

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=880970&r1=880969&r2=880970&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 21:37:34 2009
@@ -27,10 +27,10 @@
 import org.apache.hupa.client.widgets.HasDialog;
 import org.apache.hupa.client.widgets.HasURL;
 import org.apache.hupa.client.widgets.Iframe;
-import org.apache.hupa.client.widgets.Loading;
 import org.apache.hupa.client.widgets.MyDialogBox;
 import org.apache.hupa.shared.SConsts;
 import org.apache.hupa.shared.data.MessageAttachment;
+import org.apache.hupa.widgets.ui.Loading;
 import org.cobogw.gwt.user.client.ui.Button;
 import org.cobogw.gwt.user.client.ui.ButtonBar;
 
@@ -80,7 +80,7 @@
     public final static int DELETE_BUTTON = 0;
     public final static int REPLY_BUTTON = 1;
     public final static int REPLY_ALL_BUTTON = 2;
-    private Loading loading  = new Loading(true);
+    private Loading loading  = new Loading();
     private SimplePanel container = new SimplePanel();
     
     @Inject

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=880970&r1=880969&r2=880970&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 21:37:34 2009
@@ -20,7 +20,7 @@
 package org.apache.hupa.client.mvp;
 
 import org.apache.hupa.client.HupaConstants;
-import org.apache.hupa.client.widgets.Loading;
+import org.apache.hupa.widgets.ui.Loading;
 import org.cobogw.gwt.user.client.ui.Button;
 import org.cobogw.gwt.user.client.ui.ButtonBar;
 import org.cobogw.gwt.user.client.ui.RoundedPanel;
@@ -52,14 +52,15 @@
     private TextBox usernameTextBox = new TextBox();
     private PasswordTextBox passwordTextBox = new PasswordTextBox();
     private Label errorLabel = new Label();
-    private Loading loading = new Loading(false);
+    private Loading loading;
     private int minUsernameLength = 1;
     private int minPasswordLength = 1;
 
     @Inject
     public LoginView(HupaConstants constants) {
         loginButton = new Button(constants.loginButton());
-        resetButton = new Button(constants.resetButton());        
+        resetButton = new Button(constants.resetButton());  
+        loading = new Loading(constants.loading());
         VerticalPanel vPanel = new VerticalPanel();
         vPanel.setSpacing(5);
         vPanel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);

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=880970&r1=880969&r2=880970&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 21:37:34 2009
@@ -31,7 +31,6 @@
 import org.apache.hupa.client.widgets.ConfirmDialogBox;
 import org.apache.hupa.client.widgets.HasDialog;
 import org.apache.hupa.client.widgets.IMAPTreeItem;
-import org.apache.hupa.client.widgets.Loading;
 import org.apache.hupa.shared.data.IMAPFolder;
 import org.apache.hupa.shared.data.Message;
 import org.apache.hupa.shared.data.User;
@@ -46,6 +45,7 @@
 import org.apache.hupa.widgets.ui.EnableHyperlink;
 import org.apache.hupa.widgets.ui.HasEditable;
 import org.apache.hupa.widgets.ui.HasEnable;
+import org.apache.hupa.widgets.ui.Loading;
 import org.cobogw.gwt.user.client.ui.RoundedPanel;
 
 import com.allen_sauer.gwt.dnd.client.DragContext;
@@ -90,8 +90,8 @@
     private EnableHyperlink renameFolderButton;
     private EnableHyperlink deleteFolderButton;
     private ConfirmDialogBox confirmFolderDeleteBox = new ConfirmDialogBox();
-    private Loading loader = new Loading(false);
-    private Loading messageLoader = new Loading(true);
+    private Loading loader;
+    private Loading messageLoader = new Loading();
     private List<DropController> dropControllerList = new ArrayList<DropController>();
     private EventBus bus;
     private PagingScrollTableRowDragController controller;
@@ -103,7 +103,7 @@
         this.messages = messages;
         this.controller = controllerProvider;
         this.bus = bus;
-
+        loader = new Loading(constants.loading());
         newFolderButton = new EnableHyperlink(constants.newFolder(), "");
         renameFolderButton = new EnableHyperlink(constants.renameFolder(), "");
         deleteFolderButton = new EnableHyperlink(constants.deleteFolder(), "");

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=880970&r1=880969&r2=880970&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 21:37:34 2009
@@ -25,9 +25,9 @@
 import gwtupload.client.MultiUploader;
 
 import org.apache.hupa.client.HupaConstants;
-import org.apache.hupa.client.widgets.Loading;
 import org.apache.hupa.client.widgets.EnableButton;
 import org.apache.hupa.widgets.ui.EnableHyperlink;
+import org.apache.hupa.widgets.ui.Loading;
 import org.apache.hupa.shared.SConsts;
 import org.apache.hupa.widgets.ui.HasEnable;
 
@@ -65,7 +65,7 @@
     private TextArea text = new TextArea();
     private EnableButton sendButton;
     private EnableHyperlink backButton;
-    private Loading sendProgress = new Loading(true);
+    private Loading sendProgress = new Loading();
 
     @Inject
     public MessageSendView(HupaConstants constants) {

Added: james/hupa/trunk/widgets/src/main/java/org/apache/hupa/widgets/PagingOptionsConstants.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/widgets/src/main/java/org/apache/hupa/widgets/PagingOptionsConstants.java?rev=880970&view=auto
==============================================================================
--- james/hupa/trunk/widgets/src/main/java/org/apache/hupa/widgets/PagingOptionsConstants.java
(added)
+++ james/hupa/trunk/widgets/src/main/java/org/apache/hupa/widgets/PagingOptionsConstants.java
Mon Nov 16 21:37:34 2009
@@ -0,0 +1,34 @@
+/****************************************************************
+ * 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.widgets;
+
+import com.google.gwt.i18n.client.Constants;
+
+public interface PagingOptionsConstants extends Constants{
+
+    public String pageNext();
+
+    public String pageLast();
+
+    public String pagePrev();
+
+    public String pageFirst();
+    
+}

Copied: james/hupa/trunk/widgets/src/main/java/org/apache/hupa/widgets/ui/Loading.java (from
r834137, james/hupa/trunk/client/src/main/java/org/apache/hupa/client/widgets/Loading.java)
URL: http://svn.apache.org/viewvc/james/hupa/trunk/widgets/src/main/java/org/apache/hupa/widgets/ui/Loading.java?p2=james/hupa/trunk/widgets/src/main/java/org/apache/hupa/widgets/ui/Loading.java&p1=james/hupa/trunk/client/src/main/java/org/apache/hupa/client/widgets/Loading.java&r1=834137&r2=880970&rev=880970&view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/widgets/Loading.java (original)
+++ james/hupa/trunk/widgets/src/main/java/org/apache/hupa/widgets/ui/Loading.java Mon Nov
16 21:37:34 2009
@@ -17,9 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.hupa.client.widgets;
-
-import org.apache.hupa.client.HupaConstants;
+package org.apache.hupa.widgets.ui;
 
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.user.client.ui.Composite;
@@ -34,20 +32,23 @@
  *
  */
 public class Loading extends Composite{
-    private HupaConstants constants = GWT.create(HupaConstants.class);
     private SimplePanel sPanel = new SimplePanel();
     private HorizontalPanel panel = new HorizontalPanel();
-    public Loading(boolean small) {
+    public Loading(String loadingMsg) {
         panel.setHorizontalAlignment(HorizontalPanel.ALIGN_CENTER);
         panel.setVerticalAlignment(HorizontalPanel.ALIGN_MIDDLE);
         panel.add(new Image(GWT.getModuleBaseURL() + "../images/ajax-loader.gif"));
-        if (small == false) {
-            panel.add(new Label(constants.loading()));
+        if (loadingMsg != null) {
+            panel.add(new Label(loadingMsg));
         }
         
         initWidget(sPanel);
     }
     
+    public Loading() {
+        this(null);
+    }
+    
     /**
      * Show the Loading image
      */

Copied: james/hupa/trunk/widgets/src/main/java/org/apache/hupa/widgets/ui/PagingOptions.java
(from r835896, james/hupa/trunk/client/src/main/java/org/apache/hupa/client/widgets/PagingOptions.java)
URL: http://svn.apache.org/viewvc/james/hupa/trunk/widgets/src/main/java/org/apache/hupa/widgets/ui/PagingOptions.java?p2=james/hupa/trunk/widgets/src/main/java/org/apache/hupa/widgets/ui/PagingOptions.java&p1=james/hupa/trunk/client/src/main/java/org/apache/hupa/client/widgets/PagingOptions.java&r1=835896&r2=880970&rev=880970&view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/widgets/PagingOptions.java
(original)
+++ james/hupa/trunk/widgets/src/main/java/org/apache/hupa/widgets/ui/PagingOptions.java Mon
Nov 16 21:37:34 2009
@@ -17,12 +17,10 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.hupa.client.widgets;
+package org.apache.hupa.widgets.ui;
 
-import org.apache.hupa.client.HupaConstants;
-import org.apache.hupa.widgets.ui.EnableHyperlink;
+import org.apache.hupa.widgets.PagingOptionsConstants;
 
-import com.google.gwt.core.client.GWT;
 import com.google.gwt.event.dom.client.ClickEvent;
 import com.google.gwt.event.dom.client.ClickHandler;
 import com.google.gwt.gen2.table.client.PagingScrollTable;
@@ -46,20 +44,22 @@
  * PagingOptions for using to control the PagingScrollTable
  *
  */
-public class PagingOptions extends Composite {
-    private HupaConstants constants = GWT.create(HupaConstants.class);
-    
+public class PagingOptions extends Composite {    
     private HorizontalPanel pagingPanel = new HorizontalPanel();
-    private EnableHyperlink firstLink = new EnableHyperlink("<< " + constants.pageFirst(),"");
-    private EnableHyperlink prevLink = new EnableHyperlink("< " + constants.pagePrev(),"");
-    private EnableHyperlink lastLink = new EnableHyperlink(constants.pageLast() + " >>","");
-    private EnableHyperlink nextLink = new EnableHyperlink(constants.pageNext() + " >","");
+    private EnableHyperlink firstLink;
+    private EnableHyperlink prevLink;
+    private EnableHyperlink lastLink;
+    private EnableHyperlink nextLink;
     private Label text = new Label();
     private int currentPage = 1;
-    private Loading loading = new Loading(true);
+    private Loading loading = new Loading();
     private SimplePanel panel = new SimplePanel();
     
-    public PagingOptions(final PagingScrollTable<?> table) {
+    public PagingOptions(final PagingScrollTable<?> table, PagingOptionsConstants constants)
{
+        firstLink = new EnableHyperlink("<< " + constants.pageFirst(),"");
+        prevLink = new EnableHyperlink("< " + constants.pagePrev(),"");
+        lastLink = new EnableHyperlink(constants.pageLast() + " >>","");
+        nextLink = new EnableHyperlink(constants.pageNext() + " >","");
         pagingPanel.setSpacing(3);
 
         pagingPanel.add(panel);



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