#NEWLINE# def a2btn( self , ba , **kw ) : #NEWLINE# #INDENT# a = ba . action #NEWLINE# if ( a . parameters and ( not a . no_params_window ) ) : #NEWLINE# #INDENT# kw . update ( panel_btn_handler = js_code ( ( 'Lino.param_action_handler(Lino.%s)' % ba . full_name ( ) ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( a , SubmitInsert ) : #NEWLINE# #INDENT# js = 'function(panel){panel.save()}' #NEWLINE# kw . update ( panel_btn_handler = js_code ( js ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( a , SubmitDetail ) : #NEWLINE# #INDENT# js = 'function(panel){panel.save()}' #NEWLINE# kw . update ( panel_btn_handler = js_code ( js ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( a , ShowDetailAction ) : #NEWLINE# #INDENT# kw . update ( panel_btn_handler = js_code ( 'Lino.show_detail' ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( a , InsertRow ) : #NEWLINE# #INDENT# kw . update ( panel_btn_handler = js_code ( 'Lino.show_insert' ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# kw . update ( panel_btn_handler = js_code ( self . get_panel_btn_handler ( ba ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# if a . icon_name : #NEWLINE# #INDENT# kw . update ( iconCls = ( 'x-tbar-' + a . icon_name ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# kw . update ( text = a . label ) #NEWLINE# #UNINDENT# kw . update ( menu_item_text = a . label , overflowText = a . label , auto_save = a . auto_save , itemId = a . action_name ) #NEWLINE# if a . key : #NEWLINE# #INDENT# kw . update ( keycode = a . key . keycode ) #NEWLINE# #UNINDENT# if a . help_text : #NEWLINE# #INDENT# kw . update ( tooltip = a . help_text ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ba . icon_name : #NEWLINE# #INDENT# kw . update ( tooltip = a . label ) #NEWLINE# #UNINDENT# #UNINDENT# return kw