2015-02-11 16:22:22 +01:00
|
|
|
package org.gcube.portlets.user.td.tablewidget.client.geometry;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
2015-05-27 16:51:49 +02:00
|
|
|
import org.gcube.portlets.user.td.expressionwidget.client.properties.ColumnDataPropertiesCombo;
|
2015-02-11 16:22:22 +01:00
|
|
|
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;
|
2015-02-12 11:29:25 +01:00
|
|
|
import org.gcube.portlets.user.td.gwtservice.shared.geometry.GeometryCreatePointSession;
|
2015-02-11 16:22:22 +01:00
|
|
|
import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialog;
|
|
|
|
import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialogListener;
|
2015-11-12 18:51:40 +01:00
|
|
|
import org.gcube.portlets.user.td.tablewidget.client.TableWidgetMessages;
|
2015-02-11 16:22:22 +01:00
|
|
|
import org.gcube.portlets.user.td.tablewidget.client.resources.ResourceBundle;
|
|
|
|
import org.gcube.portlets.user.td.tablewidget.client.util.UtilsGXT3;
|
2015-11-12 18:51:40 +01:00
|
|
|
import org.gcube.portlets.user.td.widgetcommonevent.client.CommonMessages;
|
2015-02-11 16:22:22 +01:00
|
|
|
import org.gcube.portlets.user.td.widgetcommonevent.client.event.ChangeTableRequestEvent;
|
|
|
|
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
|
|
|
|
import org.gcube.portlets.user.td.widgetcommonevent.client.type.ChangeTableRequestType;
|
|
|
|
import org.gcube.portlets.user.td.widgetcommonevent.client.type.ChangeTableWhy;
|
|
|
|
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
|
|
|
|
import org.gcube.portlets.user.td.widgetcommonevent.shared.OperationResult;
|
|
|
|
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
2015-04-13 13:00:05 +02:00
|
|
|
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnData;
|
2015-02-11 16:22:22 +01:00
|
|
|
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnDataType;
|
2015-02-13 17:29:52 +01:00
|
|
|
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnTypeCode;
|
2015-02-11 16:22:22 +01:00
|
|
|
|
|
|
|
import com.allen_sauer.gwt.log.client.Log;
|
|
|
|
import com.google.gwt.core.client.GWT;
|
|
|
|
import com.google.gwt.event.logical.shared.SelectionEvent;
|
|
|
|
import com.google.gwt.event.logical.shared.SelectionHandler;
|
|
|
|
import com.google.gwt.user.client.rpc.AsyncCallback;
|
|
|
|
import com.google.web.bindery.event.shared.EventBus;
|
|
|
|
import com.sencha.gxt.cell.core.client.ButtonCell.IconAlign;
|
|
|
|
import com.sencha.gxt.cell.core.client.form.ComboBoxCell.TriggerAction;
|
|
|
|
import com.sencha.gxt.core.client.dom.ScrollSupport.ScrollMode;
|
|
|
|
import com.sencha.gxt.core.client.util.Margins;
|
|
|
|
import com.sencha.gxt.data.shared.LabelProvider;
|
|
|
|
import com.sencha.gxt.data.shared.ListStore;
|
|
|
|
import com.sencha.gxt.widget.core.client.FramedPanel;
|
|
|
|
import com.sencha.gxt.widget.core.client.button.TextButton;
|
|
|
|
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer;
|
|
|
|
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData;
|
|
|
|
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;
|
2015-02-12 11:29:25 +01:00
|
|
|
import com.sencha.gxt.widget.core.client.form.TextField;
|
2015-02-11 16:22:22 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @author "Giancarlo Panichi" <a
|
|
|
|
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
public class GeometryCreatePointPanel extends FramedPanel implements
|
|
|
|
MonitorDialogListener {
|
|
|
|
private static final String WIDTH = "640px";
|
|
|
|
private static final String HEIGHT = "520px";
|
|
|
|
|
|
|
|
private TRId trId;
|
|
|
|
private EventBus eventBus;
|
|
|
|
private boolean created;
|
|
|
|
|
|
|
|
private ArrayList<ColumnData> columns;
|
|
|
|
private VerticalLayoutContainer vl;
|
|
|
|
|
2015-11-12 18:51:40 +01:00
|
|
|
private TextButton btnCreatePoint;
|
2015-02-11 16:22:22 +01:00
|
|
|
private ComboBox<ColumnData> comboLatitude;
|
|
|
|
private ComboBox<ColumnData> comboLongitude;
|
|
|
|
private ListStore<ColumnData> storeComboLatitude;
|
|
|
|
private ListStore<ColumnData> storeComboLongitude;
|
2015-11-12 18:51:40 +01:00
|
|
|
private TextField columnField;
|
|
|
|
private CommonMessages msgsCommon;
|
|
|
|
private TableWidgetMessages msgs;
|
2015-02-11 16:22:22 +01:00
|
|
|
|
|
|
|
public GeometryCreatePointPanel(TRId trId, EventBus eventBus) {
|
|
|
|
super();
|
|
|
|
this.trId = trId;
|
|
|
|
|
|
|
|
this.eventBus = eventBus;
|
|
|
|
this.created = false;
|
|
|
|
forceLayoutOnResize = true;
|
2015-11-12 18:51:40 +01:00
|
|
|
|
|
|
|
initMessages();
|
2015-02-11 16:22:22 +01:00
|
|
|
retrieveColumns();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2015-11-12 18:51:40 +01:00
|
|
|
protected void initMessages() {
|
|
|
|
msgsCommon = GWT.create(CommonMessages.class);
|
|
|
|
msgs = GWT.create(TableWidgetMessages.class);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2015-02-11 16:22:22 +01:00
|
|
|
protected void testCreated() {
|
|
|
|
if (created) {
|
|
|
|
updateCombo();
|
|
|
|
} else {
|
|
|
|
created = true;
|
|
|
|
create();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
protected void updateCombo() {
|
|
|
|
storeComboLatitude.clear();
|
|
|
|
storeComboLatitude.addAll(columns);
|
|
|
|
storeComboLatitude.commitChanges();
|
|
|
|
comboLatitude.reset();
|
|
|
|
comboLatitude.clear();
|
|
|
|
|
|
|
|
storeComboLongitude.clear();
|
|
|
|
storeComboLongitude.addAll(columns);
|
|
|
|
storeComboLongitude.commitChanges();
|
|
|
|
comboLongitude.reset();
|
|
|
|
comboLongitude.clear();
|
2015-02-13 17:29:52 +01:00
|
|
|
|
2015-02-11 16:22:22 +01:00
|
|
|
onResize();
|
|
|
|
forceLayout();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
protected void create() {
|
|
|
|
|
|
|
|
setWidth(WIDTH);
|
|
|
|
setHeight(HEIGHT);
|
|
|
|
setHeaderVisible(false);
|
|
|
|
setBodyBorder(false);
|
|
|
|
|
2015-02-13 17:29:52 +01:00
|
|
|
Log.debug("Create GeometryPointPanel(): [" + trId.toString() + "]");
|
2015-02-11 16:22:22 +01:00
|
|
|
|
|
|
|
// Column Propierties
|
|
|
|
ColumnDataPropertiesCombo propsColumnData = GWT
|
|
|
|
.create(ColumnDataPropertiesCombo.class);
|
2015-11-12 18:51:40 +01:00
|
|
|
|
|
|
|
// Longitude
|
|
|
|
storeComboLongitude = new ListStore<ColumnData>(propsColumnData.id());
|
|
|
|
storeComboLongitude.addAll(columns);
|
2015-02-11 16:22:22 +01:00
|
|
|
|
2015-11-12 18:51:40 +01:00
|
|
|
comboLongitude = new ComboBox<ColumnData>(storeComboLongitude,
|
|
|
|
propsColumnData.label());
|
|
|
|
Log.trace("Combo ColumnData created");
|
|
|
|
|
|
|
|
addHandlersForComboColumnLongitude(propsColumnData.label());
|
|
|
|
|
|
|
|
comboLongitude.setEmptyText(msgs.comboLongitudeEmptyMessage());
|
|
|
|
comboLongitude.setWidth(191);
|
|
|
|
comboLongitude.setTypeAhead(false);
|
|
|
|
comboLongitude.setEditable(false);
|
|
|
|
comboLongitude.setTriggerAction(TriggerAction.ALL);
|
|
|
|
|
|
|
|
FieldLabel comboLongitudeLabel=new FieldLabel(comboLongitude, msgs.comboLongitudeLabel());
|
|
|
|
|
|
|
|
|
2015-02-11 16:22:22 +01:00
|
|
|
// Latitude
|
|
|
|
storeComboLatitude = new ListStore<ColumnData>(propsColumnData.id());
|
|
|
|
storeComboLatitude.addAll(columns);
|
|
|
|
|
|
|
|
comboLatitude = new ComboBox<ColumnData>(storeComboLatitude,
|
|
|
|
propsColumnData.label());
|
|
|
|
Log.trace("Combo ColumnData created");
|
|
|
|
|
|
|
|
addHandlersForComboColumnLatitude(propsColumnData.label());
|
|
|
|
|
2015-11-12 18:51:40 +01:00
|
|
|
comboLatitude.setEmptyText(msgs.comboLatitudeEmptyText());
|
2015-02-11 16:22:22 +01:00
|
|
|
comboLatitude.setWidth(191);
|
|
|
|
comboLatitude.setTypeAhead(false);
|
|
|
|
comboLatitude.setEditable(false);
|
|
|
|
comboLatitude.setTriggerAction(TriggerAction.ALL);
|
2015-11-12 18:51:40 +01:00
|
|
|
|
|
|
|
FieldLabel comboLatitudeLabel=new FieldLabel(comboLatitude, msgs.comboLatitudeLabel());
|
|
|
|
|
|
|
|
|
2015-02-13 17:29:52 +01:00
|
|
|
|
|
|
|
// Column Label
|
2015-11-12 18:51:40 +01:00
|
|
|
columnField = new TextField();
|
|
|
|
columnField.setValue(msgs.columnFieldDefault());
|
|
|
|
FieldLabel columnFieldLabel = new FieldLabel(columnField, msgs.columnFieldLabel());
|
2015-02-13 17:29:52 +01:00
|
|
|
|
2015-02-11 16:22:22 +01:00
|
|
|
// Create
|
2015-11-12 18:51:40 +01:00
|
|
|
btnCreatePoint = new TextButton(msgs.btnCreatePointText());
|
|
|
|
btnCreatePoint.setIcon(ResourceBundle.INSTANCE.geometryPoint());
|
|
|
|
btnCreatePoint.setIconAlign(IconAlign.RIGHT);
|
|
|
|
btnCreatePoint.setToolTip(msgs.btnCreatePointToolTip());
|
2015-02-11 16:22:22 +01:00
|
|
|
|
2015-11-12 18:51:40 +01:00
|
|
|
btnCreatePoint.addSelectHandler(new SelectHandler() {
|
2015-02-11 16:22:22 +01:00
|
|
|
|
|
|
|
public void onSelect(SelectEvent event) {
|
|
|
|
onGeometryCreatePoint();
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
vl = new VerticalLayoutContainer();
|
|
|
|
vl.setScrollMode(ScrollMode.AUTO);
|
|
|
|
vl.setAdjustForScroll(true);
|
|
|
|
|
2015-11-12 18:51:40 +01:00
|
|
|
vl.add(comboLongitudeLabel,
|
2015-02-11 16:22:22 +01:00
|
|
|
new VerticalLayoutData(1, -1));
|
2015-11-12 18:51:40 +01:00
|
|
|
vl.add(comboLatitudeLabel,
|
2015-02-18 12:48:20 +01:00
|
|
|
new VerticalLayoutData(1, -1));
|
|
|
|
|
2015-11-12 18:51:40 +01:00
|
|
|
vl.add(columnFieldLabel, new VerticalLayoutData(1, -1));
|
2015-02-12 11:29:25 +01:00
|
|
|
|
2015-11-12 18:51:40 +01:00
|
|
|
vl.add(btnCreatePoint, new VerticalLayoutData(-1, -1, new Margins(
|
2015-02-13 17:29:52 +01:00
|
|
|
10, 0, 10, 0)));
|
2015-02-11 16:22:22 +01:00
|
|
|
|
|
|
|
add(vl);
|
|
|
|
|
|
|
|
onResize();
|
|
|
|
}
|
|
|
|
|
|
|
|
private void addHandlersForComboColumnLatitude(
|
|
|
|
final LabelProvider<ColumnData> labelProvider) {
|
|
|
|
comboLatitude.addSelectionHandler(new SelectionHandler<ColumnData>() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onSelection(SelectionEvent<ColumnData> event) {
|
|
|
|
Log.debug("Latitude selected: " + event.getSelectedItem());
|
|
|
|
ColumnData latitude = event.getSelectedItem();
|
|
|
|
updatedLatitude(latitude);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
protected void updatedLatitude(ColumnData latitude) {
|
|
|
|
// TODO Auto-generated method stub
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
private void addHandlersForComboColumnLongitude(
|
|
|
|
final LabelProvider<ColumnData> labelProvider) {
|
|
|
|
comboLongitude.addSelectionHandler(new SelectionHandler<ColumnData>() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onSelection(SelectionEvent<ColumnData> event) {
|
|
|
|
Log.debug("Longitude selected: " + event.getSelectedItem());
|
|
|
|
ColumnData longitude = event.getSelectedItem();
|
|
|
|
updatedLongitude(longitude);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
protected void updatedLongitude(ColumnData longitude) {
|
|
|
|
// TODO Auto-generated method stub
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
protected void onGeometryCreatePoint() {
|
2015-02-18 12:48:20 +01:00
|
|
|
ColumnData longitude = comboLongitude.getCurrentValue();
|
|
|
|
if (longitude != null) {
|
|
|
|
ColumnData latitude = comboLatitude.getCurrentValue();
|
|
|
|
if (latitude != null) {
|
2015-11-12 18:51:40 +01:00
|
|
|
String columnLab = columnField.getCurrentValue();
|
2015-02-13 17:29:52 +01:00
|
|
|
if (columnLab != null && !columnLab.isEmpty()) {
|
2015-02-12 11:29:25 +01:00
|
|
|
GeometryCreatePointSession geoCreatePointSession = new GeometryCreatePointSession(
|
|
|
|
trId, latitude, longitude, columnLab);
|
|
|
|
callGeometryCreatePoint(geoCreatePointSession);
|
|
|
|
} else {
|
2015-11-12 18:51:40 +01:00
|
|
|
UtilsGXT3.alert(msgsCommon.attention(), msgs.attentionSelectAColumnLabel());
|
2015-02-12 11:29:25 +01:00
|
|
|
}
|
2015-02-13 17:29:52 +01:00
|
|
|
} else {
|
2015-11-12 18:51:40 +01:00
|
|
|
UtilsGXT3.alert(msgsCommon.attention(), msgs.attentionSelectLatitude());
|
2015-02-11 16:22:22 +01:00
|
|
|
}
|
|
|
|
} else {
|
2015-11-12 18:51:40 +01:00
|
|
|
UtilsGXT3.alert(msgsCommon.attention(), msgs.attentionSelectLongitude());
|
2015-02-11 16:22:22 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private void callGeometryCreatePoint(
|
2015-02-12 11:29:25 +01:00
|
|
|
GeometryCreatePointSession geometryCreatPointSession) {
|
|
|
|
TDGWTServiceAsync.INSTANCE.startGeometryCreatePoint(
|
|
|
|
geometryCreatPointSession, new AsyncCallback<String>() {
|
2015-02-11 16:22:22 +01:00
|
|
|
|
|
|
|
public void onFailure(Throwable caught) {
|
|
|
|
if (caught instanceof TDGWTSessionExpiredException) {
|
|
|
|
eventBus.fireEvent(new SessionExpiredEvent(
|
|
|
|
SessionExpiredType.EXPIREDONSERVER));
|
|
|
|
} else {
|
|
|
|
if (caught instanceof TDGWTIsLockedException) {
|
|
|
|
Log.error(caught.getLocalizedMessage());
|
2015-11-12 18:51:40 +01:00
|
|
|
UtilsGXT3.alert(msgsCommon.errorLocked(),
|
2015-02-11 16:22:22 +01:00
|
|
|
caught.getLocalizedMessage());
|
|
|
|
} else {
|
|
|
|
if (caught instanceof TDGWTIsFinalException) {
|
|
|
|
Log.error(caught.getLocalizedMessage());
|
2015-11-12 18:51:40 +01:00
|
|
|
UtilsGXT3.alert(msgsCommon.errorFinal(),
|
2015-02-11 16:22:22 +01:00
|
|
|
caught.getLocalizedMessage());
|
|
|
|
} else {
|
2015-02-12 11:29:25 +01:00
|
|
|
Log.debug("Create a Point Error: "
|
2015-02-11 16:22:22 +01:00
|
|
|
+ caught.getLocalizedMessage());
|
|
|
|
UtilsGXT3
|
2015-11-12 18:51:40 +01:00
|
|
|
.alert(msgsCommon.error(),
|
|
|
|
msgs.errorCreatingAPointFixed()
|
2015-02-11 16:22:22 +01:00
|
|
|
+ caught.getLocalizedMessage());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void onSuccess(String taskId) {
|
|
|
|
openMonitorDialog(taskId);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
protected void retrieveColumns() {
|
|
|
|
TDGWTServiceAsync.INSTANCE.getColumns(trId,
|
|
|
|
new AsyncCallback<ArrayList<ColumnData>>() {
|
|
|
|
|
|
|
|
public void onFailure(Throwable caught) {
|
|
|
|
if (caught instanceof TDGWTSessionExpiredException) {
|
|
|
|
eventBus.fireEvent(new SessionExpiredEvent(
|
|
|
|
SessionExpiredType.EXPIREDONSERVER));
|
|
|
|
} else {
|
|
|
|
if (caught instanceof TDGWTIsLockedException) {
|
|
|
|
Log.error(caught.getLocalizedMessage());
|
2015-11-12 18:51:40 +01:00
|
|
|
UtilsGXT3.alert(msgsCommon.errorLocked(),
|
2015-02-11 16:22:22 +01:00
|
|
|
caught.getLocalizedMessage());
|
|
|
|
} else {
|
|
|
|
if (caught instanceof TDGWTIsFinalException) {
|
|
|
|
Log.error(caught.getLocalizedMessage());
|
2015-11-12 18:51:40 +01:00
|
|
|
UtilsGXT3.alert(msgsCommon.errorFinal(),
|
2015-02-11 16:22:22 +01:00
|
|
|
caught.getLocalizedMessage());
|
|
|
|
} else {
|
|
|
|
Log.error("load combo failure:"
|
|
|
|
+ caught.getLocalizedMessage());
|
2015-11-12 18:51:40 +01:00
|
|
|
UtilsGXT3.alert(msgsCommon.error(),
|
|
|
|
msgs.errorRetrievingColumsOfTabularResourceFixed()
|
2015-02-11 16:22:22 +01:00
|
|
|
+ trId.getId());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public void onSuccess(ArrayList<ColumnData> result) {
|
|
|
|
Log.trace("loaded " + result.size() + " ColumnData");
|
|
|
|
columns = new ArrayList<ColumnData>();
|
|
|
|
|
|
|
|
for (ColumnData column : result) {
|
2015-02-13 17:29:52 +01:00
|
|
|
ColumnTypeCode columnTypeCode = ColumnTypeCode
|
|
|
|
.getColumnTypeCodeFromId(column
|
|
|
|
.getTypeCode());
|
|
|
|
if (columnTypeCode
|
|
|
|
.compareTo(ColumnTypeCode.ATTRIBUTE) == 0
|
|
|
|
|| columnTypeCode
|
|
|
|
.compareTo(ColumnTypeCode.MEASURE) == 0) {
|
|
|
|
ColumnDataType columnDataType = ColumnDataType
|
|
|
|
.getColumnDataTypeFromId(column
|
|
|
|
.getDataTypeName());
|
|
|
|
if (columnDataType
|
|
|
|
.compareTo(ColumnDataType.Integer) == 0
|
|
|
|
|| columnDataType
|
|
|
|
.compareTo(ColumnDataType.Numeric) == 0) {
|
|
|
|
columns.add(column);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2015-02-11 16:22:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
if (columns.size() < 1) {
|
|
|
|
Log.debug("Attention no Integer or Numeric column is present in the tabular resource");
|
|
|
|
UtilsGXT3
|
2015-11-12 18:51:40 +01:00
|
|
|
.alert(msgsCommon.attention(),
|
|
|
|
msgs.attentionNoIntegerOrNumericColumnIsPresent());
|
2015-02-11 16:22:22 +01:00
|
|
|
}
|
|
|
|
testCreated();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public void update(TRId trId) {
|
|
|
|
this.trId = trId;
|
2015-02-13 17:29:52 +01:00
|
|
|
|
2015-02-11 16:22:22 +01:00
|
|
|
retrieveColumns();
|
|
|
|
}
|
|
|
|
|
|
|
|
protected void close() {
|
|
|
|
/*
|
|
|
|
* if (parent != null) { parent.close(); }
|
|
|
|
*/
|
|
|
|
}
|
|
|
|
|
2015-02-13 17:29:52 +01:00
|
|
|
//
|
2015-02-11 16:22:22 +01:00
|
|
|
protected void openMonitorDialog(String taskId) {
|
|
|
|
MonitorDialog monitorDialog = new MonitorDialog(taskId, eventBus);
|
|
|
|
monitorDialog.addProgressDialogListener(this);
|
|
|
|
monitorDialog.show();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void operationComplete(OperationResult operationResult) {
|
|
|
|
ChangeTableWhy why = ChangeTableWhy.TABLEUPDATED;
|
|
|
|
ChangeTableRequestEvent changeTableRequestEvent = new ChangeTableRequestEvent(
|
|
|
|
ChangeTableRequestType.GEOSPATIALCREATECOORDINATES,
|
|
|
|
operationResult.getTrId(), why);
|
|
|
|
eventBus.fireEvent(changeTableRequestEvent);
|
|
|
|
close();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void operationFailed(Throwable caught, String reason, String details) {
|
|
|
|
UtilsGXT3.alert(reason, details);
|
|
|
|
close();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void operationStopped(OperationResult operationResult,
|
|
|
|
String reason, String details) {
|
|
|
|
ChangeTableWhy why = ChangeTableWhy.TABLECURATION;
|
|
|
|
ChangeTableRequestEvent changeTableRequestEvent = new ChangeTableRequestEvent(
|
|
|
|
ChangeTableRequestType.GEOSPATIALCREATECOORDINATES,
|
|
|
|
operationResult.getTrId(), why);
|
|
|
|
eventBus.fireEvent(changeTableRequestEvent);
|
|
|
|
close();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void operationAborted() {
|
|
|
|
close();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void operationPutInBackground() {
|
|
|
|
close();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|