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"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <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> <attributes>
<attribute name="optional" value="true"/> <attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
@ -31,5 +31,5 @@
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="con" path="com.google.gwt.eclipse.core.GWT_CONTAINER"/> <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> </classpath>

View File

@ -2,6 +2,6 @@
<<<<<<<=.mine <<<<<<<=.mine
>>>>>>>=.r71295 >>>>>>>=.r71295
eclipse.preferences.version=1 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 warSrcDir=src/main/webapp
warSrcDirIsOutput=false warSrcDirIsOutput=false

View File

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

View File

@ -30,7 +30,7 @@ public class ClientRepeatableSequence extends Composite implements ClientSequenc
this.repSequence = sRS; this.repSequence = sRS;
this.identifier = sRS.getKey(); this.identifier = sRS.getKey();
this.originalSequence = extractOriginalSequence(sRS); 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); myPanel.add(seqW);
for (RepeatableSequence repeatSeq : getRepeats()) { 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 { public class ClientReportReference extends Composite implements ClientSequence {
private final int indentationValue = 20; private final int indentationValue = 20;
protected ArrayList<TemplateComponent> groupedComponents = new ArrayList<TemplateComponent>(); protected ArrayList<TemplateComponent> groupedComponents = new ArrayList<TemplateComponent>();
private VerticalPanel myPanel = new VerticalPanel(); private VerticalPanel myPanel = new VerticalPanel();
@ -31,7 +31,7 @@ public class ClientReportReference extends Composite implements ClientSequence {
private SequenceWidget first; private SequenceWidget first;
private Presenter p; private Presenter p;
private boolean singleRelation; //allow or not to add new entries private boolean singleRelation; //allow or not to add new entries
/** /**
* s * s
* @param p * @param p
@ -42,9 +42,9 @@ public class ClientReportReference extends Composite implements ClientSequence {
this.refType = refType; this.refType = refType;
this.tupleList = tupleList; this.tupleList = tupleList;
this.singleRelation = singleRelation; this.singleRelation = singleRelation;
shrinkComponents(tupleList); //(beacuse the ref is indented shrinkComponents(tupleList); //(beacuse the ref is indented
for (Tuple seq : tupleList) { for (Tuple seq : tupleList) {
if (myPanel.getWidgetCount()==0) { // if is the first one if (myPanel.getWidgetCount()==0) { // if is the first one
first = getMasterSequence(seq); first = getMasterSequence(seq);
@ -52,10 +52,7 @@ public class ClientReportReference extends Composite implements ClientSequence {
first.removeAddAnotherButton(); first.removeAddAnotherButton();
myPanel.add(first); myPanel.add(first);
} else { } else {
SequenceWidget seqW = new SequenceWidget(p, this, seq, false, false); SequenceWidget seqW = getRefSequence(p, this, seq, false, false);
seqW.getElement().getStyle().setMarginLeft(indentationValue, Unit.PX);
seqW.getElement().getStyle().setBackgroundColor("#FFF");
seqW.alignButtonsLeft();
myPanel.add(seqW); myPanel.add(seqW);
} }
} }
@ -76,11 +73,8 @@ public class ClientReportReference extends Composite implements ClientSequence {
* the first seq has to behave differently * the first seq has to behave differently
*/ */
private SequenceWidget getMasterSequence(RepeatableSequence seq) { private SequenceWidget getMasterSequence(RepeatableSequence seq) {
SequenceWidget toReturn = new SequenceWidget(p, this, seq, true, false); SequenceWidget toReturn = getRefSequence(p, this, seq, true, false);
toReturn.alignButtonsLeft();
toReturn.getElement().getStyle().setMarginLeft(indentationValue, Unit.PX);
toReturn.getElement().getStyle().setBackgroundColor("#FFF");
if (tupleList.size() == 1) { if (tupleList.size() == 1) {
toReturn.enableClear(); toReturn.enableClear();
if (isTupleEmpty(tupleList.get(0))) { if (isTupleEmpty(tupleList.get(0))) {
@ -120,13 +114,18 @@ public class ClientReportReference extends Composite implements ClientSequence {
@Override @Override
public boolean add(String id, RepeatableSequence sequence) { 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()) { if (first.isSelectNewEnabled()) {
first = getMasterSequence(sequence); first = getMasterSequence(sequence);
myPanel.clear(); myPanel.clear();
myPanel.add(first); myPanel.add(first);
tupleList.clear(); tupleList.clear();
} else { } else {
SequenceWidget seqW = new SequenceWidget(p, this, sequence, false, true); SequenceWidget seqW = getRefSequence(p, this, sequence, false, true);
myPanel.add(seqW); myPanel.add(seqW);
first.hideClearAssociationButton(); first.hideClearAssociationButton();
} }
@ -171,4 +170,16 @@ public class ClientReportReference extends Composite implements ClientSequence {
public void clear() { public void clear() {
first.clearAssociation(); 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;
}
} }