Minor Update

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-table-widget@111926 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2015-02-12 10:29:25 +00:00 committed by Giancarlo Panichi
parent 8213b6b161
commit fc0577ba9d
1 changed files with 26 additions and 16 deletions

View File

@ -7,7 +7,7 @@ import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTIsFinalException;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTIsLockedException;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
import org.gcube.portlets.user.td.gwtservice.shared.geospatial.GeospatialCreateCoordinatesSession;
import org.gcube.portlets.user.td.gwtservice.shared.geometry.GeometryCreatePointSession;
import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData;
import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialog;
import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialogListener;
@ -42,6 +42,7 @@ import com.sencha.gxt.widget.core.client.event.SelectEvent;
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
import com.sencha.gxt.widget.core.client.form.ComboBox;
import com.sencha.gxt.widget.core.client.form.FieldLabel;
import com.sencha.gxt.widget.core.client.form.TextField;
import com.sencha.gxt.widget.core.client.info.Info;
/**
@ -67,6 +68,7 @@ public class GeometryCreatePointPanel extends FramedPanel implements
private ComboBox<ColumnData> comboLongitude;
private ListStore<ColumnData> storeComboLatitude;
private ListStore<ColumnData> storeComboLongitude;
private TextField columnLabelField;
public GeometryCreatePointPanel(TRId trId, EventBus eventBus) {
super();
@ -151,8 +153,12 @@ public class GeometryCreatePointPanel extends FramedPanel implements
comboLongitude.setTypeAhead(false);
comboLongitude.setEditable(false);
comboLongitude.setTriggerAction(TriggerAction.ALL);
//Column Label
columnLabelField = new TextField();
columnLabelField.setValue("Points");
FieldLabel columnLab= new FieldLabel(columnLabelField, "Column Label");
// Create
createPointButton = new TextButton("Create");
createPointButton.setIcon(ResourceBundle.INSTANCE
@ -178,14 +184,15 @@ public class GeometryCreatePointPanel extends FramedPanel implements
vl.add(new FieldLabel(comboLongitude, "Longitude"),
new VerticalLayoutData(1, -1));
vl.add(columnLab,
new VerticalLayoutData(1, -1));
vl.add(createPointButton, new VerticalLayoutData(-1, -1,
new Margins(10, 0, 10, 0)));
add(vl);
onResize();
}
@ -252,11 +259,14 @@ public class GeometryCreatePointPanel extends FramedPanel implements
if (latitude != null) {
ColumnData longitude = comboLongitude.getCurrentValue();
if (longitude != null) {
/*GeospatialCoordinatesType type=null;
GeospatialCreateCoordinatesSession gsCreateCoordinatesSession = new GeospatialCreateCoordinatesSession(
trId, latitude, longitude, type, null, null);
callGeometryCreatePoint(gsCreateCoordinatesSession);*/
String columnLab=columnLabelField.getCurrentValue();
if(columnLab!=null && !columnLab.isEmpty()){
GeometryCreatePointSession geoCreatePointSession = new GeometryCreatePointSession(
trId, latitude, longitude, columnLab);
callGeometryCreatePoint(geoCreatePointSession);
} else {
UtilsGXT3.alert("Attention", "Select a column label!");
}
} else {
UtilsGXT3.alert("Attention", "Select Longitude!");
}
@ -266,9 +276,9 @@ public class GeometryCreatePointPanel extends FramedPanel implements
}
private void callGeometryCreatePoint(
GeospatialCreateCoordinatesSession gsCreateCoordinatesSession) {
TDGWTServiceAsync.INSTANCE.startGeospatialCreateCoordinates(
gsCreateCoordinatesSession, new AsyncCallback<String>() {
GeometryCreatePointSession geometryCreatPointSession) {
TDGWTServiceAsync.INSTANCE.startGeometryCreatePoint(
geometryCreatPointSession, new AsyncCallback<String>() {
public void onFailure(Throwable caught) {
if (caught instanceof TDGWTSessionExpiredException) {
@ -285,11 +295,11 @@ public class GeometryCreatePointPanel extends FramedPanel implements
UtilsGXT3.alert("Error Final",
caught.getLocalizedMessage());
} else {
Log.debug("Create Geospatial Coordinates Error: "
Log.debug("Create a Point Error: "
+ caught.getLocalizedMessage());
UtilsGXT3
.alert("Error Creating Geospatial Coordinates",
"Error creating geospatial coordinates: "
.alert("Error Creating a point",
"Error creating a point: "
+ caught.getLocalizedMessage());
}
}