Added Century and Decade
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-column-widget@111624 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
375b99f0fb
commit
1a88c3ee03
|
@ -43,7 +43,7 @@ import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
|||
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnDataType;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnTypeCode;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnTypeMap;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.TimeDimensionType;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.PeriodDataType;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
import com.google.gwt.core.client.GWT;
|
||||
|
@ -418,12 +418,6 @@ public class ChangeColumnTypePanel extends FramedPanel implements
|
|||
storeComboTimeDimensionType.addAll(TimeDimensionTypeStore
|
||||
.getTimeDimensionType());
|
||||
|
||||
/*
|
||||
* ListView<TimeDimensionTypeElement, String> view = new
|
||||
* ListView<TimeDimensionTypeElement,
|
||||
* String>(storeComboTimeDimensionType,
|
||||
* propsTimeDimensionType.viewLabel()); view.setWidth("150px");
|
||||
*/
|
||||
comboTimeDimensionType = new ComboBox<TimeDimensionTypeElement>(
|
||||
storeComboTimeDimensionType, propsTimeDimensionType.label());
|
||||
Log.trace("ComboTimeDimensionType created");
|
||||
|
@ -775,7 +769,7 @@ public class ChangeColumnTypePanel extends FramedPanel implements
|
|||
|
||||
}
|
||||
|
||||
protected void updateTimeDimensionType(TimeDimensionType type) {
|
||||
protected void updateTimeDimensionType(PeriodDataType type) {
|
||||
|
||||
}
|
||||
|
||||
|
@ -1151,7 +1145,7 @@ public class ChangeColumnTypePanel extends FramedPanel implements
|
|||
TimeDimensionTypeElement timeDimensionTypeElement = comboTimeDimensionType
|
||||
.getCurrentValue();
|
||||
if (timeDimensionTypeElement != null) {
|
||||
TimeDimensionType timeDimensionType = timeDimensionTypeElement
|
||||
PeriodDataType timeDimensionType = timeDimensionTypeElement
|
||||
.getType();
|
||||
if (timeDimensionType != null) {
|
||||
changeColumnTypeSession
|
||||
|
|
|
@ -39,7 +39,7 @@ import org.gcube.portlets.user.td.widgetcommonevent.shared.OperationResult;
|
|||
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnDataType;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnTypeCode;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.TimeDimensionType;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.PeriodDataType;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
import com.google.gwt.core.client.GWT;
|
||||
|
@ -643,7 +643,7 @@ public class AddColumnPanel extends FramedPanel implements
|
|||
|
||||
}
|
||||
|
||||
protected void updateTimeDimensionType(TimeDimensionType type) {
|
||||
protected void updateTimeDimensionType(PeriodDataType type) {
|
||||
|
||||
}
|
||||
|
||||
|
@ -791,7 +791,7 @@ public class AddColumnPanel extends FramedPanel implements
|
|||
TimeDimensionTypeElement timeDimensionTypeElement = comboTimeDimensionType
|
||||
.getCurrentValue();
|
||||
if (timeDimensionTypeElement != null) {
|
||||
TimeDimensionType timeDimensionType = timeDimensionTypeElement
|
||||
PeriodDataType timeDimensionType = timeDimensionTypeElement
|
||||
.getType();
|
||||
if (timeDimensionType != null) {
|
||||
defNewColumn = new DefNewColumn(labelS, type,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package org.gcube.portlets.user.td.columnwidget.client.store;
|
||||
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.TimeDimensionType;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.PeriodDataType;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -11,10 +11,10 @@ import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.TimeDimensi
|
|||
public class TimeDimensionTypeElement {
|
||||
|
||||
protected int id; // For insert in table only
|
||||
protected TimeDimensionType type;
|
||||
protected PeriodDataType type;
|
||||
|
||||
|
||||
public TimeDimensionTypeElement(int id,TimeDimensionType type){
|
||||
public TimeDimensionTypeElement(int id,PeriodDataType type){
|
||||
this.id=id;
|
||||
this.type=type;
|
||||
}
|
||||
|
@ -28,19 +28,19 @@ public class TimeDimensionTypeElement {
|
|||
this.id = id;
|
||||
}
|
||||
|
||||
public TimeDimensionType getType() {
|
||||
public PeriodDataType getType() {
|
||||
return type;
|
||||
}
|
||||
public void setCode(TimeDimensionType type) {
|
||||
public void setCode(PeriodDataType type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getLabel() {
|
||||
return type.toString();
|
||||
return type.getPeriodDataTypeLabel();
|
||||
}
|
||||
|
||||
public String getViewLabel() {
|
||||
return type.toString();
|
||||
return type.getPeriodDataTypeLabel();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -3,7 +3,8 @@ package org.gcube.portlets.user.td.columnwidget.client.store;
|
|||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.TimeDimensionType;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.PeriodDataType;
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -18,13 +19,15 @@ public class TimeDimensionTypeStore implements Serializable {
|
|||
|
||||
private static final long serialVersionUID = -5669638279415262224L;
|
||||
|
||||
protected static ArrayList<TimeDimensionTypeElement> store;
|
||||
|
||||
protected static TimeDimensionTypeElement dayElement=new TimeDimensionTypeElement(1,TimeDimensionType.Day);
|
||||
protected static TimeDimensionTypeElement monthElement=new TimeDimensionTypeElement(2,TimeDimensionType.Month);
|
||||
protected static TimeDimensionTypeElement quarterElement=new TimeDimensionTypeElement(3,TimeDimensionType.Quarter);
|
||||
protected static TimeDimensionTypeElement yearElement=new TimeDimensionTypeElement(4,TimeDimensionType.Year);
|
||||
private static ArrayList<TimeDimensionTypeElement> store;
|
||||
|
||||
private static TimeDimensionTypeElement dayElement=new TimeDimensionTypeElement(1,PeriodDataType.DAY);
|
||||
private static TimeDimensionTypeElement monthElement=new TimeDimensionTypeElement(2,PeriodDataType.MONTH);
|
||||
private static TimeDimensionTypeElement quarterElement=new TimeDimensionTypeElement(3,PeriodDataType.QUARTER);
|
||||
private static TimeDimensionTypeElement yearElement=new TimeDimensionTypeElement(4,PeriodDataType.YEAR);
|
||||
private static TimeDimensionTypeElement decadeElement=new TimeDimensionTypeElement(5,PeriodDataType.DECADE);
|
||||
private static TimeDimensionTypeElement centuryElement=new TimeDimensionTypeElement(6,PeriodDataType.CENTURY);
|
||||
|
||||
|
||||
public static ArrayList<TimeDimensionTypeElement> getTimeDimensionType(){
|
||||
store=new ArrayList<TimeDimensionTypeElement>();
|
||||
|
@ -32,23 +35,33 @@ public class TimeDimensionTypeStore implements Serializable {
|
|||
store.add(monthElement);
|
||||
store.add(quarterElement);
|
||||
store.add(yearElement);
|
||||
store.add(decadeElement);
|
||||
store.add(centuryElement);
|
||||
return store;
|
||||
}
|
||||
|
||||
public static int selectedTimeDimensionPosition(String selected){
|
||||
int position=0;
|
||||
if(selected.compareTo(TimeDimensionType.Day.toString())==0){
|
||||
if(selected.compareTo(PeriodDataType.DAY.toString())==0){
|
||||
position=1;
|
||||
} else {
|
||||
if(selected.compareTo(TimeDimensionType.Month.toString())==0){
|
||||
if(selected.compareTo(PeriodDataType.MONTH.toString())==0){
|
||||
position=2;
|
||||
} else {
|
||||
if(selected.compareTo(TimeDimensionType.Quarter.toString())==0){
|
||||
if(selected.compareTo(PeriodDataType.QUARTER.toString())==0){
|
||||
position=3;
|
||||
} else {
|
||||
if(selected.compareTo(TimeDimensionType.Year.toString())==0){
|
||||
if(selected.compareTo(PeriodDataType.YEAR.toString())==0){
|
||||
position=4;
|
||||
} else {
|
||||
if(selected.compareTo(PeriodDataType.DECADE.toString())==0){
|
||||
position=5;
|
||||
} else {
|
||||
if(selected.compareTo(PeriodDataType.CENTURY.toString())==0){
|
||||
position=6;
|
||||
} else {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -57,40 +70,32 @@ public class TimeDimensionTypeStore implements Serializable {
|
|||
}
|
||||
|
||||
|
||||
public static TimeDimensionType selectedTimeDimension(String selected){
|
||||
if(selected.compareTo(TimeDimensionType.Day.toString())==0){
|
||||
return TimeDimensionType.Day;
|
||||
} else {
|
||||
if(selected.compareTo(TimeDimensionType.Month.toString())==0){
|
||||
return TimeDimensionType.Month;
|
||||
} else {
|
||||
if(selected.compareTo(TimeDimensionType.Quarter.toString())==0){
|
||||
return TimeDimensionType.Quarter;
|
||||
} else {
|
||||
if(selected.compareTo(TimeDimensionType.Year.toString())==0){
|
||||
return TimeDimensionType.Year;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public static PeriodDataType selectedTimeDimension(String selected){
|
||||
return PeriodDataType.getPeriodFromString(selected);
|
||||
}
|
||||
|
||||
public static TimeDimensionTypeElement selectedTimeDimensionElement(String selected){
|
||||
if(selected.compareTo(TimeDimensionType.Day.toString())==0){
|
||||
if(selected.compareTo(PeriodDataType.DAY.toString())==0){
|
||||
return dayElement;
|
||||
} else {
|
||||
if(selected.compareTo(TimeDimensionType.Month.toString())==0){
|
||||
if(selected.compareTo(PeriodDataType.MONTH.toString())==0){
|
||||
return monthElement;
|
||||
} else {
|
||||
if(selected.compareTo(TimeDimensionType.Quarter.toString())==0){
|
||||
if(selected.compareTo(PeriodDataType.QUARTER.toString())==0){
|
||||
return quarterElement;
|
||||
} else {
|
||||
if(selected.compareTo(TimeDimensionType.Year.toString())==0){
|
||||
if(selected.compareTo(PeriodDataType.YEAR.toString())==0){
|
||||
return yearElement;
|
||||
} else {
|
||||
return null;
|
||||
if(selected.compareTo(PeriodDataType.DECADE.toString())==0){
|
||||
return decadeElement;
|
||||
} else {
|
||||
if(selected.compareTo(PeriodDataType.CENTURY.toString())==0){
|
||||
return centuryElement;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue