diff --git a/.classpath b/.classpath
index b054457..0300e96 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 860f1db..33612c4 100644
--- a/.settings/com.google.gdt.eclipse.core.prefs
+++ b/.settings/com.google.gdt.eclipse.core.prefs
@@ -1,8 +1,8 @@
-#Fri May 31 18:12:53 CEST 2013
+#Tue Jul 16 14:28:26 CEST 2013
=\=\=\=\=\=\=
<<<<<<<=.mine
>>>>>>>=.r71295
eclipse.preferences.version=1
-lastWarOutDir=/Users/massi/Documents/workspace/reports/target/reports-4.3.0-SNAPSHOT
+lastWarOutDir=/Users/massi/Documents/workspace/reports/target/reports-4.4.0-SNAPSHOT
warSrcDir=src/main/webapp
warSrcDirIsOutput=false
diff --git a/HowTOBuildOffiline b/HowTOBuildOffiline
new file mode 100644
index 0000000..9e20b21
--- /dev/null
+++ b/HowTOBuildOffiline
@@ -0,0 +1 @@
+To Be Completed
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 298e858..7f7904b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -12,7 +12,7 @@
org.gcube.portlets.user
reports
war
- 4.3.0-SNAPSHOT
+ 4.4.0-SNAPSHOT
gCube Reports Portlet
gCube Reports Portlet.
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 606708c..44f59de 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
@@ -944,8 +944,8 @@ public class Presenter {
}
else {
BasicTextArea textArea = (BasicTextArea) component.getContent();
- textArea.getMyInstance().setTop(uiY);
- textArea.getMyInstance().setLeft(uiX);
+// textArea.getMyInstance().setTop(uiY);
+// textArea.getMyInstance().setLeft(uiX);
wp.addComponentToLayout(textArea, component.isDoubleColLayout());
}
diff --git a/src/main/java/org/gcube/portlets/user/reportgenerator/client/model/TemplateComponent.java b/src/main/java/org/gcube/portlets/user/reportgenerator/client/model/TemplateComponent.java
index 946799e..e8d3b00 100644
--- a/src/main/java/org/gcube/portlets/user/reportgenerator/client/model/TemplateComponent.java
+++ b/src/main/java/org/gcube/portlets/user/reportgenerator/client/model/TemplateComponent.java
@@ -294,13 +294,21 @@ public class TemplateComponent {
case COMMENT:
HTML comment = new HTML();
comment.setStyleName("commentArea");
- comment.setHTML((String) sc.getPossibleContent());
+ String contentC = (String) sc.getPossibleContent();
+ // replace all the line braks by
, and all the double spaces by the html version
+ String htmlPreservedLineBreaks2 = contentC.replaceAll("(\r\n|\n)","
");
+ htmlPreservedLineBreaks2 = htmlPreservedLineBreaks2.replaceAll("\\s\\s"," ");
+ comment.setHTML(htmlPreservedLineBreaks2);
this.content = comment;
break;
case INSTRUCTION:
+ String content = (String) sc.getPossibleContent();
+ // replace all the line braks by
, and all the double spaces by the html version
+ String htmlPreservedLineBreaks = content.replaceAll("(\r\n|\n)","
");
+ htmlPreservedLineBreaks = htmlPreservedLineBreaks.replaceAll("\\s\\s"," ");
HTML instr = new HTML();
instr.setStyleName("instructionArea");
- instr.setHTML((String) sc.getPossibleContent());
+ instr.setHTML(htmlPreservedLineBreaks);
this.content = instr;
break;
case TIME_SERIES:
diff --git a/src/main/java/org/gcube/portlets/user/reportgenerator/client/targets/BasicTextArea.java b/src/main/java/org/gcube/portlets/user/reportgenerator/client/targets/BasicTextArea.java
index fe01a84..66ef1fd 100644
--- a/src/main/java/org/gcube/portlets/user/reportgenerator/client/targets/BasicTextArea.java
+++ b/src/main/java/org/gcube/portlets/user/reportgenerator/client/targets/BasicTextArea.java
@@ -1,9 +1,11 @@
package org.gcube.portlets.user.reportgenerator.client.targets;
+import java.util.Date;
+
import org.gcube.portlets.d4sreporting.common.shared.ComponentType;
-import org.gcube.portlets.user.reportgenerator.client.ReportGenerator;
import org.gcube.portlets.user.reportgenerator.client.Presenter.Presenter;
+import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.event.dom.client.KeyUpEvent;
import com.google.gwt.event.dom.client.KeyUpHandler;
@@ -11,119 +13,104 @@ import com.google.gwt.event.dom.client.MouseDownEvent;
import com.google.gwt.event.dom.client.MouseDownHandler;
import com.google.gwt.event.dom.client.MouseOutEvent;
import com.google.gwt.event.dom.client.MouseOutHandler;
-import com.google.gwt.user.client.ui.HTML;
-import com.google.gwt.user.client.ui.HasVerticalAlignment;
import com.google.gwt.user.client.ui.RichTextArea;
-import com.google.gwt.user.client.ui.VerticalPanel;
+import com.google.gwt.user.client.ui.TextArea;
import com.google.gwt.user.client.ui.Widget;
/**
- * BasicTextArea
+ * BasicTextArea
is a resizable textArea
*
* @author Massimiliano Assante, ISTI-CNR - massimiliano.assante@isti.cnr.it
- * @version July 2011 (3.0)
+ * @version July 2013
*/
-public class BasicTextArea extends ReportTextArea {
- private RichTextArea textArea = new RichTextArea();
- //private TextArea textArea = new TextArea();
-
- private VerticalPanel myPanel;
-
- int currHeight = 0;
-
-
-
+public class BasicTextArea extends TextArea {
+ private String myId;
public BasicTextArea(ComponentType type, final Presenter presenter, int left, int top, final int width, final int height, boolean hasComments, boolean showClose) {
- super(type, presenter, left, top, width, height, hasComments, showClose);
- currHeight = height;
- myPanel = getResizablePanel();
- textArea.setPixelSize(width, height);
- textArea.getElement().getStyle().setMarginTop(-4, Unit.PX); //this is needed because the richtextarea has margin 8px and a not able to modify it via css
+ myId = Long.toString(new Date().getTime());
+ this.setPixelSize(width, height);
- textArea.addMouseOutHandler(new MouseOutHandler() {
+ this.addMouseOutHandler(new MouseOutHandler() {
public void onMouseOut(MouseOutEvent event) {
presenter.storeChangeInSession((Widget) event.getSource());
}
});
- textArea.setStyleName("report-ui-component");
-
+ this.setStyleName("report-ui-component");
+ this.addStyleName("d4sFrame");
+ this.getElement().setId(myId);
+
switch (type) {
case BODY_NOT_FORMATTED:
- textArea.addStyleName("simpleText");
- myPanel.setTitle("Simple text");
+ this.addStyleName("simpleText");
break;
default:
break;
}
- myPanel.add(textArea);
- myPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_BOTTOM);
- myPanel.setPixelSize(width, height);
-
- textArea.addMouseOutHandler(new MouseOutHandler() {
+ this.addMouseOutHandler(new MouseOutHandler() {
public void onMouseOut(MouseOutEvent event) {
presenter.storeChangeInSession((Widget) event.getSource());
-
}
});
- textArea.addKeyUpHandler(new KeyUpHandler() {
+ this.addKeyUpHandler(new KeyUpHandler() {
public void onKeyUp(KeyUpEvent event) {
- HTML div = ReportGenerator.get().getDivHidden();
- div.setHTML(textArea.getHTML());
- int newHeight = div.getOffsetHeight();
-
- resizePanel(width, newHeight);
- presenter.resizeTemplateComponentInModel(myInstance, width, newHeight);
- currHeight = newHeight;
-
+ //presenter.resizeTemplateComponentInModel(myInstance, width, newHeight);
}
});
- textArea.addMouseDownHandler(new MouseDownHandler() {
+ this.addMouseDownHandler(new MouseDownHandler() {
public void onMouseDown(MouseDownEvent event) {
- HTML div = ReportGenerator.get().getDivHidden();
- div.setHTML(textArea.getHTML());
- int newHeight = div.getOffsetHeight();
-
- resizePanel(width, newHeight);
- presenter.resizeTemplateComponentInModel(myInstance, width, newHeight);
- currHeight = newHeight;
-
+ autoSizeIt(myId, height);
}
});
}
- public String getText() {
- return textArea.getText();
- }
- public void setText(String text) {
- textArea.setText(text);
-
- }
public RichTextArea getRichTextArea() {
return null;
}
/**
- * used to resize the panel
- * @param width w
- * @param height h
+ * This method actually makes resizable the textArea
+ * @param id
*/
- @Override
- public void resizePanel(int width, int height) {
- if (height > 25) {
- mainPanel.setPixelSize(width, height);
- resizablePanel.setPixelSize(width, height);
- textArea.setPixelSize(width-4, height);
- currHeight = height;
+ public static native void autoSizeIt(String id, int height) /*-{
+ var text = $doc.getElementById(id);
+ var observe;
+ if (window.attachEvent) {
+ observe = function (element, event, handler) {
+ element.attachEvent('on'+event, handler);
+ };
}
- }
+ else {
+ observe = function (element, event, handler) {
+ element.addEventListener(event, handler, false);
+ };
+ }
+
+ function resize () {
+ text.style.height = height+'px';
+ text.style.height = text.scrollHeight+'px';
+ }
+
+ function delayedResize () {
+ window.setTimeout(resize, 0);
+ }
+
+ observe(text, 'change', resize);
+ observe(text, 'cut', delayedResize);
+ observe(text, 'paste', delayedResize);
+ observe(text, 'drop', delayedResize);
+ observe(text, 'keydown', delayedResize);
+
+ text.focus();
+ text.select();
+ resize();
+ }-*/;
}
diff --git a/src/main/webapp/ReportGenerator.css b/src/main/webapp/ReportGenerator.css
index 160421b..ded59db 100644
--- a/src/main/webapp/ReportGenerator.css
+++ b/src/main/webapp/ReportGenerator.css
@@ -1,8 +1,5 @@
@import url('reports/old-dialog.css');
-
-
-
.openOptionsPanel {
margin: 25px 5px 0px -45px;
border: 1px solid #e3e8f3;
@@ -38,7 +35,6 @@
background: url('images/uploadReport.png') 55% 25px no-repeat;
}
-
.exportPanel {
margin: 5px 5px 5px 20px;
border: 1px solid #e3e8f3;
@@ -49,19 +45,15 @@
border-radius: 5px;
height: 0px;
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;
@@ -457,7 +449,7 @@ tableBorder td {
}
.d4sFrame {
- border: 1px solid #CCC;
+ border: 1px solid #CCC !important;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
@@ -510,9 +502,8 @@ tableBorder td {
}
.heading2-label {
- font-size: 13pt;
- padding-left: 0px;
- font-weight: bold;
+ font-size: 15pt;
+ padding-left: 0px
}
.heading3 {
@@ -521,9 +512,8 @@ tableBorder td {
}
.heading3-label {
- font-size: 10pt;
+ font-size: 13pt;
padding-left: 2px;
- font-weight: bold;
}
.heading4 {
@@ -532,8 +522,8 @@ tableBorder td {
}
.heading4-label {
- font-size: 9pt;
- padding-left: 15px;
+ font-size: 12pt;
+ padding-left: 10px;
}
.heading5 {
@@ -543,12 +533,12 @@ tableBorder td {
.heading5-label {
font-size: 8pt;
- padding-left: 4px;
+ padding-left: 25px;
}
.simpleText {
padding-left: 4px;
- font-size: 12px;
+ font-size: 13px;
color: black;
}
@@ -820,5 +810,4 @@ gwt-MenuBar {
.cw-RichText {
border: 1px solid #BBBBBB;
border-spacing: 0px;
-}
-
+}
\ No newline at end of file
diff --git a/src/main/webapp/ReportGenerator.html b/src/main/webapp/ReportGenerator.html
index 180d5eb..904e51b 100644
--- a/src/main/webapp/ReportGenerator.html
+++ b/src/main/webapp/ReportGenerator.html
@@ -20,6 +20,9 @@
+
+