<commit_before>dojo.provide("dojox.grid.VirtualGrid");
dojo.require("dojox.grid._grid.lib");
dojo.require("dojox.grid._grid.scroller");
dojo.require("dojox.grid._grid.view");
dojo.require("dojox.grid._grid.views");
dojo.require("dojox.grid._grid.layout");
dojo.require("dojox.grid._grid.rows");
dojo.require("dojox.grid._grid.focus");
dojo.require("dojox.grid._grid.selection");
dojo.require("dojox.grid._grid.edit");
dojo.require("dojox.grid._grid.rowbar");
dojo.require("dojox.grid._grid.publicEvents");

dojo.declare('dojox.VirtualGrid', [dijit._Widget, dijit._Templated], {
	/* summary:
			A grid widget with virtual scrolling, cell editing, complex rows, sorting, fixed columns, sizeable columns, etc.

		description:
			VirtualGrid provides the full set of grid features without any direct connection to a data store.
			The grid exposes a get function for the grid, or optionally individual columns, to populate cell contents.
			The grid is rendered based on its structure, an object describing column and cell layout.

		usage:
			A quick sample:
			
			define the grid structure:
			var structure = [ // array of view objects
			{ cells: [// array of rows, a row is an array of cells
					[{ name: "Alpha", width: 6 }, { name: "Beta" }, { name: "Gamma", get: function }]
			]};
			
			define a get function
			function get(inRowIndex) { // called in cell context
				return [this.index, inRowIndex].join(', ');
			}
			
			<div id="grid" rowCount="100" get="get" structure="structure" dojoType="dojox.VirtualGrid"></div>
	*/

	templateString: '<div class="dojoxGrid" hidefocus="hidefocus" role="wairole:grid"><div class="dojoxGrid-master-header" dojoAttachPoint="headerNode"></div><div class="dojoxGrid-master-view" dojoAttachPoint="viewsNode"></div><span dojoAttachPoint="lastFocusNode" tabindex="0"></span></div>',
	// classTag: string
	// css class applied to the grid's domNode
	classTag: 'dojoxGrid',
	get: function(inRowIndex){
		/* summary: Default data getter. 
			description:
				Provides data to display in a grid cell. Called in grid cell context.
				So this.cell.index is the column index.
			inRowIndex: integer
				row for which to provide data
			returns:
				data to display for a given grid cell.
		*/
	},
	// settings
	// rowCount: int
	//	Number of rows to display. 
	rowCount: 5,
	// keepRows: int
	//	Number of rows to keep in the rendering cache.
	keepRows: 75, 
	// rowsPerPage: int
	//	Number of rows to render at a time.
	rowsPerPage: 25,
	// autoWidth: boolean
	//	If autoWidth is true, grid width is automatically set to fit the data.
	autoWidth: false,
	// autoHeight: boolean
	//	If autoHeight is true, grid height is automatically set to fit the data.
	autoHeight: false,
	// autoRender: boolean
	//	If autoRender is true, grid will render itself after initialization.
	autoRender: true,
	// defaultHeight: string
	//	default height of the grid, measured in any valid css unit.
	defaultHeight: '15em',
	// structure: object or string
	//	View layout defintion. Can be set to a layout object, or to the (string) name of a layout object.
	structure: '',
	// elasticView: int
	//	Override defaults and make the indexed grid view elastic, thus filling available horizontal space.
	elasticView: -1,
	// singleClickEdit: boolean
	//	Single-click starts editing. Default is double-click
	singleClickEdit: false,
	// private
	sortInfo: 0,
	themeable: true,
	// initialization
	buildRendering: function(){
		this.inherited(arguments);
		// reset get from blank function (needed for markup parsing) to null, if not changed
		if(this.get == dojox.VirtualGrid.prototype.get){
			this.get = null;
		}
		if(!this.domNode.getAttribute('tabIndex')){
			this.domNode.tabIndex = "0";
		}
		this.domNode.onReveal = dojo.hitch(this, "reveal");
		this.domNode.onSizeChange = dojo.hitch(this, "sizeChange");
		this.createScroller();
		this.createLayout();
		this.createViews();
		this.createManagers();
		dojox.grid.initTextSizePoll();
		this.connect(dojox.grid, "textSizeChanged", "textSizeChanged");
		dojox.grid.funnelEvents(this.domNode, this, 'doKeyEvent', dojox.grid.keyEvents);
	},
	postCreate: function(){
		// replace stock styleChanged with one that triggers an update
		this.styleChanged = this._styleChanged;
		this.setStructure(this.structure);
	},
	destroy: function(){
		this.domNode.onReveal = null;
		this.domNode.onSizeChange = null;
		this.edit.destroy();
		dojox.grid.unwatchTextSizePoll(this, 'textSizeChanged');
		this.views.destroyViews();
		this.inherited(arguments);
	},
	styleChanged: function(){
		this.setStyledClass(this.domNode, '');
	},
	_styleChanged: function(){
		this.styleChanged();
		this.update();
	},
	textSizeChanged: function(){
		setTimeout(dojo.hitch(this, "_textSizeChanged"), 1);
	},
	_textSizeChanged: function(){
		if(this.domNode){<commit_msg>* remove call to non-existent text watching disconnect function (now taken care of by dijit)<commit_after>dojo.provide("dojox.grid.VirtualGrid");
dojo.require("dojox.grid._grid.lib");
dojo.require("dojox.grid._grid.scroller");
dojo.require("dojox.grid._grid.view");
dojo.require("dojox.grid._grid.views");
dojo.require("dojox.grid._grid.layout");
dojo.require("dojox.grid._grid.rows");
dojo.require("dojox.grid._grid.focus");
dojo.require("dojox.grid._grid.selection");
dojo.require("dojox.grid._grid.edit");
dojo.require("dojox.grid._grid.rowbar");
dojo.require("dojox.grid._grid.publicEvents");

dojo.declare('dojox.VirtualGrid', [dijit._Widget, dijit._Templated], {
	/* summary:
			A grid widget with virtual scrolling, cell editing, complex rows, sorting, fixed columns, sizeable columns, etc.

		description:
			VirtualGrid provides the full set of grid features without any direct connection to a data store.
			The grid exposes a get function for the grid, or optionally individual columns, to populate cell contents.
			The grid is rendered based on its structure, an object describing column and cell layout.

		usage:
			A quick sample:
			
			define the grid structure:
			var structure = [ // array of view objects
			{ cells: [// array of rows, a row is an array of cells
					[{ name: "Alpha", width: 6 }, { name: "Beta" }, { name: "Gamma", get: function }]
			]};
			
			define a get function
			function get(inRowIndex) { // called in cell context
				return [this.index, inRowIndex].join(', ');
			}
			
			<div id="grid" rowCount="100" get="get" structure="structure" dojoType="dojox.VirtualGrid"></div>
	*/

	templateString: '<div class="dojoxGrid" hidefocus="hidefocus" role="wairole:grid"><div class="dojoxGrid-master-header" dojoAttachPoint="headerNode"></div><div class="dojoxGrid-master-view" dojoAttachPoint="viewsNode"></div><span dojoAttachPoint="lastFocusNode" tabindex="0"></span></div>',
	// classTag: string
	// css class applied to the grid's domNode
	classTag: 'dojoxGrid',
	get: function(inRowIndex){
		/* summary: Default data getter. 
			description:
				Provides data to display in a grid cell. Called in grid cell context.
				So this.cell.index is the column index.
			inRowIndex: integer
				row for which to provide data
			returns:
				data to display for a given grid cell.
		*/
	},
	// settings
	// rowCount: int
	//	Number of rows to display. 
	rowCount: 5,
	// keepRows: int
	//	Number of rows to keep in the rendering cache.
	keepRows: 75, 
	// rowsPerPage: int
	//	Number of rows to render at a time.
	rowsPerPage: 25,
	// autoWidth: boolean
	//	If autoWidth is true, grid width is automatically set to fit the data.
	autoWidth: false,
	// autoHeight: boolean
	//	If autoHeight is true, grid height is automatically set to fit the data.
	autoHeight: false,
	// autoRender: boolean
	//	If autoRender is true, grid will render itself after initialization.
	autoRender: true,
	// defaultHeight: string
	//	default height of the grid, measured in any valid css unit.
	defaultHeight: '15em',
	// structure: object or string
	//	View layout defintion. Can be set to a layout object, or to the (string) name of a layout object.
	structure: '',
	// elasticView: int
	//	Override defaults and make the indexed grid view elastic, thus filling available horizontal space.
	elasticView: -1,
	// singleClickEdit: boolean
	//	Single-click starts editing. Default is double-click
	singleClickEdit: false,
	// private
	sortInfo: 0,
	themeable: true,
	// initialization
	buildRendering: function(){
		this.inherited(arguments);
		// reset get from blank function (needed for markup parsing) to null, if not changed
		if(this.get == dojox.VirtualGrid.prototype.get){
			this.get = null;
		}
		if(!this.domNode.getAttribute('tabIndex')){
			this.domNode.tabIndex = "0";
		}
		this.domNode.onReveal = dojo.hitch(this, "reveal");
		this.domNode.onSizeChange = dojo.hitch(this, "sizeChange");
		this.createScroller();
		this.createLayout();
		this.createViews();
		this.createManagers();
		dojox.grid.initTextSizePoll();
		this.connect(dojox.grid, "textSizeChanged", "textSizeChanged");
		dojox.grid.funnelEvents(this.domNode, this, 'doKeyEvent', dojox.grid.keyEvents);
	},
	postCreate: function(){
		// replace stock styleChanged with one that triggers an update
		this.styleChanged = this._styleChanged;
		this.setStructure(this.structure);
	},
	destroy: function(){
		this.domNode.onReveal = null;
		this.domNode.onSizeChange = null;
		this.edit.destroy();
		this.views.destroyViews();
		this.inherited(arguments);
	},
	styleChanged: function(){
		this.setStyledClass(this.domNode, '');
	},
	_styleChanged: function(){
		this.styleChanged();
		this.update();
	},
	textSizeChanged: function(){
		setTimeout(dojo.hitch(this, "_textSizeChanged"), 1);
	},
	_textSizeChanged: function(){
		if(this.domNode){
{'fraction_non_alphanumeric': 0.12964115328769965, 'fraction_numerical': 0.003318813524165111, 'mean_word_length': 4.1788399570354455, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '614559', 'n_tokens_mistral': 3322, 'n_tokens_neox': 3059, 'n_words': 887}