use of org.gwtopenmaps.openlayers.client.control.SelectFeature.ClickFeatureListener in project geo-platform by geosdi.
the class GenericFeatureOperation method createControl.
/**
* (non-Javadoc)
*
* @see
* org.geosdi.geoplatform.gui.impl.map.control.GeoPlatformMapControl#createControl()
*/
@Override
public void createControl() {
if (!initialized) {
SelectFeatureOptions selectFeatureOptions = new SelectFeatureOptions();
selectFeatureOptions.clickFeature(new ClickFeatureListener() {
@Override
public void onFeatureClicked(final VectorFeature vectorFeature) {
GeoPlatformMessage.confirmMessage(MapModuleConstants.INSTANCE.GenericFeatureOperation_confirmDeletionTitleText(), MapModuleConstants.INSTANCE.GenericFeatureOperation_confirmDeletionBodyText(), new Listener<MessageBoxEvent>() {
@Override
public void handleEvent(MessageBoxEvent be) {
if (Dialog.YES.equals(be.getButtonClicked().getItemId())) {
Dispatcher.forwardEvent(MapWidgetEvents.DELETE_FEATURE, vectorFeature);
}
}
});
}
});
control = new SelectFeature(vector, selectFeatureOptions);
this.initialized = true;
}
}
Aggregations