reads repeatable sequences
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/reports@69676 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
3cd598aeac
commit
f35ba10645
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" output="target/reports-4.0.0-SNAPSHOT/WEB-INF/classes" path="src/main/java">
|
||||
<classpathentry kind="src" output="target/reports-4.0.1-SNAPSHOT/WEB-INF/classes" path="src/main/java">
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
|
@ -30,5 +30,5 @@
|
|||
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="output" path="target/reports-4.0.0-SNAPSHOT/WEB-INF/classes"/>
|
||||
<classpathentry kind="output" path="target/reports-4.0.1-SNAPSHOT/WEB-INF/classes"/>
|
||||
</classpath>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#Wed Feb 06 12:30:01 CET 2013
|
||||
#Tue Feb 26 17:29:33 CET 2013
|
||||
eclipse.preferences.version=1
|
||||
jarsExcludedFromWebInfLib=
|
||||
lastWarOutDir=/Users/massi/Documents/workspace/reports/target/reports-4.0.0-SNAPSHOT
|
||||
lastWarOutDir=/Users/massi/Documents/workspace/reports/target/reports-4.0.1-SNAPSHOT
|
||||
warSrcDir=src/main/webapp
|
||||
warSrcDirIsOutput=false
|
||||
|
|
10
pom.xml
10
pom.xml
|
@ -1,6 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
|
@ -13,7 +12,7 @@
|
|||
<groupId>org.gcube.portlets.user</groupId>
|
||||
<artifactId>reports</artifactId>
|
||||
<packaging>war</packaging>
|
||||
<version>4.0.0-SNAPSHOT</version>
|
||||
<version>4.0.1-SNAPSHOT</version>
|
||||
<name>gCube Reports Portlet</name>
|
||||
<description>
|
||||
gCube Reports Portlet.
|
||||
|
@ -149,6 +148,11 @@
|
|||
<version>[6.0.0-SNAPSHOT, 7.0.0-SNAPSHOT)</version>
|
||||
<scope>${setScope}</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.gcube.portlets.user</groupId>
|
||||
<artifactId>opengcubeapplication</artifactId>
|
||||
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.gcube.portlets.user</groupId>
|
||||
<artifactId>home-library</artifactId>
|
||||
|
|
|
@ -39,8 +39,6 @@ import com.google.gwt.user.client.ui.RichTextArea;
|
|||
* <code> Headerbar </code> class is the top bar component of the UI
|
||||
*
|
||||
* @author Massimiliano Assante, ISTI-CNR - massimiliano.assante@isti.cnr.it
|
||||
*
|
||||
* @version July 2011 (3.0)
|
||||
*/
|
||||
public class Headerbar extends Composite{
|
||||
|
||||
|
|
|
@ -1000,7 +1000,7 @@ public class Presenter {
|
|||
GWT.log("Reading TABLE rows: " + gt.getRowsNo() + " cols: " + gt.getCols());
|
||||
wp.addComponentToLayout(gt, component.isDoubleColLayout());
|
||||
break;
|
||||
case ATTRIBUTE:
|
||||
case ATTRIBUTE_MULTI:
|
||||
AttributeArea at = (AttributeArea) component.getContent();
|
||||
wp.addComponentToLayout(at, component.isDoubleColLayout());
|
||||
setCurrCursorPos(uiY);
|
||||
|
|
|
@ -15,7 +15,6 @@ import com.google.gwt.user.client.ui.Widget;
|
|||
* <code> WorkspacePanel </code> class is the UI Component for displaying the template
|
||||
*
|
||||
* @author Massimiliano Assante, ISTI-CNR - massimiliano.assante@isti.cnr.it
|
||||
* @version October 2008 (0.2)
|
||||
*/
|
||||
|
||||
public class WorkspacePanel extends Composite {
|
||||
|
@ -65,7 +64,7 @@ public class WorkspacePanel extends Composite {
|
|||
presenter = c;
|
||||
|
||||
templateModel = presenter.getModel();
|
||||
mainLayout.setSize(""+(templateModel.getPageWidth()), ""+templateModel.getPageHeight());
|
||||
mainLayout.setWidth(""+(templateModel.getPageWidth()));
|
||||
|
||||
mainLayout.setStyleName("wpFlow");
|
||||
|
||||
|
@ -123,7 +122,7 @@ public class WorkspacePanel extends Composite {
|
|||
* @param height .
|
||||
*/
|
||||
public void resizeWorkspace(int width, int height) {
|
||||
mainLayout.setPixelSize(width, height);
|
||||
mainLayout.setWidth(""+width);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -41,7 +41,7 @@ public class CommentDialog extends DialogBox {
|
|||
setSize(PANEL_WIDTH+"px", "100px");
|
||||
header.setPixelSize(PANEL_WIDTH, 15);
|
||||
final Image enterImage = new Image(ImageConstants.IMAGE_ARROW_ENTER);
|
||||
final Image closeImage = new Image(images.close());
|
||||
final Image closeImage = new Image(ImageConstants.IMAGE_CLOSE);
|
||||
final Image binImage = new Image(ImageConstants.IMAGE_BIN);
|
||||
closeImage.setStyleName("selectable");
|
||||
binImage.setStyleName("selectable");
|
||||
|
|
|
@ -127,7 +127,7 @@ public class FimesReportTreePanel extends ScrollPanel{
|
|||
node = createNodeWidget(image, "Table","gwt-label-componentTree");
|
||||
break;
|
||||
}
|
||||
case ATTRIBUTE: {
|
||||
case ATTRIBUTE_MULTI: {
|
||||
// TODO
|
||||
ImageResource image = FimesReportTreeStructureResources.INSTANCE.comments();
|
||||
node = createNodeWidget(image, "Attribute","gwt-label-componentTree");
|
||||
|
|
|
@ -258,7 +258,7 @@ public class TemplateComponent {
|
|||
GenericTable table = new GenericTable(st, presenter, sc.getX(), sc.getY(), TemplateModel.TEMPLATE_WIDTH - 50, 200);
|
||||
this.content = table;
|
||||
break;
|
||||
case ATTRIBUTE:
|
||||
case ATTRIBUTE_MULTI:
|
||||
AttributeArea ta = null;
|
||||
if (sc.getPossibleContent() instanceof SerializableAttributeArea) {
|
||||
SerializableAttributeArea sata = (SerializableAttributeArea) sc.getPossibleContent();
|
||||
|
@ -395,7 +395,7 @@ public class TemplateComponent {
|
|||
SerializableTable st = gt.getSerializable();
|
||||
content = st;
|
||||
break;
|
||||
case ATTRIBUTE:
|
||||
case ATTRIBUTE_MULTI:
|
||||
AttributeArea att = (AttributeArea) this.content;
|
||||
ArrayList<SerializableAttribute> values = new ArrayList<SerializableAttribute>();
|
||||
for (CheckBox box : att.getBoxes()) {
|
||||
|
|
|
@ -45,10 +45,7 @@ public class TemplateModel {
|
|||
*
|
||||
*/
|
||||
public static final int TEMPLATE_WIDTH = 750;
|
||||
/**
|
||||
* TEMPLATE_HEIGHT
|
||||
*/
|
||||
public static final int TEMPLATE_HEIGHT= 1000;
|
||||
|
||||
/**
|
||||
* DEFAULT_NAME
|
||||
*/
|
||||
|
@ -142,7 +139,7 @@ public class TemplateModel {
|
|||
super();
|
||||
this.templateName = DEFAULT_NAME;
|
||||
this.pageWidth = TEMPLATE_WIDTH;
|
||||
this.pageHeight = TEMPLATE_HEIGHT;
|
||||
this.pageHeight = -1;
|
||||
this.currentPage = 1;
|
||||
this.totalPages = 1;
|
||||
this.marginLeft = 25;
|
||||
|
|
|
@ -121,7 +121,7 @@ public class AttributeArea extends Composite {
|
|||
* @return
|
||||
*/
|
||||
public ComponentType getType() {
|
||||
return ComponentType.ATTRIBUTE;
|
||||
return ComponentType.ATTRIBUTE_MULTI;
|
||||
}
|
||||
/**
|
||||
*
|
||||
|
|
|
@ -2,46 +2,72 @@ package org.gcube.portlets.user.reportgenerator.client.targets;
|
|||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.gcube.portlets.d4sreporting.common.client.uicomponents.ReportUIComponent;
|
||||
import org.gcube.portlets.d4sreporting.common.shared.ComponentType;
|
||||
import org.gcube.portlets.d4sreporting.common.shared.SerializableComponent;
|
||||
import org.gcube.portlets.d4sreporting.common.shared.SerializableRepeatableSequence;
|
||||
import org.gcube.portlets.user.reportgenerator.client.Presenter.Presenter;
|
||||
import org.gcube.portlets.user.reportgenerator.client.model.TemplateComponent;
|
||||
import org.gcube.portlets.user.reportgenerator.client.model.TemplateModel;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.dom.client.Style.Unit;
|
||||
import com.google.gwt.event.dom.client.ClickEvent;
|
||||
import com.google.gwt.event.dom.client.ClickHandler;
|
||||
import com.google.gwt.user.client.Window;
|
||||
import com.google.gwt.user.client.ui.Button;
|
||||
import com.google.gwt.user.client.ui.Composite;
|
||||
import com.google.gwt.user.client.ui.HasAlignment;
|
||||
import com.google.gwt.user.client.ui.HorizontalPanel;
|
||||
import com.google.gwt.user.client.ui.VerticalPanel;
|
||||
|
||||
public class RepeatableSequence extends ReportUIComponent {
|
||||
public class RepeatableSequence extends Composite {
|
||||
private ArrayList<TemplateComponent> groupedComponents = new ArrayList<TemplateComponent>();
|
||||
|
||||
VerticalPanel myPanel;
|
||||
Presenter p;
|
||||
|
||||
private VerticalPanel myPanel;
|
||||
private HorizontalPanel buttonPanel = new HorizontalPanel();
|
||||
private Presenter p;
|
||||
private Button addAnotherB = new Button("Add another entry");
|
||||
|
||||
/**
|
||||
* constructor used by the system when reading the model
|
||||
* @param sRS
|
||||
*/
|
||||
public RepeatableSequence(Presenter p, SerializableRepeatableSequence sRS) {
|
||||
super(ComponentType.REPEAT_SEQUENCE, 0, 0, TemplateModel.TEMPLATE_WIDTH - 50, sRS.getHeight());
|
||||
this.p = p;
|
||||
myPanel = getResizablePanel();
|
||||
|
||||
addAnotherB.getElement().getStyle().setMargin(10, Unit.PX);
|
||||
addAnotherB.getElement().getStyle().setHeight(30, Unit.PX);
|
||||
addAnotherB.getElement().getStyle().setWidth(200, Unit.PX);
|
||||
myPanel = new VerticalPanel();
|
||||
myPanel.setHorizontalAlignment(HasAlignment.ALIGN_LEFT);
|
||||
int size = sRS.getGroupedComponents().size();
|
||||
for (int j = 0; j < size; j++) {
|
||||
SerializableComponent sComp = sRS.getGroupedComponents().get(j);
|
||||
if (j == size-1) {
|
||||
myPanel.add(buttonPanel); //add the button before the last element
|
||||
buttonPanel.setWidth("100%");
|
||||
buttonPanel.setHorizontalAlignment(HasAlignment.ALIGN_RIGHT);
|
||||
buttonPanel.add(addAnotherB);
|
||||
}
|
||||
add(new TemplateComponent(p.getModel(), sComp, p));
|
||||
}
|
||||
initWidget(myPanel);
|
||||
|
||||
addAnotherB.addClickHandler(new ClickHandler() {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
Window.alert("TODO: Missing Implementation");
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void add(TemplateComponent toAdd) {
|
||||
if (toAdd.getType() != ComponentType.REPEAT_SEQUENCE_INNER) {
|
||||
groupedComponents.add(toAdd);
|
||||
GWT.log("toAdd.getContent()= NULL? " + (toAdd.getContent() == null));
|
||||
GWT.log("ToAdd= getType " + toAdd.getType());
|
||||
myPanel.add(toAdd.getContent());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public ArrayList<TemplateComponent> getGroupedComponents() {
|
||||
|
@ -51,20 +77,4 @@ public class RepeatableSequence extends ReportUIComponent {
|
|||
public void setGroupedComponents(ArrayList<TemplateComponent> groupedComponents) {
|
||||
this.groupedComponents = groupedComponents;
|
||||
}
|
||||
|
||||
public int getHeight() {
|
||||
return super.mainPanel.getOffsetHeight();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeTemplateComponent(ReportUIComponent toRemove) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void lockComponent(ReportUIComponent toLock, boolean locked) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
@import url('reports/old-dialog.css');
|
||||
|
||||
.grouping-inner {
|
||||
background: url('images/grouping-border.png') repeat-x;
|
||||
display: block;
|
||||
|
@ -66,11 +68,12 @@ tableBorder td {
|
|||
.wpFlow {
|
||||
margin: 10px 5px 5px 20px;
|
||||
border: 1px solid #e3e8f3;
|
||||
padding-left: 44px;
|
||||
padding: 0px 0px 25px 44px;
|
||||
background-color: #e3e8f3;
|
||||
-webkit-border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
border-radius: 5px;
|
||||
width: 750px;
|
||||
}
|
||||
|
||||
.highlight_background {
|
||||
|
|
Reference in New Issue