2013-02-06 23:25:43 +01:00
|
|
|
package org.gcube.portlets.user.reportgenerator.client;
|
|
|
|
|
|
|
|
import org.gcube.portlets.user.workspace.client.AppControllerExplorer;
|
2013-03-14 17:30:16 +01:00
|
|
|
import org.gcube.portlets.user.workspace.client.event.FileDownloadEvent;
|
|
|
|
import org.gcube.portlets.user.workspace.client.event.FileDownloadEvent.DownloadType;
|
2013-02-06 23:25:43 +01:00
|
|
|
import org.gcube.portlets.user.workspace.client.view.tree.AsyncTreePanel;
|
|
|
|
|
2013-03-15 19:52:49 +01:00
|
|
|
import com.google.gwt.core.client.GWT;
|
2013-02-06 23:25:43 +01:00
|
|
|
import com.google.gwt.user.client.ui.SimplePanel;
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @author Massimiliano Assante, ISTI-CNR - massimiliano.assante@isti.cnr.it
|
|
|
|
*/
|
|
|
|
|
|
|
|
public class ToolboxPanel extends SimplePanel {
|
|
|
|
private AppControllerExplorer appController;
|
2013-03-07 18:59:50 +01:00
|
|
|
private AsyncTreePanel tp;
|
2013-02-06 23:25:43 +01:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
public static final int TOOLBOX_WIDTH = 235;
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
public static final int TOOLBOX_HEIGHT= 800;
|
|
|
|
|
|
|
|
public ToolboxPanel(AppControllerExplorer appController) {
|
2013-11-22 18:28:12 +01:00
|
|
|
this.appController = appController;
|
2013-11-14 17:57:40 +01:00
|
|
|
// AsyncTreePanel tp = appController.getTree(TOOLBOX_WIDTH, TOOLBOX_HEIGHT);
|
|
|
|
// this.tp = tp;
|
|
|
|
// add(tp);
|
|
|
|
// this.appController.hideSharingFacilities(); //sharing disabled we have problems from Reports
|
2013-02-06 23:25:43 +01:00
|
|
|
}
|
2013-11-22 18:28:12 +01:00
|
|
|
|
|
|
|
public void showStructure(ReportStructurePanel panel) {
|
|
|
|
clear();
|
|
|
|
setWidth("240px");
|
|
|
|
add(panel);
|
|
|
|
}
|
2013-02-06 23:25:43 +01:00
|
|
|
|
2013-03-14 17:30:16 +01:00
|
|
|
public void showExportedVersion(String id, String fileName) {
|
2013-03-15 19:52:49 +01:00
|
|
|
GWT.log("showExportedVersion");
|
2013-03-14 17:30:16 +01:00
|
|
|
AppControllerExplorer.getEventBus().fireEvent(new FileDownloadEvent(id, fileName, DownloadType.SHOW));
|
|
|
|
}
|
2013-02-06 23:25:43 +01:00
|
|
|
/**
|
|
|
|
* refresh the root
|
|
|
|
*/
|
|
|
|
public void refreshRoot() {
|
2013-11-22 18:28:12 +01:00
|
|
|
//appController.refreshRoot();
|
2013-02-06 23:25:43 +01:00
|
|
|
}
|
2013-03-07 18:59:50 +01:00
|
|
|
/**
|
|
|
|
* show upload file popup
|
|
|
|
*/
|
|
|
|
public void showUploadFile() {
|
2013-11-22 18:28:12 +01:00
|
|
|
//AppControllerExplorer.getEventBus().fireEvent(new FileUploadEvent(tp.getRootItem(), UploadType.FILE));
|
2013-03-07 18:59:50 +01:00
|
|
|
}
|
2013-02-06 23:25:43 +01:00
|
|
|
/**
|
|
|
|
* lalala
|
|
|
|
* @return the toolbox height
|
|
|
|
*/
|
|
|
|
public int getTreePanelHeight() {
|
|
|
|
return TOOLBOX_HEIGHT;
|
|
|
|
}
|
|
|
|
}
|