/** * Fires a open event on all registered handlers in the handler manager.If no * such handlers exist, this method will do nothing. * * @param <S> The event source * @param source the source of the handlers * @param jsObj the native event */ public static <S extends HasIconClickHandlers & HasHandlers> void fire( S source, JavaScriptObject jsObj) { if (TYPE != null) { IconClickEvent event = new IconClickEvent(jsObj); source.fireEvent(event); } }
/** * Add a iconClick handler. * <p> * StringMethod. Default action to fire when the user clicks on a form item icon. May be overridden by setting * <code>click</code> on the form item icon directly. * * @param handler the iconClick handler * @return {@link HandlerRegistration} used to remove this handler */ public HandlerRegistration addIconClickHandler(com.smartgwt.client.widgets.form.fields.events.IconClickHandler handler) { if(getHandlerCount(com.smartgwt.client.widgets.form.fields.events.IconClickEvent.getType()) == 0) setupIconClickEvent(); return doAddHandler(handler, com.smartgwt.client.widgets.form.fields.events.IconClickEvent.getType()); }
public void onIconClick(IconClickEvent iconClickEvent) { FormItemIcon icon = iconClickEvent.getIcon(); if (GeocoderLayout.showClearIcon && clearIcon.getSrc().equals(icon.getSrc())) { presenter.clearLocation(); } else { presenter.goToLocation((String) textItem.getValue()); } } });