restyle of Refs complete and tested ok

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/reports@86661 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Massimiliano Assante 2013-12-06 11:35:06 +00:00
parent f0830ba3be
commit c59e783d75
5 changed files with 30 additions and 19 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/reports-4.6.10-SNAPSHOT/WEB-INF/classes" path="src/main/java">
<classpathentry kind="src" output="target/reports-4.6.12-SNAPSHOT/WEB-INF/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
@ -31,5 +31,5 @@
</attributes>
</classpathentry>
<classpathentry kind="con" path="com.google.gwt.eclipse.core.GWT_CONTAINER"/>
<classpathentry kind="output" path="target/reports-4.6.10-SNAPSHOT/WEB-INF/classes"/>
<classpathentry kind="output" path="target/reports-4.6.12-SNAPSHOT/WEB-INF/classes"/>
</classpath>

View File

@ -2,6 +2,6 @@
<<<<<<<=.mine
>>>>>>>=.r71295
eclipse.preferences.version=1
lastWarOutDir=/Users/massi/Documents/workspace/reports/target/reports-4.6.10-SNAPSHOT
lastWarOutDir=/Users/massi/Documents/workspace/reports/target/reports-4.6.12-SNAPSHOT
warSrcDir=src/main/webapp
warSrcDirIsOutput=false

View File

@ -12,7 +12,7 @@
<groupId>org.gcube.portlets.user</groupId>
<artifactId>reports</artifactId>
<packaging>war</packaging>
<version>4.6.11-SNAPSHOT</version>
<version>4.6.12-SNAPSHOT</version>
<name>gCube Reports Manager</name>
<description>
gCube Reports Portlet.

View File

@ -30,7 +30,7 @@ public class ClientRepeatableSequence extends Composite implements ClientSequenc
this.repSequence = sRS;
this.identifier = sRS.getKey();
this.originalSequence = extractOriginalSequence(sRS);
SequenceWidget seqW = new SequenceWidget(p, this, originalSequence, false, false); //TODO: Now all seq are removable, need to be handled differently
SequenceWidget seqW = new SequenceWidget(p, this, originalSequence, true, false);
myPanel.add(seqW);
for (RepeatableSequence repeatSeq : getRepeats()) {

View File

@ -22,7 +22,7 @@ import com.google.gwt.user.client.ui.VerticalPanel;
public class ClientReportReference extends Composite implements ClientSequence {
private final int indentationValue = 20;
protected ArrayList<TemplateComponent> groupedComponents = new ArrayList<TemplateComponent>();
private VerticalPanel myPanel = new VerticalPanel();
@ -31,7 +31,7 @@ public class ClientReportReference extends Composite implements ClientSequence {
private SequenceWidget first;
private Presenter p;
private boolean singleRelation; //allow or not to add new entries
/**
* s
* @param p
@ -42,9 +42,9 @@ public class ClientReportReference extends Composite implements ClientSequence {
this.refType = refType;
this.tupleList = tupleList;
this.singleRelation = singleRelation;
shrinkComponents(tupleList); //(beacuse the ref is indented
for (Tuple seq : tupleList) {
if (myPanel.getWidgetCount()==0) { // if is the first one
first = getMasterSequence(seq);
@ -52,10 +52,7 @@ public class ClientReportReference extends Composite implements ClientSequence {
first.removeAddAnotherButton();
myPanel.add(first);
} else {
SequenceWidget seqW = new SequenceWidget(p, this, seq, false, false);
seqW.getElement().getStyle().setMarginLeft(indentationValue, Unit.PX);
seqW.getElement().getStyle().setBackgroundColor("#FFF");
seqW.alignButtonsLeft();
SequenceWidget seqW = getRefSequence(p, this, seq, false, false);
myPanel.add(seqW);
}
}
@ -76,11 +73,8 @@ public class ClientReportReference extends Composite implements ClientSequence {
* the first seq has to behave differently
*/
private SequenceWidget getMasterSequence(RepeatableSequence seq) {
SequenceWidget toReturn = new SequenceWidget(p, this, seq, true, false);
toReturn.alignButtonsLeft();
toReturn.getElement().getStyle().setMarginLeft(indentationValue, Unit.PX);
toReturn.getElement().getStyle().setBackgroundColor("#FFF");
SequenceWidget toReturn = getRefSequence(p, this, seq, true, false);
if (tupleList.size() == 1) {
toReturn.enableClear();
if (isTupleEmpty(tupleList.get(0))) {
@ -120,13 +114,18 @@ public class ClientReportReference extends Composite implements ClientSequence {
@Override
public boolean add(String id, RepeatableSequence sequence) {
//(beacuse the ref is indented
for (BasicComponent bc : sequence.getGroupedComponents()) {
bc.setWidth(bc.getWidth()-(indentationValue+5));
}
if (first.isSelectNewEnabled()) {
first = getMasterSequence(sequence);
myPanel.clear();
myPanel.add(first);
tupleList.clear();
} else {
SequenceWidget seqW = new SequenceWidget(p, this, sequence, false, true);
SequenceWidget seqW = getRefSequence(p, this, sequence, false, true);
myPanel.add(seqW);
first.hideClearAssociationButton();
}
@ -171,4 +170,16 @@ public class ClientReportReference extends Composite implements ClientSequence {
public void clear() {
first.clearAssociation();
}
/**
* A Ref is a seqeunce with diffrent style (intendedm white background and less wide)
*
*/
private SequenceWidget getRefSequence(Presenter p, ClientSequence owner, RepeatableSequence repSequence, boolean notRemovable, boolean isNew) {
SequenceWidget toReturn = new SequenceWidget(p, this, repSequence, notRemovable, isNew);
toReturn.getElement().getStyle().setMarginLeft(indentationValue, Unit.PX);
toReturn.getElement().getStyle().setBackgroundColor("#FFF");
toReturn.alignButtonsLeft();
return toReturn;
}
}