2013-02-08 10:56:27 +01:00
|
|
|
package org.gcube.portlets.user.workspace.client.view.panels;
|
|
|
|
|
|
|
|
import org.gcube.portlets.user.workspace.client.ConstantsPortlet.ViewSwitchTypeInResult;
|
|
|
|
import org.gcube.portlets.user.workspace.client.view.GxtListView;
|
|
|
|
import org.gcube.portlets.user.workspace.client.view.grids.GxtGridFilterGroupPanel;
|
2013-05-23 19:03:22 +02:00
|
|
|
import org.gcube.portlets.user.workspace.client.view.toolbars.GxtToolBarItemAccounting;
|
|
|
|
import org.gcube.portlets.user.workspace.client.view.toolbars.GxtToolBarItemFunctionality;
|
2013-02-08 10:56:27 +01:00
|
|
|
|
|
|
|
import com.extjs.gxt.ui.client.widget.ContentPanel;
|
|
|
|
import com.extjs.gxt.ui.client.widget.LayoutContainer;
|
|
|
|
import com.extjs.gxt.ui.client.widget.layout.CardLayout;
|
|
|
|
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
|
|
|
|
import com.google.gwt.user.client.Element;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
public class GxtCardLayoutResultPanel extends LayoutContainer{
|
|
|
|
|
|
|
|
private CardLayout cardLayout = new CardLayout();
|
|
|
|
private GxtItemsPanel itemPanel;
|
|
|
|
private GxtListView iconsViewContainer;
|
|
|
|
private GxtGridFilterGroupPanel gridGroupViewContainer;
|
|
|
|
private ContentPanel activePanel = null;
|
2013-05-23 19:03:22 +02:00
|
|
|
private GxtToolBarItemFunctionality toolBarItemFunct;
|
|
|
|
private GxtToolBarItemAccounting toolBarItemDetails;
|
2013-02-08 10:56:27 +01:00
|
|
|
|
|
|
|
public GxtCardLayoutResultPanel(
|
|
|
|
GxtGridFilterGroupPanel gridFilterGroupContainer,
|
|
|
|
GxtListView listViewContainer,
|
2013-05-23 19:03:22 +02:00
|
|
|
GxtToolBarItemAccounting toolBarItemDetails) {
|
2013-02-08 10:56:27 +01:00
|
|
|
this.iconsViewContainer = listViewContainer;
|
|
|
|
this.gridGroupViewContainer = gridFilterGroupContainer;
|
2013-05-23 19:03:22 +02:00
|
|
|
this.toolBarItemDetails = toolBarItemDetails;
|
2013-02-08 10:56:27 +01:00
|
|
|
|
|
|
|
instanceItemsPanel();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
private void instanceItemsPanel(){
|
2013-05-23 19:03:22 +02:00
|
|
|
this.toolBarItemFunct = new GxtToolBarItemFunctionality(gridGroupViewContainer); //instance toolbar
|
|
|
|
this.itemPanel = new GxtItemsPanel(iconsViewContainer, gridGroupViewContainer, toolBarItemFunct, toolBarItemDetails);
|
2013-02-08 10:56:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected void onRender(Element parent, int pos) {
|
|
|
|
super.onRender(parent, pos);
|
|
|
|
setLayout(new FitLayout());
|
|
|
|
|
|
|
|
ContentPanel cp = new ContentPanel();
|
|
|
|
cp.setHeaderVisible(false);
|
|
|
|
cp.setLayout(cardLayout);
|
|
|
|
|
|
|
|
cp.add(itemPanel);
|
|
|
|
|
|
|
|
cardLayout.setActiveItem(itemPanel);
|
|
|
|
activePanel = itemPanel;
|
|
|
|
|
|
|
|
add(cp);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
public void setActivePanel(ViewSwitchTypeInResult type){
|
|
|
|
|
|
|
|
|
|
|
|
if(type.equals(ViewSwitchTypeInResult.Group) ){
|
|
|
|
cardLayout.setActiveItem(itemPanel);
|
|
|
|
activePanel = itemPanel;
|
|
|
|
// toolBar.setEnabled(true);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// public GxtGridMessagesFilterPanel getMessagesPanelContainer() {
|
|
|
|
// return messagesPanelContainer;
|
|
|
|
// }
|
|
|
|
|
|
|
|
public GxtItemsPanel getItemPanel() {
|
|
|
|
return itemPanel;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setItemPanel(GxtItemsPanel itemPanel) {
|
|
|
|
this.itemPanel = itemPanel;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-05-27 18:25:26 +02:00
|
|
|
public GxtToolBarItemFunctionality getToolBarItemFunctionalities() {
|
2013-05-23 19:03:22 +02:00
|
|
|
return toolBarItemFunct;
|
2013-02-08 10:56:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public ContentPanel getActivePanel(){
|
|
|
|
return activePanel;
|
|
|
|
}
|
|
|
|
|
2013-05-27 18:25:26 +02:00
|
|
|
public GxtToolBarItemAccounting getToolBarItemDetails() {
|
|
|
|
return toolBarItemDetails;
|
|
|
|
}
|
|
|
|
|
2013-02-08 10:56:27 +01:00
|
|
|
}
|