Minor Update

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-column-widget@90970 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-02-06 12:48:28 +00:00
parent 5111c16b9b
commit ab663a2f4f
6 changed files with 282 additions and 38 deletions

View File

@ -542,3 +542,35 @@ Compiling...
Compilation completed in 0.00 seconds Compilation completed in 0.00 seconds
Removing invalidated units Removing invalidated units
Finding entry point classes Finding entry point classes
Public resources found in...
Translatable source found in...
Found 0 cached/archived units. Used 0 / 2719 units from cache.
Compiling...
40% complete (ETR: 5 seconds)
40% complete (ETR: 5 seconds)
40% complete (ETR: 5 seconds)
40% complete (ETR: 5 seconds)
40% complete (ETR: 5 seconds)
50% complete (ETR: 5 seconds)
60% complete (ETR: 4 seconds)
70% complete (ETR: 2 seconds)
80% complete (ETR: 2 seconds)
90% complete (ETR: 1 seconds)
100% complete (ETR: 0 seconds)
Compilation completed in 14.57 seconds
Removing invalidated units
Finding entry point classes
Public resources found in...
Translatable source found in...
Found 2719 cached/archived units. Used 2719 / 2719 units from cache.
Compiling...
Compilation completed in 0.00 seconds
Removing invalidated units
Finding entry point classes
Public resources found in...
Translatable source found in...
Found 2719 cached/archived units. Used 2719 / 2719 units from cache.
Compiling...
Compilation completed in 0.00 seconds
Removing invalidated units
Finding entry point classes

View File

@ -70,6 +70,7 @@ public class ChangeColumnTypePanel extends FramedPanel {
this.trId = trId; this.trId = trId;
this.columnName = columnName; this.columnName = columnName;
this.eventBus = eventBus; this.eventBus = eventBus;
Log.debug("Create ChangeColumnTypePanel(): ["+ trId.toString()+" columnName: "+columnName+"]");
//Column Data //Column Data
ColumnDataProperties propsColumnData = GWT ColumnDataProperties propsColumnData = GWT
@ -338,17 +339,7 @@ public class ChangeColumnTypePanel extends FramedPanel {
public void onSuccess(ArrayList<ColumnData> result) { public void onSuccess(ArrayList<ColumnData> result) {
Log.trace("loaded " + result.size() + " ColumnData"); Log.trace("loaded " + result.size() + " ColumnData");
if (columnName != null) { setComboStatus(result);
Log.debug("ColumnName:"+columnName);
for (ColumnData cd : result) {
Log.debug("ColumnData name:"+cd.getName());
if (cd.getName().compareTo(columnName) == 0) {
comboColumn.setValue(cd);
comboColumnTypeCode.select(ColumnTypeCodeStore
.selected(cd.getTypeCode()));
}
}
}
callback.onSuccess(new ListLoadResultBean<ColumnData>( callback.onSuccess(new ListLoadResultBean<ColumnData>(
result)); result));
@ -358,4 +349,42 @@ public class ChangeColumnTypePanel extends FramedPanel {
} }
protected void setComboStatus(ArrayList<ColumnData> result){
Log.debug("ColumnName:"+columnName);
if (columnName != null) {
for (ColumnData cd : result) {
Log.debug("ColumnData name:"+cd.getName());
if (cd.getName().compareTo(columnName) == 0) {
updateComboStatus(cd);
}
}
}
}
protected void updateComboStatus(ColumnData cd){
Log.debug("ColumnData: "+cd.toString());
comboColumn.setValue(cd);
comboColumnTypeCode.setValue(ColumnTypeCodeStore.selectedElement(cd.getTypeCode()));
ColumnTypeCode type=ColumnTypeCodeStore.selected(cd.getTypeCode());
updateColumnType(type);
if (type == ColumnTypeCode.MEASURE) {
comboMeasureType.setValue(ColumnDataTypeStore.selectedMeasureElement(cd.getDataTypeName()));
} else {
if (type == ColumnTypeCode.ATTRIBUTE) {
comboMeasureType.setValue(ColumnDataTypeStore.selectedMeasureElement(cd.getDataTypeName()));
} else {
}
}
}
public void update(TRId trId, String columnName){
if(this.trId.getId()=trId.)
this.trId=trId;
this.columnName=columnName;
}
} }

View File

@ -39,11 +39,13 @@ public class ColumnDataTypeElement {
return type.toString(); return type.toString();
} }
@Override @Override
public String toString() { public String toString() {
return "ColumnTypeCode [id=" + id + ", code=" + type + ", getLabel()=" return "ColumnDataTypeElement [id=" + id + ", type=" + type + "]";
+ getLabel() + "]";
} }
} }

View File

@ -20,14 +20,21 @@ public class ColumnDataTypeStore implements Serializable {
protected static ArrayList<ColumnDataTypeElement> store; protected static ArrayList<ColumnDataTypeElement> store;
protected static ColumnDataTypeElement integerElement=new ColumnDataTypeElement(1,ColumnDataType.Integer);
protected static ColumnDataTypeElement numericElement=new ColumnDataTypeElement(2,ColumnDataType.Numeric);
protected static ColumnDataTypeElement booleanElement=new ColumnDataTypeElement(3,ColumnDataType.Boolean);
protected static ColumnDataTypeElement geometryElement=new ColumnDataTypeElement(4,ColumnDataType.Geometry);
protected static ColumnDataTypeElement textElement=new ColumnDataTypeElement(5,ColumnDataType.Text);
public static ArrayList<ColumnDataTypeElement> getMeasureType(){ public static ArrayList<ColumnDataTypeElement> getMeasureType(){
store=new ArrayList<ColumnDataTypeElement>(); store=new ArrayList<ColumnDataTypeElement>();
store.add(new ColumnDataTypeElement(1,ColumnDataType.Integer)); store.add(integerElement);
store.add(new ColumnDataTypeElement(2,ColumnDataType.Numeric)); store.add(numericElement);
return store; return store;
} }
public static int selectedMeasure(String selected){ public static int selectedMeasurePosition(String selected){
int position=0; int position=0;
if(selected.compareTo(ColumnDataType.Integer.toString())==0){ if(selected.compareTo(ColumnDataType.Integer.toString())==0){
position=1; position=1;
@ -40,18 +47,45 @@ public class ColumnDataTypeStore implements Serializable {
return position; return position;
} }
public static ColumnDataType selectedMeasure(String selected){
if(selected.compareTo(ColumnDataType.Integer.toString())==0){
return ColumnDataType.Integer;
} else {
if(selected.compareTo(ColumnDataType.Numeric.toString())==0){
return ColumnDataType.Numeric;
} else {
return null;
}
}
}
public static ColumnDataTypeElement selectedMeasureElement(String selected){
if(selected.compareTo(ColumnDataType.Integer.toString())==0){
return integerElement;
} else {
if(selected.compareTo(ColumnDataType.Numeric.toString())==0){
return numericElement;
} else {
return null;
}
}
}
public static ArrayList<ColumnDataTypeElement> getAttributeType(){ public static ArrayList<ColumnDataTypeElement> getAttributeType(){
store=new ArrayList<ColumnDataTypeElement>(); store=new ArrayList<ColumnDataTypeElement>();
store.add(new ColumnDataTypeElement(1,ColumnDataType.Integer)); store.add(integerElement);
store.add(new ColumnDataTypeElement(2,ColumnDataType.Numeric)); store.add(numericElement);
store.add(new ColumnDataTypeElement(3,ColumnDataType.Boolean)); store.add(booleanElement);
store.add(new ColumnDataTypeElement(4,ColumnDataType.Geometry)); store.add(geometryElement);
store.add(new ColumnDataTypeElement(5,ColumnDataType.Text)); store.add(textElement);
return store; return store;
} }
public static int selectedAttribute(String selected){ public static int selectedAttributePosition(String selected){
int position=0; int position=0;
if(selected.compareTo(ColumnDataType.Integer.toString())==0){ if(selected.compareTo(ColumnDataType.Integer.toString())==0){
position=1; position=1;
@ -76,5 +110,52 @@ public class ColumnDataTypeStore implements Serializable {
return position; return position;
} }
public static ColumnDataType selectedAttribute(String selected){
if(selected.compareTo(ColumnDataType.Integer.toString())==0){
return ColumnDataType.Integer;
} else {
if(selected.compareTo(ColumnDataType.Numeric.toString())==0){
return ColumnDataType.Numeric;
} else {
if(selected.compareTo(ColumnDataType.Boolean.toString())==0){
return ColumnDataType.Boolean;
} else {
if(selected.compareTo(ColumnDataType.Geometry.toString())==0){
return ColumnDataType.Geometry;
} else {
if(selected.compareTo(ColumnDataType.Text.toString())==0){
return ColumnDataType.Text;
} else {
return null;
}
}
}
}
}
}
public static ColumnDataTypeElement selectedAttributeElement(String selected){
if(selected.compareTo(ColumnDataType.Integer.toString())==0){
return integerElement;
} else {
if(selected.compareTo(ColumnDataType.Numeric.toString())==0){
return numericElement;
} else {
if(selected.compareTo(ColumnDataType.Boolean.toString())==0){
return booleanElement;
} else {
if(selected.compareTo(ColumnDataType.Geometry.toString())==0){
return geometryElement;
} else {
if(selected.compareTo(ColumnDataType.Text.toString())==0){
return textElement;
} else {
return null;
}
}
}
}
}
}
} }

View File

@ -39,11 +39,12 @@ public class ColumnTypeCodeElement {
return code.getColumnTypeCodeLabel(); return code.getColumnTypeCodeLabel();
} }
@Override @Override
public String toString() { public String toString() {
return "ColumnTypeCode [id=" + id + ", code=" + code + ", getLabel()=" return "ColumnTypeCodeElement [id=" + id + ", code=" + code + "]";
+ getLabel() + "]";
} }
} }

View File

@ -18,23 +18,34 @@ public class ColumnTypeCodeStore implements Serializable {
private static final long serialVersionUID = -1908324094430432681L; private static final long serialVersionUID = -1908324094430432681L;
protected static ColumnTypeCodeElement annotation=new ColumnTypeCodeElement(1,ColumnTypeCode.ANNOTATION);
protected static ColumnTypeCodeElement attribute=new ColumnTypeCodeElement(2,ColumnTypeCode.ATTRIBUTE);
protected static ColumnTypeCodeElement measure=new ColumnTypeCodeElement(3,ColumnTypeCode.MEASURE);
protected static ColumnTypeCodeElement code=new ColumnTypeCodeElement(4,ColumnTypeCode.CODE);
protected static ColumnTypeCodeElement codeName=new ColumnTypeCodeElement(5,ColumnTypeCode.CODENAME);
protected static ColumnTypeCodeElement codeDescription=new ColumnTypeCodeElement(6,ColumnTypeCode.CODEDESCRIPTION);
protected static ColumnTypeCodeElement dimension=new ColumnTypeCodeElement(7,ColumnTypeCode.DIMENSION);
protected static ColumnTypeCodeElement timeDimension=new ColumnTypeCodeElement(8,ColumnTypeCode.TIMEDIMENSION);
protected static ArrayList<ColumnTypeCodeElement> store; protected static ArrayList<ColumnTypeCodeElement> store;
public static ArrayList<ColumnTypeCodeElement> getColumnTypeCodes(){ public static ArrayList<ColumnTypeCodeElement> getColumnTypeCodes(){
store = new ArrayList<ColumnTypeCodeElement>(); store = new ArrayList<ColumnTypeCodeElement>();
store.add(new ColumnTypeCodeElement(1,ColumnTypeCode.ANNOTATION)); store.add(annotation);
store.add(new ColumnTypeCodeElement(2,ColumnTypeCode.ATTRIBUTE)); store.add(attribute);
store.add(new ColumnTypeCodeElement(3,ColumnTypeCode.MEASURE)); store.add(measure);
store.add(new ColumnTypeCodeElement(4,ColumnTypeCode.CODE)); store.add(code);
store.add(new ColumnTypeCodeElement(5,ColumnTypeCode.CODENAME)); store.add(codeName);
store.add(new ColumnTypeCodeElement(6,ColumnTypeCode.CODEDESCRIPTION)); store.add(codeDescription);
store.add(new ColumnTypeCodeElement(7,ColumnTypeCode.DIMENSION)); store.add(dimension);
store.add(new ColumnTypeCodeElement(8,ColumnTypeCode.TIMEDIMENSION)); store.add(timeDimension);
return store; return store;
} }
public static int selected(String selected){ public static int selectedPosition(String selected){
int position=0; int position=0;
if(selected.compareTo(ColumnTypeCode.ANNOTATION.toString())==0){ if(selected.compareTo(ColumnTypeCode.ANNOTATION.toString())==0){
position=1; position=1;
@ -79,4 +90,92 @@ public class ColumnTypeCodeStore implements Serializable {
return position; return position;
} }
public static ColumnTypeCode selected(String selected){
if(selected.compareTo(ColumnTypeCode.ANNOTATION.toString())==0){
return ColumnTypeCode.ANNOTATION;
} else {
if(selected.compareTo(ColumnTypeCode.ATTRIBUTE.toString())==0){
return ColumnTypeCode.ATTRIBUTE;
} else {
if(selected.compareTo(ColumnTypeCode.MEASURE.toString())==0){
return ColumnTypeCode.MEASURE;
} else {
if(selected.compareTo(ColumnTypeCode.CODE.toString())==0){
return ColumnTypeCode.CODE;
} else {
if(selected.compareTo(ColumnTypeCode.CODENAME.toString())==0){
return ColumnTypeCode.CODENAME;
} else {
if(selected.compareTo(ColumnTypeCode.CODEDESCRIPTION.toString())==0){
return ColumnTypeCode.CODEDESCRIPTION;
} else {
if(selected.compareTo(ColumnTypeCode.DIMENSION.toString())==0){
return ColumnTypeCode.DIMENSION;
} else {
if(selected.compareTo(ColumnTypeCode.TIMEDIMENSION.toString())==0){
return ColumnTypeCode.TIMEDIMENSION;
} else {
return null;
}
}
}
}
}
}
}
}
}
public static ColumnTypeCodeElement selectedElement(String selected){
if(selected.compareTo(ColumnTypeCode.ANNOTATION.toString())==0){
return annotation;
} else {
if(selected.compareTo(ColumnTypeCode.ATTRIBUTE.toString())==0){
return attribute;
} else {
if(selected.compareTo(ColumnTypeCode.MEASURE.toString())==0){
return measure;
} else {
if(selected.compareTo(ColumnTypeCode.CODE.toString())==0){
return code;
} else {
if(selected.compareTo(ColumnTypeCode.CODENAME.toString())==0){
return codeName;
} else {
if(selected.compareTo(ColumnTypeCode.CODEDESCRIPTION.toString())==0){
return codeDescription;
} else {
if(selected.compareTo(ColumnTypeCode.DIMENSION.toString())==0){
return dimension;
} else {
if(selected.compareTo(ColumnTypeCode.TIMEDIMENSION.toString())==0){
return timeDimension;
} else {
return null;
}
}
}
}
}
}
}
}
}
} }