added open report button in toolbar
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/reports@71486 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
52d60eca5c
commit
1cd70b45bf
|
@ -26,14 +26,16 @@ import com.google.gwt.user.client.ui.PopupPanel;
|
||||||
* <code> CommonCommands </code> class contains the menu commands for the UI
|
* <code> CommonCommands </code> class contains the menu commands for the UI
|
||||||
*
|
*
|
||||||
* @author Massimiliano Assante, ISTI-CNR - massimiliano.assante@isti.cnr.it
|
* @author Massimiliano Assante, ISTI-CNR - massimiliano.assante@isti.cnr.it
|
||||||
*
|
|
||||||
* @version December 2012 (2.7)
|
|
||||||
*/
|
*/
|
||||||
public class CommonCommands {
|
public class CommonCommands {
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public Command openTemplate;
|
public Command openTemplate;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public Command openReport;
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@ -66,7 +68,7 @@ public class CommonCommands {
|
||||||
|
|
||||||
GWT.runAsync(WorkspaceLightTreeLoadPopup.class, new RunAsyncCallback() {
|
GWT.runAsync(WorkspaceLightTreeLoadPopup.class, new RunAsyncCallback() {
|
||||||
public void onSuccess() {
|
public void onSuccess() {
|
||||||
WorkspaceLightTreeLoadPopup wpTreepopup = new WorkspaceLightTreeLoadPopup("Open Template", true, true);
|
WorkspaceLightTreeLoadPopup wpTreepopup = new WorkspaceLightTreeLoadPopup("Select a Template to open", true, true);
|
||||||
wpTreepopup.setShowableTypes(ItemType.REPORT_TEMPLATE);
|
wpTreepopup.setShowableTypes(ItemType.REPORT_TEMPLATE);
|
||||||
wpTreepopup.setSelectableTypes(ItemType.REPORT_TEMPLATE);
|
wpTreepopup.setSelectableTypes(ItemType.REPORT_TEMPLATE);
|
||||||
|
|
||||||
|
@ -93,6 +95,38 @@ public class CommonCommands {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
openReport = new Command() {
|
||||||
|
public void execute() {
|
||||||
|
|
||||||
|
GWT.runAsync(WorkspaceLightTreeLoadPopup.class, new RunAsyncCallback() {
|
||||||
|
public void onSuccess() {
|
||||||
|
int left = presenter.getHeader().getMainLayout().getAbsoluteLeft() + 50;
|
||||||
|
int top = presenter.getHeader().getMainLayout().getAbsoluteTop() + 25;
|
||||||
|
|
||||||
|
WorkspaceLightTreeLoadPopup wpTreepopup = new WorkspaceLightTreeLoadPopup("Select a Report to open", true, true);
|
||||||
|
wpTreepopup.setShowableTypes(ItemType.REPORT);
|
||||||
|
wpTreepopup.setSelectableTypes(ItemType.REPORT);
|
||||||
|
wpTreepopup.addPopupHandler(new PopupHandler() {
|
||||||
|
public void onPopup(PopupEvent event) {
|
||||||
|
if (! event.isCanceled()) {
|
||||||
|
if (event.getSelectedItem() != null) {
|
||||||
|
presenter.openTemplate(event.getSelectedItem().getName(), event.getSelectedItem().getId(), false);
|
||||||
|
}
|
||||||
|
presenter.getHeader().enableExports();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
wpTreepopup.setPopupPosition(left, top);
|
||||||
|
wpTreepopup.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onFailure(Throwable reason) {
|
||||||
|
Window.alert("There are networks problem, please check your connection.");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
pickColor = new Command() {
|
pickColor = new Command() {
|
||||||
public void execute() {
|
public void execute() {
|
||||||
|
|
|
@ -360,6 +360,7 @@ public class Presenter {
|
||||||
|
|
||||||
toReturn.put("save", commonCommands.saveTemplate);
|
toReturn.put("save", commonCommands.saveTemplate);
|
||||||
toReturn.put("newdoc", newTemplate);
|
toReturn.put("newdoc", newTemplate);
|
||||||
|
toReturn.put("open_report", commonCommands.openReport);
|
||||||
toReturn.put("open_template", commonCommands.openTemplate);
|
toReturn.put("open_template", commonCommands.openTemplate);
|
||||||
toReturn.put("importing", commonCommands.importTemplateCommand);
|
toReturn.put("importing", commonCommands.importTemplateCommand);
|
||||||
toReturn.put("insertImage", commonCommands.insertImage);
|
toReturn.put("insertImage", commonCommands.insertImage);
|
||||||
|
@ -407,7 +408,7 @@ public class Presenter {
|
||||||
*/
|
*/
|
||||||
public void addTextToolBar() {
|
public void addTextToolBar() {
|
||||||
|
|
||||||
RichTextToolbar rtbar = new RichTextToolbar(new RichTextArea(), false, getCommands() );
|
RichTextToolbar rtbar = new RichTextToolbar(new RichTextArea(), false, getCommands(), true);
|
||||||
SimplePanel deco = new SimplePanel();
|
SimplePanel deco = new SimplePanel();
|
||||||
rtbar.setEnabled(false);
|
rtbar.setEnabled(false);
|
||||||
deco.add(rtbar);
|
deco.add(rtbar);
|
||||||
|
@ -606,7 +607,7 @@ public class Presenter {
|
||||||
*/
|
*/
|
||||||
public void enableTextToolBar(RichTextArea d4sArea) {
|
public void enableTextToolBar(RichTextArea d4sArea) {
|
||||||
|
|
||||||
RichTextToolbar rtbar = new RichTextToolbar(d4sArea, false, getCommands() );
|
RichTextToolbar rtbar = new RichTextToolbar(d4sArea, false, getCommands(), true);
|
||||||
if (menuForWorkflowDocument) //disable open and save buttons from the toolbar
|
if (menuForWorkflowDocument) //disable open and save buttons from the toolbar
|
||||||
rtbar.enableCommands(false);
|
rtbar.enableCommands(false);
|
||||||
currentSelectedToolbar = rtbar;
|
currentSelectedToolbar = rtbar;
|
||||||
|
@ -1161,15 +1162,23 @@ public class Presenter {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
Window.alert("Error: " + caught.getMessage());
|
Window.alert("Error while trying exporting this report: " + caught.getMessage());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showExportPanel(final String filePath, final String itemName, final TypeExporter type, String tempFileId) {
|
public void showExportPanel(final String filePath, final String itemName, final TypeExporter type, String tempFileId) {
|
||||||
ExportOptions exo = new ExportOptions(this, toolBoxPanel, filePath, itemName, type, reportService, tempFileId);
|
final ExportOptions exo = new ExportOptions(this, toolBoxPanel, filePath, itemName, type, reportService, tempFileId);
|
||||||
exportsPanel.add(exo);
|
exportsPanel.add(exo);
|
||||||
|
//needed for applying the css3 transition effect
|
||||||
|
final Timer t = new Timer() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
exo.getMainPanel().addStyleName("exportPanel-show");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
t.schedule(10);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void clearExportPanel() {
|
public void clearExportPanel() {
|
||||||
|
|
|
@ -19,9 +19,12 @@ import org.gcube.portlets.user.workspace.lighttree.client.load.WorkspaceLightTre
|
||||||
import com.google.gwt.core.client.EntryPoint;
|
import com.google.gwt.core.client.EntryPoint;
|
||||||
import com.google.gwt.core.client.GWT;
|
import com.google.gwt.core.client.GWT;
|
||||||
import com.google.gwt.core.client.RunAsyncCallback;
|
import com.google.gwt.core.client.RunAsyncCallback;
|
||||||
|
import com.google.gwt.event.dom.client.ClickEvent;
|
||||||
|
import com.google.gwt.event.dom.client.ClickHandler;
|
||||||
import com.google.gwt.event.logical.shared.ResizeEvent;
|
import com.google.gwt.event.logical.shared.ResizeEvent;
|
||||||
import com.google.gwt.event.logical.shared.ResizeHandler;
|
import com.google.gwt.event.logical.shared.ResizeHandler;
|
||||||
import com.google.gwt.user.client.Window;
|
import com.google.gwt.user.client.Window;
|
||||||
|
import com.google.gwt.user.client.ui.Button;
|
||||||
import com.google.gwt.user.client.ui.CellPanel;
|
import com.google.gwt.user.client.ui.CellPanel;
|
||||||
import com.google.gwt.user.client.ui.HTML;
|
import com.google.gwt.user.client.ui.HTML;
|
||||||
import com.google.gwt.user.client.ui.HorizontalPanel;
|
import com.google.gwt.user.client.ui.HorizontalPanel;
|
||||||
|
@ -127,7 +130,6 @@ public class ReportGenerator implements EntryPoint {
|
||||||
toolbarPanel.setWidth("100%");
|
toolbarPanel.setWidth("100%");
|
||||||
toolbarPanel.setHeight("40");
|
toolbarPanel.setHeight("40");
|
||||||
|
|
||||||
|
|
||||||
CellPanel cellPanel = new HorizontalPanel();
|
CellPanel cellPanel = new HorizontalPanel();
|
||||||
cellPanel.setStyleName("cella");
|
cellPanel.setStyleName("cella");
|
||||||
cellPanel.add(toolBoxPanel);
|
cellPanel.add(toolBoxPanel);
|
||||||
|
@ -178,7 +180,6 @@ public class ReportGenerator implements EntryPoint {
|
||||||
});
|
});
|
||||||
|
|
||||||
//showGuidedTour() ;
|
//showGuidedTour() ;
|
||||||
//presenter.showExportSaveOptions("", "", TypeExporter.DOCX, null);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
private void showGuidedTour() {
|
private void showGuidedTour() {
|
||||||
|
@ -370,14 +371,6 @@ public class ReportGenerator implements EntryPoint {
|
||||||
return toolbarPanel;
|
return toolbarPanel;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param toolbarPanel .
|
|
||||||
*/
|
|
||||||
public void setToolbarPanel(VerticalPanel toolbarPanel) {
|
|
||||||
this.toolbarPanel = toolbarPanel;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @return .
|
* @return .
|
||||||
|
|
|
@ -1,9 +1,5 @@
|
||||||
package org.gcube.portlets.user.reportgenerator.client;
|
package org.gcube.portlets.user.reportgenerator.client;
|
||||||
|
|
||||||
//
|
|
||||||
//import org.gcube.portlets.user.workspace.client.tree.WorkspaceTreePanel;
|
|
||||||
//import org.gcube.portlets.user.workspace.client.workspace.GWTWorkspace;
|
|
||||||
|
|
||||||
import org.gcube.portlets.user.workspace.client.AppControllerExplorer;
|
import org.gcube.portlets.user.workspace.client.AppControllerExplorer;
|
||||||
import org.gcube.portlets.user.workspace.client.event.FileDownloadEvent;
|
import org.gcube.portlets.user.workspace.client.event.FileDownloadEvent;
|
||||||
import org.gcube.portlets.user.workspace.client.event.FileDownloadEvent.DownloadType;
|
import org.gcube.portlets.user.workspace.client.event.FileDownloadEvent.DownloadType;
|
||||||
|
@ -12,7 +8,6 @@ import org.gcube.portlets.user.workspace.client.event.FileUploadEvent.UploadType
|
||||||
import org.gcube.portlets.user.workspace.client.view.tree.AsyncTreePanel;
|
import org.gcube.portlets.user.workspace.client.view.tree.AsyncTreePanel;
|
||||||
|
|
||||||
import com.google.gwt.core.client.GWT;
|
import com.google.gwt.core.client.GWT;
|
||||||
import com.google.gwt.user.client.ui.HTML;
|
|
||||||
import com.google.gwt.user.client.ui.SimplePanel;
|
import com.google.gwt.user.client.ui.SimplePanel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -32,9 +27,6 @@ public class ToolboxPanel extends SimplePanel {
|
||||||
*/
|
*/
|
||||||
public static final int TOOLBOX_HEIGHT= 800;
|
public static final int TOOLBOX_HEIGHT= 800;
|
||||||
|
|
||||||
/**
|
|
||||||
* constructor
|
|
||||||
*/
|
|
||||||
public ToolboxPanel(AppControllerExplorer appController) {
|
public ToolboxPanel(AppControllerExplorer appController) {
|
||||||
this.appController = appController;
|
this.appController = appController;
|
||||||
AsyncTreePanel tp = appController.getTree(TOOLBOX_WIDTH, TOOLBOX_HEIGHT);
|
AsyncTreePanel tp = appController.getTree(TOOLBOX_WIDTH, TOOLBOX_HEIGHT);
|
||||||
|
|
|
@ -18,6 +18,7 @@ import com.google.gwt.user.client.Window;
|
||||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||||
import com.google.gwt.user.client.ui.Composite;
|
import com.google.gwt.user.client.ui.Composite;
|
||||||
import com.google.gwt.user.client.ui.HTML;
|
import com.google.gwt.user.client.ui.HTML;
|
||||||
|
import com.google.gwt.user.client.ui.HTMLPanel;
|
||||||
import com.google.gwt.user.client.ui.Widget;
|
import com.google.gwt.user.client.ui.Widget;
|
||||||
|
|
||||||
public class ExportOptions extends Composite {
|
public class ExportOptions extends Composite {
|
||||||
|
@ -33,6 +34,7 @@ public class ExportOptions extends Composite {
|
||||||
@UiField HTML saveOpen;
|
@UiField HTML saveOpen;
|
||||||
@UiField HTML save;
|
@UiField HTML save;
|
||||||
@UiField HTML saveAs;
|
@UiField HTML saveAs;
|
||||||
|
@UiField HTMLPanel myPanel;
|
||||||
|
|
||||||
private String tempFileId;
|
private String tempFileId;
|
||||||
private String filePath;
|
private String filePath;
|
||||||
|
@ -132,6 +134,10 @@ public class ExportOptions extends Composite {
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public HTMLPanel getMainPanel() {
|
||||||
|
return myPanel;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
|
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
|
||||||
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
|
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
|
||||||
xmlns:g="urn:import:com.google.gwt.user.client.ui">
|
xmlns:g="urn:import:com.google.gwt.user.client.ui">
|
||||||
<g:HTMLPanel styleName="exportPanel">
|
<g:HTMLPanel styleName="exportPanel" ui:field="myPanel">
|
||||||
<table style="width: 700px; text-align: center;">
|
<table style="width: 700px; text-align: center;">
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="3">
|
<td colspan="3">
|
||||||
|
|
|
@ -4,11 +4,35 @@
|
||||||
margin: 10px 5px 5px 20px;
|
margin: 10px 5px 5px 20px;
|
||||||
border: 1px solid #e3e8f3;
|
border: 1px solid #e3e8f3;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
background-color: #FFFFBF;
|
background-color: #FFF;
|
||||||
-webkit-border-radius: 5px;
|
-webkit-border-radius: 5px;
|
||||||
-moz-border-radius: 5px;
|
-moz-border-radius: 5px;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
width: 775px;
|
width: 775px;
|
||||||
|
height: 20px;
|
||||||
|
opacity: 0;
|
||||||
|
|
||||||
|
transition-property: opacity, height;
|
||||||
|
transition-duration: .55s;
|
||||||
|
transition-timing-function: ease-out;
|
||||||
|
|
||||||
|
-moz-transition-property: opacity, height;
|
||||||
|
-moz-transition-duration: .55s;
|
||||||
|
-moz-transition-timing-function: ease-out;
|
||||||
|
|
||||||
|
-webkit-transition-property: opacity, height;
|
||||||
|
-webkit-transition-duration: .55s;
|
||||||
|
-webkit-transition-timing-function: ease-out;
|
||||||
|
|
||||||
|
-ms-transition-property: opacity, height;
|
||||||
|
-ms-transition-duration: .55s;
|
||||||
|
-ms-transition-timing-function: ease-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
.exportPanel-show {
|
||||||
|
opacity: 1;
|
||||||
|
background-color: #FFFFBF;
|
||||||
|
height: 220px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.exportResult {
|
.exportResult {
|
||||||
|
@ -55,7 +79,6 @@
|
||||||
background: url('images/save_open.png') 55% 25px no-repeat;
|
background: url('images/save_open.png') 55% 25px no-repeat;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.closeImage {
|
.closeImage {
|
||||||
background: url(images/close.png) 0px 0px no-repeat;
|
background: url(images/close.png) 0px 0px no-repeat;
|
||||||
height: 15px;
|
height: 15px;
|
||||||
|
@ -200,7 +223,6 @@
|
||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.selectedCell {
|
.selectedCell {
|
||||||
background-color: #e3e8f3 !important;
|
background-color: #e3e8f3 !important;
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue