You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by ma...@apache.org on 2009/12/08 15:39:59 UTC
svn commit: r888410 - in /james/hupa/trunk:
client/src/main/java/org/apache/hupa/client/
client/src/main/java/org/apache/hupa/client/gin/
client/src/main/java/org/apache/hupa/client/mvp/
client/src/main/java/org/apache/hupa/client/mvp/place/ client/war...
Author: manolo
Date: Tue Dec 8 14:39:58 2009
New Revision: 888410
URL: http://svn.apache.org/viewvc?rev=888410&view=rev
Log:
Changed Hupa's layout: added logo, moved contacts and mail tabs to top-buttons.
Made MainView configurable using css.
Added flash events to display messages to the user.
Added:
james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/place/ContactsPresenterPlace.java
james/hupa/trunk/client/war/images/ajax-loader.gif
- copied unchanged from r886859, james/hupa/trunk/client/war/images/ajax-loader.gif
james/hupa/trunk/client/war/images/hupa-logo-32.jpg (with props)
james/hupa/trunk/client/war/images/hupa-logo-48.jpg (with props)
james/hupa/trunk/client/war/images/hupa-logo-64.jpg (with props)
james/hupa/trunk/client/war/images/hupa-logo-original-transparent.jpg (with props)
james/hupa/trunk/client/war/images/hupa-logo-original.jpg (with props)
james/hupa/trunk/client/war/images/hupa-spinning.gif (with props)
james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/events/FlashEvent.java
james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/events/FlashEventHandler.java
Removed:
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
Modified:
james/hupa/trunk/client/src/main/java/org/apache/hupa/client/HupaCSS.java
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/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/AppView.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/LoginPresenter.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/place/HupaPlaceManager.java
james/hupa/trunk/client/war/Hupa.css
james/hupa/trunk/client/war/Hupa.html
Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/HupaCSS.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/HupaCSS.java?rev=888410&r1=888409&r2=888410&view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/HupaCSS.java (original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/HupaCSS.java Tue Dec 8 14:39:58 2009
@@ -25,8 +25,17 @@
*/
public class HupaCSS {
- public static final String C_main_container = "Hupa";
+ public static final String C_main_container ="Hupa";
+
+ public static final String C_logo_container ="hupa-logo";
+
+ public static final String C_button_container ="hupa-button-bar";
+ public static final String C_login_label = "hupa-login-label";
+ public static final String C_login_username = "hupa-login-user";
+ public static final String C_menu_button = "hupa-menu-button";
- public static final String C_logout_btn = "hupa-logout-btn";
+ public static final String C_info_container ="hupa-info-bar";
+ public static final String C_header ="hupa-header";
+ public static final String C_flash ="hupa-flash";
}
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=888410&r1=888409&r2=888410&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 Tue Dec 8 14:39:58 2009
@@ -113,4 +113,6 @@
public String contactsTab();
public String mailTab();
+
+ public String welcome();
}
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=888410&r1=888409&r2=888410&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 Tue Dec 8 14:39:58 2009
@@ -110,3 +110,4 @@
refresh=Refresh
mailTab=Mail
contactsTab=Contacts
+welcome=Welcome to Hupa webmail
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=888410&r1=888409&r2=888410&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 Tue Dec 8 14:39:58 2009
@@ -23,7 +23,6 @@
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;
@@ -31,19 +30,18 @@
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;
import org.apache.hupa.client.mvp.IMAPMessageListView;
import org.apache.hupa.client.mvp.IMAPMessagePresenter;
-import org.apache.hupa.client.mvp.MessageSendPresenter;
-import org.apache.hupa.client.mvp.MessageSendView;
import org.apache.hupa.client.mvp.IMAPMessageView;
import org.apache.hupa.client.mvp.LoginPresenter;
import org.apache.hupa.client.mvp.LoginView;
import org.apache.hupa.client.mvp.MainPresenter;
import org.apache.hupa.client.mvp.MainView;
+import org.apache.hupa.client.mvp.MessageSendPresenter;
+import org.apache.hupa.client.mvp.MessageSendView;
import org.apache.hupa.client.mvp.MessageTableModel;
+import org.apache.hupa.client.mvp.place.ContactsPresenterPlace;
import org.apache.hupa.client.mvp.place.HupaPlaceManager;
import org.apache.hupa.client.mvp.place.IMAPMessageListPresenterPlace;
import org.apache.hupa.client.mvp.place.LoginPresenterPlace;
@@ -63,7 +61,6 @@
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);
bindPresenter(ContactsPresenter.class, ContactsPresenter.Display.class, ContactsView.class);
bind(CachingDispatchAsync.class);
bind(PagingScrollTableRowDragController.class).in(Singleton.class);
@@ -71,6 +68,7 @@
bind(LoginPresenterPlace.class).in(Singleton.class);
bind(IMAPMessageListPresenterPlace.class).in(Singleton.class);
bind(MessageSendPresenterPlace.class).in(Singleton.class);
+ bind(ContactsPresenterPlace.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=888410&r1=888409&r2=888410&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 Tue Dec 8 14:39:58 2009
@@ -26,7 +26,10 @@
import net.customware.gwt.presenter.client.widget.WidgetContainerPresenter;
import org.apache.hupa.client.HupaCallback;
+import org.apache.hupa.client.HupaConstants;
import org.apache.hupa.shared.data.User;
+import org.apache.hupa.shared.events.FlashEvent;
+import org.apache.hupa.shared.events.FlashEventHandler;
import org.apache.hupa.shared.events.LoginEvent;
import org.apache.hupa.shared.events.LoginEventHandler;
import org.apache.hupa.shared.events.LogoutEvent;
@@ -38,19 +41,16 @@
import org.apache.hupa.shared.events.ServerStatusEvent.ServerStatus;
import org.apache.hupa.shared.rpc.CheckSession;
import org.apache.hupa.shared.rpc.CheckSessionResult;
-import org.apache.hupa.shared.rpc.LogoutUser;
-import org.apache.hupa.shared.rpc.LogoutUserResult;
import org.apache.hupa.shared.rpc.Idle;
import org.apache.hupa.shared.rpc.IdleResult;
+import org.apache.hupa.shared.rpc.LogoutUser;
+import org.apache.hupa.shared.rpc.LogoutUserResult;
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.event.dom.client.HasClickHandlers;
import com.google.gwt.user.client.Timer;
-import com.google.gwt.user.client.Window;
-import com.google.gwt.user.client.Window.ClosingEvent;
-import com.google.gwt.user.client.Window.ClosingHandler;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.HasText;
import com.google.inject.Inject;
@@ -62,13 +62,19 @@
*/
public class AppPresenter extends WidgetContainerPresenter<AppPresenter.Display>{
- private static final int NOOP_INTERVAL = 150000;
+ private static final int IDLE_INTERVAL = 150000;
+ HupaConstants constants;
public interface Display extends WidgetContainerDisplay {
public HasClickHandlers getLogoutClick();
+ public HasClickHandlers getContactsClick();
+ public HasClickHandlers getMainClick();
public void showTopNavigation(boolean show);
+ public void showContactsButton();
+ public void showMainButton();
public HasText getUserText();
public void setServerStatus(ServerStatus status);
+ public void showMessage(String message, int millisecs);
}
private Timer noopTimer = new IdleTimer();
@@ -76,28 +82,37 @@
private DispatchAsync dispatcher;
private User user;
private ServerStatus serverStatus = ServerStatus.Available;
- private ContainerPresenter containerPresenter;
+ private MainPresenter mainPresenter;
private LoginPresenter loginPresenter;
+ private ContactsPresenter contactsPresenter;
@Inject
- public AppPresenter(Display display, DispatchAsync dispatcher,final EventBus bus, LoginPresenter loginPresenter, ContainerPresenter containerPresenter) {
- super(display,bus, loginPresenter, containerPresenter);
- this.containerPresenter = containerPresenter;
+ public AppPresenter(Display display, DispatchAsync dispatcher, final EventBus bus, HupaConstants constants, LoginPresenter loginPresenter, MainPresenter mainPresenter, ContactsPresenter contactsPresenter) {
+ super(display, bus, loginPresenter, mainPresenter, contactsPresenter);
+ this.mainPresenter = mainPresenter;
this.loginPresenter = loginPresenter;
+ this.contactsPresenter = contactsPresenter;
this.dispatcher = dispatcher;
+ this.constants = constants;
}
private void showMain(User user) {
display.showTopNavigation(true);
- containerPresenter.revealDisplay(user);
+ display.showContactsButton();
+ mainPresenter.revealDisplay(user);
}
-
private void showLogin(String username) {
display.showTopNavigation(false);
loginPresenter.revealDisplay();
}
+ private void showContacts() {
+ display.showTopNavigation(true);
+ display.showMainButton();
+ contactsPresenter.revealDisplay();
+ }
+
@Override
protected void onBind() {
super.onBind();
@@ -106,8 +121,9 @@
public void onLogin(LoginEvent event) {
user = event.getUser();
display.getUserText().setText(event.getUser().getName());
- noopTimer.scheduleRepeating(NOOP_INTERVAL);
+ noopTimer.scheduleRepeating(IDLE_INTERVAL);
showMain(user);
+ display.showMessage(constants.welcome(), 3000);
}
}));
@@ -132,14 +148,17 @@
}
}));
- registerHandler(Window.addWindowClosingHandler(new ClosingHandler() {
-
- public void onWindowClosing(ClosingEvent event) {
- // TODO: When the application is loaded, it checks if there is already a valid session in the server.
- // Executing here doLogout makes the application remove the user session when
- // the user closes the window or reloads the application.
- // It is better let the user decide when to logout instead of do it automatically
- // doLogout();
+ registerHandler(display.getContactsClick().addClickHandler(new ClickHandler() {
+
+ public void onClick(ClickEvent event) {
+ showContacts();
+ }
+
+ }));
+ registerHandler(display.getMainClick().addClickHandler(new ClickHandler() {
+
+ public void onClick(ClickEvent event) {
+ showMain(user);
}
}));
@@ -161,6 +180,13 @@
}
}));
+ registerHandler(eventBus.addHandler(FlashEvent.TYPE, new FlashEventHandler() {
+
+ public void onFlash(FlashEvent event) {
+ display.showMessage(event.getMessage(), event.getMillisec());
+ }
+
+ }));
checkSession();
}
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=888410&r1=888409&r2=888410&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 Tue Dec 8 14:39:58 2009
@@ -24,13 +24,14 @@
import org.apache.hupa.shared.events.ServerStatusEvent.ServerStatus;
import com.google.gwt.event.dom.client.HasClickHandlers;
+import com.google.gwt.user.client.Timer;
import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.DockPanel;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HasText;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Hyperlink;
import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.PopupPanel;
import com.google.gwt.user.client.ui.SimplePanel;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;
@@ -42,82 +43,80 @@
*
*/
public class AppView extends Composite implements AppPresenter.Display {
- private SimplePanel mainPanel = new SimplePanel();
- private HorizontalPanel northTop = new HorizontalPanel();
- private Hyperlink logoutButton;
- private SimplePanel topNavigatorPanel = new SimplePanel();
- private HTML dummy = new HTML(" ");
- private Label userName = new Label();
- private HorizontalPanel loginInfoPanel = new HorizontalPanel();
- private ServerStatusPanel serverStatusPanel = new ServerStatusPanel();
- private class ServerStatusPanel extends PopupPanel {
- HTML messageLabel = new HTML("");
- ServerStatusPanel() {
- add(messageLabel);
- addStyleName("hupa-server-status");
- setPopupPosition(400, 1);
- setAnimationEnabled(true);
- }
- // TODO: i18n (take a look to gmail's messages when the server is unacessible)
- public void setStatus(ServerStatus status) {
- if (status == ServerStatus.Available) {
- messageLabel.setHTML("<h2>Server is available now.</h2>");
- hide();
- } else {
- messageLabel.setHTML("<h2>Server unavailable</h2>");
- show();
- }
- }
- }
+
+ private DockPanel appContainer = new DockPanel();
+
+ private HTML logoContainer = new HTML("");
+ private HorizontalPanel buttonContainer = new HorizontalPanel();
+ private HorizontalPanel infoContainer = new HorizontalPanel();
+ private SimplePanel centralContainer = new SimplePanel();
+ private HorizontalPanel loginInfoPanel = new HorizontalPanel();
+ private Label loginLabel = new Label();
+ private Label loginUserLabel = new Label();
+ private Hyperlink mainButton = new Hyperlink();
+ private Hyperlink contactsButton = new Hyperlink();
+ private Hyperlink logoutButton = new Hyperlink();
+
+ private Label appnameLabel = new Label();
+ private Label messageLabel = new Label();
+ private Label extraLabel = new Label();
+
@Inject
public AppView(HupaConstants constants) {
- logoutButton = new Hyperlink(constants.logoutButton(),"");
- logoutButton.addStyleName(HupaCSS.C_logout_btn);
-
- VerticalPanel vPanel = new VerticalPanel();
- vPanel.setStyleName(HupaCSS.C_main_container);
-
- vPanel.setSpacing(3);
- vPanel.setWidth("100%");
- vPanel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);
- vPanel.setVerticalAlignment(VerticalPanel.ALIGN_MIDDLE);
-
- topNavigatorPanel.setHeight("20px");
- vPanel.add(topNavigatorPanel);
-
- loginInfoPanel.setSpacing(5);
- loginInfoPanel.add(new Label(constants.loginAs() + ":"));
- loginInfoPanel.add(userName);
- userName.getElement().getStyle().setProperty("textDecoration",
- "underline");
- userName.getElement().getStyle().setProperty("fontWeight", "bold");
-
- northTop.setStyleName("hupa-MainButtonBar");
- northTop.setHorizontalAlignment(HorizontalPanel.ALIGN_RIGHT);
- northTop.setVerticalAlignment(VerticalPanel.ALIGN_MIDDLE);
-
- northTop.setWidth("100%");
- northTop.setHeight("100%");
- northTop.add(loginInfoPanel);
- northTop.setCellHorizontalAlignment(loginInfoPanel,
- HorizontalPanel.ALIGN_LEFT);
- northTop.add(logoutButton);
-
- Label header = new Label(constants.productName());
- header.setHeight("25px");
- header.setStyleName("hupa-Header");
- vPanel.add(header);
- vPanel.setCellHorizontalAlignment(header, VerticalPanel.ALIGN_LEFT);
- vPanel.setCellVerticalAlignment(header, VerticalPanel.ALIGN_MIDDLE);
-
- vPanel.add(mainPanel);
- vPanel.setCellHorizontalAlignment(mainPanel, VerticalPanel.ALIGN_LEFT);
- dummy.setHeight("100%");
+ // add class names
+ appContainer.setStyleName(HupaCSS.C_main_container);
+ logoContainer.addStyleName(HupaCSS.C_logo_container);
+ buttonContainer.setStyleName(HupaCSS.C_button_container);
+ infoContainer.setStyleName(HupaCSS.C_info_container);
+ loginLabel.addStyleName(HupaCSS.C_login_label);
+ loginUserLabel.addStyleName(HupaCSS.C_login_username);
+ logoutButton.addStyleName(HupaCSS.C_menu_button);
+ contactsButton.addStyleName(HupaCSS.C_menu_button);
+ mainButton.addStyleName(HupaCSS.C_menu_button);
+ appnameLabel.setStyleName(HupaCSS.C_header);
+ messageLabel.setStyleName(HupaCSS.C_flash);
+
+ // internationalize elements
+ logoutButton.setText(constants.logoutButton());
+ loginLabel.setText(constants.loginAs() + ": ");
+ appnameLabel.setText(constants.productName());
+ contactsButton.setText(constants.contactsTab());
+ mainButton.setText(constants.mailTab());
+
+ // Layout containers and panels
+ buttonContainer.setHorizontalAlignment(HorizontalPanel.ALIGN_LEFT);
+ buttonContainer.setVerticalAlignment(VerticalPanel.ALIGN_MIDDLE);
+ buttonContainer.add(loginInfoPanel);
+ loginInfoPanel.add(loginLabel);
+ loginInfoPanel.add(loginUserLabel);
+ buttonContainer.add(contactsButton);
+ buttonContainer.add(mainButton);
+ buttonContainer.add(logoutButton);
+
+ infoContainer.setHorizontalAlignment(VerticalPanel.ALIGN_LEFT);
+ infoContainer.setVerticalAlignment(VerticalPanel.ALIGN_MIDDLE);
+ infoContainer.add(appnameLabel);
+ infoContainer.add(messageLabel);
+ infoContainer.add(extraLabel);
+
+ appContainer.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);
+ appContainer.setVerticalAlignment(VerticalPanel.ALIGN_MIDDLE);
+ appContainer.add(centralContainer, DockPanel.SOUTH);
+ appContainer.add(logoContainer, DockPanel.WEST);
+ appContainer.add(buttonContainer, DockPanel.NORTH);
+ appContainer.add(infoContainer, DockPanel.CENTER);
+
+ // Move all buttons to the right
+ buttonContainer.setCellWidth(loginInfoPanel,"100%");
+ // Make logo's width configurable in css.
+ appContainer.setCellWidth(buttonContainer,"100%");
+
+ initWidget(appContainer);
+
showTopNavigation(false);
- initWidget(vPanel);
}
@@ -146,11 +145,7 @@
* )
*/
public void showTopNavigation(boolean show) {
- if (show) {
- topNavigatorPanel.setWidget(northTop);
- } else {
- topNavigatorPanel.setWidget(dummy);
- }
+ buttonContainer.setVisible(show);
}
/*
@@ -159,23 +154,16 @@
* @see org.apache.hupa.client.mvp.AppPresenter.Display#getUserText()
*/
public HasText getUserText() {
- return userName;
+ return loginUserLabel;
}
- /*
- * (non-Javadoc)
- * @see org.apache.hupa.client.mvp.AppPresenter.Display#setServerStatus(org.apache.hupa.shared.events.ServerStatusEvent.ServerStatus)
- */
- public void setServerStatus(ServerStatus status) {
- serverStatusPanel.setStatus(status);
- }
/*
* (non-Javadoc)
* @see net.customware.gwt.presenter.client.widget.WidgetContainerDisplay#addWidget(com.google.gwt.user.client.ui.Widget)
*/
public void addWidget(Widget widget) {
- mainPanel.setWidget(widget);
+ centralContainer.setWidget(widget);
}
/*
@@ -183,7 +171,7 @@
* @see net.customware.gwt.presenter.client.widget.WidgetContainerDisplay#removeWidget(com.google.gwt.user.client.ui.Widget)
*/
public void removeWidget(Widget widget) {
- mainPanel.remove(widget);
+ centralContainer.remove(widget);
}
/*
@@ -191,7 +179,67 @@
* @see net.customware.gwt.presenter.client.widget.WidgetContainerDisplay#showWidget(com.google.gwt.user.client.ui.Widget)
*/
public void showWidget(Widget widget) {
- mainPanel.setWidget(widget);
+ centralContainer.setWidget(widget);
+ }
+
+
+ public HasClickHandlers getContactsClick() {
+ return contactsButton;
+ }
+
+
+ /*
+ * (non-Javadoc)
+ * @see org.apache.hupa.client.mvp.AppPresenter.Display#setServerStatus(org.apache.hupa.shared.events.ServerStatusEvent.ServerStatus)
+ */
+ public void setServerStatus(ServerStatus status) {
+ if (status == ServerStatus.Available)
+ showMessage("Server available.", 2000);
+ else
+ showMessage("Server unavailable", 0);
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.hupa.client.mvp.AppPresenter.Display#showMessage(java.lang.String, int)
+ */
+ public void showMessage(String message, int millisecs) {
+ messageLabel.setText(message);
+ messageLabel.setVisible(true);
+ if (millisecs > 0)
+ hideMessage.schedule(millisecs);
+ }
+
+ private final Timer hideMessage = new Timer() {
+ public void run() {
+ //TODO: toggle effect
+ messageLabel.setVisible(false);
+ messageLabel.setText("");
+ }
+ };
+
+ /* (non-Javadoc)
+ * @see org.apache.hupa.client.mvp.AppPresenter.Display#showContactsButton()
+ */
+ public void showContactsButton() {
+ mainButton.setVisible(false);
+ contactsButton.setVisible(true);
+ }
+
+
+ /* (non-Javadoc)
+ * @see org.apache.hupa.client.mvp.AppPresenter.Display#showMainButton()
+ */
+ public void showMainButton() {
+ mainButton.setVisible(true);
+ contactsButton.setVisible(false);
+ }
+
+
+ /* (non-Javadoc)
+ * @see org.apache.hupa.client.mvp.AppPresenter.Display#getMainClick()
+ */
+ public HasClickHandlers getMainClick() {
+ return mainButton;
}
}
Modified: 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=888410&r1=888409&r2=888410&view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/ContactsView.java (original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/ContactsView.java Tue Dec 8 14:39:58 2009
@@ -22,6 +22,7 @@
import org.apache.hupa.client.HupaConstants;
import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Widget;
import com.google.inject.Inject;
@@ -35,6 +36,7 @@
this.constants = constants;
panel.setWidth("100%");
panel.setHeight("100");
+ panel.add(new HTML("<center><h1>Contacts view: comming soon<h1></center>"));
initWidget(panel);
}
Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/LoginPresenter.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/LoginPresenter.java?rev=888410&r1=888409&r2=888410&view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/LoginPresenter.java (original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/LoginPresenter.java Tue Dec 8 14:39:58 2009
@@ -26,6 +26,7 @@
import org.apache.hupa.client.HupaCallback;
import org.apache.hupa.client.HupaConstants;
+import org.apache.hupa.shared.events.FlashEvent;
import org.apache.hupa.shared.events.LoginEvent;
import org.apache.hupa.shared.events.SessionExpireEvent;
import org.apache.hupa.shared.events.SessionExpireEventHandler;
@@ -37,7 +38,6 @@
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.user.client.ui.Focusable;
-import com.google.gwt.user.client.ui.HasText;
import com.google.gwt.user.client.ui.HasValue;
import com.google.inject.Inject;
@@ -55,7 +55,6 @@
public HasValue<String> getUserNameValue();
public HasValue<String> getPasswordValue();
public Focusable getUserNameFocus();
- public HasText getErrorText();
public void setLoading(boolean loading);
}
@@ -81,8 +80,7 @@
}
public void callbackError(Throwable caught) {
display.setLoading(false);
-
- display.getErrorText().setText(constants.loginInvalid());
+ eventBus.fireEvent(new FlashEvent(constants.loginInvalid(), 4000));
doReset();
}
});
@@ -94,7 +92,6 @@
private void doReset() {
display.getUserNameValue().setValue("");
display.getPasswordValue().setValue("");
- display.getErrorText().setText("");
display.getUserNameFocus().setFocus(true);
}
@@ -118,7 +115,7 @@
registerHandler(eventBus.addHandler(SessionExpireEvent.TYPE, new SessionExpireEventHandler() {
public void onSessionExpireEvent(SessionExpireEvent event) {
- display.getErrorText().setText(constants.sessionTimedOut());
+ eventBus.fireEvent(new FlashEvent(constants.sessionTimedOut(), 4000));
}
}));
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=888410&r1=888409&r2=888410&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 Tue Dec 8 14:39:58 2009
@@ -32,9 +32,7 @@
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Focusable;
import com.google.gwt.user.client.ui.Grid;
-import com.google.gwt.user.client.ui.HasText;
import com.google.gwt.user.client.ui.HasValue;
-import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.PasswordTextBox;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.VerticalPanel;
@@ -51,7 +49,6 @@
private Button resetButton;
private TextBox usernameTextBox = new TextBox();
private PasswordTextBox passwordTextBox = new PasswordTextBox();
- private Label errorLabel = new Label();
private Loading loading;
private int minUsernameLength = 1;
private int minPasswordLength = 1;
@@ -101,9 +98,6 @@
formPanel.add(buttonBar);
- errorLabel.setStyleName("hupa-ErrorLabel");
- formPanel.add(errorLabel);
-
RoundedPanel rPanel = new RoundedPanel(RoundedPanel.ALL,1);
rPanel.setBorder();
rPanel.add(formPanel);
@@ -149,14 +143,6 @@
/*
* (non-Javadoc)
- * @see org.apache.hupa.client.mvp.LoginPresenter.Display#getErrorText()
- */
- public HasText getErrorText() {
- return errorLabel;
- }
-
- /*
- * (non-Javadoc)
* @see org.apache.hupa.client.mvp.LoginPresenter.Display#getLoginClick()
*/
public HasClickHandlers getLoginClick() {
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=888410&r1=888409&r2=888410&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 Tue Dec 8 14:39:58 2009
@@ -446,7 +446,6 @@
registerHandler(display.getNewClick().addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
- display.getNewEnable().setEnabled(false);
editableTreeItem = display.createFolder(new EditHandler() {
public void onEditEvent(EditEvent event) {
@@ -458,11 +457,10 @@
public void onFailure(Throwable caught) {
GWT.log("Error while create folder", caught);
item.cancelEdit();
- display.getNewEnable().setEnabled(true);
}
public void onSuccess(GenericResult result) {
- display.getNewEnable().setEnabled(true);
+ // Nothing todo
}
});
Added: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/place/ContactsPresenterPlace.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/place/ContactsPresenterPlace.java?rev=888410&view=auto
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/place/ContactsPresenterPlace.java (added)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/place/ContactsPresenterPlace.java Tue Dec 8 14:39:58 2009
@@ -0,0 +1,41 @@
+/****************************************************************
+ * 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.place;
+
+import net.customware.gwt.presenter.client.gin.ProvidedPresenterPlace;
+
+import org.apache.hupa.client.mvp.ContactsPresenter;
+
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+
+public class ContactsPresenterPlace extends ProvidedPresenterPlace<ContactsPresenter>{
+
+ @Inject
+ public ContactsPresenterPlace(Provider<ContactsPresenter> presenter) {
+ super(presenter);
+ }
+
+ @Override
+ public String getName() {
+ return "Contacts";
+ }
+
+}
Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/place/HupaPlaceManager.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/place/HupaPlaceManager.java?rev=888410&r1=888409&r2=888410&view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/place/HupaPlaceManager.java (original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/place/HupaPlaceManager.java Tue Dec 8 14:39:58 2009
@@ -32,8 +32,8 @@
public class HupaPlaceManager extends DefaultPlaceManager{
@Inject
- public HupaPlaceManager(EventBus eventBus, LoginPresenterPlace loginPresenterPlace, IMAPMessageListPresenterPlace messageListPresenterPlace, IMAPMessagePresenterPlace imapMessagePresenterPlace, MessageSendPresenterPlace sendPresenterPlace) {
- super(eventBus, loginPresenterPlace, messageListPresenterPlace, imapMessagePresenterPlace, sendPresenterPlace);
+ public HupaPlaceManager(EventBus eventBus, LoginPresenterPlace loginPresenterPlace, IMAPMessageListPresenterPlace messageListPresenterPlace, IMAPMessagePresenterPlace imapMessagePresenterPlace, MessageSendPresenterPlace sendPresenterPlace, ContactsPresenterPlace contactsPresenterPlace) {
+ super(eventBus, loginPresenterPlace, messageListPresenterPlace, imapMessagePresenterPlace, sendPresenterPlace, contactsPresenterPlace);
}
}
Modified: james/hupa/trunk/client/war/Hupa.css
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/war/Hupa.css?rev=888410&r1=888409&r2=888410&view=diff
==============================================================================
--- james/hupa/trunk/client/war/Hupa.css (original)
+++ james/hupa/trunk/client/war/Hupa.css Tue Dec 8 14:39:58 2009
@@ -1,5 +1,67 @@
@import url("hupa/Upload.css");
+.Hupa {
+ width: 100%;
+ text-align: left;
+}
+
+.hupa-logo {
+ background: url(images/hupa-logo-64.jpg) no-repeat;
+ color: white;
+ height: 54px;
+ width: 70px;
+}
+
+.hupa-button-bar, .hupa-info-bar {
+ height: 24px;
+ width: 100%;
+}
+
+.hupa-info-bar {
+ border-top: 1px solid silver;
+ border-bottom: 1px solid silver;
+ text-align: left;
+ background-color: #E0ECFF;
+}
+
+div.hupa-header {
+ width: 20%;
+ padding-left: 10px;
+ height: 20px;
+ color: #E0ECFF;
+}
+
+div.hupa-flash {
+ border: 1px solid #FAD163;
+ background-color: #fae5b0;
+ height: 15px;
+ width: 50%;
+ text-align: center;
+}
+
+.hupa-menu-button {
+ margin-right: 20px;
+ text-decoration: underline;
+ cursor: pointer;
+}
+
+.hupa-login-label, .hupa-login-user {
+ margin-left: 10px;
+ font-size: 12px;
+}
+
+.hupa-login-user {
+ font-style: italic;
+ font-weight: bold;
+}
+
+
+.hupa-Container-Navigation {
+ border: 2px solid #E0ECFF;
+}
+
+
+
.cbg-RP {
background-color: #E0ECFF;
}
@@ -16,9 +78,6 @@
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;
@@ -40,14 +99,6 @@
background-color: #E0ECFF;
}
-.hupa-Header {
- border-top: 1pt solid silver;
- border-bottom: 1pt solid silver;
- text-align: left;
- padding-left: 5px;
- background-color: #E0ECFF;
-}
-
.hupa-validationErrorBorder {
border: 1pt solid red;
}
@@ -71,10 +122,6 @@
background-color: #E0ECFF;
}
-.hupa-MainButtonBar {
- border-bottom: 1pt solid silver;
- border-top: 1pt solid silver;
-}
.hupa-Mailtable-row-notseen {
font-weight: bold;
@@ -124,6 +171,3 @@
border: 2px solid #E0ECFF;
}
-.hupa-logout-btn {
- margin-right: 20px;
-}
Modified: james/hupa/trunk/client/war/Hupa.html
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/war/Hupa.html?rev=888410&r1=888409&r2=888410&view=diff
==============================================================================
--- james/hupa/trunk/client/war/Hupa.html (original)
+++ james/hupa/trunk/client/war/Hupa.html Tue Dec 8 14:39:58 2009
@@ -25,7 +25,6 @@
<!-- If you add any GWT meta tags, they must -->
<!-- be added before this line. -->
<!-- -->
- <script type="text/javascript" language="javascript" src="hupa/hupa.nocache.js"></script>
</head>
<!-- -->
@@ -34,9 +33,11 @@
<!-- to create a completely dynamic UI. -->
<!-- -->
<body oncontextmenu="return false;">
- <div id="loading" align="center"><img src="images/ajax-loader.gif"> Loading Webmail...</div>
+ <div id="loading" align="center">
+ <br><br><br></br><img src="images/hupa-spinning.gif"></div>
<!-- OPTIONAL: include this if you want history support -->
<iframe src="javascript:''" id="__gwt_historyFrame" style="width:0;height:0;border:0"></iframe>
<iframe src="" id="__download" style="width:0;height:0;border:0"></iframe>
</body>
+ <script type="text/javascript" language="javascript" src="hupa/hupa.nocache.js"></script>
</html>
Added: james/hupa/trunk/client/war/images/hupa-logo-32.jpg
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/war/images/hupa-logo-32.jpg?rev=888410&view=auto
==============================================================================
Binary file - no diff available.
Propchange: james/hupa/trunk/client/war/images/hupa-logo-32.jpg
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: james/hupa/trunk/client/war/images/hupa-logo-48.jpg
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/war/images/hupa-logo-48.jpg?rev=888410&view=auto
==============================================================================
Binary file - no diff available.
Propchange: james/hupa/trunk/client/war/images/hupa-logo-48.jpg
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: james/hupa/trunk/client/war/images/hupa-logo-64.jpg
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/war/images/hupa-logo-64.jpg?rev=888410&view=auto
==============================================================================
Binary file - no diff available.
Propchange: james/hupa/trunk/client/war/images/hupa-logo-64.jpg
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: james/hupa/trunk/client/war/images/hupa-logo-original-transparent.jpg
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/war/images/hupa-logo-original-transparent.jpg?rev=888410&view=auto
==============================================================================
Binary file - no diff available.
Propchange: james/hupa/trunk/client/war/images/hupa-logo-original-transparent.jpg
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: james/hupa/trunk/client/war/images/hupa-logo-original.jpg
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/war/images/hupa-logo-original.jpg?rev=888410&view=auto
==============================================================================
Binary file - no diff available.
Propchange: james/hupa/trunk/client/war/images/hupa-logo-original.jpg
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: james/hupa/trunk/client/war/images/hupa-spinning.gif
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/war/images/hupa-spinning.gif?rev=888410&view=auto
==============================================================================
Binary file - no diff available.
Propchange: james/hupa/trunk/client/war/images/hupa-spinning.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/events/FlashEvent.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/events/FlashEvent.java?rev=888410&view=auto
==============================================================================
--- james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/events/FlashEvent.java (added)
+++ james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/events/FlashEvent.java Tue Dec 8 14:39:58 2009
@@ -0,0 +1,58 @@
+/****************************************************************
+ * 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.shared.events;
+
+import com.google.gwt.event.shared.GwtEvent;
+
+public class FlashEvent extends GwtEvent<FlashEventHandler> {
+
+ public static Type<FlashEventHandler> TYPE = new Type<FlashEventHandler>();
+
+ public String getMessage() {
+ return message;
+ }
+
+ public int getMillisec() {
+ return millisec;
+ }
+
+ String message;
+ int millisec;
+
+ public FlashEvent(String message) {
+ this(message, 0);
+ }
+
+ public FlashEvent(String message, int millisec) {
+ this.message = message;
+ this.millisec = millisec;
+ }
+
+ @Override
+ public com.google.gwt.event.shared.GwtEvent.Type<FlashEventHandler> getAssociatedType() {
+ return TYPE;
+ }
+
+ @Override
+ protected void dispatch(FlashEventHandler handler) {
+ handler.onFlash(this);
+ }
+
+}
Added: james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/events/FlashEventHandler.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/events/FlashEventHandler.java?rev=888410&view=auto
==============================================================================
--- james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/events/FlashEventHandler.java (added)
+++ james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/events/FlashEventHandler.java Tue Dec 8 14:39:58 2009
@@ -0,0 +1,26 @@
+/****************************************************************
+ * 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.shared.events;
+
+import com.google.gwt.event.shared.EventHandler;
+
+public interface FlashEventHandler extends EventHandler{
+ public void onFlash(FlashEvent event);
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org