@Command @NotifyChange({"miceData", "firstMarkersvm", "secondMarkersvm", "infovm"}) public void infoChangeEvent(@ContextParam(ContextType.BIND_CONTEXT) BindContext ctx) { InfoChangeEvent event = (InfoChangeEvent) ctx.getTriggerEvent(); _mapsvm.setMiceData(event); Ginfo info = event.getInfo(); if (info instanceof Gmarker) _markersvmMap.get(info.getId()).setOpen(false); else _infovm.setOpen(false); }
@Command @NotifyChange({"mmeData", "firstMarkersvm", "secondMarkersvm"}) public void mapMouseEvent(@ContextParam(ContextType.BIND_CONTEXT) BindContext ctx) { MapMouseEvent event = (MapMouseEvent) ctx.getTriggerEvent(); _mapsvm.setMmeData(event); if ("onMapClick".equals(event.getName()) && (event.getReference() instanceof Gmarker)) { GmarkersVM vm = _markersvmMap.get(((Gmarker) event.getReference()).getId()); if (!vm.getOpen()) vm.setOpen(true); } }
@Command @NotifyChange({"mdeData", "firstMarkersvm", "secondMarkersvm"}) public void mapDropEvent(@ContextParam(ContextType.BIND_CONTEXT) BindContext ctx) { MapDropEvent event = (MapDropEvent) ctx.getTriggerEvent(); _mapsvm.setMdeData(event); if (event.getDragged() instanceof Gmarker) { GmarkersVM vm = _markersvmMap.get(((Gmarker) event.getDragged()).getId()); vm.setLat(event.getLat()); vm.setLng(event.getLng()); } }
/** * Given a Boolean value and return associated "true" object if true; or "false" object if null or * false * * @param val the boolean value to be checked. * @param comp associate Component * @param ctx bind context for associate {@link Binding} and extra parameter (e.g. true and false) * @return the converted "true" object if true; or "false" object if null or false. */ public Object coerceToUi(Object val, Component comp, BindContext ctx) { final Object trueObj = ctx.getConverterArg("true"); final Object falseObj = ctx.getConverterArg("false"); final Boolean b = (Boolean) val; return b != null && b.booleanValue() ? trueObj : falseObj; }
/** * Given an object value and return whether it is a "true" object. * * @param val the object to be checked if a true object * @param comp associated Component * @param ctx bind context for associate {@link Binding} and extra parameter (e.g. true and false) * @return the converted Boolean object */ public Object coerceToBean(Object val, Component comp, BindContext ctx) { final Object trueObj = ctx.getConverterArg("true"); return Boolean.valueOf(Objects.equals(val, trueObj)); }
@Command @NotifyChange("mzeData") public void mapZoomEvent(@ContextParam(ContextType.BIND_CONTEXT) BindContext ctx) { _mapsvm.setMzeData((MapZoomEvent) ctx.getTriggerEvent()); }
public void setBindContext(BindContext ctx) { _bindContext = ctx; _types.add(new Type(ctx.getClass(), _bindContext)); }