// Path: gwt/src/opus/gwt/management/console/client/event/BreadCrumbEvent.java
// public class BreadCrumbEvent extends GwtEvent<BreadCrumbEventHandler> {
// 	
// 	public static Type<BreadCrumbEventHandler> TYPE = new Type<BreadCrumbEventHandler>();
// 	public enum Action{SET_CRUMBS, SET_ACTIVE, ADD_CRUMB, REMOVE_CRUMB};
// 	private Action actionType;
// 	private String[] names;
// 	private String crumb;
// 	
// 	public BreadCrumbEvent(Action actionType, String[] names){
// 		this.actionType = actionType;
// 		this.names = names;
// 	}
// 	
// 	public BreadCrumbEvent(Action actionType, String crumb){
// 		this.actionType = actionType;
// 		this.crumb = crumb;
// 	}
// 	
// 	public Action getAction(){
// 		return actionType;
// 	}
// 
// 	public String getCrumb(){
// 		return crumb;
// 	}
// 	
// 	public String[] getCrumbNames(){
// 		return names;
// 	}
// 	
//   	@Override
//   	public Type<BreadCrumbEventHandler> getAssociatedType() {
// 	  return TYPE;
//   	}
// 
//   	@Override
//   	protected void dispatch(BreadCrumbEventHandler handler) {
// 	  handler.onBreadCrumb(this);
//   	}
// }
// 
// 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);
//   	}
// }


import opus.gwt.management.console.client.ClientFactory;
import opus.gwt.management.console.client.event.BreadCrumbEvent;
import opus.gwt.management.console.client.event.PanelTransitionEvent;
import opus.gwt.management.console.client.event.PanelTransitionEventHandler;
import opus.gwt.management.console.client.resources.ProjectManagerCss.ProjectManagerStyle;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.DeckPanel;
import com.google.gwt.user.client.ui.Widget;
/*############################################################################
# Copyright 2010 North Carolina State University                             #
#                                                                            #
#   Licensed 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 opus.gwt.management.console.client.dashboard;



public class ProjectManagerController extends Composite {

	private static ProjectDashboardUiBinder uiBinder = GWT.create(ProjectDashboardUiBinder.class);
	interface ProjectDashboardUiBinder extends UiBinder<Widget, ProjectManagerController> {}

	private DashboardPanel dashboardPanel;
//	private DeleteProjectPanel deleteProjectPanel;
	private AppSettingsPanel appSettingsPanel;
	private EventBus eventBus;
	private String projectName;
	private ClientFactory clientFactory;

	@UiField ProjectManagerStyle style;
	@UiField DeckPanel managerDeckPanel;
	
	public ProjectManagerController(ClientFactory clientFactory){
		initWidget(uiBinder.createAndBindUi(this));
		this.clientFactory = clientFactory;
		this.eventBus = clientFactory.getEventBus();
		this.dashboardPanel = new DashboardPanel(clientFactory);
		this.appSettingsPanel = new AppSettingsPanel(clientFactory);
		setupBreadCrumbs();
		setupmanagerDeckPanel();
		registerHandlers();
	}
	
	private void setupBreadCrumbs(){
		String[] crumbs = {"Projects", projectName, dashboardPanel.getTitle()};
// Path: gwt/src/opus/gwt/management/console/client/event/BreadCrumbEvent.java
// public class BreadCrumbEvent extends GwtEvent<BreadCrumbEventHandler> {
// 	
// 	public static Type<BreadCrumbEventHandler> TYPE = new Type<BreadCrumbEventHandler>();
// 	public enum Action{SET_CRUMBS, SET_ACTIVE, ADD_CRUMB, REMOVE_CRUMB};
// 	private Action actionType;
// 	private String[] names;
// 	private String crumb;
// 	
// 	public BreadCrumbEvent(Action actionType, String[] names){
// 		this.actionType = actionType;
// 		this.names = names;
// 	}
// 	
// 	public BreadCrumbEvent(Action actionType, String crumb){
// 		this.actionType = actionType;
// 		this.crumb = crumb;
// 	}
// 	
// 	public Action getAction(){
// 		return actionType;
// 	}
// 
// 	public String getCrumb(){
// 		return crumb;
// 	}
// 	
// 	public String[] getCrumbNames(){
// 		return names;
// 	}
// 	
//   	@Override
//   	public Type<BreadCrumbEventHandler> getAssociatedType() {
// 	  return TYPE;
//   	}
// 
//   	@Override
//   	protected void dispatch(BreadCrumbEventHandler handler) {
// 	  handler.onBreadCrumb(this);
//   	}
// }
// 
// 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/dashboard/ProjectManagerController.java
import opus.gwt.management.console.client.ClientFactory;
import opus.gwt.management.console.client.event.BreadCrumbEvent;
import opus.gwt.management.console.client.event.PanelTransitionEvent;
import opus.gwt.management.console.client.event.PanelTransitionEventHandler;
import opus.gwt.management.console.client.resources.ProjectManagerCss.ProjectManagerStyle;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.DeckPanel;
import com.google.gwt.user.client.ui.Widget;

/*############################################################################
# Copyright 2010 North Carolina State University                             #
#                                                                            #
#   Licensed 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 opus.gwt.management.console.client.dashboard;



public class ProjectManagerController extends Composite {

	private static ProjectDashboardUiBinder uiBinder = GWT.create(ProjectDashboardUiBinder.class);
	interface ProjectDashboardUiBinder extends UiBinder<Widget, ProjectManagerController> {}

	private DashboardPanel dashboardPanel;
//	private DeleteProjectPanel deleteProjectPanel;
	private AppSettingsPanel appSettingsPanel;
	private EventBus eventBus;
	private String projectName;
	private ClientFactory clientFactory;

	@UiField ProjectManagerStyle style;
	@UiField DeckPanel managerDeckPanel;
	
	public ProjectManagerController(ClientFactory clientFactory){
		initWidget(uiBinder.createAndBindUi(this));
		this.clientFactory = clientFactory;
		this.eventBus = clientFactory.getEventBus();
		this.dashboardPanel = new DashboardPanel(clientFactory);
		this.appSettingsPanel = new AppSettingsPanel(clientFactory);
		setupBreadCrumbs();
		setupmanagerDeckPanel();
		registerHandlers();
	}
	
	private void setupBreadCrumbs(){
		String[] crumbs = {"Projects", projectName, dashboardPanel.getTitle()};
		eventBus.fireEvent(new BreadCrumbEvent(BreadCrumbEvent.Action.SET_CRUMBS, crumbs));