Added alert when the export menu is disabled and workspace refresh when the file export is successfully completed
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/reports@70999 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
be1f07644b
commit
17b18d7926
|
@ -1,5 +1,4 @@
|
|||
#Wed Mar 06 18:58:12 CET 2013
|
||||
eclipse.preferences.version=1
|
||||
lastWarOutDir=/Users/massi/Documents/workspace/reports/target/reports-4.1.0-SNAPSHOT
|
||||
lastWarOutDir=/home/gioia/workspace/reports/target/reports-4.1.0-SNAPSHOT
|
||||
warSrcDir=src/main/webapp
|
||||
warSrcDirIsOutput=false
|
||||
|
|
|
@ -231,7 +231,11 @@ public class Headerbar extends Composite{
|
|||
public Command getNullCommand() {
|
||||
Command openNothing = new Command() {
|
||||
|
||||
public void execute() { }
|
||||
public void execute() {
|
||||
|
||||
MessageBox.alert("Alert",
|
||||
"Export is disabled for templates, please save this template as a Report and retry", null);
|
||||
}
|
||||
};
|
||||
|
||||
return openNothing;
|
||||
|
@ -377,8 +381,8 @@ public class Headerbar extends Composite{
|
|||
optionDOCX.setHTML(EXPORT_OPENXML);
|
||||
optionDOCX.setCommand(generateDOCX);
|
||||
|
||||
optionPDF.setHTML("Export to PDF");
|
||||
optionPDF.setCommand(generatePDF);
|
||||
optionPDF.setHTML("Export to PDF");
|
||||
optionPDF.setCommand(generatePDF);
|
||||
|
||||
optionHTML.setHTML(EXPORT_HTML);
|
||||
optionHTML.setCommand(generateHTML);
|
||||
|
|
|
@ -8,6 +8,8 @@ import org.gcube.portlets.d4sreporting.common.shared.ComponentType;
|
|||
import org.gcube.portlets.d4sreporting.common.shared.Metadata;
|
||||
import org.gcube.portlets.d4sreporting.common.shared.Model;
|
||||
import org.gcube.portlets.user.exporter.client.ReportExporterPopup;
|
||||
import org.gcube.portlets.user.exporter.client.event.ReportExporterEvent;
|
||||
import org.gcube.portlets.user.exporter.client.event.ReportExporterEventHandler;
|
||||
import org.gcube.portlets.user.exporter.shared.TypeExporter;
|
||||
import org.gcube.portlets.user.gcubewidgets.client.popup.GCubeDialog;
|
||||
import org.gcube.portlets.user.reportgenerator.client.Headerbar;
|
||||
|
@ -53,7 +55,9 @@ import com.extjs.gxt.ui.client.widget.layout.FitLayout;
|
|||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.event.dom.client.ClickEvent;
|
||||
import com.google.gwt.event.dom.client.ClickHandler;
|
||||
import com.google.gwt.event.shared.EventBus;
|
||||
import com.google.gwt.event.shared.HandlerManager;
|
||||
import com.google.gwt.event.shared.SimpleEventBus;
|
||||
import com.google.gwt.user.client.Command;
|
||||
import com.google.gwt.user.client.Timer;
|
||||
import com.google.gwt.user.client.Window;
|
||||
|
@ -143,6 +147,16 @@ public class Presenter {
|
|||
// refreshWorkspace();
|
||||
// }
|
||||
// });
|
||||
eventBus.addHandler(ReportExporterEvent.TYPE, new ReportExporterEventHandler() {
|
||||
|
||||
@Override
|
||||
public void onCompletedExport(ReportExporterEvent event) {
|
||||
if(event.isSuccssfullyCompleted()) {
|
||||
refreshWorkspace();
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
eventBus.addHandler(AddCommentEvent.TYPE, new AddCommentEventHandler() {
|
||||
public void onAddComment(AddCommentEvent event) {
|
||||
|
@ -661,7 +675,7 @@ public class Presenter {
|
|||
// }
|
||||
|
||||
|
||||
ReportExporterPopup popup = new ReportExporterPopup();
|
||||
ReportExporterPopup popup = new ReportExporterPopup(eventBus);
|
||||
Model reportModel = model.getSerializableModel();
|
||||
|
||||
switch (type) {
|
||||
|
|
Reference in New Issue