Apply a layout to the given `view`.

@name .applyLayout
@param  {Object} `view`
@return {Object} Returns a `view` object.
971522
function(view) {
    if (view.options.layoutApplied) {
      return view;
    }

    // handle pre-layout middleware
    this.handle('preLayout', view);

    var opts = {};
    lazy.extend(opts, this.options);
    lazy.extend(opts, view.options);
    lazy.extend(opts, view.context());

    // get the layout stack
    var stack = {};
    var alias = this.viewTypes.layout;
    var len = alias.length, i = 0;

    while (len--) {
      var views = this.views[alias[i++]];
      for (var key in views) {
        var val = views[key];
        if (views.hasOwnProperty(key) && typeof val !== 'function' && val.path) {
          stack[key] = val;
        }
      }
    }

    // get the name of the first layout
    var name = view.layout;
    var str = view.content;
    var self = this;

    if (!name) return view;

    // Handle each layout before it's applied to a view
    function handleLayout(layoutObj) {
      view.currentLayout = layoutObj.layout;
      self.handle('onLayout', view);
      delete view.currentLayout;
    }

    // actually apply the layout
    var res = lazy.layouts(str, name, stack, opts, handleLayout);

    view.option('layoutStack', res.history);
    view.option('layoutApplied', true);
    view.content = res.result;

    // handle post-layout middleware
    this.handle('postLayout', view);
    return view;
  }
1339077
public static void apply(@NonNull View view) {
        if (view.isInEditMode()) {
            return;
        }

        final AssetManager assets = view.getContext().getAssets();
        if (view instanceof TextView) {
            setTypeface((TextView) view, getFontFromTag(assets, view, false));
        } else if (view instanceof ViewGroup) {
            applyAllRecursively((ViewGroup) view, assets);
        }
    }
506337
function(view) {
        // If we're destroying, the entire subtree will be
        // freed, and the DOM will be handled separately,
        // so no need to mess with childViews.
        if (this.isDestroying) { return; }

        // update parent node
        set(view, '_parentView', null);

        // remove view from childViews array.
        var childViews = this._childViews;

        removeObject(childViews, view);

        this.propertyDidChange('childViews'); // HUH?! what happened to will change?

        return this;
      }
19161
protected final void invokeOnLayout(View view, boolean changed, int l, int t, int r, int b) {
        final ViewProxy proxy = (ViewProxy) view;
        proxy.invokeOnLayout(changed, l, t, r, b);
    }
831268
function layoutNode (root) {
  var rootNode = createNode(root);
  computeLayout(rootNode);
  walkNode(rootNode);
  return rootNode;
}
149871
function(view) {
    if (!view) {
      throw new TypeError('A binding must clone against a view');
    }

    var node = view;
    this._elementPath.forEach(function(index) {
      node = node.childNodes[index];
    });

    var binding = Object.create(this);
    binding.clonedFrom = this;
    binding.view = view;
    binding.element = node;
    binding.node = node;
    binding.init();
    return binding;
  }
47869
function(view, force) {
    var parentViews;
    // Shorthand the managers for easier access.
    var manager = view.__manager__;
    var rentManager = manager.parent && manager.parent.__manager__;
    // Test for keep.
    var keep = typeof view.keep === "boolean" ? view.keep : view.options.keep;

    // In insert mode, remove views that do not have `keep` attribute set,
    // unless the force flag is set.
    if ((!keep && rentManager && rentManager.insert === true) || force) {
      // Clean out the events.
      LayoutManager.cleanViews(view);

      // Since we are removing this view, force subviews to remove
      view._removeViews(true);

      // Remove the View completely.
      view.$el.remove();

      // Cancel any pending renders, if present.
      view._cancelQueuedRAFRender();

      // Bail out early if no parent exists.
      if (!manager.parent) { return; }

      // Assign (if they exist) the sibling Views to a property.
      parentViews = manager.parent.views[manager.selector];

      // If this is an array of items remove items that are not marked to
      // keep.
      if (_.isArray(parentViews)) {
        // Remove duplicate Views.
        _.each(_.clone(parentViews), function(view, i) {
          // If the managers match, splice off this View.
          if (view && view.__manager__ === manager) {
            aSplice.call(parentViews, i, 1);
          }
        });
        if (_.isEmpty(parentViews)) {
          manager.parent.trigger("empty", manager.selector);
        }
        return;
      }

      // Otherwise delete the parent selector.
      delete manager.parent.views[manager.selector];
      manager.parent.trigger("empty", manager.selector);
    }
  }
207265
function(method, args){
      _.each(this._views, function(view){
        if (_.isFunction(view[method])){
          view[method].apply(view, args || []);
        }
      });
    }
803410
public void setMenuView(View view) {
        setMenuView(view, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
    }
505434
function initViews () {
    // list of views - may be empty
    this.modelViews = []
    // if view is false no model views will be applied overriding any defaults
    if (this.args.view === false) {
        return
    }
    // get view from args or default
    var viewArg = defined(this.args.view) ? this.args.view : this.model.views.default
    // skip unless view arg is set from args or default
    if (!defined(viewArg)) {
        return
    }
    // list of views to apply to model
    var views
    // if view is string then convert to array
    if (typeof viewArg === 'string') {
        views = [viewArg]
    }
    // if view is array use it
    else if (Array.isArray(viewArg)) {
        views = viewArg
    }
    // invalid argument
    else {
        throw this.error('invalid view argument')
    }
    // iterate over views getting model view objects
    _.each(views, view => {
        var modelView = requireValidModelView(view, this.model.views, true)
        // if result is array then add all
        if (Array.isArray(modelView)) {
            _.each(modelView, modelView => this.modelViews.push(modelView))
        }
        // otherwise add object
        else {
            this.modelViews.push(modelView)
        }
    })
    // instantiate model view engine if there are views
    if (this.modelViews.length > 0) {
        this.modelViewEngine = new ImmutableCoreModelViewEngine({query: this})
    }
}
825042
function getLayout(collection, name) {
  if (!name) return;
  if (collection instanceof Map) {
    for (const [key, view] of collection) {
      if (name === key) {
        return view;
      }
      if (!view.path) continue;
      if (!view.hasPath) {
        return getView(collection, name);
      }
      if (view.hasPath(name)) {
        return view;
      }
    }
    return;
  }

  for (const key of Object.keys(collection)) {
    const view = collection[key];
    if (name === key) {
      return view;
    }
    if (!view.path) continue;
    if (!view.hasPath) {
      return getView(collection, name);
    }
    if (view.hasPath(name)) {
      return view;
    }
  }
}
289679
def apply_layout(self, child, layout):
        
        params = self.create_layout_params(child, layout)
        w = child.widget
        if w:
            # padding
            if layout.get('padding'):
                dp = self.dp
                l, t, r, b = layout['padding']
                w.setPadding(int(l*dp), int(t*dp),
                             int(r*dp), int(b*dp))
        child.layout_params = params
1122325
public function setViewPath($view)
    {
        $this->layout->layout = $this->viewPath->setUp($this->layout->layout, $view);

        return $this;
    }
722179
function (cb, data, layout) {
            var self = this;

            Y.prepare([DEFAULT_THEME, themeDir], self.getProjectMeta(), function (err, opts) {
                if (err) {
                    console.log(err);
                }
                if (!data.name) {
                    return;
                }

                opts.meta = Y.merge(opts.meta, data);

                opts.meta.title = self.data.project.name;
                opts.meta.moduleName = data.name;
                opts.meta.projectRoot = '../';
                opts.meta.projectAssets = '../assets';
                opts.meta.projectLogo = self._resolveUrl(self.data.project.logo, opts);

                opts = self.populateClasses(opts);
                opts = self.populateModules(opts);
                opts = self.populateFiles(opts);

                opts.meta.fileName = data.name;
                fs.readFile(opts.meta.fileName, Y.charset, Y.rbind(function (err, str, opts, data) {
                    if (err) {
                        Y.log(err, 'error', 'builder');
                        cb(err);
                        return;
                    }

                    if (typeof self.options.tabspace === 'string') {
                        str = str.replace(/\t/g, self.options.tabspace);
                    }

                    opts.meta.fileData = str;
                    var view = new Y.DocView(opts.meta, 'index');
                    var mainLayout = opts.layouts[layout];
                    self.render('{{>files}}', view, mainLayout, opts.partials, function (err, html) {
                        self.files++;
                        cb(html, view, data);
                    });

                }, this, opts, data));
            });

        }
694522
public static void addViewToFrame(final JInternalFrame internalFrame, final View<?, ?> view)
	{
		internalFrame.add(view.getComponent(), BorderLayout.CENTER);
		internalFrame.pack();
	}
884557
function updateLayoutInfo(name) {
      var layouts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

      if (!menus.has(name)) {
        return;
      }

      var menu = Object.assign({}, menus.get(name));

      if (layouts.hasOwnProperty('triggerLayout')) {
        menu.triggerLayout = layouts.triggerLayout;
      }

      if (layouts.hasOwnProperty('optionsLayout')) {
        menu.optionsLayout = layouts.optionsLayout;
      }

      menus.set(name, menu);
    }
772929
function setLayout(d, layout, lastDisplay) {
        if (layout === 'vertical' || layout === 'multimode_vertical' ||
            layout === 'all_vertical') {

            d.displayDiv.style.float = 'none';
            d.titleDiv.style.float = 'none';
            d.titleDiv.style['margin-right'] = '0px';
            d.contentDiv.style.float = 'none';
            return true;
        }
        if (layout === 'horizontal') {
            d.displayDiv.style.float = 'none';
            d.titleDiv.style.float = 'left';
            d.titleDiv.style['margin-right'] = '6px';
            d.contentDiv.style.float = 'right';
            return true;
        }
        if (layout === 'multimode_horizontal') {
            d.displayDiv.style.float = 'left';
            d.titleDiv.style.float = 'none';
            d.titleDiv.style['margin-right'] = '0px';
            d.contentDiv.style.float = 'none';
            if (!lastDisplay) {
                d.displayDiv.style['margin-right'] = '10px';
            }
            return true;
        }
        if (layout === 'all_horizontal') {
            d.displayDiv.style.float = 'left';
            d.titleDiv.style.float = 'left';
            d.titleDiv.style['margin-right'] = '6px';
            d.contentDiv.style.float = 'right';
            if (!lastDisplay) {
                d.displayDiv.style['margin-right'] = '10px';
            }
            return true;
        }
        return false;
    }