コード例 #1
0
 @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);
 }
コード例 #2
0
 @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);
   }
 }
コード例 #3
0
 @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());
   }
 }
コード例 #4
0
ファイル: ObjectBooleanConverter.java プロジェクト: zkoss/zk
 /**
  * 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;
 }
コード例 #5
0
ファイル: ObjectBooleanConverter.java プロジェクト: zkoss/zk
 /**
  * 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));
 }
コード例 #6
0
 @Command
 @NotifyChange("mzeData")
 public void mapZoomEvent(@ContextParam(ContextType.BIND_CONTEXT) BindContext ctx) {
   _mapsvm.setMzeData((MapZoomEvent) ctx.getTriggerEvent());
 }
コード例 #7
0
ファイル: ParamCall.java プロジェクト: howardroark2018/zk
 public void setBindContext(BindContext ctx) {
   _bindContext = ctx;
   _types.add(new Type(ctx.getClass(), _bindContext));
 }