mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
v2.10.3.1
This commit is contained in:
57
400_xowa/src/gplx/xowa/guis/menus/Xog_menu_mgr.java
Normal file
57
400_xowa/src/gplx/xowa/guis/menus/Xog_menu_mgr.java
Normal file
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012 gnosygnu@gmail.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.guis.menus; import gplx.*; import gplx.xowa.*; import gplx.xowa.guis.*;
|
||||
import gplx.xowa.guis.menus.dom.*;
|
||||
import gplx.xowa.langs.*;
|
||||
public class Xog_menu_mgr implements GfoInvkAble {
|
||||
private Xoae_app app;
|
||||
public Xog_menu_mgr(Xoa_gui_mgr gui_mgr) {
|
||||
menu_bldr = new Xog_mnu_bldr();
|
||||
regy = new Xog_mnu_regy(gui_mgr);
|
||||
popup_mnu_mgr = new Xog_popup_mnu_mgr(gui_mgr, this);
|
||||
window_mnu_mgr = new Xog_window_mnu_mgr(gui_mgr, this);
|
||||
}
|
||||
public Xog_mnu_regy Regy() {return regy;} private Xog_mnu_regy regy;
|
||||
public Xog_popup_mnu_mgr Popup() {return popup_mnu_mgr;} private Xog_popup_mnu_mgr popup_mnu_mgr;
|
||||
public Xog_window_mnu_mgr Window() {return window_mnu_mgr;} private Xog_window_mnu_mgr window_mnu_mgr;
|
||||
public Xog_mnu_bldr Menu_bldr() {return menu_bldr;} private Xog_mnu_bldr menu_bldr;
|
||||
public void Init_by_app(Xoae_app app) {
|
||||
this.app = app;
|
||||
regy.Init_by_app(app);
|
||||
}
|
||||
public void Init_by_kit() {
|
||||
try {
|
||||
if (!app.Mode().Tid_is_gui()) return; // NOTE: do not try to initialize menu if http_server; will fail in headless mode when it tries to load SWT images; DATE:2015-03-27
|
||||
popup_mnu_mgr.Init_by_kit();
|
||||
window_mnu_mgr.Init_by_kit();
|
||||
Lang_changed(app.Usere().Lang());
|
||||
}
|
||||
catch (Exception e) { // ignore errors while loading custom menus, else fatal error; DATE:2014-07-01
|
||||
app.Usr_dlg().Warn_many("", "", "error while loading menus; err=~{0}", Err_.Message_gplx_full(e));
|
||||
}
|
||||
}
|
||||
public void Lang_changed(Xol_lang_itm lang) {
|
||||
window_mnu_mgr.Lang_changed(lang);
|
||||
popup_mnu_mgr.Lang_changed(lang);
|
||||
}
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Invk_contexts)) return popup_mnu_mgr;
|
||||
else if (ctx.Match(k, Invk_windows)) return window_mnu_mgr;
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
} private static final String Invk_contexts = "contexts", Invk_windows = "windows";
|
||||
}
|
||||
247
400_xowa/src/gplx/xowa/guis/menus/Xog_menu_mnu_src.java
Normal file
247
400_xowa/src/gplx/xowa/guis/menus/Xog_menu_mnu_src.java
Normal file
@@ -0,0 +1,247 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012 gnosygnu@gmail.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.guis.menus; import gplx.*; import gplx.xowa.*; import gplx.xowa.guis.*;
|
||||
import gplx.xowa.guis.cmds.*;
|
||||
class Xog_menu_mgr_src {
|
||||
public static final String Browser_win
|
||||
= Xog_menu_bldr.Instance
|
||||
. Add_grp_bgn(Xog_cmd_itm_.Key_gui_menus_group_file)
|
||||
. Add_btn(Xog_cmd_itm_.Key_gui_browser_tabs_new_dflt__at_dflt__focus_y)
|
||||
. Add_btn(Xog_cmd_itm_.Key_gui_browser_tabs_close_cur)
|
||||
. Add_spr()
|
||||
. Add_btn(Xog_cmd_itm_.Key_gui_page_view_save_as)
|
||||
. Add_btn(Xog_cmd_itm_.Key_gui_page_view_print)
|
||||
. Add_btn(Xog_cmd_itm_.Key_app_exit)
|
||||
. Add_grp_end()
|
||||
. Add_grp_bgn(Xog_cmd_itm_.Key_gui_menus_group_edit)
|
||||
. Add_btn(Xog_cmd_itm_.Key_gui_page_selection_select_all)
|
||||
. Add_btn(Xog_cmd_itm_.Key_gui_page_selection_copy)
|
||||
. Add_spr()
|
||||
. Add_btn(Xog_cmd_itm_.Key_gui_browser_find_show)
|
||||
. Add_grp_end()
|
||||
. Add_grp_bgn(Xog_cmd_itm_.Key_gui_menus_group_view)
|
||||
. Add_btn(Xog_cmd_itm_.Key_gui_font_increase)
|
||||
. Add_btn(Xog_cmd_itm_.Key_gui_font_decrease)
|
||||
. Add_btn(Xog_cmd_itm_.Key_gui_font_reset)
|
||||
. Add_spr()
|
||||
. Add_btn(Xog_cmd_itm_.Key_gui_page_view_mode_read)
|
||||
. Add_btn(Xog_cmd_itm_.Key_gui_page_view_mode_edit)
|
||||
. Add_btn(Xog_cmd_itm_.Key_gui_page_view_mode_html)
|
||||
. Add_spr()
|
||||
. Add_btn(Xog_cmd_itm_.Key_gui_page_view_reload)
|
||||
. Add_spr()
|
||||
. Add_btn(Xog_cmd_itm_.Key_gui_browser_prog_log_show)
|
||||
. Add_grp_end()
|
||||
. Add_grp_bgn(Xog_cmd_itm_.Key_gui_menus_group_history)
|
||||
. Add_btn(Xog_cmd_itm_.Key_nav_go_bwd)
|
||||
. Add_btn(Xog_cmd_itm_.Key_nav_go_fwd)
|
||||
. Add_spr()
|
||||
. Add_btn(Xog_cmd_itm_.Key_usr_history_show)
|
||||
. Add_grp_end()
|
||||
. Add_grp_bgn(Xog_cmd_itm_.Key_gui_menus_group_bookmarks)
|
||||
. Add_btn(Xog_cmd_itm_.Key_nav_wiki_main_page)
|
||||
. Add_spr()
|
||||
. Add_btn(Xog_cmd_itm_.Key_usr_bookmarks_add)
|
||||
. Add_btn(Xog_cmd_itm_.Key_usr_bookmarks_show)
|
||||
. Add_grp_end()
|
||||
. Add_grp_bgn(Xog_cmd_itm_.Key_gui_menus_group_tools)
|
||||
. Add_btn(Xog_cmd_itm_.Key_nav_cfg_main)
|
||||
. Add_spr()
|
||||
. Add_btn(Xog_cmd_itm_.Key_nav_setup_import_from_list)
|
||||
. Add_btn(Xog_cmd_itm_.Key_nav_setup_import_from_script)
|
||||
. Add_spr()
|
||||
. Add_btn(Xog_cmd_itm_.Key_nav_setup_maintenance)
|
||||
. Add_btn(Xog_cmd_itm_.Key_nav_setup_download)
|
||||
. Add_grp_end()
|
||||
. Add_grp_bgn(Xog_cmd_itm_.Key_gui_menus_group_help)
|
||||
. Add_btn(Xog_cmd_itm_.Key_nav_help_help)
|
||||
. Add_btn(Xog_cmd_itm_.Key_nav_help_xowa_main)
|
||||
. Add_btn(Xog_cmd_itm_.Key_nav_help_change_log)
|
||||
. Add_btn(Xog_cmd_itm_.Key_nav_help_diagnostics)
|
||||
. Add_btn(Xog_cmd_itm_.Key_nav_cfg_menu)
|
||||
. Add_spr()
|
||||
. Add_grp_bgn(Xog_cmd_itm_.Key_gui_menus_group_system_data)
|
||||
. Add_btn(Xog_cmd_itm_.Key_nav_system_data_log_session)
|
||||
. Add_btn(Xog_cmd_itm_.Key_nav_system_data_cfg_app)
|
||||
. Add_btn(Xog_cmd_itm_.Key_nav_system_data_cfg_lang)
|
||||
. Add_btn(Xog_cmd_itm_.Key_nav_system_data_cfg_user)
|
||||
. Add_btn(Xog_cmd_itm_.Key_nav_system_data_cfg_custom)
|
||||
. Add_btn(Xog_cmd_itm_.Key_nav_system_data_usr_history)
|
||||
. Add_grp_end()
|
||||
. Add_spr()
|
||||
. Add_btn(Xog_cmd_itm_.Key_nav_help_about)
|
||||
. Add_grp_end()
|
||||
. Gen_str();
|
||||
public static final String Html_page
|
||||
= Xog_menu_bldr.Instance
|
||||
. Add_btn(Xog_cmd_itm_.Key_nav_go_bwd)
|
||||
. Add_btn(Xog_cmd_itm_.Key_nav_go_fwd)
|
||||
. Add_spr()
|
||||
. Add_btn(Xog_cmd_itm_.Key_gui_page_view_reload)
|
||||
. Add_spr()
|
||||
. Add_btn(Xog_cmd_itm_.Key_gui_page_selection_select_all)
|
||||
. Add_spr()
|
||||
. Add_btn(Xog_cmd_itm_.Key_gui_font_increase)
|
||||
. Add_btn(Xog_cmd_itm_.Key_gui_font_decrease)
|
||||
. Add_btn(Xog_cmd_itm_.Key_gui_font_reset)
|
||||
. Add_spr()
|
||||
. Add_grp_bgn(Xog_cmd_itm_.Key_gui_menus_group_file)
|
||||
. Add_btn(Xog_cmd_itm_.Key_gui_page_view_save_as)
|
||||
// . Add_btn(Xog_cmd_itm_.Key_gui_page_view_print)
|
||||
. Add_btn(Xog_cmd_itm_.Key_app_exit)
|
||||
. Add_grp_end()
|
||||
. Add_grp_bgn(Xog_cmd_itm_.Key_gui_menus_group_tabs)
|
||||
. Add_btn(Xog_cmd_itm_.Key_gui_browser_tabs_new_dflt__at_dflt__focus_y)
|
||||
. Add_btn(Xog_cmd_itm_.Key_gui_browser_tabs_new_dupe__at_dflt__focus_y)
|
||||
. Add_btn(Xog_cmd_itm_.Key_gui_browser_tabs_close_cur)
|
||||
. Add_spr()
|
||||
. Add_btn(Xog_cmd_itm_.Key_gui_browser_tabs_select_fwd)
|
||||
. Add_btn(Xog_cmd_itm_.Key_gui_browser_tabs_select_bwd)
|
||||
. Add_spr()
|
||||
. Add_btn(Xog_cmd_itm_.Key_gui_browser_tabs_move_fwd)
|
||||
. Add_btn(Xog_cmd_itm_.Key_gui_browser_tabs_move_bwd)
|
||||
. Add_spr()
|
||||
. Add_btn(Xog_cmd_itm_.Key_gui_browser_tabs_close_others)
|
||||
. Add_btn(Xog_cmd_itm_.Key_gui_browser_tabs_close_to_bgn)
|
||||
. Add_btn(Xog_cmd_itm_.Key_gui_browser_tabs_close_to_end)
|
||||
. Add_spr()
|
||||
. Add_btn(Xog_cmd_itm_.Key_gui_browser_tabs_close_undo)
|
||||
. Add_grp_end()
|
||||
. Add_grp_bgn(Xog_cmd_itm_.Key_gui_menus_group_view)
|
||||
. Add_btn(Xog_cmd_itm_.Key_gui_page_view_mode_read)
|
||||
. Add_btn(Xog_cmd_itm_.Key_gui_page_view_mode_edit)
|
||||
. Add_btn(Xog_cmd_itm_.Key_gui_page_view_mode_html)
|
||||
. Add_spr()
|
||||
. Add_btn(Xog_cmd_itm_.Key_gui_browser_prog_log_show)
|
||||
. Add_grp_end()
|
||||
. Add_grp_bgn(Xog_cmd_itm_.Key_gui_menus_group_history)
|
||||
. Add_btn(Xog_cmd_itm_.Key_usr_history_show)
|
||||
. Add_grp_end()
|
||||
. Add_grp_bgn(Xog_cmd_itm_.Key_gui_menus_group_bookmarks)
|
||||
. Add_btn(Xog_cmd_itm_.Key_nav_wiki_main_page)
|
||||
. Add_spr()
|
||||
. Add_btn(Xog_cmd_itm_.Key_usr_bookmarks_add)
|
||||
. Add_btn(Xog_cmd_itm_.Key_usr_bookmarks_show)
|
||||
. Add_grp_end()
|
||||
. Add_grp_bgn(Xog_cmd_itm_.Key_gui_menus_group_tools)
|
||||
. Add_btn(Xog_cmd_itm_.Key_nav_cfg_main)
|
||||
. Add_spr()
|
||||
. Add_btn(Xog_cmd_itm_.Key_nav_setup_import_from_list)
|
||||
. Add_btn(Xog_cmd_itm_.Key_nav_setup_import_from_script)
|
||||
. Add_spr()
|
||||
. Add_btn(Xog_cmd_itm_.Key_nav_setup_maintenance)
|
||||
. Add_btn(Xog_cmd_itm_.Key_nav_setup_download)
|
||||
. Add_grp_end()
|
||||
. Add_grp_bgn(Xog_cmd_itm_.Key_gui_menus_group_help)
|
||||
. Add_btn(Xog_cmd_itm_.Key_nav_help_help)
|
||||
. Add_btn(Xog_cmd_itm_.Key_nav_help_xowa_main)
|
||||
. Add_btn(Xog_cmd_itm_.Key_nav_help_change_log)
|
||||
. Add_btn(Xog_cmd_itm_.Key_nav_help_diagnostics)
|
||||
. Add_btn(Xog_cmd_itm_.Key_nav_cfg_menu)
|
||||
. Add_spr()
|
||||
. Add_btn(Xog_cmd_itm_.Key_nav_help_about)
|
||||
. Add_grp_end()
|
||||
. Gen_str();
|
||||
|
||||
public static final String Html_link
|
||||
= Xog_menu_bldr.Instance
|
||||
. Add_btn(Xog_cmd_itm_.Key_gui_browser_tabs_new_link__at_dflt__focus_n)
|
||||
. Add_btn(Xog_cmd_itm_.Key_gui_browser_tabs_new_link__at_dflt__focus_y)
|
||||
. Add_spr()
|
||||
. Add_btn(Xog_cmd_itm_.Key_gui_page_selection_copy)
|
||||
. Add_btn(Xog_cmd_itm_.Key_gui_browser_find_show_by_paste)
|
||||
. Gen_str();
|
||||
public static final String Html_file
|
||||
= Xog_menu_bldr.Instance
|
||||
. Add_btn(Xog_cmd_itm_.Key_gui_browser_tabs_new_link__at_dflt__focus_n)
|
||||
. Add_btn(Xog_cmd_itm_.Key_gui_browser_tabs_new_link__at_dflt__focus_y)
|
||||
. Add_spr()
|
||||
. Add_btn(Xog_cmd_itm_.Key_gui_page_selection_save_file_as)
|
||||
. Gen_str();
|
||||
public static final String Tabs_btns
|
||||
= Xog_menu_bldr.Instance
|
||||
. Add_btn(Xog_cmd_itm_.Key_gui_browser_tabs_new_dflt__at_dflt__focus_y)
|
||||
. Add_btn(Xog_cmd_itm_.Key_gui_browser_tabs_new_dupe__at_dflt__focus_y)
|
||||
. Add_btn(Xog_cmd_itm_.Key_gui_browser_tabs_close_cur)
|
||||
. Add_spr()
|
||||
. Add_btn(Xog_cmd_itm_.Key_gui_browser_tabs_select_fwd)
|
||||
. Add_btn(Xog_cmd_itm_.Key_gui_browser_tabs_select_bwd)
|
||||
. Add_spr()
|
||||
. Add_btn(Xog_cmd_itm_.Key_gui_browser_tabs_move_fwd)
|
||||
. Add_btn(Xog_cmd_itm_.Key_gui_browser_tabs_move_bwd)
|
||||
. Add_spr()
|
||||
. Add_btn(Xog_cmd_itm_.Key_gui_browser_tabs_close_others)
|
||||
. Add_btn(Xog_cmd_itm_.Key_gui_browser_tabs_close_to_bgn)
|
||||
. Add_btn(Xog_cmd_itm_.Key_gui_browser_tabs_close_to_end)
|
||||
. Add_spr()
|
||||
. Add_btn(Xog_cmd_itm_.Key_gui_browser_tabs_close_undo)
|
||||
. Gen_str();
|
||||
public static final String Prog
|
||||
= Xog_menu_bldr.Instance
|
||||
. Add_btn(Xog_cmd_itm_.Key_gui_browser_prog_log_show)
|
||||
. Gen_str();
|
||||
public static final String Info = String_.Concat_lines_nl
|
||||
( ""
|
||||
);
|
||||
}
|
||||
class Xog_menu_bldr {
|
||||
private int indent = 0;
|
||||
private Bry_bfr bfr = Bry_bfr.reset_(0);
|
||||
public String Gen_str() {return bfr.To_str_and_clear();}
|
||||
private Xog_menu_bldr Indent_add() {indent += 2; return this;}
|
||||
private Xog_menu_bldr Indent_del() {indent -= 2; return this;}
|
||||
private void Indent() {
|
||||
if (indent > 0)
|
||||
bfr.Add_byte_repeat(Byte_ascii.Space, indent);
|
||||
}
|
||||
public Xog_menu_bldr Add_spr() {
|
||||
Indent();
|
||||
bfr.Add(Const_spr);
|
||||
return this;
|
||||
}
|
||||
public Xog_menu_bldr Add_grp_bgn(String key) {
|
||||
Indent();
|
||||
bfr.Add(Const_itm_grp_bgn_lhs);
|
||||
bfr.Add_str(key);
|
||||
bfr.Add(Const_itm_grp_bgn_rhs);
|
||||
Indent_add();
|
||||
return this;
|
||||
}
|
||||
public Xog_menu_bldr Add_grp_end() {
|
||||
Indent_del();
|
||||
Indent();
|
||||
bfr.Add(Const_itm_grp_end);
|
||||
return this;
|
||||
}
|
||||
public Xog_menu_bldr Add_btn(String key) {
|
||||
Indent();
|
||||
bfr.Add(Const_itm_btn_bgn_lhs);
|
||||
bfr.Add_str(key);
|
||||
bfr.Add(Const_itm_btn_bgn_rhs);
|
||||
return this;
|
||||
}
|
||||
private static final byte[]
|
||||
Const_spr = Bry_.new_a7("add_spr;\n")
|
||||
, Const_itm_btn_bgn_lhs = Bry_.new_a7("add_btn_default('")
|
||||
, Const_itm_btn_bgn_rhs = Bry_.new_a7("');\n")
|
||||
, Const_itm_grp_bgn_lhs = Bry_.new_a7("add_grp_default('")
|
||||
, Const_itm_grp_bgn_rhs = Bry_.new_a7("') {\n")
|
||||
, Const_itm_grp_end = Bry_.new_a7("}\n")
|
||||
;
|
||||
public static final Xog_menu_bldr Instance = new Xog_menu_bldr(); Xog_menu_bldr() {}
|
||||
}
|
||||
69
400_xowa/src/gplx/xowa/guis/menus/Xog_popup_mnu_mgr.java
Normal file
69
400_xowa/src/gplx/xowa/guis/menus/Xog_popup_mnu_mgr.java
Normal file
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012 gnosygnu@gmail.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.guis.menus; import gplx.*; import gplx.xowa.*; import gplx.xowa.guis.*;
|
||||
import gplx.xowa.guis.menus.dom.*;
|
||||
import gplx.xowa.langs.*;
|
||||
public class Xog_popup_mnu_mgr implements GfoInvkAble {
|
||||
private Ordered_hash hash = Ordered_hash_.New();
|
||||
private Xoa_gui_mgr gui_mgr;
|
||||
private Xog_mnu_grp[] mnus = new Xog_mnu_grp[6];
|
||||
public Xog_popup_mnu_mgr(Xoa_gui_mgr gui_mgr, Xog_menu_mgr menu_mgr) {
|
||||
this.gui_mgr = gui_mgr;
|
||||
html_page = Ctor(0, Root_key_html_page, Xog_menu_mgr_src.Html_page); // NOTE: default menu; always build first; NOTE: set default here (fires before cfg)
|
||||
html_link = Ctor(1, Root_key_html_link, Xog_menu_mgr_src.Html_link);
|
||||
html_file = Ctor(2, Root_key_html_file, Xog_menu_mgr_src.Html_file);
|
||||
tabs_btns = Ctor(3, Root_key_tabs_btns, Xog_menu_mgr_src.Tabs_btns);
|
||||
prog = Ctor(4, Root_key_prog, Xog_menu_mgr_src.Prog);
|
||||
info = Ctor(5, Root_key_info, Xog_menu_mgr_src.Info);
|
||||
}
|
||||
public Xog_mnu_grp Tabs_btns() {return tabs_btns;} private Xog_mnu_grp tabs_btns;
|
||||
public Xog_mnu_grp Html_page() {return html_page;} private Xog_mnu_grp html_page;
|
||||
public Xog_mnu_grp Html_link() {return html_link;} private Xog_mnu_grp html_link;
|
||||
public Xog_mnu_grp Html_file() {return html_file;} private Xog_mnu_grp html_file;
|
||||
public Xog_mnu_grp Prog() {return prog;} private Xog_mnu_grp prog;
|
||||
public Xog_mnu_grp Info() {return info;} private Xog_mnu_grp info;
|
||||
public void Init_by_kit() {
|
||||
for (int i = 0; i < mnus.length; i++)
|
||||
mnus[i].Source_exec(gui_mgr.App().Gfs_mgr()); // NOTE: build menu now; NOTE: do not set default here, or else will override user setting
|
||||
}
|
||||
public void Lang_changed(Xol_lang_itm lang) {
|
||||
for (int i = 0; i < mnus.length; i++)
|
||||
Xog_mnu_base.Update_grp_by_lang(gui_mgr.Menu_mgr().Menu_bldr(), lang, mnus[i]);
|
||||
}
|
||||
public Xog_mnu_grp Get_or_new(String key) {
|
||||
Xog_mnu_grp rv = (Xog_mnu_grp)hash.Get_by(key);
|
||||
if (rv == null) {
|
||||
rv = new Xog_mnu_grp(gui_mgr, true, key);
|
||||
hash.Add(key, rv);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Invk_get)) return Get_or_new(m.ReadStr("v"));
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
} private static final String Invk_get = "get";
|
||||
public static final String Root_key_tabs_btns = "browser.tabs.btns"
|
||||
, Root_key_html_page = "html_box", Root_key_html_link = "browser.html.link", Root_key_html_file = "browser.html.file"
|
||||
, Root_key_prog = "browser.prog", Root_key_info = "browser.info"
|
||||
;
|
||||
private Xog_mnu_grp Ctor(int i, String key, String src) {
|
||||
Xog_mnu_grp rv = Get_or_new(key).Source_default_(src);
|
||||
mnus[i] = rv;
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
47
400_xowa/src/gplx/xowa/guis/menus/Xog_window_mnu_mgr.java
Normal file
47
400_xowa/src/gplx/xowa/guis/menus/Xog_window_mnu_mgr.java
Normal file
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012 gnosygnu@gmail.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.guis.menus; import gplx.*; import gplx.xowa.*; import gplx.xowa.guis.*;
|
||||
import gplx.xowa.guis.menus.dom.*;
|
||||
import gplx.xowa.langs.*;
|
||||
public class Xog_window_mnu_mgr implements GfoInvkAble {
|
||||
private Ordered_hash hash = Ordered_hash_.New();
|
||||
public Xog_mnu_grp Browser() {return browser;} private Xog_mnu_grp browser;
|
||||
public Xog_window_mnu_mgr(Xoa_gui_mgr gui_mgr, Xog_menu_mgr menu_mgr) {
|
||||
this.gui_mgr = gui_mgr;
|
||||
browser = Get_or_new(Root_key_browser_win).Source_default_(Xog_menu_mgr_src.Browser_win); // NOTE: set default here (fires before cfg)
|
||||
} private Xoa_gui_mgr gui_mgr;
|
||||
public void Init_by_kit() {
|
||||
browser.Source_exec(gui_mgr.App().Gfs_mgr()); // NOTE: build menu now; NOTE: do not set default here, or else will override user setting
|
||||
}
|
||||
public Xog_mnu_grp Get_or_new(String key) {
|
||||
Xog_mnu_grp rv = (Xog_mnu_grp)hash.Get_by(key);
|
||||
if (rv == null) {
|
||||
rv = new Xog_mnu_grp(gui_mgr, false, key);
|
||||
hash.Add(key, rv);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
public void Lang_changed(Xol_lang_itm lang) {
|
||||
Xog_mnu_base.Update_grp_by_lang(gui_mgr.Menu_mgr().Menu_bldr(), lang, browser);
|
||||
}
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Invk_get)) return Get_or_new(m.ReadStr("v"));
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
} private static final String Invk_get = "get";
|
||||
public static final String Root_key_browser_win = "main_win";
|
||||
}
|
||||
117
400_xowa/src/gplx/xowa/guis/menus/dom/Xog_mnu_base.java
Normal file
117
400_xowa/src/gplx/xowa/guis/menus/dom/Xog_mnu_base.java
Normal file
@@ -0,0 +1,117 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012 gnosygnu@gmail.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.guis.menus.dom; import gplx.*; import gplx.xowa.*; import gplx.xowa.guis.*; import gplx.xowa.guis.menus.*;
|
||||
import gplx.gfui.*; import gplx.xowa.langs.*; import gplx.xowa.guis.cmds.*;
|
||||
public abstract class Xog_mnu_base implements GfoInvkAble {
|
||||
private List_adp list = List_adp_.new_();
|
||||
public Xog_mnu_base() {evt_mgr = new Xog_mnu_evt_mgr(this);}
|
||||
public Xog_mnu_evt_mgr Evt_mgr() {return evt_mgr;} private Xog_mnu_evt_mgr evt_mgr;
|
||||
public void Evt_mgr_(Xog_mnu_evt_mgr v) {this.evt_mgr = v;}
|
||||
public Xoa_gui_mgr Gui_mgr() {return gui_mgr;} private Xoa_gui_mgr gui_mgr;
|
||||
public abstract boolean Tid_is_app_menu_grp();
|
||||
public void Ctor(Xoa_gui_mgr gui_mgr) {this.gui_mgr = gui_mgr;}
|
||||
public void Clear() {
|
||||
int len = list.Count();
|
||||
for (int i = 0; i < len; i++) {
|
||||
Xog_mnu_itm itm = (Xog_mnu_itm)list.Get_at(i);
|
||||
itm.Clear();
|
||||
}
|
||||
list.Clear();
|
||||
}
|
||||
public int Len() {return list.Count();}
|
||||
public Xog_mnu_itm Get_at(int i) {return (Xog_mnu_itm)list.Get_at(i);}
|
||||
public Xog_mnu_itm Add_btn_default(String key) {return Add_itm_default(Xog_mnu_itm.Tid_btn, key);}
|
||||
public Xog_mnu_itm Add_chk_default(String key) {return Add_itm_default(Xog_mnu_itm.Tid_chk, key);}
|
||||
public Xog_mnu_itm Add_rdo_default(String key) {return Add_itm_default(Xog_mnu_itm.Tid_rdo, key);}
|
||||
public Xog_mnu_itm Add_grp_default(String key) {return Add_itm_default(Xog_mnu_itm.Tid_grp, key);}
|
||||
private Xog_mnu_itm Add_itm_default(byte tid, String key) {
|
||||
Xog_mnu_itm itm = gui_mgr.Menu_mgr().Regy().Get_or_make(key);
|
||||
itm.Tid_(tid);
|
||||
list.Add(itm);
|
||||
return itm;
|
||||
}
|
||||
public Xog_mnu_itm Add_btn(String key, String text, String shortcut, String img, String cmd) {
|
||||
Xog_mnu_itm rv = Add_itm(Xog_mnu_itm.Tid_btn, key, text, shortcut, img);
|
||||
rv.Cmd_(cmd);
|
||||
return rv;
|
||||
}
|
||||
public Xog_mnu_itm Add_chk(String key, String text, String shortcut, String img, String cmd) {
|
||||
Xog_mnu_itm rv = Add_itm(Xog_mnu_itm.Tid_chk, key, text, shortcut, img);
|
||||
rv.Cmd_(cmd);
|
||||
return rv;
|
||||
}
|
||||
public Xog_mnu_itm Add_rdo(String key, String text, String shortcut, String img, String cmd) {
|
||||
Xog_mnu_itm rv = Add_itm(Xog_mnu_itm.Tid_rdo, key, text, shortcut, img);
|
||||
rv.Cmd_(cmd);
|
||||
return rv;
|
||||
}
|
||||
public Xog_mnu_itm Add_grp(String key, String text, String shortcut, String img) {return Add_itm(Xog_mnu_itm.Tid_grp, key, text, shortcut, img);}
|
||||
private Xog_mnu_itm Add_itm(byte tid, String key, String text, String shortcut, String img) {
|
||||
Xog_mnu_itm itm = gui_mgr.Menu_mgr().Regy().Get_or_make(key);
|
||||
itm.Tid_(tid);
|
||||
list.Add(itm);
|
||||
itm.Init_by_custom(text, shortcut, img);
|
||||
return itm;
|
||||
}
|
||||
public Xog_mnu_itm Add_spr() {
|
||||
String key = "xowa.spr" + Int_.To_str(list.Count());
|
||||
Xog_mnu_itm rv = new Xog_mnu_itm(gui_mgr, key).Tid_(Xog_mnu_itm.Tid_spr);
|
||||
list.Add(rv);
|
||||
return rv;
|
||||
}
|
||||
@gplx.Virtual 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_add)) return Add_itm_default(Xog_mnu_itm.Tid_nil, m.ReadStr("v"));
|
||||
else if (ctx.Match(k, Invk_add_spr)) return Add_spr();
|
||||
else if (ctx.Match(k, Invk_add_grp_default)) return Add_grp_default(m.ReadStr("v"));
|
||||
else if (ctx.Match(k, Invk_add_grp)) return Add_grp(m.ReadStr("key"), m.ReadStr("text"), m.ReadStr("shortcut"), m.ReadStrOr("img", ""));
|
||||
else if (ctx.Match(k, Invk_add_btn_default)) return Add_btn_default(m.ReadStr("v"));
|
||||
else if (ctx.Match(k, Invk_add_btn)) return Add_btn(m.ReadStr("key"), m.ReadStr("text"), m.ReadStr("shortcut"), m.ReadStr("img"), m.ReadStr("cmd"));
|
||||
else if (ctx.Match(k, Invk_add_chk_default)) return Add_chk_default(m.ReadStr("v"));
|
||||
else if (ctx.Match(k, Invk_add_chk)) return Add_chk(m.ReadStr("key"), m.ReadStr("text"), m.ReadStr("shortcut"), m.ReadStr("img"), m.ReadStr("cmd"));
|
||||
else if (ctx.Match(k, Invk_add_rdo_default)) return Add_rdo_default(m.ReadStr("v"));
|
||||
else if (ctx.Match(k, Invk_add_rdo)) return Add_rdo(m.ReadStr("key"), m.ReadStr("text"), m.ReadStr("shortcut"), m.ReadStr("img"), m.ReadStr("cmd"));
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
return this;
|
||||
}
|
||||
private static final String
|
||||
Invk_clear = "clear"
|
||||
, Invk_add_spr = "add_spr"
|
||||
, Invk_add_grp_default = "add_grp_default", Invk_add_grp = "add_grp"
|
||||
, Invk_add_btn_default = "add_btn_default", Invk_add_btn = "add_btn"
|
||||
, Invk_add_chk_default = "add_chk_default", Invk_add_chk = "add_chk"
|
||||
, Invk_add_rdo_default = "add_rdo_default", Invk_add_rdo = "add_rdo"
|
||||
;
|
||||
public static void Update_grp_by_lang(Xog_mnu_bldr bldr, Xol_lang_itm lang, Xog_mnu_base grp) {
|
||||
int len = grp.Len();
|
||||
for (int i = 0; i < len; i++) {
|
||||
Xog_mnu_itm itm = grp.Get_at(i);
|
||||
itm.Init_by_lang(lang);
|
||||
if (itm.Under_gui() != null) {
|
||||
itm.Under_gui().Text_(itm.Gui_text());
|
||||
ImageAdp img = grp.Tid_is_app_menu_grp()
|
||||
? ImageAdp_.Null // set image to null if window menu grp
|
||||
: bldr.Get_img(itm.Img_nest())
|
||||
;
|
||||
itm.Under_gui().Img_(img);
|
||||
}
|
||||
if (itm.Tid() == Xog_mnu_itm.Tid_grp)
|
||||
Update_grp_by_lang(bldr, lang, itm);
|
||||
}
|
||||
}
|
||||
}
|
||||
84
400_xowa/src/gplx/xowa/guis/menus/dom/Xog_mnu_bldr.java
Normal file
84
400_xowa/src/gplx/xowa/guis/menus/dom/Xog_mnu_bldr.java
Normal file
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012 gnosygnu@gmail.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.guis.menus.dom; import gplx.*; import gplx.xowa.*; import gplx.xowa.guis.*; import gplx.xowa.guis.menus.*;
|
||||
import gplx.gfui.*; import gplx.xowa.guis.cmds.*; import gplx.xowa.apps.gfs.*;
|
||||
public class Xog_mnu_bldr {
|
||||
private Xoae_app app; private Gfui_kit kit; private Io_url img_dir;
|
||||
public void Init_by_kit(Xoae_app app, Gfui_kit kit, Io_url img_dir) {
|
||||
this.app = app; this.kit = kit; this.img_dir = img_dir;
|
||||
}
|
||||
public void Build(Gfui_mnu_grp grp_gui, Xog_mnu_grp grp_dom) {
|
||||
if (grp_gui == null) return; // NOTE: hackish, ignore call from user.gfs b/c it fires before kit is inited; note that Xog_popup_mnu_mgr will call html_box's context menu explicitly
|
||||
grp_gui.Itms_clear();
|
||||
Build_owner(grp_gui, grp_dom);
|
||||
}
|
||||
private void Build_owner(Gfui_mnu_grp grp_gui, Xog_mnu_base grp_dom) {
|
||||
int len = grp_dom.Len();
|
||||
for (int i = 0; i < len; i++) {
|
||||
Xog_mnu_itm sub_dom = grp_dom.Get_at(i);
|
||||
Gfui_mnu_itm sub_gui = null;
|
||||
String sub_text = sub_dom.Name(), sub_shortcut = sub_dom.Shortcut();
|
||||
switch (sub_dom.Tid()) {
|
||||
case Xog_mnu_itm.Tid_spr: sub_gui = grp_gui.Itms_add_separator(); break;
|
||||
case Xog_mnu_itm.Tid_btn: sub_gui = Add_btn(grp_gui, sub_dom, sub_text, sub_shortcut); break;
|
||||
case Xog_mnu_itm.Tid_chk: sub_gui = Add_chk(grp_gui, sub_dom, sub_text, sub_shortcut); break;
|
||||
case Xog_mnu_itm.Tid_rdo: sub_gui = Add_rdo(grp_gui, sub_dom, sub_text, sub_shortcut); break;
|
||||
case Xog_mnu_itm.Tid_grp: {
|
||||
Gfui_mnu_grp sub_gui_grp = grp_gui.Itms_add_grp(sub_dom.Gui_text(), Get_img(sub_dom.Img_nest()));
|
||||
Build_owner(sub_gui_grp, (Xog_mnu_base)sub_dom);
|
||||
sub_gui = sub_gui_grp;
|
||||
break;
|
||||
}
|
||||
default: throw Err_.new_unhandled(sub_dom.Tid());
|
||||
}
|
||||
sub_dom.Under_gui_(sub_gui);
|
||||
}
|
||||
}
|
||||
public ImageAdp Get_img(String[] img_nest) {
|
||||
Io_url img_url = img_nest.length == 0 ? Io_url_.Empty : img_dir.GenSubFil_nest(img_nest);
|
||||
return Io_mgr.Instance.ExistsFil(img_url) ? kit.New_img_load(img_url) : ImageAdp_null.Instance; // NOTE: must check if file exists else swt exception; NOTE: must use ImageAdp_null.Instance, not ImageAdp_.Null, else error in non-X11 environments
|
||||
}
|
||||
private Gfui_mnu_itm Add_btn(Gfui_mnu_grp owner_gui, Xog_mnu_itm sub, String sub_text, String sub_shortcut) {
|
||||
String cmd_text = "app.api.exec('" + sub.Key() + "');";
|
||||
GfoMsg msg = Xoa_gfs_mgr_.Parse_to_msg(cmd_text);
|
||||
ImageAdp img = Get_img(sub.Img_nest());
|
||||
return owner_gui.Itms_add_btn_msg(sub.Gui_text(), img, app, app.Gfs_mgr(), msg);
|
||||
}
|
||||
private Gfui_mnu_itm Add_chk(Gfui_mnu_grp owner_gui, Xog_mnu_itm sub, String sub_text, String sub_shortcut) {
|
||||
ImageAdp img = Get_img(sub.Img_nest());
|
||||
GfoMsg msg_n = Xoa_gfs_mgr_.Parse_to_msg("app.api.exec('" + sub.Key() + "n_');");
|
||||
GfoMsg msg_y = Xoa_gfs_mgr_.Parse_to_msg("app.api.exec('" + sub.Key() + "y_');");
|
||||
Gfui_mnu_itm mnu_itm = owner_gui.Itms_add_chk_msg(sub.Gui_text(), img, app, app.Gfs_mgr(), msg_n, msg_y);
|
||||
sub.Evt_mgr().Sub(mnu_itm);
|
||||
Xog_cmd_itm cmd = app.Gui_mgr().Cmd_mgr().Get_or_null(sub.Key());
|
||||
boolean v = Bool_.cast(app.Gfs_mgr().Run_str_for(app, cmd.Cmd()));
|
||||
mnu_itm.Selected_(v);
|
||||
return mnu_itm;
|
||||
}
|
||||
// private void Add_chk(String key, String text, String shortcut, String img) {
|
||||
// Xog_mnu_itm rv = Add_itm(Xog_mnu_itm.Tid_chk, key, text, shortcut, img);
|
||||
// Xog_cmd_itm cmd = gui_mgr.Cmd_mgr().Regy().Get_or_null(key); if (cmd == null) throw Err_.new_wo_type("unknown cmd; key={0}", key);
|
||||
// GfoEvObj pub = gui_mgr.App().Gfs_mgr().Get_owner_as_event_obj(cmd.Cmd());
|
||||
// GfoEvMgr_.SubSame(pub, Xog_mnu_evt_mgr.Evt_selected_changed, rv.Evt_mgr());
|
||||
// }
|
||||
private Gfui_mnu_itm Add_rdo(Gfui_mnu_grp owner_gui, Xog_mnu_itm sub, String sub_text, String sub_shortcut) {
|
||||
ImageAdp img = Get_img(sub.Img_nest());
|
||||
GfoMsg msg = Xoa_gfs_mgr_.Parse_to_msg("app.api.exec('" + sub.Key() + "');");
|
||||
return owner_gui.Itms_add_rdo_msg(sub.Gui_text(), img, app, app.Gfs_mgr(), msg);
|
||||
}
|
||||
}
|
||||
38
400_xowa/src/gplx/xowa/guis/menus/dom/Xog_mnu_evt_mgr.java
Normal file
38
400_xowa/src/gplx/xowa/guis/menus/dom/Xog_mnu_evt_mgr.java
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012 gnosygnu@gmail.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.guis.menus.dom; import gplx.*; import gplx.xowa.*; import gplx.xowa.guis.*; import gplx.xowa.guis.menus.*;
|
||||
import gplx.gfui.*; import gplx.xowa.guis.cmds.*;
|
||||
public class Xog_mnu_evt_mgr implements GfoEvObj {
|
||||
private Ordered_hash itms = Ordered_hash_.New();
|
||||
public Xog_mnu_evt_mgr(Xog_mnu_base owner) {this.ev_mgr = GfoEvMgr.new_(this);}
|
||||
public GfoEvMgr EvMgr() {return ev_mgr;} private GfoEvMgr ev_mgr;
|
||||
public void Sub(Gfui_mnu_itm mnu_itm) {
|
||||
itms.Add(mnu_itm.Uid(), mnu_itm);
|
||||
}
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Evt_selected_changed)) {
|
||||
int len = itms.Count();
|
||||
for (int i = 0; i < len; i++) {
|
||||
Gfui_mnu_itm itm = (Gfui_mnu_itm)itms.Get_at(i);
|
||||
itm.Selected_(m.ReadBool("v"));
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
public static final String Evt_selected_changed = "selected_changed";
|
||||
}
|
||||
113
400_xowa/src/gplx/xowa/guis/menus/dom/Xog_mnu_grp.java
Normal file
113
400_xowa/src/gplx/xowa/guis/menus/dom/Xog_mnu_grp.java
Normal file
@@ -0,0 +1,113 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012 gnosygnu@gmail.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.guis.menus.dom; import gplx.*; import gplx.xowa.*; import gplx.xowa.guis.*; import gplx.xowa.guis.menus.*;
|
||||
import gplx.gfui.*;
|
||||
import gplx.xowa.apps.*; import gplx.xowa.apps.gfs.*;
|
||||
import gplx.xowa.guis.views.*;
|
||||
public class Xog_mnu_grp extends Xog_mnu_base {
|
||||
public Xog_mnu_grp(Xoa_gui_mgr gui_mgr, boolean mnu_is_popup, String key) {
|
||||
this.app = gui_mgr.App(); this.mnu_is_popup = mnu_is_popup; this.key = key;
|
||||
this.Ctor(gui_mgr);
|
||||
} private Xoae_app app;
|
||||
public String Key() {return key;} private String key; private boolean mnu_is_popup;
|
||||
public Gfui_mnu_grp Under_mnu() {
|
||||
if (under_mnu.Disposed()) Build(); // NOTE: menu may be disposed when calling .dispose on Swt_html; rebuild if needed; DATE:2014-07-09
|
||||
return under_mnu;
|
||||
} private Gfui_mnu_grp under_mnu;
|
||||
@Override public boolean Tid_is_app_menu_grp() {return !mnu_is_popup;}
|
||||
public boolean Enabled() {return enabled;} private boolean enabled = true;
|
||||
public void Enabled_(boolean v) {
|
||||
this.enabled = v;
|
||||
if (under_mnu != null) // null when changed by cfg.gfs
|
||||
under_mnu.Itms_clear();
|
||||
if (v)
|
||||
this.Source_exec(app.Gfs_mgr());
|
||||
else
|
||||
this.Clear();
|
||||
if (!mnu_is_popup && app.Gui_mgr().Browser_win().Win_box() != null)
|
||||
GfoInvkAble_.InvkCmd(app.Gui_mgr().Browser_win(), gplx.gfui.Gfui_html.Evt_win_resized);
|
||||
}
|
||||
public String Source() {return source;} private String source;
|
||||
public String Source_default() {return source_default;} public Xog_mnu_grp Source_default_(String v) {source_default = source = v; return this;} private String source_default;
|
||||
private Xog_mnu_grp Source_(Xoa_gfs_mgr gfs_mgr, String v) {
|
||||
Object rslt = Source_exec(gfs_mgr, v);
|
||||
if (rslt != GfoInvkAble_.Rv_error)
|
||||
source = v;
|
||||
return this;
|
||||
}
|
||||
public Object Source_exec(Xoa_gfs_mgr gfs_mgr) {return Source_exec(gfs_mgr, source);}
|
||||
private Object Source_exec(Xoa_gfs_mgr gfs_mgr, String v) {
|
||||
if (!enabled) return GfoInvkAble_.Rv_handled;
|
||||
String script = "clear;\n" + v + "build;";
|
||||
return gfs_mgr.Run_str_for(this, script);
|
||||
}
|
||||
public void Build() {
|
||||
Xoa_gui_mgr gui_mgr = app.Gui_mgr(); Gfui_kit kit = gui_mgr.Kit(); Xog_win_itm win = gui_mgr.Browser_win();
|
||||
if (!kit.Kit_mode__ready()) return; // NOTE: .gfs will fire Build before Kit.Init; check that kit is inited
|
||||
if (under_mnu == null) {
|
||||
if (mnu_is_popup) {
|
||||
if (String_.Eq(key, Xog_popup_mnu_mgr.Root_key_tabs_btns))
|
||||
under_mnu = kit.New_mnu_popup(key, win.Tab_mgr().Tab_mgr());
|
||||
else
|
||||
under_mnu = kit.New_mnu_popup(key, win.Win_box());
|
||||
}
|
||||
else
|
||||
under_mnu = kit.New_mnu_bar(key, win.Win_box());
|
||||
}
|
||||
Xog_mnu_bldr bldr = gui_mgr.Menu_mgr().Menu_bldr();
|
||||
bldr.Build(under_mnu, this);
|
||||
Xog_mnu_base.Update_grp_by_lang(bldr, app.Usere().Lang(), this); // NOTE: always set lang after rebuild; else changes in Help:Options/Menus will show blank captions; DATE:2014-06-05
|
||||
if (mnu_is_popup) {
|
||||
boolean rebind_to_win = false;
|
||||
if (String_.Eq(key, Xog_popup_mnu_mgr.Root_key_tabs_btns)) {
|
||||
kit.Set_mnu_popup(win.Tab_mgr().Tab_mgr(), under_mnu);
|
||||
rebind_to_win = true;
|
||||
}
|
||||
else if (String_.Eq(key, Xog_popup_mnu_mgr.Root_key_html_page)) // rebind new popup box; DATE:2014-05-16
|
||||
Bind_popup_menu(gui_mgr);
|
||||
else if (String_.Eq(key, Xog_popup_mnu_mgr.Root_key_html_link))
|
||||
rebind_to_win = true;
|
||||
else if (String_.Eq(key, Xog_popup_mnu_mgr.Root_key_prog))
|
||||
kit.Set_mnu_popup(win.Prog_box(), under_mnu);
|
||||
else if (String_.Eq(key, Xog_popup_mnu_mgr.Root_key_info))
|
||||
kit.Set_mnu_popup(win.Info_box(), under_mnu);
|
||||
if (rebind_to_win) { // WORKAROUND: SWT seems to bind popup menus to window; always rebind window to html_page; DATE:2014-05-17
|
||||
kit.Set_mnu_popup(win.Win_box(), gui_mgr.Menu_mgr().Popup().Html_page().Under_mnu());
|
||||
}
|
||||
}
|
||||
}
|
||||
private void Bind_popup_menu(Xoa_gui_mgr gui_mgr) {
|
||||
Gfui_kit kit = gui_mgr.Kit(); Xog_win_itm win = gui_mgr.Browser_win(); Xog_tab_mgr tab_mgr = win.Tab_mgr();
|
||||
int tabs_len = tab_mgr.Tabs_len();
|
||||
for (int i = 0; i < tabs_len; i++) {
|
||||
Xog_tab_itm tab = tab_mgr.Tabs_get_at(i);
|
||||
kit.Set_mnu_popup(tab.Html_box(), under_mnu);
|
||||
}
|
||||
}
|
||||
@Override public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Invk_build)) this.Build();
|
||||
else if (ctx.Match(k, Invk_enabled)) return Yn.To_str(enabled);
|
||||
else if (ctx.Match(k, Invk_enabled_)) this.Enabled_(m.ReadYn("v"));
|
||||
else if (ctx.Match(k, Invk_source)) return source;
|
||||
else if (ctx.Match(k, Invk_source_)) this.Source_(app.Gfs_mgr(), m.ReadStr("v"));
|
||||
else if (ctx.Match(k, Invk_source_default)) return source_default;
|
||||
else if (ctx.Match(k, Invk_source_default_)) source_default = m.ReadStr("v");
|
||||
else return super.Invk(ctx, ikey, k, m);
|
||||
return this;
|
||||
} private static final String Invk_build = "build", Invk_enabled = "enabled", Invk_enabled_ = "enabled_", Invk_source = "source", Invk_source_ = "source_", Invk_source_default = "source_default", Invk_source_default_ = "source_default_";
|
||||
}
|
||||
87
400_xowa/src/gplx/xowa/guis/menus/dom/Xog_mnu_itm.java
Normal file
87
400_xowa/src/gplx/xowa/guis/menus/dom/Xog_mnu_itm.java
Normal file
@@ -0,0 +1,87 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012 gnosygnu@gmail.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.guis.menus.dom; import gplx.*; import gplx.xowa.*; import gplx.xowa.guis.*; import gplx.xowa.guis.menus.*;
|
||||
import gplx.gfui.*; import gplx.xowa.langs.*; import gplx.xowa.guis.cmds.*; import gplx.xowa.langs.msgs.*;
|
||||
public class Xog_mnu_itm extends Xog_mnu_base {
|
||||
private Xoa_gui_mgr gui_mgr;
|
||||
public Xog_mnu_itm(Xoa_gui_mgr gui_mgr, String key) {
|
||||
this.gui_mgr = gui_mgr; this.key = key; this.key_bry = Bry_.new_u8(key);
|
||||
this.Ctor(gui_mgr);
|
||||
}
|
||||
public byte Tid() {return tid;} public Xog_mnu_itm Tid_(byte v) {tid = v; return this;} private byte tid;
|
||||
@Override public boolean Tid_is_app_menu_grp() {return false;}
|
||||
public String Key() {return key;} private String key; private byte[] key_bry;
|
||||
public String Name() {return name;} public void Name_(String v) {this.name = v; Gui_text_calc_();} private String name = "";
|
||||
public String Shortcut() {return shortcut;} public void Shortcut_(String v) {this.shortcut = v; Gui_text_calc_();} private String shortcut;
|
||||
public String Gui_text() {return gui_text;} public void Gui_text_calc_() {gui_text = Gui_text_calc(name, shortcut);} private String gui_text = "";
|
||||
public String[] Img_nest() {return img_nest;} private String[] img_nest = String_.Ary_empty;
|
||||
private String Cmd() {
|
||||
Xog_cmd_itm cmd_itm = gui_mgr.Cmd_mgr().Get_or_null(key);
|
||||
return cmd_itm == null ? "" : cmd_itm.Cmd();
|
||||
}
|
||||
public Xog_mnu_itm Cmd_(String cmd) {
|
||||
Xog_cmd_itm cmd_itm = gui_mgr.Cmd_mgr().Get_or_make(key);
|
||||
cmd_itm.Cmd_(cmd);
|
||||
return this;
|
||||
}
|
||||
public Gfui_mnu_itm Under_gui() {return under_gui;} public void Under_gui_(Gfui_mnu_itm v) {under_gui = v;} private Gfui_mnu_itm under_gui;
|
||||
private Xog_mnu_itm Init_by_clone(Xog_mnu_itm comp) {
|
||||
this.tid = comp.tid; this.name = comp.name; this.shortcut = comp.shortcut; this.img_nest = comp.img_nest; this.gui_text = comp.gui_text;
|
||||
return this;
|
||||
}
|
||||
public void Init_by_lang(Xol_lang_itm lang) {
|
||||
this.name = Xol_msg_mgr_.Get_msg_val_gui_or(lang.Lang_mgr(), lang, Xog_cmd_itm_.Msg_pre_api, key_bry, Xog_cmd_itm_.Msg_suf_name, name); // NOTE: custom cmds must use Get_val_or, not Get_val_or_null; DATE:2014-05-30
|
||||
this.shortcut = Xol_msg_mgr_.Get_msg_val_gui_or(lang.Lang_mgr(), lang, Xog_cmd_itm_.Msg_pre_api, key_bry, Xog_cmd_itm_.Msg_suf_letter, shortcut);
|
||||
this.img_nest = Img_nest_of(Xol_msg_mgr_.Get_msg_val_gui_or(lang.Lang_mgr(), lang, Xog_cmd_itm_.Msg_pre_api, key_bry, Xog_cmd_itm_.Msg_suf_image, ""));
|
||||
this.gui_text = Gui_text_calc(name, shortcut);
|
||||
}
|
||||
public void Init_by_custom(String name, String shortcut, String img_nest_str) {
|
||||
this.name = name;
|
||||
this.shortcut = shortcut;
|
||||
this.img_nest = Img_nest_of(img_nest_str);
|
||||
this.gui_text = Gui_text_calc(name, shortcut);
|
||||
}
|
||||
public static String Gui_text_calc(String name, String shortcut) {
|
||||
if (shortcut == null || String_.Len(shortcut) != 1) return name; // shortcut is null or > 1 char; return name
|
||||
int pos = String_.FindFwd(String_.Lower(name), String_.Lower(shortcut)); // search for shortcut in name
|
||||
if (pos == String_.Find_none) return name; // shortcut not found; return name; EX: "x" in "File" returns "File"
|
||||
return String_.Mid(name, 0, pos) + "&" + String_.Mid(name, pos); // add & before shortcut; EX: "x" in "Exit" -> "E&xit"
|
||||
}
|
||||
public Xog_mnu_itm Clone() {
|
||||
Xog_mnu_itm rv = new Xog_mnu_itm(gui_mgr, key).Init_by_clone(this);
|
||||
rv.Evt_mgr_(this.Evt_mgr());
|
||||
return rv;
|
||||
}
|
||||
@Override public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Invk_text)) return name;
|
||||
else if (ctx.Match(k, Invk_text_)) Name_(m.ReadStr("v"));
|
||||
else if (ctx.Match(k, Invk_shortcut)) return shortcut;
|
||||
else if (ctx.Match(k, Invk_shortcut_)) Shortcut_(m.ReadStr("v"));
|
||||
else if (ctx.Match(k, Invk_cmd)) return this.Cmd();
|
||||
else if (ctx.Match(k, Invk_cmd_)) Cmd_(m.ReadStr("v"));
|
||||
else if (ctx.Match(k, Invk_img)) return String_.Concat_with_str("/", img_nest);
|
||||
else if (ctx.Match(k, Invk_img_)) img_nest = Img_nest_of(m.ReadStr("v"));
|
||||
else return super.Invk(ctx, ikey, k, m);
|
||||
return this;
|
||||
}
|
||||
private static final String Invk_text = "text", Invk_text_ = "text_", Invk_shortcut = "shortcut", Invk_shortcut_ = "shortcut_", Invk_cmd = "cmd", Invk_cmd_ = "cmd_", Invk_img = "img", Invk_img_ = "img_"
|
||||
;
|
||||
public static final byte Tid_nil = 0, Tid_grp = 1, Tid_spr = 2, Tid_btn = 3, Tid_chk = 4, Tid_rdo = 5;
|
||||
private static String[] Img_nest_of(String img) {return String_.Len_eq_0(img) ? String_.Ary_empty : String_.Split(img, "/");}
|
||||
public static final Xog_mnu_itm Null = new Xog_mnu_itm(null, "null");
|
||||
}
|
||||
103
400_xowa/src/gplx/xowa/guis/menus/dom/Xog_mnu_regy.java
Normal file
103
400_xowa/src/gplx/xowa/guis/menus/dom/Xog_mnu_regy.java
Normal file
@@ -0,0 +1,103 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012 gnosygnu@gmail.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.guis.menus.dom; import gplx.*; import gplx.xowa.*; import gplx.xowa.guis.*; import gplx.xowa.guis.menus.*;
|
||||
import gplx.xowa.guis.cmds.*;
|
||||
public class Xog_mnu_regy {
|
||||
private Ordered_hash hash;
|
||||
private Xoa_gui_mgr gui_mgr;
|
||||
public Xog_mnu_regy(Xoa_gui_mgr gui_mgr) {
|
||||
this.gui_mgr = gui_mgr;
|
||||
}
|
||||
public void Init_by_app(Xoae_app app) {
|
||||
hash = Ordered_hash_.New();
|
||||
Xog_cmd_mgr cmd_mgr = app.Gui_mgr().Cmd_mgr();
|
||||
int len = cmd_mgr.Len();
|
||||
for (int i = 0; i < len; i++) {
|
||||
Xog_cmd_itm cmd_itm = cmd_mgr.Get_at(i);
|
||||
String key = cmd_itm.Key();
|
||||
Xog_mnu_itm rv = new Xog_mnu_itm(gui_mgr, key);
|
||||
hash.Add(key, rv);
|
||||
}
|
||||
Init_obsolete(hash, gui_mgr);
|
||||
}
|
||||
public Xog_mnu_itm Get_or_make(String key) {
|
||||
Xog_mnu_itm rv = (Xog_mnu_itm)hash.Get_by(key);
|
||||
if (rv == null) {
|
||||
rv = new Xog_mnu_itm(gui_mgr, key);
|
||||
hash.Add(key, rv);
|
||||
}
|
||||
else
|
||||
rv = rv.Clone();
|
||||
return rv;
|
||||
}
|
||||
private static void Init_obsolete(Ordered_hash hash, Xoa_gui_mgr gui_mgr) {
|
||||
Init_obsolete_itm(hash, gui_mgr, "xowa.file" , Xog_cmd_itm_.Key_gui_menus_group_file);
|
||||
Init_obsolete_itm(hash, gui_mgr, "xowa.tabs.new_dflt__at_dflt__focus_y" , Xog_cmd_itm_.Key_gui_browser_tabs_new_dflt__at_dflt__focus_y);
|
||||
Init_obsolete_itm(hash, gui_mgr, "xowa.tabs.close_cur" , Xog_cmd_itm_.Key_gui_browser_tabs_close_cur);
|
||||
Init_obsolete_itm(hash, gui_mgr, "xowa.file.save_as" , Xog_cmd_itm_.Key_gui_page_view_save_as);
|
||||
Init_obsolete_itm(hash, gui_mgr, "xowa.file.print" , Xog_cmd_itm_.Key_gui_page_view_print);
|
||||
Init_obsolete_itm(hash, gui_mgr, "xowa.file.exit" , Xog_cmd_itm_.Key_app_exit);
|
||||
Init_obsolete_itm(hash, gui_mgr, "xowa.edit" , Xog_cmd_itm_.Key_gui_menus_group_edit);
|
||||
Init_obsolete_itm(hash, gui_mgr, "xowa.edit.select_all" , Xog_cmd_itm_.Key_gui_page_selection_select_all);
|
||||
Init_obsolete_itm(hash, gui_mgr, "xowa.edit.copy" , Xog_cmd_itm_.Key_gui_page_selection_copy);
|
||||
Init_obsolete_itm(hash, gui_mgr, "xowa.edit.find" , Xog_cmd_itm_.Key_gui_browser_find_show_by_paste);
|
||||
Init_obsolete_itm(hash, gui_mgr, "xowa.view" , Xog_cmd_itm_.Key_gui_menus_group_view);
|
||||
Init_obsolete_itm(hash, gui_mgr, "xowa.view.font.increase" , Xog_cmd_itm_.Key_gui_font_increase);
|
||||
Init_obsolete_itm(hash, gui_mgr, "xowa.view.font.decrease" , Xog_cmd_itm_.Key_gui_font_decrease);
|
||||
Init_obsolete_itm(hash, gui_mgr, "xowa.view.page.read" , Xog_cmd_itm_.Key_gui_page_view_mode_read);
|
||||
Init_obsolete_itm(hash, gui_mgr, "xowa.view.page.edit" , Xog_cmd_itm_.Key_gui_page_view_mode_edit);
|
||||
Init_obsolete_itm(hash, gui_mgr, "xowa.view.page.html" , Xog_cmd_itm_.Key_gui_page_view_mode_html);
|
||||
Init_obsolete_itm(hash, gui_mgr, "xowa.view.windows.progress.show" , Xog_cmd_itm_.Key_gui_browser_prog_log_show);
|
||||
Init_obsolete_itm(hash, gui_mgr, "xowa.history" , Xog_cmd_itm_.Key_gui_menus_group_history);
|
||||
Init_obsolete_itm(hash, gui_mgr, "xowa.history.go_bwd" , Xog_cmd_itm_.Key_nav_go_bwd);
|
||||
Init_obsolete_itm(hash, gui_mgr, "xowa.history.go_fwd" , Xog_cmd_itm_.Key_nav_go_fwd);
|
||||
Init_obsolete_itm(hash, gui_mgr, "xowa.history.show" , Xog_cmd_itm_.Key_usr_history_show);
|
||||
Init_obsolete_itm(hash, gui_mgr, "xowa.bookmarks" , Xog_cmd_itm_.Key_gui_menus_group_bookmarks);
|
||||
Init_obsolete_itm(hash, gui_mgr, "xowa.bookmarks.goto_main_page" , Xog_cmd_itm_.Key_nav_wiki_main_page);
|
||||
Init_obsolete_itm(hash, gui_mgr, "xowa.bookmarks.add" , Xog_cmd_itm_.Key_usr_bookmarks_add);
|
||||
Init_obsolete_itm(hash, gui_mgr, "xowa.bookmarks.show" , Xog_cmd_itm_.Key_usr_bookmarks_show);
|
||||
Init_obsolete_itm(hash, gui_mgr, "xowa.tools" , Xog_cmd_itm_.Key_gui_menus_group_tools);
|
||||
Init_obsolete_itm(hash, gui_mgr, "xowa.tools.options" , Xog_cmd_itm_.Key_nav_cfg_main);
|
||||
Init_obsolete_itm(hash, gui_mgr, "xowa.tools.wikis.import_from_list" , Xog_cmd_itm_.Key_nav_setup_import_from_list);
|
||||
Init_obsolete_itm(hash, gui_mgr, "xowa.tools.wikis.import_from_script" , Xog_cmd_itm_.Key_nav_setup_import_from_script);
|
||||
Init_obsolete_itm(hash, gui_mgr, "xowa.tools.wikis.maintenance" , Xog_cmd_itm_.Key_nav_setup_maintenance);
|
||||
Init_obsolete_itm(hash, gui_mgr, "xowa.tools.wikis.download" , Xog_cmd_itm_.Key_nav_setup_download);
|
||||
Init_obsolete_itm(hash, gui_mgr, "xowa.help" , Xog_cmd_itm_.Key_gui_menus_group_help);
|
||||
Init_obsolete_itm(hash, gui_mgr, "xowa.help.help" , Xog_cmd_itm_.Key_nav_help_help);
|
||||
Init_obsolete_itm(hash, gui_mgr, "xowa.help.change_log" , Xog_cmd_itm_.Key_nav_help_change_log);
|
||||
Init_obsolete_itm(hash, gui_mgr, "xowa.help.diagnostics" , Xog_cmd_itm_.Key_nav_help_diagnostics);
|
||||
Init_obsolete_itm(hash, gui_mgr, "xowa.help.context_menu" , Xog_cmd_itm_.Key_nav_cfg_menu);
|
||||
Init_obsolete_itm(hash, gui_mgr, "xowa.system.data" , Xog_cmd_itm_.Key_gui_menus_group_system_data);
|
||||
Init_obsolete_itm(hash, gui_mgr, "xowa.system.data.log_session" , Xog_cmd_itm_.Key_nav_system_data_log_session);
|
||||
Init_obsolete_itm(hash, gui_mgr, "xowa.system.data.cfg_app" , Xog_cmd_itm_.Key_nav_system_data_cfg_app);
|
||||
Init_obsolete_itm(hash, gui_mgr, "xowa.system.data.cfg_lang" , Xog_cmd_itm_.Key_nav_system_data_cfg_lang);
|
||||
Init_obsolete_itm(hash, gui_mgr, "xowa.system.data.cfg_user" , Xog_cmd_itm_.Key_nav_system_data_cfg_user);
|
||||
Init_obsolete_itm(hash, gui_mgr, "xowa.system.data.cfg_custom" , Xog_cmd_itm_.Key_nav_system_data_cfg_custom);
|
||||
Init_obsolete_itm(hash, gui_mgr, "xowa.system.data.usr_history" , Xog_cmd_itm_.Key_nav_system_data_usr_history);
|
||||
Init_obsolete_itm(hash, gui_mgr, "xowa.help.about" , Xog_cmd_itm_.Key_nav_help_about);
|
||||
Init_obsolete_itm(hash, gui_mgr, "xowa.tabs.new_link__at_dflt__focus_n" , Xog_cmd_itm_.Key_gui_browser_tabs_new_link__at_dflt__focus_n);
|
||||
Init_obsolete_itm(hash, gui_mgr, "xowa.tabs.new_link__at_dflt__focus_y" , Xog_cmd_itm_.Key_gui_browser_tabs_new_link__at_dflt__focus_y);
|
||||
Init_obsolete_itm(hash, gui_mgr, "xowa.widgets.find.show_by_paste" , Xog_cmd_itm_.Key_gui_browser_find_show_by_paste);
|
||||
Init_obsolete_itm(hash, gui_mgr, "xowa.file.save_file_as" , Xog_cmd_itm_.Key_gui_page_selection_save_file_as);
|
||||
Init_obsolete_itm(hash, gui_mgr, "xowa.widgets.prog_log.show" , Xog_cmd_itm_.Key_gui_browser_prog_log_show);
|
||||
}
|
||||
private static void Init_obsolete_itm(Ordered_hash hash, Xoa_gui_mgr gui_mgr, String old, String cur) {
|
||||
Xog_mnu_itm rv = new Xog_mnu_itm(gui_mgr, cur);
|
||||
hash.Add(old, rv);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user