This method builds the layout and returns the root view.
196548
def build_view
      # Only in the 'layout' method will we allow default container to be
      # created automatically (when 'add' is called)
      @assign_root = true
      prev_should_run = @should_run_deferred
      @should_run_deferred = true
      layout
      unless @view
        if @assign_root
          create_default_root_context
          @view = @context
        else
          NSLog('Warning! No root view was set in TreeLayout#layout. Did you mean to call `root`?')
        end
      end
      run_deferred(@view)
      @should_run_deferred = prev_should_run
      @assign_root = false
      # context can be set via the 'create_default_root_context' method, which
      # may be outside a 'context' block, so make sure to restore context to
      # it's previous value
      @context = nil

      if @preset_root
        @view = WeakRef.new(@view)
        @preset_root = nil
      end

      @view
    end
463578
@PostConstruct
    public void init() {
        if (defaultDistributionSetTypeLayout.getComponentCount() > 0) {
            configurationViews.add(defaultDistributionSetTypeLayout);
        }
        configurationViews.add(repositoryConfigurationView);
        configurationViews.add(rolloutConfigurationView);
        configurationViews.add(authenticationConfigurationView);
        configurationViews.add(pollingConfigurationView);
        if (customConfigurationViews != null) {
            configurationViews.addAll(
                    customConfigurationViews.stream().filter(ConfigurationGroup::show).collect(Collectors.toList()));
        }

        final Panel rootPanel = new Panel();
        rootPanel.setStyleName("tenantconfig-root");

        final VerticalLayout rootLayout = new VerticalLayout();
        rootLayout.setSizeFull();
        rootLayout.setMargin(true);
        rootLayout.setSpacing(true);

        configurationViews.forEach(rootLayout::addComponent);

        final HorizontalLayout buttonContent = saveConfigurationButtonsLayout();
        rootLayout.addComponent(buttonContent);
        rootLayout.setComponentAlignment(buttonContent, Alignment.BOTTOM_LEFT);
        rootPanel.setContent(rootLayout);
        setCompositionRoot(rootPanel);

        configurationViews.forEach(view -> view.addChangeListener(this));
    }
954939
@SuppressWarnings("unchecked")
    protected P buildRootPane() throws CoreException {

        // Build the root node by reflection without any parameter or excluded class
        this.rootNode = (P) ClassUtility.buildGenericType(this.getClass(), Pane.class);
        return this.rootNode;
    }
114650
public function build()
    {
        $layout = Layout::blank([
            $this->layout(),
        ]);

        return $layout->build($this->post);
    }
131737
protected function runLayoutsGenerationProcess()
    {
        # Website creation
        if (null === $site = $this->entyMgr->find('BackBee\Site\Site', md5($this->siteLabel))) {
            $site = $this->createSite($this->siteLabel, $this->siteDomain);
        }
        $this->bbapp->getContainer()->set('site', $site);

        # Home layout
        if (null === $layout = $this->entyMgr->find('BackBee\Site\Layout', md5('defaultlayout-' . $this->siteLabel))) {
            $layout = $this->createHomeLayout($site);
        }

        # Creating site root page
        if (null === $root = $this->entyMgr->find('BackBee\NestedNode\Page', md5('root-' . $this->siteLabel))) {
            $root = $this->createRootPage($site, $layout);
        }        

        // Creating mediacenter root
        if (null === $mediafolder = $this->entyMgr->find('BackBee\NestedNode\MediaFolder', md5('media'))) {
            $this->createMediaFolder();
        }

        // Creating keyword
        if (null === $this->entyMgr->find('BackBee\NestedNode\KeyWord', md5('root'))) {
            $this->createKeyword();
        }

        return $this;
    }
770926
protected void buildLayout() {
        setSizeFull();
        setSpacing(true);
        setMargin(false);
        setStyleName("group");
        final VerticalLayout gridHeaderLayout = new VerticalLayout();
        gridHeaderLayout.setSizeFull();
        gridHeaderLayout.setSpacing(false);
        gridHeaderLayout.setMargin(false);

        gridHeaderLayout.setStyleName("table-layout");
        gridHeaderLayout.addComponent(gridHeader);

        gridHeaderLayout.setComponentAlignment(gridHeader, Alignment.TOP_CENTER);
        gridHeaderLayout.addComponent(grid);
        gridHeaderLayout.setComponentAlignment(grid, Alignment.TOP_CENTER);
        gridHeaderLayout.setExpandRatio(grid, 1.0F);

        addComponent(gridHeaderLayout);
        setComponentAlignment(gridHeaderLayout, Alignment.TOP_CENTER);
        setExpandRatio(gridHeaderLayout, 1.0F);
        if (hasFooterSupport()) {
            final Layout footerLayout = getFooterSupport().createFooterMessageComponent();
            addComponent(footerLayout);
            setComponentAlignment(footerLayout, Alignment.BOTTOM_CENTER);
        }

    }
443555
public function getLayout()
    {
        if ( null === $this->_layout && $this->layoutId )
        {
            $this->_layout = $this->getMapper()
                                  ->find( $this->layoutId );
        }

        return $this->_layout;
    }
1071285
private Layout getActiveLayout(Project phoenixProject)
   {
      //
      // Start with the first layout we find
      //
      Layout activeLayout = phoenixProject.getLayouts().getLayout().get(0);

      //
      // If this isn't active, find one which is... and if none are,
      // we'll just use the first.
      //
      if (!activeLayout.isActive().booleanValue())
      {
         for (Layout layout : phoenixProject.getLayouts().getLayout())
         {
            if (layout.isActive().booleanValue())
            {
               activeLayout = layout;
               break;
            }
         }
      }

      return activeLayout;
   }
406636
public function getCurrentLayout()
    {
        if (!$this->layout && $this->layoutNodeId) {
            $this->layout = $this->getStorage()->findForNodeOnSite($this->layoutNodeId, $this->layoutSiteId, true);
        }

        return $this->layout;
    }
48084
protected function loadLayout()
    {
        $this->hook->trigger(self::HOOK_LOAD_LAYOUT_BEFORE);

        if ($this->config->get('parable.layout.header')) {
            $this->response->setHeaderContent(
                $this->view->partial($this->config->get('parable.layout.header'))
            );
        }
        if ($this->config->get('parable.layout.footer')) {
            $this->response->setFooterContent(
                $this->view->partial($this->config->get('parable.layout.footer'))
            );
        }

        $this->hook->trigger(self::HOOK_LOAD_LAYOUT_AFTER);
        return $this;
    }
912469
@Override
    public final V view() {
        if (this.view == null) {
            try {
                this.view = buildView();
            } catch (final CoreException ce) {
                LOGGER.log(UIMessages.CREATION_FAILURE, ce, this.getClass().getName());
                throw new CoreRuntimeException(ce);
            }
        }
        return this.view;
    }
402921
public UI wrapLayout(Layout layout) {
        // TODO: add a header to switch the style, etc
        // TODO: add bookmark to set the style
        if (server.getConfig().isDevelopmentHeader()) {
            final VerticalSplitPanel mainLayout = new VerticalSplitPanel();
            mainLayout.setSizeFull();
            mainLayout.setSplitPosition(SPLIT_POSITION, Sizeable.Unit.PIXELS);
            mainLayout.setLocked(true);

            final DevApplicationHeader header = new DevApplicationHeader(server);
            header.setSpacing(true);
            mainLayout.setFirstComponent(header);

            mainLayout.setSecondComponent(layout);

            return new DevUI(mainLayout);
        } else {
            return new DevUI(layout);
        }
    }
490297
private void init() {
        this.setOrientation(LinearLayout.VERTICAL);
        mLayoutParams = new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
    }
511546
@SuppressWarnings("unchecked")
    protected V buildView() throws CoreException {

        return (V) ClassUtility.findAndBuildGenericType(this.getClass(), View.class, NullView.class, this);
    }
1113357
def init_layout(self):
        
        super(AndroidDialog, self).init_layout()

        #: Set the content
        for view in self.child_widgets():
            self.dialog.setContentView(view)
            break

        #: Show it if needed
        d = self.declaration
        if d.show:
            self.set_show(d.show)
321503
public static View inflateView(LayoutInflater inflater, ViewGroup parent, int layoutId) {
        return inflater.inflate(layoutId, parent, false);
    }
688928
public Query build() {
            Query.Builder root = this;
            while (true) {
                if (root.parent == null) {
                    break;
                }
                root = root.parent;
            }

            root.done();
            return root.tree;
        }