/**
 * <License>
 */
package edu.colorado.csdms.wmt.client.ui.handler;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.HTML;

import edu.colorado.csdms.wmt.client.control.DataManager;
import edu.colorado.csdms.wmt.client.ui.widgets.LoginDialogBox;

/**
 * Handles login events.
 * 
 * @author Mark Piper (mark.piper@colorado.edu)
 */
public class LoginHandler implements ClickHandler {

  private DataManager data;
  private LoginDialogBox loginDialog;
  
  /**
   * Creates a new {@link LoginHandler}.
   * 
   * @param data the DataManager object for the WMT session
   */
  public LoginHandler(DataManager data) {
    this.data = data;
  }
  
  @Override
  public void onClick(ClickEvent event) {
    HTML loginHtml = (HTML) event.getSource();
    if (data.security.isLoggedIn()) {
      Boolean isConfirmed = Window.confirm("Are you sure you want to log out?");
      if (isConfirmed) {
        loginHtml.setHTML("<a href=\"javascript:;\">Login</a>");
      }
      data.security.isLoggedIn(!isConfirmed);
    } else {
      loginDialog = new LoginDialogBox();
      loginDialog.getChoicePanel().getOkButton().addClickHandler(
          new LoginAuthenticationHandler(data, loginDialog));
      loginDialog.getChoicePanel().getCancelButton().addClickHandler(
          new DialogCancelHandler(loginDialog));
      loginDialog.center();
    }
  }

}

@@ -214,51 +214,8 @@
 dow;
-%0Aimport com.google.gwt.user.client.ui.HTML;
 %0A%0Aim
@@ -790,55 +790,8 @@
 ) %7B%0A
-    HTML loginHtml = (HTML) event.getSource();%0A
     
@@ -942,17 +942,42 @@
     
-l
+data.getPerspective().getL
 oginHtml
 .set
@@ -972,16 +972,18 @@
 oginHtml
+()
 .setHTML
@@ -983,16 +983,29 @@
 setHTML(
+%0A            
 %22%3Ca href

Update login widget through DataManager