Search in sources :

Example 1 with ClickFeatureListener

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;
    }
}
Also used : MessageBoxEvent(com.extjs.gxt.ui.client.event.MessageBoxEvent) VectorFeature(org.gwtopenmaps.openlayers.client.feature.VectorFeature) Listener(com.extjs.gxt.ui.client.event.Listener) ClickFeatureListener(org.gwtopenmaps.openlayers.client.control.SelectFeature.ClickFeatureListener) SelectFeatureOptions(org.gwtopenmaps.openlayers.client.control.SelectFeatureOptions) SelectFeature(org.gwtopenmaps.openlayers.client.control.SelectFeature) ClickFeatureListener(org.gwtopenmaps.openlayers.client.control.SelectFeature.ClickFeatureListener)

Aggregations

Listener (com.extjs.gxt.ui.client.event.Listener)1 MessageBoxEvent (com.extjs.gxt.ui.client.event.MessageBoxEvent)1 SelectFeature (org.gwtopenmaps.openlayers.client.control.SelectFeature)1 ClickFeatureListener (org.gwtopenmaps.openlayers.client.control.SelectFeature.ClickFeatureListener)1 SelectFeatureOptions (org.gwtopenmaps.openlayers.client.control.SelectFeatureOptions)1 VectorFeature (org.gwtopenmaps.openlayers.client.feature.VectorFeature)1