Select the given model.
Or in multiselect mode, add the given model to the selection.

@param {*} model
486233
function (model) {
            if (!this.ngModel) {
                return; // A kb-item can't be selected without a ng-model on the container element.
            }
            if (this.multiple) {
                if (this.isSelected(model) === false) {
                    this.selected.push(model);
                    this.ngModel.$setViewValue(this.selected);
                }
            } else {
                this.selected[0] = model;
                this.ngModel.$setViewValue(model);
            }
        }
53825
function( model ) {
			var coll = this.getCollection( model );
			coll._onModelEvent( 'change:' + model.idAttribute, model, coll );
		}
521849
function(model, options) {
    options = options ? extend({}, options) : {};
    if (!(model = this._prepareModel(model, options))){
      return false;
    }
    if (!options.wait){
      this.add(model, options);
    }
    var collection = this;
    options.cb = options.callback;
    options.callback = function cb(err, model, response){
      if (err){
        return callback(err, model, response, options);
      }
      if (options.wait){
        collection.add(model, options);
      }
      callback(null, model, response, options);
    };

    model.save(null, options);
    return model;
  }
57808
function(model) {
    const maxLen = model.get("seq").length;
    const selection = [];
    const sels = this.g.selcol.getSelForRow(model.get("id"));
    const rows = find(sels, function(el) { return el.get("type") === "row"; });
    if ((typeof rows !== "undefined" && rows !== null)) {
      // full match
      const end = maxLen - 1;
      for (let n = 0; n <= end; n++) {
        selection.push(n);
      }
    } else if (sels.length > 0) {
      for (let i = 0, sel; i < sels.length; i++) {
        sel = sels[i];
        const start = sel.get("xStart");
        const end = sel.get("xEnd");
        for (let n = start; n <= end; n++) {
          selection.push(n);
        }
      }
    }

    return selection;
  }
1217629
def ng_model(model, opt = {})
    opt[:root_selector] ||= ng_root_selector
    row = ng.row(opt)
    ng_models(model, opt)[row]
  end
361883
function selectItem(editor, model, getItemRange) {
	editor.transact(() => {
		const selections = editor.getSelectedBufferRanges()
		.map(anchor => getItemRange(model, anchor) || anchor);

		editor.setSelectedBufferRanges(selections);
	});
}
174937
public void put(DajlabModelInterface model) {
		if (model != null) {
			String name = model.getClass().getName();
			dajlab.put(name, model);
		}
	}
9903
public void setInputModel(TreeModel model)
    {
        Enumeration<TreePath> expandedDescendants = 
            this.tree.getExpandedDescendants(new TreePath(treeModel.getRoot()));
        
        this.treeModel = new FilteredTreeModel(model);
        this.tree.setModel(treeModel);
        
        if (expandedDescendants != null)
        {
            while (expandedDescendants.hasMoreElements())
            {
                TreePath expanded = expandedDescendants.nextElement();
                TreePath translatedPath = 
                    JTrees.translatePath(treeModel, expanded);
                if (translatedPath != null)
                {
                    this.tree.expandPath(translatedPath);
                }
            }
        }
    }
760417
function(model, options) {
            var item, tag;

            // Define options
            options = _.defaults(options || {}, {
                silent: false,
                render: true,
                at: _.size(this.items),
            });

            if (this.items[model.id] != null) {
                this.removeModel(model);
            }

            item = new this.Item({
                "model": model,
                "list": this,
                "collection": this.collection
            }, this);
            this.listenTo(model, "set", function() {
                item.update();
                this.applyFilter(item);
            });
            this.listenTo(model, "id", function(newId, oldId) {
                this.items[newId] = this.items[oldId];
                delete this.items[oldId];
            });

            item.update();
            tag = this.Item.prototype.tagName;
            if (this.Item.prototype.className) tag = tag+"."+this.Item.prototype.className.split(" ")[0];

            if (options.at > 0) {
                this.$("> "+tag).eq(options.at-1).after(item.$el);
            } else {
                this.$el.prepend(item.$el);
            }
            this.items[model.id] = item;

            this.applyFilter(item);

            if (!options.silent) this.trigger("add", model);
            if (options.render) this.update();

            return this;
        }
62773
def toggleSelection(self, index, comp):
        """"""
        self.model.toggleSelection(index.row(), comp)
893918
public void setLeftTableModel(TableModel model)
   {
      TableModel old = m_leftTable.getModel();
      m_leftTable.setModel(model);
      firePropertyChange("leftTableModel", old, model);
   }
528630
function( model ) {
			var modelColl = model.collection;
			var coll = this.getCollection( model );
			coll && coll._add( model );
			model.collection = modelColl;
		}
930118
def setModel(self, model):
        
        self.paramList.setModel(model)
        model.hintRequested.connect(self.hintRequested)
        model.rowsInserted.connect(self.updateTitle)
        model.rowsRemoved.connect(self.updateTitle)
        self.updateTitle()
689326
function(models, options) {
      models  || (models = []);
      options || (options = {});
      for (var i = 0, l = this.models.length; i < l; i++) {
        this._removeReference(this.models[i]);
      }
      this._reset();
      this.add(models, _.extend({silent: true}, options));
      if (!options.silent) this.trigger('reset', this, options);
      return this;
    }
357067
function(model, options) {
            // Define options
            options = _.defaults(options || {}, {
                silent: false,
                render: true
            });

            this.stopListening(model);

            if (this.items[model.id] == null) return this;

            this.items[model.id].remove();
            this.items[model.id] = null;
            delete this.items[model.id];

            if (!options.silent) this.trigger("remove", model);
            if (options.render) this.update();

            return this;
        }
48009
function(model, options) {
      model = this._prepareModel(model, options);
      this.add(model, _.extend({at: 0}, options));
      return model;
    }
1205887
@Override public void setModel(TableModel model)
   {
      super.setModel(model);
      int columns = model.getColumnCount();
      TableColumnModel tableColumnModel = getColumnModel();
      for (int index = 0; index < columns; index++)
      {
         tableColumnModel.getColumn(index).setPreferredWidth(m_columnWidth);
      }
   }