package org.gcube.portlets.user.workspace.client.view;

import org.gcube.portlets.user.workspace.client.view.grids.GxtGridFilterGroupPanel;
import org.gcube.portlets.user.workspace.client.view.panels.GxtBasicTabPanel;
import org.gcube.portlets.user.workspace.client.view.panels.GxtBorderLayoutPanel;
import org.gcube.portlets.user.workspace.client.view.panels.GxtCardLayoutResultPanel;
import org.gcube.portlets.user.workspace.client.view.panels.GxtSeachAndFilterPanel;
import org.gcube.portlets.user.workspace.client.view.toolbars.GxtPathPanel;


/**
 * @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
 *
 */
public class WorskpacePortlet {

	private GxtBorderLayoutPanel borderLayoutContainer = null;
	private GxtBasicTabPanel basicTabContainer = null;
//	private GxtToolBarFunctionsPanel toolbarPanelContainer = null;
	private ExplorerPanel explorerPanel = null;
	private GxtDetailsContainer detailsContainer;
	private GxtListView listViewContainer;
	private GxtPathPanel toolBarPathPanel;
	private GxtGridFilterGroupPanel gridFilterGroupContainer;
	private GxtSeachAndFilterPanel searchAndFilterContainer;
	private GxtGridFilterGroupPanel gridFilterContainer;
	private GxtCardLayoutResultPanel gxtCardLayoutResultPanel; 

	public WorskpacePortlet(boolean activeGroup) {

//		Log.trace("Initializing WorskpacePortlet");
		this.basicTabContainer = new GxtBasicTabPanel();
		this.toolBarPathPanel = new GxtPathPanel();
		this.searchAndFilterContainer = new GxtSeachAndFilterPanel(this.toolBarPathPanel.getToolBarPathPanel());
			
		this.gridFilterContainer = new GxtGridFilterGroupPanel(false);
		this.gridFilterGroupContainer = new GxtGridFilterGroupPanel(activeGroup);
		this.listViewContainer = new GxtListView();
		this.detailsContainer = new GxtDetailsContainer();

		
		this.gxtCardLayoutResultPanel = new GxtCardLayoutResultPanel(gridFilterContainer, gridFilterGroupContainer, listViewContainer, detailsContainer);
		
	}
	
	public WorskpacePortlet(ExplorerPanel expPanel, boolean activeGroup) {
		this(activeGroup);
		this.explorerPanel = expPanel;
		
		this.borderLayoutContainer = new GxtBorderLayoutPanel(this.searchAndFilterContainer, this.explorerPanel, this.gxtCardLayoutResultPanel, this.detailsContainer);
	}

	public GxtBorderLayoutPanel getBorderLayoutContainer() {
		return borderLayoutContainer;
	}
	
	public GxtBasicTabPanel getBasicTabContainer() {
		return basicTabContainer;
	}
	
	public GxtDetailsContainer getDetailsContainer() {
		return detailsContainer;
	}


	public GxtSeachAndFilterPanel getSearchAndFilterContainer() {
		return searchAndFilterContainer;
	}


	public GxtPathPanel getToolBarPath() {
		return toolBarPathPanel;
	}


	public GxtGridFilterGroupPanel getGridGroupContainer() {
		return gridFilterGroupContainer;
	}


	public ExplorerPanel getExplorerPanel() {
		return explorerPanel;
	}

	public GxtGridFilterGroupPanel getGridFilterContainer() {
		return gridFilterContainer;
	}


	public void setGridFilterContainer(GxtGridFilterGroupPanel gridFilterContainer) {
		this.gridFilterContainer = gridFilterContainer;
	}

	public GxtCardLayoutResultPanel getGxtCardLayoutResultPanel() {
		return gxtCardLayoutResultPanel;
	}
}
