parameters: (self)
return_statement: return menu
docstring: menu_item = DivWdg()
          menu_item.add_class("spt_menu_item")
          menu_item.add("Create New Panel")
          menu.add(menu_item)
          menu_item.add_behavior( {
              'type': 'click',
              'cbjs_action': '''
              var class_name = 'tactic.ui.container.panel_wdg.UserPanelCreatorWdg';
              var kwargs = {
              }
              spt.panel.load_popup("Panel Creator", class_name, kwargs);
              '''
          } )
docstring_summary: menu_item = DivWdg()
          menu_item.add_class("spt_menu_item")
          menu_item.add("Create New Panel")
          menu.add(menu_item)
          menu_item.add_behavior( {
              'type': 'click',
              'cbjs_action': '''
              var class_name = 'tactic.ui.container.panel_wdg.UserPanelCreatorWdg';
              var kwargs = {
              }
              spt.panel.load_popup("Panel Creator", class_name, kwargs);
              '''
          } )
docstring_tokens: menu_item = DivWdg () menu_item . add_class ( spt_menu_item ) menu_item . add ( Create New Panel ) menu . add ( menu_item ) menu_item . add_behavior ( { type : click cbjs_action : var class_name = tactic . ui . container . panel_wdg . UserPanelCreatorWdg ; var kwargs = { } spt . panel . load_popup ( Panel Creator class_name kwargs ) ; } )
function: def get_action_menu(self):
  
          menu = DivWdg()
          menu.add_style("width: 180")
          menu.add_style("background", "#FFF")
          menu.add_style("border: solid 1px #DDD")
          menu.add_style("box-shadow: 0px 0px 15px rgba(0,0,0,0.1)")
          menu.add_style("z-index: 1000")
          menu.add_style("text-align: center")
  
          menu.add_class("spt_menu_top")
  
          style = HtmlElement.style()
          menu.add(style)
          style.add('''
          .spt_panel_layout_top .spt_menu_top .spt_menu_item {
              padding: 10px;
              border-bottom: solid 1px #DDD;
              cursor: pointer;
          }
          ''')
  
  
          menu.add_relay_behavior( {
              'type': 'mouseenter',
              'bvr_match_class': 'spt_menu_item',
              'cbjs_action': '''
              bvr.src_el.setStyle("background", "#EEE");
              '''
          } )
          menu.add_relay_behavior( {
              'type': 'mouseleave',
              'bvr_match_class': 'spt_menu_item',
              'cbjs_action': '''
              bvr.src_el.setStyle("background", "");
              '''
          } )
  
  
          """
          menu_item = DivWdg()
          menu_item.add_class("spt_menu_item")
          menu_item.add("Create New Panel")
          menu.add(menu_item)
          menu_item.add_behavior( {
              'type': 'click',
              'cbjs_action': '''
              var class_name = 'tactic.ui.container.panel_wdg.UserPanelCreatorWdg';
              var kwargs = {
              }
              spt.panel.load_popup("Panel Creator", class_name, kwargs);
              '''
          } )
          """
  
  
          login = Environment.get_user_name()
          view_filter = "pages.%s.%%" % login
  
  
          if len(self.pages) > 5:
  
  
              menu_item = DivWdg()
              menu_item.add_class("spt_menu_item")
              menu.add(menu_item)
              menu_item.add("Load Content")
              menu_item.add_behavior( {
                  'cbjs_action': '''
                  var class_name = 'tactic.ui.container.panel_wdg.UserPanelSelectWdg';
                  var kwargs = {
                      view: bvr.page,
                  }
                  var popup = spt.panel.load_popup("Load Panel", class_name, kwargs);
                  popup.activator = bvr.src_el;
  
                  '''
              } )
  
          else:
  
              for page in self.pages:
                  menu_item = DivWdg()
                  menu_item.add(page)
                  menu_item.add_class("spt_menu_item")
                  menu_item.add_behavior( {
                      'page': page,
                      'cbjs_action': '''
                      var top = bvr.src_el.getParent(".spt_panel_top");
                      var content = top.getElement(".spt_panel_content");
  
                      var class_name = 'tactic.ui.panel.CustomLayoutWdg';
                      var kwargs = {
                          view: bvr.page,
                      }
                      spt.panel.load(content, class_name, kwargs);
  
                      '''
                  } )
                  menu.add(menu_item)
  
  
  
  
          """
          menu_item = DivWdg()
          menu_item.add_class("spt_menu_item")
          menu_item.add("Edit Panel")
          menu.add(menu_item)
          menu_item.add_behavior( {
              'type': 'click',
              'view_filter': view_filter,
              'cbjs_action': '''
              spt.tab.set_main_body_tab();
              title = "Panel Editor";
              var class_name = 'tactic.ui.tools.CustomLayoutEditWdg';
              var kwargs = {
                  view_filter: bvr.view_filter
              }
              spt.tab.add_new(title, title, class_name, kwargs);
              '''
          } )
          """
  
  
  
          menu_item = DivWdg()
          menu_item.add_class("spt_menu_item")
          menu.add(menu_item)
          menu_item.add("Reload Panel")
          menu_item.add_behavior( {
              'type': 'click',
              'cbjs_action': '''
              var activator = spt.smenu.get_activator(bvr);
              var top = activator.getParent(".spt_panel_top");
              var content = top.getElement(".spt_panel_content");
              spt.panel.refresh(content);
              '''
          } )
  
  
  
  
          menu_item = DivWdg()
          menu_item.add_class("spt_menu_item")
          menu.add(menu_item)
          menu_item.add("Save Layout")
          menu_item.add_behavior( {
              'type': 'click',
              'view': self.view,
              'cbjs_action': '''
              var activator = spt.smenu.get_activator(bvr);
              var top = activator.getParent(".spt_panel_layout_top");
  
              var panels = top.getElements(".spt_panel_content");
  
              for (var i = 0; i < panels.length; i++) {
                  var panel = panels[i];
                  var content = panel.getElement(".spt_panel");
                  if (content == null) {
                      continue;
                  }
                  var class_name = content.getAttribute("spt_class_name");
                  var kwargs = spt.panel.get_element_options(content);
  
                  element_name = "panel_" + i;
  
                  try {
                      var server = TacticServerStub.get();
                      server.add_config_element("PanelLayoutWdg", bvr.view, element_name, { class_name: class_name, display_options: kwargs, unique: false });
                  }
                  catch(e) {
                      alert(e);
                      throw(e);
                  }
  
              }
  
              '''
          } )
  
  
  
  
  
  
          menu_item = DivWdg()
          menu.add(menu_item)
          menu_item.add("<< Move Left")
          menu_item.add_class("spt_menu_item")
          menu_item.add_behavior( {
              'cbjs_action': '''
              var top = bvr.src_el.getParent(".spt_panel_top");
              var prev = top.getPrevious();
              if (prev) {
                  top.inject(prev, "before");
              }
              '''
          } )
  
  
  
          menu_item = DivWdg()
          menu.add(menu_item)
          menu_item.add("Move Right >>")
          menu_item.add_class("spt_menu_item")
          menu_item.add_behavior( {
              'cbjs_action': '''
              var top = bvr.src_el.getParent(".spt_panel_top");
              var next = top.getNext();
              if (next) {
                  top.inject(next, "after");
              }
              '''
          } )
  
  
  
  
  
  
          menu_item = DivWdg()
          menu.add(menu_item)
          menu_item.add("Remove Panel")
          menu_item.add_class("spt_menu_item")
          menu_item.add_behavior( {
              'cbjs_action': '''
              var top = bvr.src_el.getParent(".spt_panel_top");
              spt.behavior.destroy_element(top);
  
              '''
          } )
  
  
          return menu
function_tokens: def get_action_menu ( self ) : menu = DivWdg ( ) menu . add_style ( "width: 180" ) menu . add_style ( "background" , "#FFF" ) menu . add_style ( "border: solid 1px #DDD" ) menu . add_style ( "box-shadow: 0px 0px 15px rgba(0,0,0,0.1)" ) menu . add_style ( "z-index: 1000" ) menu . add_style ( "text-align: center" ) menu . add_class ( "spt_menu_top" ) style = HtmlElement . style ( ) menu . add ( style ) style . add ( '''
          .spt_panel_layout_top .spt_menu_top .spt_menu_item {
              padding: 10px;
              border-bottom: solid 1px #DDD;
              cursor: pointer;
          }
          ''' ) menu . add_relay_behavior ( { 'type' : 'mouseenter' , 'bvr_match_class' : 'spt_menu_item' , 'cbjs_action' : '''
              bvr.src_el.setStyle("background", "#EEE");
              ''' } ) menu . add_relay_behavior ( { 'type' : 'mouseleave' , 'bvr_match_class' : 'spt_menu_item' , 'cbjs_action' : '''
              bvr.src_el.setStyle("background", "");
              ''' } ) login = Environment . get_user_name ( ) view_filter = "pages.%s.%%" % login if len ( self . pages ) > 5 : menu_item = DivWdg ( ) menu_item . add_class ( "spt_menu_item" ) menu . add ( menu_item ) menu_item . add ( "Load Content" ) menu_item . add_behavior ( { 'cbjs_action' : '''
                  var class_name = 'tactic.ui.container.panel_wdg.UserPanelSelectWdg';
                  var kwargs = {
                      view: bvr.page,
                  }
                  var popup = spt.panel.load_popup("Load Panel", class_name, kwargs);
                  popup.activator = bvr.src_el;
  
                  ''' } ) else : for page in self . pages : menu_item = DivWdg ( ) menu_item . add ( page ) menu_item . add_class ( "spt_menu_item" ) menu_item . add_behavior ( { 'page' : page , 'cbjs_action' : '''
                      var top = bvr.src_el.getParent(".spt_panel_top");
                      var content = top.getElement(".spt_panel_content");
  
                      var class_name = 'tactic.ui.panel.CustomLayoutWdg';
                      var kwargs = {
                          view: bvr.page,
                      }
                      spt.panel.load(content, class_name, kwargs);
  
                      ''' } ) menu . add ( menu_item ) """
          menu_item = DivWdg()
          menu_item.add_class("spt_menu_item")
          menu_item.add("Edit Panel")
          menu.add(menu_item)
          menu_item.add_behavior( {
              'type': 'click',
              'view_filter': view_filter,
              'cbjs_action': '''
              spt.tab.set_main_body_tab();
              title = "Panel Editor";
              var class_name = 'tactic.ui.tools.CustomLayoutEditWdg';
              var kwargs = {
                  view_filter: bvr.view_filter
              }
              spt.tab.add_new(title, title, class_name, kwargs);
              '''
          } )
          """ menu_item = DivWdg ( ) menu_item . add_class ( "spt_menu_item" ) menu . add ( menu_item ) menu_item . add ( "Reload Panel" ) menu_item . add_behavior ( { 'type' : 'click' , 'cbjs_action' : '''
              var activator = spt.smenu.get_activator(bvr);
              var top = activator.getParent(".spt_panel_top");
              var content = top.getElement(".spt_panel_content");
              spt.panel.refresh(content);
              ''' } ) menu_item = DivWdg ( ) menu_item . add_class ( "spt_menu_item" ) menu . add ( menu_item ) menu_item . add ( "Save Layout" ) menu_item . add_behavior ( { 'type' : 'click' , 'view' : self . view , 'cbjs_action' : '''
              var activator = spt.smenu.get_activator(bvr);
              var top = activator.getParent(".spt_panel_layout_top");
  
              var panels = top.getElements(".spt_panel_content");
  
              for (var i = 0; i < panels.length; i++) {
                  var panel = panels[i];
                  var content = panel.getElement(".spt_panel");
                  if (content == null) {
                      continue;
                  }
                  var class_name = content.getAttribute("spt_class_name");
                  var kwargs = spt.panel.get_element_options(content);
  
                  element_name = "panel_" + i;
  
                  try {
                      var server = TacticServerStub.get();
                      server.add_config_element("PanelLayoutWdg", bvr.view, element_name, { class_name: class_name, display_options: kwargs, unique: false });
                  }
                  catch(e) {
                      alert(e);
                      throw(e);
                  }
  
              }
  
              ''' } ) menu_item = DivWdg ( ) menu . add ( menu_item ) menu_item . add ( "<< Move Left" ) menu_item . add_class ( "spt_menu_item" ) menu_item . add_behavior ( { 'cbjs_action' : '''
              var top = bvr.src_el.getParent(".spt_panel_top");
              var prev = top.getPrevious();
              if (prev) {
                  top.inject(prev, "before");
              }
              ''' } ) menu_item = DivWdg ( ) menu . add ( menu_item ) menu_item . add ( "Move Right >>" ) menu_item . add_class ( "spt_menu_item" ) menu_item . add_behavior ( { 'cbjs_action' : '''
              var top = bvr.src_el.getParent(".spt_panel_top");
              var next = top.getNext();
              if (next) {
                  top.inject(next, "after");
              }
              ''' } ) menu_item = DivWdg ( ) menu . add ( menu_item ) menu_item . add ( "Remove Panel" ) menu_item . add_class ( "spt_menu_item" ) menu_item . add_behavior ( { 'cbjs_action' : '''
              var top = bvr.src_el.getParent(".spt_panel_top");
              spt.behavior.destroy_element(top);
  
              ''' } ) return menu