Author: dongxu
Date: Thu Sep 12 03:38:32 2013
New Revision: 1522228
URL: http://svn.apache.org/r1522228
Log:
replace with uibinder
Modified:
james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/LoginView.java
james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/LoginView.ui.xml
james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/TopView.java
james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/TopView.ui.xml
Modified:
james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/LoginView.java
URL:
http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/LoginView.java?rev=1522228&r1=1522227&r2=1522228&view=diff
==============================================================================
---
james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/LoginView.java
(original)
+++
james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/LoginView.java
Thu Sep 12 03:38:32 2013
@@ -44,9 +44,9 @@ import org.apache.hupa.client.HupaCSS;
import org.apache.hupa.client.HupaConstants;
import org.apache.hupa.client.activity.LoginActivity;
import org.apache.hupa.widgets.ui.Loading;
-import org.apache.hupa.widgets.ui.RndPanel;
<<<<<<< HEAD
+<<<<<<< HEAD
>>>>>>> Change to new mvp framework - first step
=======
package org.apache.hupa.client.ui;
@@ -54,12 +54,16 @@ package org.apache.hupa.client.ui;
>>>>>>> change the LOGIN progress using native MVP instead of gwt-presenter
=======
>>>>>>> Change to new mvp framework - first step
+=======
+import com.google.gwt.core.client.GWT;
+>>>>>>> replace with uibinder
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;
<<<<<<< HEAD
<<<<<<< HEAD
+<<<<<<< HEAD
import com.google.gwt.resources.client.ClientBundle;
import com.google.gwt.resources.client.CssResource;
import com.google.gwt.resources.client.CssResource.NotStrict;
@@ -69,6 +73,10 @@ import com.google.gwt.uibinder.client.Ui
>>>>>>> change the LOGIN progress using native MVP instead of gwt-presenter
=======
>>>>>>> change the LOGIN progress using native MVP instead of gwt-presenter
+=======
+import com.google.gwt.uibinder.client.UiBinder;
+import com.google.gwt.uibinder.client.UiField;
+>>>>>>> replace with uibinder
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
@@ -212,11 +220,18 @@ public class LoginView extends Composite
import com.google.inject.Inject;
public class LoginView extends Composite implements KeyUpHandler,
LoginActivity.Displayable {
+<<<<<<< HEAD
>>>>>>> Change to new mvp framework - first step
+=======
+ @UiField VerticalPanel mainContainer;
+>>>>>>> replace with uibinder
private Button loginButton = new Button();
private SubmitButton submitButton;
private Button resetButton;
private Loading loading;
+// FlowPanel rPanel = new FlowPanel();
+ @UiField FlexTable flexTable;
+ Panel buttonBar = new FlowPanel();
// We wrap login/password boxes with a form which must be in the html
// document,
// in this way, the browser knows that we are sending a login form and
@@ -224,15 +239,12 @@ public class LoginView extends Composite
private TextBox usernameTextBox =
TextBox.wrap(DOM.getElementById("email"));
private PasswordTextBox passwordTextBox =
PasswordTextBox.wrap(DOM.getElementById("password"));
// wrap the form after inputs so as they are in the dom when are wrapped
- final private FormPanel formPanel =
FormPanel.wrap(DOM.getElementById("loginForm"), true);
+ @UiField FormPanel formPanel;
@Inject
public LoginView(HupaConstants constants) {
-
- VerticalPanel mainContainer = new VerticalPanel();
- RndPanel rPanel = new RndPanel();
- FlexTable flexTable = new FlexTable();
- Panel buttonBar = new FlowPanel();
+ initWidget(binder.createAndBindUi(this));
+ formPanel = FormPanel.wrap(DOM.getElementById("loginForm"),
true);
submitButton = new SubmitButton(constants.loginButton());
resetButton = new Button(constants.resetButton());
submitButton.getElement().setClassName(HupaCSS.C_button);
@@ -241,7 +253,7 @@ public class LoginView extends Composite
loading = new Loading(constants.loading());
mainContainer.setStyleName(HupaCSS.C_login_container);
- flexTable.addStyleName(HupaCSS.C_login_form);
+// flexTable.addStyleName(HupaCSS.C_login_form);
usernameTextBox.addStyleName(HupaCSS.C_login_box);
passwordTextBox.addStyleName(HupaCSS.C_login_box);
@@ -255,7 +267,7 @@ public class LoginView extends Composite
flexTable.getFlexCellFormatter().setColSpan(2, 0, 2);
flexTable.setWidget(2, 0, buttonBar);
- rPanel.add(formPanel);
+// rPanel.add(formPanel);
formPanel.add(flexTable);
mainContainer.add(formPanel);
mainContainer.add(loading);
@@ -335,6 +347,7 @@ public class LoginView extends Composite
mainContainer.add(loginButton);
loginButton.setVisible(false);
<<<<<<< HEAD
+<<<<<<< HEAD
>>>>>>> change the LOGIN progress using native MVP instead of gwt-presenter
=======
// loginButton must be in the document to handle the click()
method
@@ -344,6 +357,8 @@ public class LoginView extends Composite
=======
initWidget(mainContainer);
>>>>>>> make login form available
+=======
+>>>>>>> replace with uibinder
}
@Override
@@ -430,6 +445,7 @@ public class LoginView extends Composite
<<<<<<< HEAD
<<<<<<< HEAD
+<<<<<<< HEAD
interface LoginViewUiBinder extends UiBinder<FlowPanel, LoginView> {
}
@@ -440,4 +456,11 @@ public class LoginView extends Composite
>>>>>>> change the LOGIN progress using native MVP instead of gwt-presenter
=======
>>>>>>> change the LOGIN progress using native MVP instead of gwt-presenter
+=======
+ interface LoginViewUiBinder extends UiBinder<VerticalPanel, LoginView> {
+ }
+
+ private static LoginViewUiBinder binder =
GWT.create(LoginViewUiBinder.class);
+
+>>>>>>> replace with uibinder
}
Modified:
james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/LoginView.ui.xml
URL:
http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/LoginView.ui.xml?rev=1522228&r1=1522227&r2=1522228&view=diff
==============================================================================
---
james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/LoginView.ui.xml
(original)
+++
james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/LoginView.ui.xml
Thu Sep 12 03:38:32 2013
@@ -1,3 +1,4 @@
+<<<<<<< HEAD
<!-- 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
@@ -81,4 +82,32 @@
</g:HTML>
</g:FlowPanel>
</g:FlowPanel>
+=======
+<!--
+ 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.
+-->
+
+<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'
+ xmlns:g='urn:import:com.google.gwt.user.client.ui'>
+ <g:VerticalPanel ui:field="mainContainer">
+ <g:FormPanel ui:field="formPanel">
+ <g:FlexTable ui:field="flexTable"></g:FlexTable>
+ </g:FormPanel>
+ </g:VerticalPanel>
+>>>>>>> replace with uibinder
</ui:UiBinder>
\ No newline at end of file
Modified:
james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/TopView.java
URL:
http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/TopView.java?rev=1522228&r1=1522227&r2=1522228&view=diff
==============================================================================
---
james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/TopView.java
(original)
+++
james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/TopView.java
Thu Sep 12 03:38:32 2013
@@ -150,7 +150,7 @@ import org.apache.hupa.widgets.ui.RndPan
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.uibinder.client.UiBinder;
-import com.google.gwt.uibinder.client.UiConstructor;
+import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.Timer;
import com.google.gwt.user.client.ui.Anchor;
import com.google.gwt.user.client.ui.Composite;
@@ -193,6 +193,7 @@ public class TopView extends Composite i
>>>>>>> decorate the theme
=======
public class TopView extends Composite implements TopActivity.Displayable {
+<<<<<<< HEAD
>>>>>>> introduce the top activity
interface TopViewUiBinder extends UiBinder<FlowPanel, TopView> {
@@ -216,59 +217,39 @@ public class TopView extends Composite i
private HorizontalPanel loginInfoPanel = new HorizontalPanel();
+=======
+ @UiField HorizontalPanel buttonContainer;
+ @UiField HorizontalPanel infoContainer;
+ @UiField HorizontalPanel loginInfoPanel;
+>>>>>>> replace with uibinder
private Label loginLabel = new Label();
- private Label loginUserLabel = new Label();
- private Anchor mainButton;
+ @UiField Label loginUserLabel;
+ @UiField Anchor mainButton;
private Anchor contactsButton;
- private Anchor logoutButton;
- private Label appnameLabel = new Label();
+ @UiField Anchor logoutButton;
+ @UiField Label appnameLabel;
private RndPanel flashContainer = new RndPanel();
private Label flashLabel = new Label();
- private Label extraLabel = new Label();
+ @UiField Label extraLabel;
@Inject
- @UiConstructor
public TopView(HupaConstants constants) {
- mainButton = new Anchor(constants.mailTab());
+ initWidget(binder.createAndBindUi(this));
+ mainButton.setText(constants.mailTab());
contactsButton = new Anchor(constants.contactsTab());
- logoutButton = new Anchor(constants.logoutButton());
-// panel.addStyleName(HupaCSS.C_top_container + "-wrap");
- buttonContainer.addStyleName(HupaCSS.C_button_container);
- infoContainer.addStyleName(HupaCSS.C_info_container);
-// loginInfoPanel.addStyleName(HupaCSS.C_login_info_container);
+ logoutButton.setText(constants.logoutButton());
loginLabel.addStyleName(HupaCSS.C_login_info_label);
-// loginUserLabel.addStyleName(HupaCSS.C_login_info_user);
-// logoutButton.addStyleName(HupaCSS.C_menu_button);
-// contactsButton.addStyleName(HupaCSS.C_menu_button);
-// mainButton.addStyleName(HupaCSS.C_menu_button);
+ logoutButton.addStyleName(HupaCSS.C_menu_button);
appnameLabel.addStyleName(HupaCSS.C_header);
flashContainer.addStyleName(HupaCSS.C_flash);
-
- // internationalize elements
-// logoutButton.setText(constants.logoutButton());
-// contactsButton.setText(constants.contactsTab());
-// mainButton.setText(constants.mailTab());
loginLabel.setText(constants.loginAs() + ": ");
appnameLabel.setText(constants.productName());
-
- // Layout containers and panels
- buttonContainer.add(loginInfoPanel);
-// loginInfoPanel.add(loginLabel);
-// loginInfoPanel.add(loginUserLabel);
- buttonContainer.add(loginUserLabel);
-// buttonContainer.add(contactsButton);
- buttonContainer.add(mainButton);
- buttonContainer.add(logoutButton);
- buttonContainer.setCellWidth(loginInfoPanel, "100%");
-
infoContainer.add(appnameLabel);
infoContainer.add(extraLabel);
- panel.add(buttonContainer);
-// panel.add(infoContainer);
-// panel.add(flashContainer);
flashContainer.add(flashLabel);
<<<<<<< HEAD
+<<<<<<< HEAD
>>>>>>> introduce the top activity
initWidget(panel);
showTopNavigation(false);
@@ -344,6 +325,8 @@ public class TopView extends Composite i
=======
>>>>>>> introduce the top activity
initWidget(panel);
+=======
+>>>>>>> replace with uibinder
showTopNavigation(false);
}
@@ -410,5 +393,13 @@ public class TopView extends Composite i
}
};
+<<<<<<< HEAD
>>>>>>> introduce the top activity
+=======
+ interface TopViewUiBinder extends UiBinder<FlowPanel, TopView> {
+ }
+
+ private static TopViewUiBinder binder =
GWT.create(TopViewUiBinder.class);
+
+>>>>>>> replace with uibinder
}
Modified:
james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/TopView.ui.xml
URL:
http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/TopView.ui.xml?rev=1522228&r1=1522227&r2=1522228&view=diff
==============================================================================
---
james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/TopView.ui.xml
(original)
+++
james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/TopView.ui.xml
Thu Sep 12 03:38:32 2013
@@ -36,6 +36,7 @@
<g:Label ui:field="appnameLabel"></g:Label>
<g:Label ui:field="extraLabel"></g:Label>
</g:HorizontalPanel>
+<<<<<<< HEAD
=======
=======
>>>>>>> decorate the theme
@@ -69,5 +70,7 @@
=======
<g:FlowPanel ui:field="topWrapper">
>>>>>>> make it look more beautiful
+=======
+>>>>>>> replace with uibinder
</g:FlowPanel>
</ui:UiBinder>
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]