Ejemplo n.º 1
0
 public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
   if (ctx.Match(k, Invk_new_dflt__at_dflt__focus_y)) this.New_dflt(Bool_.Y);
   else if (ctx.Match(k, Invk_new_link__at_dflt__focus_n))
     this.New_link(Bool_.N, m.ReadStrOr("v", null));
   else if (ctx.Match(k, Invk_new_link__at_dflt__focus_y))
     this.New_link(Bool_.Y, m.ReadStrOr("v", null));
   else if (ctx.Match(k, Invk_new_href__at_dflt__focus_y)) this.New_href(Bool_.Y);
   else if (ctx.Match(k, Invk_new_dupe__at_dflt__focus_y)) this.New_dupe(Bool_.Y);
   else if (ctx.Match(k, Invk_close_cur)) this.Close_cur();
   else if (ctx.Match(k, Invk_select_bwd)) this.Select_bwd();
   else if (ctx.Match(k, Invk_select_fwd)) this.Select_fwd();
   else if (ctx.Match(k, Invk_move_bwd)) this.Move_bwd();
   else if (ctx.Match(k, Invk_move_fwd)) this.Move_fwd();
   else if (ctx.Match(k, Invk_close_others)) this.Close_others();
   else if (ctx.Match(k, Invk_close_to_bgn)) this.Close_to_bgn();
   else if (ctx.Match(k, Invk_close_to_end)) this.Close_to_end();
   else if (ctx.Match(k, Invk_close_undo)) this.Close_undo();
   else if (ctx.Match(k, Invk_pin_toggle)) this.Pin_toggle();
   else if (ctx.Match(k, Invk_select_by_idx_1)) this.Select_by_idx(1);
   else if (ctx.Match(k, Invk_select_by_idx_2)) this.Select_by_idx(2);
   else if (ctx.Match(k, Invk_select_by_idx_3)) this.Select_by_idx(3);
   else if (ctx.Match(k, Invk_select_by_idx_4)) this.Select_by_idx(4);
   else if (ctx.Match(k, Invk_select_by_idx_5)) this.Select_by_idx(5);
   else if (ctx.Match(k, Invk_select_by_idx_6)) this.Select_by_idx(6);
   else if (ctx.Match(k, Invk_select_by_idx_7)) this.Select_by_idx(7);
   else if (ctx.Match(k, Invk_select_by_idx_8)) this.Select_by_idx(8);
   else if (ctx.Match(k, Invk_select_by_idx_9)) this.Select_by_idx(9);
   else return GfoInvkAble_.Rv_unhandled;
   return this;
 }
Ejemplo n.º 2
0
 static void Args_reset(GfoMsg owner) {
   int len = owner.Subs_count();
   for (int i = 0; i < len; i++) {
     GfoMsg sub = owner.Subs_getAt(i);
     sub.Args_reset();
   }
 }
Ejemplo n.º 3
0
 public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
   if (ctx.Match(k, Invk_version)) return Xoa_app_.Version;
   else if (ctx.Match(k, Invk_build_date)) return Xoa_app_.Build_date;
   else if (ctx.Match(k, Invk_free_mem_when_))
     free_mem_when = gplx.core.ios.Io_size_.parse_or(m.ReadStr("v"), Io_mgr.Len_mb * 5);
   else if (ctx.Match(k, Invk_lang)) return lang_key;
   else if (ctx.Match(k, Invk_lang_)) Lang_(m.ReadBry("v"));
   else if (ctx.Match(k, Invk_lang_list)) return Options_lang_list();
   else if (ctx.Match(k, Invk_options_version)) return options_version;
   else if (ctx.Match(k, Invk_options_version_)) options_version = m.ReadInt("v");
   else return Gfo_invk_.Rv_unhandled;
   return this;
 }
Ejemplo n.º 4
0
 public GfoMsg CloneNew() {
   GfoMsg_base rv = new GfoMsg_base().ctor_(key, parse);
   if (args != null) {
     rv.args = List_adp_.New();
     for (int i = 0; i < args.Count(); i++) rv.args.Add(args.Get_at(i));
   }
   if (subs != null) {
     rv.subs = List_adp_.New();
     for (int i = 0; i < args.Count(); i++) {
       GfoMsg sub = (GfoMsg) args.Get_at(i);
       rv.subs.Add(sub.CloneNew()); // NOTE: recursion
     }
   }
   return rv;
 }
Ejemplo n.º 5
0
 public static void Rcvd(TabBox tabBox, GfsCtx ctx, GfoMsg m) {
   TabPnlItm itm = (TabPnlItm) m.CastObj("v");
   GfuiBtn btn = GfuiBtn_.as_(tabBox.BtnBox().SubElems().Get_by(itm.Key()));
   if (btn
       != null) // HACK: check needed b/c Gfds will raise UpdateCaption event before Creating tab
   btn.Text_(itm.Name()).TipText_(itm.Name());
 }
Ejemplo n.º 6
0
 public static GfoMsg root_leafArgs_(String[] ary, Keyval... kvAry) {
   int len = Array_.Len(ary);
   if (len == 0) throw Err_.new_invalid_arg("== 0", "@len", len);
   GfoMsg root = new GfoMsg_base().ctor_(ary[0], false);
   GfoMsg owner = root;
   for (int i = 1; i < len; i++) {
     String key = ary[i];
     GfoMsg cur = new GfoMsg_base().ctor_(key, false);
     owner.Subs_add(cur);
     owner = cur;
   }
   for (int i = 0; i < kvAry.length; i++) {
     Keyval kv = kvAry[i];
     owner.Add(kv.Key(), kv.Val());
   }
   return root;
 }
Ejemplo n.º 7
0
 public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
   if (ctx.Match(k, Invk_go_bwd)) this.Go_bwd();
   else if (ctx.Match(k, Invk_go_fwd)) this.Go_fwd();
   else if (ctx.Match(k, Invk_goto)) this.Goto(m.ReadStr("v"));
   else if (ctx.Match(k, Invk_wiki)) return wiki;
   else return GfoInvkAble_.Rv_unhandled;
   return this;
 }
Ejemplo n.º 8
0
 void To_str(String_bldr sb, XtoStrWkr wkr, GfoMsg m) {
   sb.Add(m.Key());
   if (m.Subs_count() == 0) {
     sb.Add(":");
     boolean first = true;
     for (int i = 0; i < m.Args_count(); i++) {
       Keyval kv = m.Args_getAt(i);
       if (kv.Val() == null) continue;
       if (!first) sb.Add(" ");
       sb.Add(kv.Key());
       sb.Add("='");
       sb.Add(wkr.To_str(kv.Val()));
       sb.Add("'");
       first = false;
     }
     sb.Add(";");
   } else {
     sb.Add(".");
     To_str(sb, wkr, m.Subs_getAt(0));
   }
 }
Ejemplo n.º 9
0
 public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
   if (ctx.Match(k, Invk_clear)) this.Clear();
   else if (ctx.Match(k, Invk_separators)) return separators_mgr;
   else if (ctx.Match(k, Invk_digits)) {
     digits_translate = true;
     return digits_mgr;
   } // NOTE: only langes with a digit_transform_table will call digits; DATE:2014-05-28
   else if (ctx.Match(k, Invk_digit_grouping_pattern))
     return String_.new_u8(num_grp_fmtr.Digit_grouping_pattern());
   else if (ctx.Match(k, Invk_digit_grouping_pattern_))
     num_grp_fmtr.Digit_grouping_pattern_(m.ReadBry("v"));
   else return Gfo_invk_.Rv_unhandled;
   return this;
 }
Ejemplo n.º 10
0
  public static GfoMsg chain_(GfoMsg owner, String key) {
    GfoMsg sub = owner;
    List_adp list = List_adp_.New();
    list.Add(sub.Key());
    while (sub != null) {
      if (sub.Subs_count() == 0) break;
      sub = (GfoMsg) sub.Subs_getAt(0);
      list.Add(sub.Key());
    }
    list.Add(key);

    GfoMsg root = GfoMsg_.new_parse_((String) list.Get_at(0));
    GfoMsg cur = root;
    for (int i = 1; i < list.Count(); i++) {
      String k = (String) list.Get_at(i);
      GfoMsg mm = GfoMsg_.new_parse_(k);
      cur.Subs_add(mm);
      cur = mm;
    }
    return root;
  }
Ejemplo n.º 11
0
 public static GfoMsg basic_(String cmd, Object... vals) {
   GfoMsg rv = new_cast_(cmd);
   int len = vals.length;
   for (int i = 0; i < len; i++) rv.Add("", vals[i]);
   return rv;
 }
Ejemplo n.º 12
0
 public static GfoMsg srl_(GfoMsg owner, String key) {
   GfoMsg rv = new_parse_(key);
   owner.Subs_add(rv);
   return rv;
 }
 @Override
 public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
   if (ctx.Match(k, Invk_tier_id_bmk_)) tier_id_bmk = m.ReadInt("v");
   else if (ctx.Match(k, Invk_page_id_bmk_)) page_id_bmk = m.ReadInt("v");
   else if (ctx.Match(k, Invk_lnki_id_bmk_)) lnki_id_bmk = m.ReadInt("v");
   else if (ctx.Match(k, Invk_select_interval_)) select_interval = m.ReadInt("v");
   else if (ctx.Match(k, Invk_commit_interval_)) commit_interval = m.ReadInt("v");
   else if (ctx.Match(k, Invk_progress_interval_)) progress_interval = m.ReadInt("v");
   else if (ctx.Match(k, Invk_delete_interval_)) delete_interval = m.ReadInt("v");
   else if (ctx.Match(k, Invk_exec_count_max_)) exec_count_max = m.ReadInt("v");
   else if (ctx.Match(k, Invk_exec_fail_max_)) exec_fail_max = m.ReadInt("v");
   else if (ctx.Match(k, Invk_exit_after_commit_)) exit_after_commit = m.ReadYn("v");
   else if (ctx.Match(k, Invk_exit_now_)) exit_now = m.ReadYn("v");
   else if (ctx.Match(k, Invk_resume_enabled_)) resume_enabled = m.ReadYn("v");
   else if (ctx.Match(k, Invk_ns_ids_)) ns_ids = Int_.Ary_parse(m.ReadStr("v"), "|");
   else if (ctx.Match(k, Invk_src_bin_mgr__fsdb_version_))
     src_bin_mgr__fsdb_version = m.ReadStr("v");
   else if (ctx.Match(k, Invk_src_bin_mgr__fsdb_skip_wkrs_))
     src_bin_mgr__fsdb_skip_wkrs = m.ReadStrAry("v", "|");
   else if (ctx.Match(k, Invk_src_bin_mgr__wmf_enabled_)) src_bin_mgr__wmf_enabled = m.ReadYn("v");
   else if (ctx.Match(k, Invk_src_bin_mgr__cache_enabled_))
     src_bin_mgr__cache_enabled = m.ReadYn("v");
   else if (ctx.Match(k, Invk_trg_bin_mgr__fsdb_version_))
     trg_bin_mgr__fsdb_version = m.ReadStr("v");
   else if (ctx.Match(k, Invk_poll_mgr)) return poll_mgr;
   else if (ctx.Match(k, Invk_download_keep_tier_ids))
     download_keep_tier_ids = Int_.Ary_parse(m.ReadStr("v"), "|");
   else if (ctx.Match(k, Invk_download_size_max))
     download_size_max = Io_size_.To_long_by_msg_mb(m, download_size_max);
   else return Gfo_invk_.Rv_unhandled;
   return this;
 }
 public static TabBoxEvt_orderChanged Handle(GfsCtx ctx, GfoMsg m) {
   TabBoxEvt_orderChanged rv = new TabBoxEvt_orderChanged();
   rv.curIdx = m.ReadInt("curIdx");
   rv.newIdx = m.ReadInt("newIdx");
   return rv;
 }
Ejemplo n.º 15
0
 public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
   if (ctx.Match(k, GxwElem_lang.AlignH_cmd)) AlignH_(GfuiAlign_.cast(m.CastObj("v")));
   return txt_box.Invk(ctx, ikey, k, m);
 }