parameters: (self)
return_statement: return top
docstring: attr_table.add_row()
          td = attr_table.add_cell("Default Access: ")
          td.add_style("padding: 5px")
          access_select = SelectWdg("attr|default_access")
          access_select.set_option("values", "allow|deny")
          if access:
              access_select.set_value(access)
          attr_table.add_cell(access_select)
docstring_summary: attr_table.add_row()
          td = attr_table.add_cell("Default Access: ")
          td.add_style("padding: 5px")
          access_select = SelectWdg("attr|default_access")
          access_select.set_option("values", "allow|deny")
          if access:
              access_select.set_value(access)
          attr_table.add_cell(access_select)
docstring_tokens: attr_table . add_row () td = attr_table . add_cell ( Default Access : ) td . add_style ( padding : 5px ) access_select = SelectWdg ( attr|default_access ) access_select . set_option ( values allow|deny ) if access : access_select . set_value ( access ) attr_table . add_cell ( access_select )
function: def get_display(self):
          top = DivWdg()
          top.add_class("spt_element_definition")
          #top.add_style("width: 530px")
  
          self.is_edit_layout = self.kwargs.get("is_edit_layout")
          self.is_insert = self.kwargs.get("is_insert")
          
          if self.is_insert in ['true', True]:
              self.is_insert = True
          else:
              self.is_insert = False
  
          self.simple_view_only = self.kwargs.get("simple_view_only") in ['true', True]
          element_name = self.kwargs.get('element_name')
          search_type = self.kwargs.get('search_type')
          self.search_type = search_type
          view = self.kwargs.get('view')
  
          config_view = WidgetConfigView.get_by_search_type(search_type, view)
          configs = WidgetConfigView.get_by_type("column")
          config_view.get_configs().extend(configs)
  
  
          edit_config_view = WidgetConfigView.get_by_search_type(search_type, "edit")
  
          if self.is_insert in ['false', False]:
  
              display_class = config_view.get_display_handler(element_name)
              widget_key = config_view.get_widget_key(element_name,'display')
              display_options = config_view.get_display_options(element_name)
              element_attr = config_view.get_element_attributes(element_name)
  
              # test build the class
              try:
                  widget = config_view.get_display_widget(element_name)
              except Exception as e:
                  print("ERROR: ", e)
                  widget = None
              is_editable = False
              if hasattr(widget, 'is_editable'):
                  is_editable = widget.is_editable()
  
              
              if is_editable:
                  #edit_config_view = self.kwargs.get("edit_config_view")
                  edit_class = edit_config_view.get_edit_handler(element_name)
                  edit_widget_key = edit_config_view.get_widget_key(element_name)
                  edit_options = edit_config_view.get_options(element_name, "edit")
                  action_class = edit_config_view.get_action_handler(element_name)
                  
              else:
                  edit_class = ''
                  edit_widget_key = ''
                  edit_options = {}
                  action_class = ''
              
              # build the xml string
              configs = config_view.get_configs()
              for x in configs:
                  xml_str = x.get_element_xml(element_name)
                  xml_str = xml_str.strip()
                  if xml_str and xml_str != "<element name='%s'/>" % element_name:
                      break
              if not xml_str:
                  xml_str = "<element name='%s'/>" % element_name
  
  
              edit = element_attr.get('edit')
              show_color  = element_attr.get('color')
              title = element_attr.get('title')
              width = element_attr.get('width')
              access = element_attr.get('access')
              if is_editable:
                  if is_editable=='optional':
                      # it needs to be explicit in this case to turn on the editability for Edit Panel mainly
                      editable = element_attr.get('edit') == 'true'
                  else:
                      editable = element_attr.get('edit') != 'false'
              else:
                 
  
                  editable = False
  
  
          else:
              widget_key = ''
              edit_widget_key = ''
              display_class = ''
              display_options = {}
  
              edit_class = ''
              edit_options = {}
              action_class = ''
  
              element_name = ''
              edit = ''
              title = ''
              width = ''
              xml_str = ''
              editable = True
  
  
  
  
          # add in the mode selected
          mode_wdg = DivWdg()
          mode_wdg.add("<div style='float: left; display: inline-block; margin-right: 10px'>Mode: </div>")
          mode_select = SelectWdg("mode")
          mode_select.add_style("width: 120px")
          mode_select.add_class('spt_element_def_mode')
          mode_select.set_option("labels", "Form|XML")
          mode_select.set_option("values", "form|xml")
          # we want to start in Form all the time
          #mode_select.set_persistence()
          mode_select.add_behavior({
              'type': 'change',
              'cbjs_action': '''
              var value = bvr.src_el.value;
              var top = bvr.src_el.getParent(".spt_element_definition");
              var form_el = top.getElement(".spt_form_top");
              var xml_el = top.getElement(".spt_xml_top");
  
              if (value == 'form') {
                 spt.show(form_el);
                 spt.hide(xml_el);
              }
              else {
                 spt.show(xml_el);
                 spt.hide(form_el);
              }
  
              '''
          })
          mode_wdg.add(mode_select)
          mode_wdg.add_style("margin: 0px -2px 0px 0px")
          mode_wdg.add_style("width: 160px")
          mode_wdg.add_style("white-space: nowrap")
          mode_wdg.add_style("display: flex")
          mode_wdg.add_style("align-items: center")
          mode = mode_select.get_value()
  
  
          # add the save button
          from tactic.ui.widget import ActionButtonWdg
          save_button = ActionButtonWdg( title='Save', tip='Save To Definition' )
          save_button.add_style("margin: 3px 3px 5px 3px")
          save_button.add_style("float: right")
          save_button.add_behavior( {
          'type': 'click_up',
          'is_insert': self.is_insert,
          'search_type': self.search_type,
          'cbjs_action': self._get_save_cbjs_action()
          } )
  
  
          title_div = DivWdg()
          top.add(title_div)
          title_div.add_style("display: flex")
          title_div.add_style("justify-content: space-between")
          title_div.add_style("align-items: center")
          title_div.add_color("background", "background", -3 )
          title_div.add_style("margin: 0 -1 10 -1")
          title_div.add_style("font-weight: bold")
          title_div.add_style("padding: 4px")
          #title_div.add_style("width: 520px")
          title_div.add_style("height: 36px")
          title_div.add_border()
          if self.is_insert:
              title_div.add("Add New Column")
          else:
              title_div.add("Edit Column Definition")
  
          if (not self.is_insert) and (not self.simple_view_only):
  
              title_div.add(mode_wdg)
  
              shelf_wdg = DivWdg()
              top.add(shelf_wdg)
              shelf_wdg.add_style("display: flex")
              shelf_wdg.add_style("align-items: center")
              shelf_wdg.add_style("justify-content: flex-end")
              gear = self.get_gear_menu(view)
                  
              # add gear menu 
              shelf_wdg.add(save_button)
              shelf_wdg.add(gear)
  
  
  
  
          #top.add("<br clear='all'/>")
  
  
  
          # add in the pure xml wdg
          xml_wdg = self.get_xml_wdg(xml_str)
          if mode != 'xml':
              xml_wdg.add_style("display: none")
  
          config_wdg = self.get_definition_configs(config_view, element_name)
          xml_wdg.add('<br/>')
          xml_wdg.add(config_wdg)
  
          xml_wdg.add_class("spt_xml_top")
          top.add(xml_wdg)
  
          # add the name
          from pyasm.web import Table
          table = Table()
          table.add_color("color", "color")
          table.add_class("spt_form_top")
          #table.add_style("width: 530px")
          table.add_style("width: 100%")
          if mode == 'xml':
              table.add_style("display: none")
          top.add(table)
      
          tr, td = table.add_row_cell()
  
          attr_wdg = DivWdg()
          attr_wdg.add_color("background", "background", -3)
          attr_wdg.add_style("margin: 10px -2px 10px -2px")
          attr_wdg.add_style("padding: 10px")
          attr_wdg.add_border()
          #title_wdg = DivWdg()
          #title_wdg.add("Element Attributes")
          #title_wdg.add_style("margin-top: -25px")
          #attr_wdg.add(title_wdg)
          td.add(attr_wdg)
  
  
          attr_table = Table()
          attr_table.add_color("color", "color")
  
  
          # add the title
          attr_table.add_row()
          td = attr_table.add_cell("Title: ")
          td.add_style("padding: 5px")
          title_text = TextWdg("attr|title")
          title_text.add_class("form-control")
          title_text.add_class("spt_element_definition_title")
          title_text.add_style("margin-bottom: 8px")
          title_text.add_attr("size", "50")
          title_text.add_style("height: 25px")
          if title:
              title_text.set_value(title)
          attr_table.add_cell(title_text)
          attr_wdg.add(attr_table)
  
          title_text.add_behavior( {
          'type': 'change',
          'cbjs_action': '''
          var top = bvr.src_el.getParent(".spt_element_definition");
          var el = top.getElement(".spt_element_definition_name");
          if (el && el.getStyle("display") != "none") {
              var value = bvr.src_el.value;
              var name = spt.convert_to_alpha_numeric(value);
              el.value = name;
          }
          '''
          } )
  
  
          show_title_details = self.kwargs.get("show_title_details") or True
          if show_title_details in ['false', False]:
              show_title_details = False
          else:
              show_title_details = True
  
  
  
          # add in the name widget
          tr = attr_table.add_row()
          if not show_title_details:
              tr.add_style("display: none")
  
          td = attr_table.add_cell("Name: ")
          td.add_style("padding: 5px")
          td = attr_table.add_cell()
          name = self.kwargs.get("element_name")
          if self.is_insert:
              name_text = TextWdg("name")
              name_text.add_style("margin-bottom: 8px")
              name_text.add_class("form-control")
              name_text.add_class("spt_element_definition_name")
              name_text.add_style("height: 25px")
              name_text.add_attr("size", "50")
  
              td.add(name_text)
  
          else:
              #hidden = HiddenWdg("name", element_name)
              hidden = TextWdg("name")
              td.add(hidden)
              hidden.set_value(element_name)
              hidden.add_style("display", "none")
              hidden.add_class("spt_element_definition_name")
              if name:
                  hidden.set_value(name)
  
              td.add_behavior( {
                  'type': 'click_up',
                  'cbjs_action': '''
                  var el = bvr.src_el.getElement(".spt_element_definition_name");
                  spt.toggle_show_hide(el);
                  var el2 = bvr.src_el.getElement(".spt_element_definition_span");
                  spt.toggle_show_hide(el2);
                  '''
              } )
  
  
              name_text = SpanWdg(element_name)
              name_text.add_class("spt_element_definition_span")
              td.add(name_text)
              name_text.add_style('font-weight: bold')
  
  
   
          # add the default security
          """
          attr_table.add_row()
          td = attr_table.add_cell("Default Access: ")
          td.add_style("padding: 5px")
          access_select = SelectWdg("attr|default_access")
          access_select.set_option("values", "allow|deny")
          if access:
              access_select.set_value(access)
          attr_table.add_cell(access_select)
          """
  
  
   
          # add the width
          tr = attr_table.add_row()
  
          if not show_title_details:
              tr.add_style("display: none")
  
          td = attr_table.add_cell("Width: ")
          td.add_style("padding: 5px")
          width_text = TextWdg("attr|width")
          width_text.add_class("form-control")
          width_text.add_style("height: 25px")
          width_text.add_style("width: 75px")
          width_text.add_style("margin-bottom: 8px")
          if width:
              width_text.set_value(width)
          width_text.add_attr("size", "3")
          attr_table.add_cell(width_text)
  
   
          if not self.is_insert and not self.simple_view_only:
  
              tr, td = attr_table.add_row_cell()
              span = DivWdg("Enable Colors: ")
              span.add_style('margin-left: 5px')
              span.add_style('margin-top: 4px')
              td.add(span)
              color_wdg = CheckboxWdg("attr|color")
              span.add(color_wdg)
              color_wdg.add_attr("size", "50")
              show_color = show_color != 'false'
              if show_color:
                  color_wdg.set_checked()
  
  
              # this is required if one is changing the View mode definition post creation
              # while making its editability info intact
              # add a hidden View Mode Enable edit here when not in insert mode
              editable_wdg = CheckboxWdg("attr|editable")
              editable_wdg.add_style('display: none')
              if editable:
                  editable_wdg.set_checked()
                  # set a original state to remember it is checked initially
                  editable_wdg.set_attr('orig', 'true')
  
              td.add(editable_wdg)
  
  
          tr, td = table.add_row_cell()
          td.add_style("padding-top: 20px")
  
         
          is_edit_layout = self.kwargs.get('is_edit_layout') == 'true'
  
          if not is_edit_layout:
              tr, td = table.add_row_cell()
              td.add(HtmlElement.br())
              attr_wdg = DivWdg()
              attr_wdg.add_color("background", "background", -3)
              attr_wdg.add_style("margin-top: 5px")
              attr_wdg.add_style("padding: 10px")
              attr_wdg.add_border()
              attr_wdg.add_style("margin: 10px -2px 10px -2px")
              title_wdg = DivWdg()
              title_wdg.add("Display Options")
              title_wdg.add_style("margin-top: -25px")
              title_wdg.add_style("font-size: 1.2em")
              attr_wdg.add(title_wdg)
              td.add(attr_wdg)
  
  
              if not display_class:
                  display_class = self.kwargs.get('display_handler')
  
  
              column_config_view = self.kwargs.get("column_config_view")
  
              if column_config_view:
                  class_labels = None
                  class_values = None
  
                  default_class=''
  
              else:
  
                  # add the widget information
                  class_labels = ['Empty', 'Raw Data', 'Default', 'Formatted Value', 'Expression', 'Expression Value', 'Button', 'Link', 'Gantt', 'Hidden Row', 'Drop Item', 'Completion', 'Custom Layout', 'Python', '-- Class Path --']
                  class_values = ['', 'raw_data', 'default', 'format', 'expression', 'expression_value', 'button', 'link', 'gantt', 'hidden_row', 'drop_item', 'completion', 'custom_layout', 'python', '__class__']
  
  
                  default_class='format'
  
              widget_class_wdg = WidgetClassSelectorWdg(widget_key=widget_key, display_class=display_class, display_options=display_options,class_labels=class_labels,class_values=class_values, prefix='option', default_class=default_class, show_action=False, element_name=element_name, column_config_view=column_config_view)
              attr_wdg.add(widget_class_wdg)
  
  
  
  
          tr, td = table.add_row_cell()
          td.add(HtmlElement.br())
  
     
          if not self.is_insert and not self.simple_view_only:
              tr, td = table.add_row_cell()
  
              title_wdg = DivWdg()
              swap = SwapDisplayWdg.get_triangle_wdg()
              title_wdg.add(swap)
              title_wdg.add("Colors")
              td.add(title_wdg)
  
              color_wdg = DivWdg()
              SwapDisplayWdg.create_swap_title(title_wdg, swap, color_wdg, is_open=False)
              color_wdg.add_class("spt_element_colors")
              color_wdg.add_style("display: none")
              color_wdg.add_color("background", "background", -3)
              color_wdg.add_style("margin-left: 5px")
              color_wdg.add_style("margin-bottom: 10px")
              color_wdg.add_style("padding: 10px")
              color_wdg.add_border()
              td.add(color_wdg)
  
              # add the color widget information
              color_wdg.add( self.get_color_wdg() )
  
              # add definition configs
              tr, td = table.add_row_cell()
  
              config_wdg = self.get_definition_configs(config_view, element_name)
              td.add(config_wdg)
          
          top.add_style("margin-bottom: 10px")
  
          # set the main xml value if one with display handler is found
          if self.main_xml:
              self.main_xml_text.set_value(self.main_xml)
          return top
function_tokens: def get_display ( self ) : top = DivWdg ( ) top . add_class ( "spt_element_definition" ) #top.add_style("width: 530px") self . is_edit_layout = self . kwargs . get ( "is_edit_layout" ) self . is_insert = self . kwargs . get ( "is_insert" ) if self . is_insert in [ 'true' , True ] : self . is_insert = True else : self . is_insert = False self . simple_view_only = self . kwargs . get ( "simple_view_only" ) in [ 'true' , True ] element_name = self . kwargs . get ( 'element_name' ) search_type = self . kwargs . get ( 'search_type' ) self . search_type = search_type view = self . kwargs . get ( 'view' ) config_view = WidgetConfigView . get_by_search_type ( search_type , view ) configs = WidgetConfigView . get_by_type ( "column" ) config_view . get_configs ( ) . extend ( configs ) edit_config_view = WidgetConfigView . get_by_search_type ( search_type , "edit" ) if self . is_insert in [ 'false' , False ] : display_class = config_view . get_display_handler ( element_name ) widget_key = config_view . get_widget_key ( element_name , 'display' ) display_options = config_view . get_display_options ( element_name ) element_attr = config_view . get_element_attributes ( element_name ) # test build the class try : widget = config_view . get_display_widget ( element_name ) except Exception as e : print ( "ERROR: " , e ) widget = None is_editable = False if hasattr ( widget , 'is_editable' ) : is_editable = widget . is_editable ( ) if is_editable : #edit_config_view = self.kwargs.get("edit_config_view") edit_class = edit_config_view . get_edit_handler ( element_name ) edit_widget_key = edit_config_view . get_widget_key ( element_name ) edit_options = edit_config_view . get_options ( element_name , "edit" ) action_class = edit_config_view . get_action_handler ( element_name ) else : edit_class = '' edit_widget_key = '' edit_options = { } action_class = '' # build the xml string configs = config_view . get_configs ( ) for x in configs : xml_str = x . get_element_xml ( element_name ) xml_str = xml_str . strip ( ) if xml_str and xml_str != "<element name='%s'/>" % element_name : break if not xml_str : xml_str = "<element name='%s'/>" % element_name edit = element_attr . get ( 'edit' ) show_color = element_attr . get ( 'color' ) title = element_attr . get ( 'title' ) width = element_attr . get ( 'width' ) access = element_attr . get ( 'access' ) if is_editable : if is_editable == 'optional' : # it needs to be explicit in this case to turn on the editability for Edit Panel mainly editable = element_attr . get ( 'edit' ) == 'true' else : editable = element_attr . get ( 'edit' ) != 'false' else : editable = False else : widget_key = '' edit_widget_key = '' display_class = '' display_options = { } edit_class = '' edit_options = { } action_class = '' element_name = '' edit = '' title = '' width = '' xml_str = '' editable = True # add in the mode selected mode_wdg = DivWdg ( ) mode_wdg . add ( "<div style='float: left; display: inline-block; margin-right: 10px'>Mode: </div>" ) mode_select = SelectWdg ( "mode" ) mode_select . add_style ( "width: 120px" ) mode_select . add_class ( 'spt_element_def_mode' ) mode_select . set_option ( "labels" , "Form|XML" ) mode_select . set_option ( "values" , "form|xml" ) # we want to start in Form all the time #mode_select.set_persistence() mode_select . add_behavior ( { 'type' : 'change' , 'cbjs_action' : '''
              var value = bvr.src_el.value;
              var top = bvr.src_el.getParent(".spt_element_definition");
              var form_el = top.getElement(".spt_form_top");
              var xml_el = top.getElement(".spt_xml_top");
  
              if (value == 'form') {
                 spt.show(form_el);
                 spt.hide(xml_el);
              }
              else {
                 spt.show(xml_el);
                 spt.hide(form_el);
              }
  
              ''' } ) mode_wdg . add ( mode_select ) mode_wdg . add_style ( "margin: 0px -2px 0px 0px" ) mode_wdg . add_style ( "width: 160px" ) mode_wdg . add_style ( "white-space: nowrap" ) mode_wdg . add_style ( "display: flex" ) mode_wdg . add_style ( "align-items: center" ) mode = mode_select . get_value ( ) # add the save button from tactic . ui . widget import ActionButtonWdg save_button = ActionButtonWdg ( title = 'Save' , tip = 'Save To Definition' ) save_button . add_style ( "margin: 3px 3px 5px 3px" ) save_button . add_style ( "float: right" ) save_button . add_behavior ( { 'type' : 'click_up' , 'is_insert' : self . is_insert , 'search_type' : self . search_type , 'cbjs_action' : self . _get_save_cbjs_action ( ) } ) title_div = DivWdg ( ) top . add ( title_div ) title_div . add_style ( "display: flex" ) title_div . add_style ( "justify-content: space-between" ) title_div . add_style ( "align-items: center" ) title_div . add_color ( "background" , "background" , - 3 ) title_div . add_style ( "margin: 0 -1 10 -1" ) title_div . add_style ( "font-weight: bold" ) title_div . add_style ( "padding: 4px" ) #title_div.add_style("width: 520px") title_div . add_style ( "height: 36px" ) title_div . add_border ( ) if self . is_insert : title_div . add ( "Add New Column" ) else : title_div . add ( "Edit Column Definition" ) if ( not self . is_insert ) and ( not self . simple_view_only ) : title_div . add ( mode_wdg ) shelf_wdg = DivWdg ( ) top . add ( shelf_wdg ) shelf_wdg . add_style ( "display: flex" ) shelf_wdg . add_style ( "align-items: center" ) shelf_wdg . add_style ( "justify-content: flex-end" ) gear = self . get_gear_menu ( view ) # add gear menu  shelf_wdg . add ( save_button ) shelf_wdg . add ( gear ) #top.add("<br clear='all'/>") # add in the pure xml wdg xml_wdg = self . get_xml_wdg ( xml_str ) if mode != 'xml' : xml_wdg . add_style ( "display: none" ) config_wdg = self . get_definition_configs ( config_view , element_name ) xml_wdg . add ( '<br/>' ) xml_wdg . add ( config_wdg ) xml_wdg . add_class ( "spt_xml_top" ) top . add ( xml_wdg ) # add the name from pyasm . web import Table table = Table ( ) table . add_color ( "color" , "color" ) table . add_class ( "spt_form_top" ) #table.add_style("width: 530px") table . add_style ( "width: 100%" ) if mode == 'xml' : table . add_style ( "display: none" ) top . add ( table ) tr , td = table . add_row_cell ( ) attr_wdg = DivWdg ( ) attr_wdg . add_color ( "background" , "background" , - 3 ) attr_wdg . add_style ( "margin: 10px -2px 10px -2px" ) attr_wdg . add_style ( "padding: 10px" ) attr_wdg . add_border ( ) #title_wdg = DivWdg() #title_wdg.add("Element Attributes") #title_wdg.add_style("margin-top: -25px") #attr_wdg.add(title_wdg) td . add ( attr_wdg ) attr_table = Table ( ) attr_table . add_color ( "color" , "color" ) # add the title attr_table . add_row ( ) td = attr_table . add_cell ( "Title: " ) td . add_style ( "padding: 5px" ) title_text = TextWdg ( "attr|title" ) title_text . add_class ( "form-control" ) title_text . add_class ( "spt_element_definition_title" ) title_text . add_style ( "margin-bottom: 8px" ) title_text . add_attr ( "size" , "50" ) title_text . add_style ( "height: 25px" ) if title : title_text . set_value ( title ) attr_table . add_cell ( title_text ) attr_wdg . add ( attr_table ) title_text . add_behavior ( { 'type' : 'change' , 'cbjs_action' : '''
          var top = bvr.src_el.getParent(".spt_element_definition");
          var el = top.getElement(".spt_element_definition_name");
          if (el && el.getStyle("display") != "none") {
              var value = bvr.src_el.value;
              var name = spt.convert_to_alpha_numeric(value);
              el.value = name;
          }
          ''' } ) show_title_details = self . kwargs . get ( "show_title_details" ) or True if show_title_details in [ 'false' , False ] : show_title_details = False else : show_title_details = True # add in the name widget tr = attr_table . add_row ( ) if not show_title_details : tr . add_style ( "display: none" ) td = attr_table . add_cell ( "Name: " ) td . add_style ( "padding: 5px" ) td = attr_table . add_cell ( ) name = self . kwargs . get ( "element_name" ) if self . is_insert : name_text = TextWdg ( "name" ) name_text . add_style ( "margin-bottom: 8px" ) name_text . add_class ( "form-control" ) name_text . add_class ( "spt_element_definition_name" ) name_text . add_style ( "height: 25px" ) name_text . add_attr ( "size" , "50" ) td . add ( name_text ) else : #hidden = HiddenWdg("name", element_name) hidden = TextWdg ( "name" ) td . add ( hidden ) hidden . set_value ( element_name ) hidden . add_style ( "display" , "none" ) hidden . add_class ( "spt_element_definition_name" ) if name : hidden . set_value ( name ) td . add_behavior ( { 'type' : 'click_up' , 'cbjs_action' : '''
                  var el = bvr.src_el.getElement(".spt_element_definition_name");
                  spt.toggle_show_hide(el);
                  var el2 = bvr.src_el.getElement(".spt_element_definition_span");
                  spt.toggle_show_hide(el2);
                  ''' } ) name_text = SpanWdg ( element_name ) name_text . add_class ( "spt_element_definition_span" ) td . add ( name_text ) name_text . add_style ( 'font-weight: bold' ) # add the default security # add the width tr = attr_table . add_row ( ) if not show_title_details : tr . add_style ( "display: none" ) td = attr_table . add_cell ( "Width: " ) td . add_style ( "padding: 5px" ) width_text = TextWdg ( "attr|width" ) width_text . add_class ( "form-control" ) width_text . add_style ( "height: 25px" ) width_text . add_style ( "width: 75px" ) width_text . add_style ( "margin-bottom: 8px" ) if width : width_text . set_value ( width ) width_text . add_attr ( "size" , "3" ) attr_table . add_cell ( width_text ) if not self . is_insert and not self . simple_view_only : tr , td = attr_table . add_row_cell ( ) span = DivWdg ( "Enable Colors: " ) span . add_style ( 'margin-left: 5px' ) span . add_style ( 'margin-top: 4px' ) td . add ( span ) color_wdg = CheckboxWdg ( "attr|color" ) span . add ( color_wdg ) color_wdg . add_attr ( "size" , "50" ) show_color = show_color != 'false' if show_color : color_wdg . set_checked ( ) # this is required if one is changing the View mode definition post creation # while making its editability info intact # add a hidden View Mode Enable edit here when not in insert mode editable_wdg = CheckboxWdg ( "attr|editable" ) editable_wdg . add_style ( 'display: none' ) if editable : editable_wdg . set_checked ( ) # set a original state to remember it is checked initially editable_wdg . set_attr ( 'orig' , 'true' ) td . add ( editable_wdg ) tr , td = table . add_row_cell ( ) td . add_style ( "padding-top: 20px" ) is_edit_layout = self . kwargs . get ( 'is_edit_layout' ) == 'true' if not is_edit_layout : tr , td = table . add_row_cell ( ) td . add ( HtmlElement . br ( ) ) attr_wdg = DivWdg ( ) attr_wdg . add_color ( "background" , "background" , - 3 ) attr_wdg . add_style ( "margin-top: 5px" ) attr_wdg . add_style ( "padding: 10px" ) attr_wdg . add_border ( ) attr_wdg . add_style ( "margin: 10px -2px 10px -2px" ) title_wdg = DivWdg ( ) title_wdg . add ( "Display Options" ) title_wdg . add_style ( "margin-top: -25px" ) title_wdg . add_style ( "font-size: 1.2em" ) attr_wdg . add ( title_wdg ) td . add ( attr_wdg ) if not display_class : display_class = self . kwargs . get ( 'display_handler' ) column_config_view = self . kwargs . get ( "column_config_view" ) if column_config_view : class_labels = None class_values = None default_class = '' else : # add the widget information class_labels = [ 'Empty' , 'Raw Data' , 'Default' , 'Formatted Value' , 'Expression' , 'Expression Value' , 'Button' , 'Link' , 'Gantt' , 'Hidden Row' , 'Drop Item' , 'Completion' , 'Custom Layout' , 'Python' , '-- Class Path --' ] class_values = [ '' , 'raw_data' , 'default' , 'format' , 'expression' , 'expression_value' , 'button' , 'link' , 'gantt' , 'hidden_row' , 'drop_item' , 'completion' , 'custom_layout' , 'python' , '__class__' ] default_class = 'format' widget_class_wdg = WidgetClassSelectorWdg ( widget_key = widget_key , display_class = display_class , display_options = display_options , class_labels = class_labels , class_values = class_values , prefix = 'option' , default_class = default_class , show_action = False , element_name = element_name , column_config_view = column_config_view ) attr_wdg . add ( widget_class_wdg ) tr , td = table . add_row_cell ( ) td . add ( HtmlElement . br ( ) ) if not self . is_insert and not self . simple_view_only : tr , td = table . add_row_cell ( ) title_wdg = DivWdg ( ) swap = SwapDisplayWdg . get_triangle_wdg ( ) title_wdg . add ( swap ) title_wdg . add ( "Colors" ) td . add ( title_wdg ) color_wdg = DivWdg ( ) SwapDisplayWdg . create_swap_title ( title_wdg , swap , color_wdg , is_open = False ) color_wdg . add_class ( "spt_element_colors" ) color_wdg . add_style ( "display: none" ) color_wdg . add_color ( "background" , "background" , - 3 ) color_wdg . add_style ( "margin-left: 5px" ) color_wdg . add_style ( "margin-bottom: 10px" ) color_wdg . add_style ( "padding: 10px" ) color_wdg . add_border ( ) td . add ( color_wdg ) # add the color widget information color_wdg . add ( self . get_color_wdg ( ) ) # add definition configs tr , td = table . add_row_cell ( ) config_wdg = self . get_definition_configs ( config_view , element_name ) td . add ( config_wdg ) top . add_style ( "margin-bottom: 10px" ) # set the main xml value if one with display handler is found if self . main_xml : self . main_xml_text . set_value ( self . main_xml ) return top