From b58ee1a4b0f1c0ee16b49b70c03deeb792fba7bf Mon Sep 17 00:00:00 2001 From: Massimiliano Assante Date: Fri, 31 May 2013 16:14:48 +0000 Subject: [PATCH] fix for ticket #1801 git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/reports@76625 82a268e6-3cf1-43bd-a215-b396298e98cf --- .classpath | 4 +-- .settings/com.google.gdt.eclipse.core.prefs | 4 +-- pom.xml | 25 ++++---------- .../client/Presenter/Presenter.java | 3 +- .../user/reportgenerator/client/TitleBar.java | 33 +++++++++++++++++-- .../client/dialog/WaitingOperationDialog.java | 2 +- .../client/uibinder/OpenOptions.ui.xml | 2 +- 7 files changed, 44 insertions(+), 29 deletions(-) diff --git a/.classpath b/.classpath index 4c881c3..b054457 100644 --- a/.classpath +++ b/.classpath @@ -1,6 +1,6 @@ - + @@ -30,5 +30,5 @@ - + diff --git a/.settings/com.google.gdt.eclipse.core.prefs b/.settings/com.google.gdt.eclipse.core.prefs index e29041e..860f1db 100644 --- a/.settings/com.google.gdt.eclipse.core.prefs +++ b/.settings/com.google.gdt.eclipse.core.prefs @@ -1,8 +1,8 @@ -#Thu May 02 16:46:18 CEST 2013 +#Fri May 31 18:12:53 CEST 2013 =\=\=\=\=\=\= <<<<<<<=.mine >>>>>>>=.r71295 eclipse.preferences.version=1 -lastWarOutDir=/Users/massi/Documents/workspace/reports/target/reports-4.2.0-SNAPSHOT +lastWarOutDir=/Users/massi/Documents/workspace/reports/target/reports-4.3.0-SNAPSHOT warSrcDir=src/main/webapp warSrcDirIsOutput=false diff --git a/pom.xml b/pom.xml index 7f29d89..298e858 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.gcube.portlets.user reports war - 4.2.0-SNAPSHOT + 4.3.0-SNAPSHOT gCube Reports Portlet gCube Reports Portlet. @@ -79,7 +79,7 @@ org.gcube.applicationsupportlayer aslcore - [3.2.1-SNAPSHOT, 3.2.2-SNAPSHOT) + [3.2.1-SNAPSHOT, 3.2.2-SNAPSHOT) provided @@ -157,14 +157,14 @@ org.gcube.portlets.user home-library [4.3.0-SNAPSHOT,5.0.0-SNAPSHOT) - ${setScope} + provided org.gcube.portlets.user home-library-jcr [1.3.0-SNAPSHOT,2.0.0-SNAPSHOT) - - ${setScope} + + provided org.gcube.applicationsupportlayer @@ -225,20 +225,7 @@ junit 4.7 test - - - javax.validation - validation-api - 1.0.0.GA - test - - - javax.validation - validation-api - 1.0.0.GA - sources - test - + diff --git a/src/main/java/org/gcube/portlets/user/reportgenerator/client/Presenter/Presenter.java b/src/main/java/org/gcube/portlets/user/reportgenerator/client/Presenter/Presenter.java index 6559c21..606708c 100644 --- a/src/main/java/org/gcube/portlets/user/reportgenerator/client/Presenter/Presenter.java +++ b/src/main/java/org/gcube/portlets/user/reportgenerator/client/Presenter/Presenter.java @@ -244,6 +244,7 @@ public class Presenter { dlg.hide(); loadModel(wfReport); header.setMenuForWorkflowDocument(sessionInfo.isEditable()); + titleBar.addWorkflowButtons(true); pollServiceForLockRenewal(); } }); @@ -253,7 +254,7 @@ public class Presenter { public void onFailure(Throwable caught) { dlg.hide(); } - public void onSuccess(Model result) { + public void onSuccess(Model result) { dlg.hide(); if (result != null) { loadModel(result); diff --git a/src/main/java/org/gcube/portlets/user/reportgenerator/client/TitleBar.java b/src/main/java/org/gcube/portlets/user/reportgenerator/client/TitleBar.java index c6617e3..c5156a8 100644 --- a/src/main/java/org/gcube/portlets/user/reportgenerator/client/TitleBar.java +++ b/src/main/java/org/gcube/portlets/user/reportgenerator/client/TitleBar.java @@ -10,6 +10,7 @@ import com.google.gwt.event.dom.client.ClickHandler; import com.google.gwt.i18n.client.DateTimeFormat; import com.google.gwt.user.client.Command; 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.Composite; import com.google.gwt.user.client.ui.HTML; @@ -59,6 +60,7 @@ import com.google.gwt.user.client.ui.HorizontalPanel; private HTML nextButton = new HTML("    ", true); + private HorizontalPanel captionPanel = new HorizontalPanel(); /** * Constructor * @param c the controller instance for this UI component @@ -81,7 +83,6 @@ import com.google.gwt.user.client.ui.HorizontalPanel; //design the part for the template name and the pages handling - HorizontalPanel captionPanel = new HorizontalPanel(); HorizontalPanel innerCaptionPanel = new HorizontalPanel(); captionPanel.setWidth("100%"); @@ -102,14 +103,16 @@ import com.google.gwt.user.client.ui.HorizontalPanel; captionPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); innerCaptionPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); - innerCaptionPanel.setVerticalAlignment(HasAlignment.ALIGN_BOTTOM); + innerCaptionPanel.setVerticalAlignment(HasAlignment.ALIGN_MIDDLE); innerCaptionPanel.add(templateNameBox); innerCaptionPanel.add(editedOn); + captionPanel.setVerticalAlignment(HasAlignment.ALIGN_MIDDLE); captionPanel.add(innerCaptionPanel); mainLayout.add(captionPanel); mainLayout.add(pageHandlerPanel); editedOn.setStyleName("docEditedBy"); mainLayout.setCellHorizontalAlignment(captionPanel, HasHorizontalAlignment.ALIGN_LEFT); + mainLayout.setCellVerticalAlignment(captionPanel, HasVerticalAlignment.ALIGN_MIDDLE); mainLayout.setCellWidth(pageHandlerPanel, "200"); initWidget(mainLayout); @@ -123,7 +126,31 @@ import com.google.gwt.user.client.ui.HorizontalPanel; public void onClick(ClickEvent event) { presenter.prevPageButtonClicked(); } }); } - + /** + * add the buttons well visible on the top + * @param isEdit + */ + public void addWorkflowButtons(final boolean isEdit) { + Button update = new Button("Update (SAVE)"); + update.addClickHandler(new ClickHandler() { + @Override + public void onClick(ClickEvent event) { + presenter.updateWorkflowDocument(isEdit); + } + }); + Button back = new Button("Do not Update"); + back.addClickHandler(new ClickHandler() { + @Override + public void onClick(ClickEvent event) { + presenter.updateWorkflowDocument(isEdit); + } + }); + update.addStyleName("addEntryButton"); + back.addStyleName("deleteEntryButton"); + captionPanel.add(update); + captionPanel.add(back); + + } /** * changes the pages label in the UI : e.g. Page x of y * @param currentPage . diff --git a/src/main/java/org/gcube/portlets/user/reportgenerator/client/dialog/WaitingOperationDialog.java b/src/main/java/org/gcube/portlets/user/reportgenerator/client/dialog/WaitingOperationDialog.java index 50053fc..1e4b23a 100644 --- a/src/main/java/org/gcube/portlets/user/reportgenerator/client/dialog/WaitingOperationDialog.java +++ b/src/main/java/org/gcube/portlets/user/reportgenerator/client/dialog/WaitingOperationDialog.java @@ -6,7 +6,7 @@ import org.gcube.portlets.user.reportgenerator.client.uibinder.ShowSaving; public class WaitingOperationDialog extends GCubeDialog { public WaitingOperationDialog() { - super(false, true); + super(true, false); setText("Please wait ..."); setStyleName("loading_DialogBox"); setWidth("200px"); diff --git a/src/main/java/org/gcube/portlets/user/reportgenerator/client/uibinder/OpenOptions.ui.xml b/src/main/java/org/gcube/portlets/user/reportgenerator/client/uibinder/OpenOptions.ui.xml index b066d9a..5b3c536 100644 --- a/src/main/java/org/gcube/portlets/user/reportgenerator/client/uibinder/OpenOptions.ui.xml +++ b/src/main/java/org/gcube/portlets/user/reportgenerator/client/uibinder/OpenOptions.ui.xml @@ -5,7 +5,7 @@
- Load Template + New From Template Open/Edit Report