Author: pcraveiro
Date: 2012-03-02 10:21:50 -0500 (Fri, 02 Mar 2012)
New Revision: 1469
Modified:
console/trunk/gui/src/main/java/org/picketlink/console/client/view/security/LoginPresenter.java
console/trunk/gui/src/main/java/org/picketlink/console/client/view/security/LoginView.java
Log:
Changed the submit clickhandler construction.
Modified:
console/trunk/gui/src/main/java/org/picketlink/console/client/view/security/LoginPresenter.java
===================================================================
---
console/trunk/gui/src/main/java/org/picketlink/console/client/view/security/LoginPresenter.java 2012-03-02
00:45:48 UTC (rev 1468)
+++
console/trunk/gui/src/main/java/org/picketlink/console/client/view/security/LoginPresenter.java 2012-03-02
15:21:50 UTC (rev 1469)
@@ -49,7 +49,7 @@
Credentials getUserCredentials();
- HasClickHandlers getLoginClickHandlers();
+ void setLoginClickHandlers(ClickHandler clickHandler);
void resetAndFocus();
@@ -78,12 +78,12 @@
@Override
protected void onBind() {
super.onBind();
- registerHandler(getView().getLoginClickHandlers().addClickHandler(new
ClickHandler() {
+ getView().setLoginClickHandlers(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
authenticate();
}
- }));
+ });
}
@Override
Modified:
console/trunk/gui/src/main/java/org/picketlink/console/client/view/security/LoginView.java
===================================================================
---
console/trunk/gui/src/main/java/org/picketlink/console/client/view/security/LoginView.java 2012-03-02
00:45:48 UTC (rev 1468)
+++
console/trunk/gui/src/main/java/org/picketlink/console/client/view/security/LoginView.java 2012-03-02
15:21:50 UTC (rev 1469)
@@ -26,13 +26,11 @@
import org.jboss.ballroom.client.widgets.window.DefaultWindow;
import org.jboss.ballroom.client.widgets.window.DialogueOptions;
import org.jboss.ballroom.client.widgets.window.WindowContentBuilder;
-import org.picketlink.console.client.model.BeanFactory;
import org.picketlink.console.client.model.Credentials;
import org.picketlink.console.client.resources.MessagesFactory;
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.ui.HTML;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;
@@ -45,8 +43,6 @@
*/
public class LoginView extends ViewImpl implements LoginPresenter.MyView {
- private BeanFactory beanFactory;
-
private DefaultWindow window;
private DialogueOptions options;
private Form<Credentials> form;
@@ -54,37 +50,22 @@
private TextBoxItem passwordTextbox;
@Inject
- public LoginView(BeanFactory factory) {
- this.beanFactory = factory;
- this.window = new DefaultWindow("Login");
- this.options = new DialogueOptions(MessagesFactory.instance().OK(), new
ClickHandler() {
-
- @Override
- public void onClick(ClickEvent event) {
-
- }
- }, "cancel", new ClickHandler() {
-
- @Override
- public void onClick(ClickEvent event) {
-
- }
- });
-
- window.setWidget(new WindowContent().asWidget());
-
- window.setWidth(480);
- window.setHeight(230);
- window.setModal(true);
-
- window.setGlassEnabled(false);
-
- window.center();
+ public LoginView() {
}
@Override
public Widget asWidget() {
- return window;
+ this.window = new DefaultWindow("Login");
+
+ this.window.setWidth(480);
+ this.window.setHeight(230);
+ this.window.setModal(true);
+
+ this.window.setGlassEnabled(false);
+
+ this.window.setWidget(new WindowContent().asWidget());
+
+ return this.window;
}
public Credentials getUserCredentials() {
@@ -92,8 +73,14 @@
}
@Override
- public HasClickHandlers getLoginClickHandlers() {
- return this.options.getSubmit();
+ public void setLoginClickHandlers(ClickHandler clickHandler) {
+ this.options = new DialogueOptions(MessagesFactory.instance().OK(), clickHandler,
"cancel", new ClickHandler() {
+
+ @Override
+ public void onClick(ClickEvent event) {
+
+ }
+ });
}
@Override
Show replies by date