예제 #1
0
 public void New_href(boolean focus) {
   Xog_tab_itm tab = tab_mgr.Active_tab();
   if (tab == Xog_tab_itm_.Null) return;
   String link = tab.Html_itm().Html_selected_get_href_or_text();
   if (String_.Len_eq_0(link)) {
     tab_mgr.Win().Usr_dlg().Prog_many("", "", "no link or text selected");
     return;
   }
   tab_mgr.Tabs_new_dflt(true);
   tab_mgr.Win().Page__navigate_by_url_bar(link);
 }
예제 #2
0
 public void Save_as() {
   if (this.Active_tab_is_null()) return;
   Xog_tab_itm tab = win.Tab_mgr().Active_tab();
   String file_name =
       Xoa_app_.Utl__encoder_mgr()
               .Fsys_safe()
               .Encode_str(String_.new_u8(tab.Page().Ttl().Full_url()))
           + ".html";
   String file_url =
       app.Gui_mgr()
           .Kit()
           .New_dlg_file(Gfui_kit_.File_dlg_type_save, "Select file to save to:")
           .Init_file_(file_name)
           .Ask();
   if (String_.Len_eq_0(file_url)) return;
   Io_mgr.I.SaveFilStr(file_url, tab.Html_box().Text());
   app.Usr_dlg().Prog_many("", "", "saved page: file=~{0}", file_url);
 }
예제 #3
0
 public void Copy(String v) {
   if (String_.Len_eq_0(v)) return;
   TextTransfer textTransfer = TextTransfer.getInstance();
   clipboard.setContents(new Object[] {v}, new Transfer[] {textTransfer});
 }