// Path: gwt/src/opus/gwt/management/console/client/event/PanelTransitionEvent.java
// public class PanelTransitionEvent extends GwtEvent<PanelTransitionEventHandler> {
// 	
// 	public static Type<PanelTransitionEventHandler> TYPE = new Type<PanelTransitionEventHandler>();
// 	//private String transitionType;
// 	private Widget panel;
// 	public enum TransitionTypes{PREVIOUS, NEXT, DELETE, SETTINGS, DEPLOY, PROJECTS, DASHBOARD};
// 	private TransitionTypes transitionType;
// 	public String name;
// 	
// 	public PanelTransitionEvent(TransitionTypes transitionType, Widget panel){
// 		this.transitionType = transitionType;
// 		this.panel = panel;
// 	}
// 
// 	public PanelTransitionEvent(TransitionTypes transitionType){
// 		this.transitionType = transitionType;
// 	}
// 
// 	public PanelTransitionEvent(TransitionTypes transitionType, String name){
// 		this.name = name;
// 		this.transitionType = transitionType;
// 	}
// 	
// 	public TransitionTypes getTransitionType(){
// 		return transitionType;
// 	}
// 	
// 	public Widget getPanel(){
// 		return panel;
// 	}
// 	
// 	public String getName(){
// 		return name;
// 	}
// 	
//   	@Override
//   	public Type<PanelTransitionEventHandler> getAssociatedType() {
// 	  return TYPE;
//   	}
// 
//   	@Override
//   	protected void dispatch(PanelTransitionEventHandler handler) {
// 	  handler.onPanelTransition(this);
//   	}
// }
// 
// Path: gwt/src/opus/gwt/management/console/client/resources/ProjectDeployerCss.java
// public interface ProjectDeployerStyle extends CssResource {
//  String redBorder();
//  String greyBorder();
//  String loadingPopup();
//  String loadingImage();
//  String loadingGlass();
//  String loadingLabel();
// }
// 
// Path: gwt/src/opus/gwt/management/console/client/tools/TooltipPanel.java
// public class TooltipPanel extends PopupPanel {
// 	private static TooltipPanelUiBinder uiBinder = GWT.create(TooltipPanelUiBinder.class);
// 	interface TooltipPanelUiBinder extends UiBinder<Widget, TooltipPanel> {}
// 	
// 	@UiField HTML text;
// 	@UiField HTMLPanel content;
// 	@UiField HTMLPanel arrow;
// 	@UiField TooltipPanelStyle style;
// 
// 	public TooltipPanel() {
// 		super();
// 		setWidget(uiBinder.createAndBindUi(this));
// 		setAutoHideEnabled(true);
// 	}
// 	
// 	/**
// 	 * Set the text to a certain String
// 	 * @param html the String to use; can contain HTML
// 	 */
// 	public void setText(String html) {
// 		text.setHTML(html);
// 	}
// 	
// 	/**
// 	 * Set the tooltip to a red color; typically used for errors
// 	 */
// 	public void setRed() {
// 		content.setStyleName(style.tooltip_right_red());
// 		arrow.setStyleName(style.tooltip_left_red());
// 	}
// 	
// 	/**
// 	 * Set the tooltip to a gray color; default color
// 	 */
// 	public void setGray() {
// 		content.setStyleName(style.tooltip_right());
// 		arrow.setStyleName(style.tooltip_left());
// 	}
// }


import opus.gwt.management.console.client.ClientFactory;
import opus.gwt.management.console.client.event.PanelTransitionEvent;
import opus.gwt.management.console.client.event.UpdateDBOptionsEvent;
import opus.gwt.management.console.client.event.UpdateDBOptionsEventHandler;
import opus.gwt.management.console.client.resources.ProjectDeployerCss.ProjectDeployerStyle;
import opus.gwt.management.console.client.tools.TooltipPanel;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.FocusEvent;
import com.google.gwt.event.dom.client.KeyUpEvent;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.http.client.URL;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HTMLPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.ListBox;
import com.google.gwt.user.client.ui.PasswordTextBox;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.Widget;
				passwordConfirmTextBox.setStyleName(deployer.redBorder());
			} else {
				passwordError.setText("");
				passwordTextBox.setStyleName(deployer.greyBorder());
				passwordConfirmTextBox.setStyleName(deployer.greyBorder());
			}
		} else {
			
		}
	}
	
	@UiHandler("emailTextBox")
	void emailTextBoxOnChange(KeyUpEvent event) {
		if(!usernameTextBox.getText().isEmpty()) {
			if(!isEmailValid()) {
				active.hide();
				emailError.setText("Enter a valid email address");
				emailTextBox.setStyleName(deployer.redBorder());
			} else {
				emailError.setText("");
				emailTextBox.setStyleName(deployer.greyBorder());
			}
		} else {
			
		}
	}
	
	@UiHandler("nextButton")
	void handleNextButton(ClickEvent event){
		if( validateFields() ){
// Path: gwt/src/opus/gwt/management/console/client/event/PanelTransitionEvent.java
// public class PanelTransitionEvent extends GwtEvent<PanelTransitionEventHandler> {
// 	
// 	public static Type<PanelTransitionEventHandler> TYPE = new Type<PanelTransitionEventHandler>();
// 	//private String transitionType;
// 	private Widget panel;
// 	public enum TransitionTypes{PREVIOUS, NEXT, DELETE, SETTINGS, DEPLOY, PROJECTS, DASHBOARD};
// 	private TransitionTypes transitionType;
// 	public String name;
// 	
// 	public PanelTransitionEvent(TransitionTypes transitionType, Widget panel){
// 		this.transitionType = transitionType;
// 		this.panel = panel;
// 	}
// 
// 	public PanelTransitionEvent(TransitionTypes transitionType){
// 		this.transitionType = transitionType;
// 	}
// 
// 	public PanelTransitionEvent(TransitionTypes transitionType, String name){
// 		this.name = name;
// 		this.transitionType = transitionType;
// 	}
// 	
// 	public TransitionTypes getTransitionType(){
// 		return transitionType;
// 	}
// 	
// 	public Widget getPanel(){
// 		return panel;
// 	}
// 	
// 	public String getName(){
// 		return name;
// 	}
// 	
//   	@Override
//   	public Type<PanelTransitionEventHandler> getAssociatedType() {
// 	  return TYPE;
//   	}
// 
//   	@Override
//   	protected void dispatch(PanelTransitionEventHandler handler) {
// 	  handler.onPanelTransition(this);
//   	}
// }
// 
// Path: gwt/src/opus/gwt/management/console/client/resources/ProjectDeployerCss.java
// public interface ProjectDeployerStyle extends CssResource {
//  String redBorder();
//  String greyBorder();
//  String loadingPopup();
//  String loadingImage();
//  String loadingGlass();
//  String loadingLabel();
// }
// 
// Path: gwt/src/opus/gwt/management/console/client/tools/TooltipPanel.java
// public class TooltipPanel extends PopupPanel {
// 	private static TooltipPanelUiBinder uiBinder = GWT.create(TooltipPanelUiBinder.class);
// 	interface TooltipPanelUiBinder extends UiBinder<Widget, TooltipPanel> {}
// 	
// 	@UiField HTML text;
// 	@UiField HTMLPanel content;
// 	@UiField HTMLPanel arrow;
// 	@UiField TooltipPanelStyle style;
// 
// 	public TooltipPanel() {
// 		super();
// 		setWidget(uiBinder.createAndBindUi(this));
// 		setAutoHideEnabled(true);
// 	}
// 	
// 	/**
// 	 * Set the text to a certain String
// 	 * @param html the String to use; can contain HTML
// 	 */
// 	public void setText(String html) {
// 		text.setHTML(html);
// 	}
// 	
// 	/**
// 	 * Set the tooltip to a red color; typically used for errors
// 	 */
// 	public void setRed() {
// 		content.setStyleName(style.tooltip_right_red());
// 		arrow.setStyleName(style.tooltip_left_red());
// 	}
// 	
// 	/**
// 	 * Set the tooltip to a gray color; default color
// 	 */
// 	public void setGray() {
// 		content.setStyleName(style.tooltip_right());
// 		arrow.setStyleName(style.tooltip_left());
// 	}
// }


// Path: gwt/src/opus/gwt/management/console/client/deployer/ProjectOptionsPanel.java
import opus.gwt.management.console.client.ClientFactory;
import opus.gwt.management.console.client.event.PanelTransitionEvent;
import opus.gwt.management.console.client.event.UpdateDBOptionsEvent;
import opus.gwt.management.console.client.event.UpdateDBOptionsEventHandler;
import opus.gwt.management.console.client.resources.ProjectDeployerCss.ProjectDeployerStyle;
import opus.gwt.management.console.client.tools.TooltipPanel;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.FocusEvent;
import com.google.gwt.event.dom.client.KeyUpEvent;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.http.client.URL;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HTMLPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.ListBox;
import com.google.gwt.user.client.ui.PasswordTextBox;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.Widget;

				passwordConfirmTextBox.setStyleName(deployer.redBorder());
			} else {
				passwordError.setText("");
				passwordTextBox.setStyleName(deployer.greyBorder());
				passwordConfirmTextBox.setStyleName(deployer.greyBorder());
			}
		} else {
			
		}
	}
	
	@UiHandler("emailTextBox")
	void emailTextBoxOnChange(KeyUpEvent event) {
		if(!usernameTextBox.getText().isEmpty()) {
			if(!isEmailValid()) {
				active.hide();
				emailError.setText("Enter a valid email address");
				emailTextBox.setStyleName(deployer.redBorder());
			} else {
				emailError.setText("");
				emailTextBox.setStyleName(deployer.greyBorder());
			}
		} else {
			
		}
	}
	
	@UiHandler("nextButton")
	void handleNextButton(ClickEvent event){
		if( validateFields() ){
			eventBus.fireEvent(new PanelTransitionEvent(PanelTransitionEvent.TransitionTypes.NEXT, this));