Triggered when a suggestion from the dropdown menu is selected.

@param event the event
@param suggestion the suggestion object
335195
private void onSelected(final Event event, final Suggestion<T> suggestion) {
        TypeaheadSelectedEvent.fire(this, suggestion, event);
    }
17293
public void addEvent(Event event) {
        if(event == null)
            throw new IllegalStateException("event must be non-null");

        if(logger.isTraceEnabled())
            logger.trace("Adding event " + event);

        eventQueue.add(event);
    }
777268
@Override
	public void actionPerformed(ActionEvent event) {
		JMenuItem item = (JMenuItem) event.getSource();

		if (item.isSelected()) {
			showColumn(item.getText());
		} else {
			hideColumn(item.getText());
		}
	}
471588
function (suggestion, selectionOptions) {
        var that = this,
            formatSelected = that.options.formatSelected || that.type.formatSelected,
            hasSameValues = selectionOptions && selectionOptions.hasSameValues,
            hasBeenEnriched = selectionOptions && selectionOptions.hasBeenEnriched,
            formattedValue,
            typeFormattedValue = null;


        if ($.isFunction(formatSelected)) {
            formattedValue = formatSelected.call(that, suggestion);
        }

        if (typeof formattedValue !== 'string') {
            formattedValue = suggestion.value;

            if (that.type.getSuggestionValue) {
                typeFormattedValue = that.type.getSuggestionValue(that, {
                    suggestion: suggestion,
                    hasSameValues: hasSameValues,
                    hasBeenEnriched: hasBeenEnriched,
                });

                if (typeFormattedValue !== null) {
                    formattedValue = typeFormattedValue;
                }
            }
        }

        return formattedValue;
    }
26072
public void actionPerformed(ActionEvent event) {
        String cmd = event.getActionCommand();
        if (cmd.equals(CUT)) {
            text.cut();
        } else if (cmd.equals(COPY)) {
            text.copy();
        } else if (cmd.equals(PASTE)) {
            text.paste();
        }
    }
646056
public void onSearchDone(SearchEvent event) {
		if (featureListTable != null) {
			featureListTable.setLayer(event.getLayer());
			for (Feature feature : event.getFeatures()) {
				featureListTable.addFeature(feature);
			}
		}
		afterSearch();
	}
195689
function ontap(oEvent) {
			var item = oEvent.srcControl;
			var value;
			if (item instanceof SuggestionItem ) {
				value = item.getSuggestionText();
				picker.close();
				window.setTimeout(function() {
					oInput.setValue(value);
					oInput.fireSearch({
						query: value,
						suggestionItem: item,
						refreshButtonPressed: false,
						clearButtonPressed: false
					});
				}, 0);
			}
		}
109819
public void onFeatureDeselected(FeatureDeselectedEvent event) {
		Feature feature = event.getFeature();

		// Only deselect if it is actually selected:
		boolean selected = false;
		ListGridRecord[] selections = getSelection();
		for (ListGridRecord selection : selections) {
			if (selection.getAttribute(FIELD_NAME_FEATURE_ID).equals(feature.getId())) {
				selected = true;
				break;
			}
		}

		// If selected, find the correct row and deselect:
		if (selected) {
			ListGridRecord[] records = this.getRecords();
			for (ListGridRecord record : records) {
				if (record.getAttribute(FIELD_NAME_FEATURE_ID).equals(feature.getId())) {
					deselectRecord(record);
					break;
				}
			}
		}
	}
1160602
public void addEvent(E event) {
    CompletableFuture<E> future = futures.poll();
    if (future != null) {
      future.complete(event);
    } else {
      events.add(event);
      if (events.size() > 100) {
        events.remove();
      }
    }
  }
1175975
public void onClick(MenuItemClickEvent event) {
		if (editController.getInfoLabel() == null) {
			editController.showGeometricInfo();
		} else {
			editController.hideGeometricInfo();
		}
	}
980823
function(event) {
        event = event || {};

        if (event.added) {
            this._renderSelectedItem(event.added);

            this._scrollToBottom();
        } else if (event.removed) {
            removeElement(this.$(getItemSelector(SELECTED_ITEM_SELECTOR, event.removed.id)));
        } else {
            this._forEachSelectedItem(removeElement);

            this._data.forEach(this._renderSelectedItem, this);

            this._updateInputWidth();
        }

        if (event.added || event.removed) {
            if (this.dropdown) {
                this.dropdown.showResults(this.filterResults(this.dropdown.results), {
                    hasMore: this.dropdown.hasMore
                });
            }

            if (!hasTouch) {
                this.focus();
            }
        }

        this.positionDropdown();

        this._updatePlaceholder();
    }
678973
@FXML
    private void send_btn_on_click(ActionEvent event) {
        // Future proof for other uses of send event handler
        if (this.dialogType == DialogType.INPUT_TEXT) {
            this.textEntry = this.inputTextField.getText();
        }

        setResponse(DialogResponse.SEND);
        close();
    }
902993
@UiHandler("m_addressField")
    void onAddressSelection(SelectionEvent<SuggestOracle.Suggestion> event) {

        m_controller.onAddressChange(event.getSelectedItem());
    }
703093
public void setEventDestinations(java.util.Collection<EventDestination> eventDestinations) {
        if (eventDestinations == null) {
            this.eventDestinations = null;
            return;
        }

        this.eventDestinations = new java.util.ArrayList<EventDestination>(eventDestinations);
    }
1031175
function(event) {
			/*
			 * The event.proposal is an object with this shape:
			 * {   proposal: "[proposal string]", // Actual text of the proposal
			 *     description: "diplay string", // Optional
			 *     positions: [{
			 *         offset: 10, // Offset of start position of parameter i
			 *         length: 3  // Length of parameter string for parameter i
			 *     }], // One object for each parameter; can be null
			 *     escapePosition: 19, // Optional; offset that caret will be placed at after exiting Linked Mode.
			 *     style: 'emphasis', // Optional: either emphasis, noemphasis, hr to provide custom styling for the proposal
			 *     unselectable: false // Optional: if set to true, then this proposal cannnot be selected through the keyboard
			 * }
			 * Offsets are relative to the text buffer.
			 */
			var proposal = event.data.proposal;

			// If escapePosition is not provided, positioned the cursor at the end of the inserted text 
			function escapePosition() {
				if (typeof proposal.escapePosition === "number") { //$NON-NLS-0$
					return proposal.escapePosition;
				}
				return event.data.start + proposal.proposal.length;
			}

			//if the proposal specifies linked positions, build the model and enter linked mode
			if (Array.isArray(proposal.positions) && this.linkedMode) {
				var positionGroups = [];
				proposal.positions.forEach(function(pos) {
					//ignore bad proposal values
					//@see https://bugs.eclipse.org/bugs/show_bug.cgi?id=513146
					if(typeof pos.offset === "number" && typeof pos.length === "number") {
						positionGroups.push({positions: [{offset: pos.offset, length: pos.length}]});
					}
				});
				if(positionGroups.length > 0) {
					this.linkedMode.enterLinkedMode({
						groups: positionGroups,
						escapePosition: escapePosition()
					});
				} else {
					this.editor.getTextView().setCaretOffset(escapePosition());
				}
			} else if (proposal.groups && proposal.groups.length > 0 && this.linkedMode) {
				this.linkedMode.enterLinkedMode({
					groups: proposal.groups,
					escapePosition: escapePosition()
				});
			} else if (typeof proposal.escapePosition === "number") { //$NON-NLS-0$
				//we don't want linked mode, but there is an escape position, so just set cursor position
				this.editor.getTextView().setCaretOffset(proposal.escapePosition);
			}
			return true;
		}
880893
public void onMouseUp(ListenerEvent event) {
		if (clickstart && !dragging) {
			Coordinate worldPosition = event.getWorldPosition();
			Point point = mapWidget.getMapModel().getGeometryFactory().createPoint(worldPosition);

			SearchByLocationRequest request = new SearchByLocationRequest();
			request.setLocation(GeometryConverter.toDto(point));
			request.setCrs(mapWidget.getMapModel().getCrs());
			request.setQueryType(SearchByLocationRequest.QUERY_INTERSECTS);
			request.setSearchType(SearchByLocationRequest.SEARCH_ALL_LAYERS);
			request.setBuffer(calculateBufferFromPixelTolerance());
			request.setFeatureIncludes(GwtCommandDispatcher.getInstance().getLazyFeatureIncludesSelect());
			
			for (Layer<?> layer : mapWidget.getMapModel().getLayers()) {
				if (layer.isShowing() && layer instanceof VectorLayer  && !layersToExclude.contains(layer.getId())) {
					request.addLayerWithFilter(layer.getId(), layer.getServerLayerId(),
							((VectorLayer) layer).getFilter());
				}
			}
			final SearchByPointRequest rasterLayerRequest = new SearchByPointRequest();
			rasterLayerRequest.setLocation(point.getCoordinate());
			rasterLayerRequest.setCrs(mapWidget.getMapModel().getCrs());
			rasterLayerRequest.setSearchType(SearchByPointRequest.SEARCH_ALL_LAYERS);
			rasterLayerRequest.setPixelTolerance(pixelTolerance);
			final Map<String, String> rasterLayerIds = new HashMap<String, String>();
			for (Layer<?> layer : mapWidget.getMapModel().getLayers()) {
				if (layer.isShowing() && layer instanceof RasterLayer && !layersToExclude.contains(layer.getId())) {
					rasterLayerIds.put(layer.getId(), layer.getServerLayerId());
				}
			}
			rasterLayerRequest.setLayerMapping(rasterLayerIds);
			rasterLayerRequest.setBbox(toBbox(mapWidget.getMapModel().getMapView().getBounds()));
			rasterLayerRequest.setScale(mapWidget.getMapModel().getMapView().getCurrentScale());

			GwtCommand commandRequest = new GwtCommand(SearchByLocationRequest.COMMAND);
			commandRequest.setCommandRequest(request);
			// TODO: commands are now chained. Perhaps we should combine this
			// into a single command?
			GwtCommandDispatcher.getInstance().execute(commandRequest, 
								new AbstractCommandCallback<SearchByLocationResponse>() {
				public void execute(final SearchByLocationResponse vectorResponse) {
					if (includeRasterLayers) {
						GwtCommand commandRequest = new GwtCommand(SearchByPointRequest.COMMAND);
						commandRequest.setCommandRequest(rasterLayerRequest);
						GwtCommandDispatcher.getInstance().execute(commandRequest,
								new AbstractCommandCallback<SearchByPointResponse>() {
									public void execute(final SearchByPointResponse rasterResponse) {
										//Featuremap maps client layer on feature
										Map<String, List<org.geomajas.layer.feature.Feature>> featureMap = 
											vectorResponse.getFeatureMap();
										featureMap.putAll(rasterResponse.getFeatureMap());
										showFeatureInfo(featureMap);
									}
								});

					} else {
						showFeatureInfo(vectorResponse.getFeatureMap());
					}
				}
			});

		} else {
			dragging = false;
		}
		clickstart = false;
	}
1238024
public void onFeatureSelected(FeatureSelectedEvent event) {
		Feature feature = event.getFeature();

		// Only select if it is actually deselected:
		boolean selected = false;
		ListGridRecord[] selections = getSelection();
		for (ListGridRecord selection : selections) {
			if (selection.getAttribute(FIELD_NAME_FEATURE_ID).equals(feature.getId())) {
				selected = true;
				break;
			}
		}

		// If deselected, find the correct row and select:
		if (!selected) {
			ListGridRecord[] records = this.getRecords();
			for (int i = 0; i < records.length; i++) {
				if (records[i].getAttribute(FIELD_NAME_FEATURE_ID).equals(feature.getId())) {
					selectRecord(i);
					break;
				}
			}
		}
	}