Maps the rendered column index to the real column index.

@param renderCol the rendered index
@return the mapped index
504847
public int getMappedColumn(final int renderCol) {
        if (columnMapping == null || renderCol == -1) {
            return renderCol;
        }
        else {
            final Integer result = columnMapping.get(renderCol);
            if (result == null) {
                throw new IllegalArgumentException("Invalid index " + renderCol);
            }
            return result;
        }
    }
340934
private void paintColumnHeadings(final WTable table, final WebXmlRenderContext renderContext) {
		XmlStringBuilder xml = renderContext.getWriter();
		int[] columnOrder = table.getColumnOrder();
		TableModel model = table.getTableModel();
		final int columnCount = columnOrder == null ? table.getColumnCount() : columnOrder.length;

		xml.appendTagOpen("ui:thead");
		xml.appendOptionalAttribute("hidden", !table.isShowColumnHeaders(), "true");
		xml.appendClose();

		for (int i = 0; i < columnCount; i++) {
			int colIndex = columnOrder == null ? i : columnOrder[i];
			WTableColumn col = table.getColumn(colIndex);

			if (col.isVisible()) {
				boolean sortable = model.isSortable(colIndex);
				paintColumnHeading(col, sortable, renderContext);
			}
		}

		xml.appendEndTag("ui:thead");
	}
550719
function(gridCompColumn,i,begin,length, isFixedColumn){
			var oThis = this,renderType = gridCompColumn.options.renderType,
				sumCol = gridCompColumn.options.sumCol,
				sumRenderType = gridCompColumn.options.sumRenderType,
				dataType = gridCompColumn.options.dataType,
				precision = gridCompColumn.options.precision,
				format = gridCompColumn.options.format,field = gridCompColumn.options.field,
				end = begin,idSuffix = isFixedColumn === true ? '_content_fixed_tbody' : '_content_tbody',
				idStr = isFixedColumn === true? 'fixed_' : '';
			if(length >0){
				end = parseInt(begin + length - 1);
			}
			this.realtimeTableRows = document.getElementById(oThis.options.id + idSuffix).children;
			// 记录role不是row的行
			var notRowIndex = -1;
			for(var k = 0;k < oThis.realtimeTableRows.length;k++) {
				if(oThis.realtimeTableRows[k].getAttribute("role") != "row") {
					notRowIndex = k
				}
			}
			$.each(oThis.dataSourceObj.rows, function(j) {
				if((begin >= 0 && j >= begin && j <= end) || isNaN(begin)){
					var trIndex = j;
					if(notRowIndex != -1 && j >= notRowIndex) {
						trIndex++;
					}
					var tr = oThis.realtimeTableRows[trIndex],td = tr.children[i];
					if(td){
						if(td.children[0].innerHTML.indexOf('u-grid-content-tree-span')   !=  -1){
							var span =  td.children[0].children[1];
						}else{
							var span =  td.children[0];
						}
						if(span){
							var v = $(this.value).attr(field);
							if(typeof renderType == 'function' || dataType == 'Date' || dataType == 'Datetime' || dataType == 'Int' || dataType == 'Float'){
								span.innerHTML = '';
								if(typeof renderType == 'function'){
									v = oThis.getString(v,'');
									var obj = {};
									obj.value = v;
									obj.element = span;
									obj.gridObj = oThis;
									obj.row = this;
									obj.gridCompColumn = gridCompColumn;
									obj.rowIndex = j;
									renderType.call(oThis,obj);
								}else if(dataType == 'Date' || dataType == 'Datetime'){
									if(v == null || v == undefined || v == 'null' || v == 'undefined' || v == ""){
										v = "";
									}
									if (dataType == 'Date'){
										v = u.dateRender(v);
									}else{
										v = u.dateTimeRender(v);
									}
									span.innerHTML = v;
									td.title = v;
								}else if(dataType == 'Int'){
									v = parseInt(v);
									span.innerHTML = v;
									td.title = v;
								}else if(dataType == 'Float'){
									if(precision){
										var o = {};
										o.value = v;
										o.precision = precision;
										v = oThis.DicimalFormater(o);
									}else{
										v = parseFloat(v);
									}
									span.innerHTML = v;
									td.title = v;
								}else{ //此处逻辑放到渲染处，减少render执行次数。
									v = oThis.getString(v,'');
									var v1 = v.replace(/\</g,'\<');
									v1 = v1.replace(/\>/g,'\>');
									td.title = v;
									v = v.replace(/\</g,'&lt;');
									v = v.replace(/\>/g,'&gt;');

									span.innerHTML = v;
								}
							}else{
								v = oThis.getString(v,'');
								var v1 = v.replace(/\</g,'\<');
								v1 = v1.replace(/\>/g,'\>');
								td.title = v;
								v = v.replace(/\</g,'&lt;');
								v = v.replace(/\>/g,'&gt;');

								span.innerHTML = v;
							}
						}

					}
				}
			});
			this.renderTypeSumRow(gridCompColumn,i,begin,length, isFixedColumn);
		}
651162
public ColumnMapper getMapper(String field) {
        String[] components = field.split("\\.");
        for (int i = components.length - 1; i >= 0; i--) {
            StringBuilder sb = new StringBuilder();
            for (int j = 0; j <= i; j++) {
                sb.append(components[j]);
                if (j < i) sb.append('.');
            }
            ColumnMapper columnMapper = columnMappers.get(sb.toString());
            if (columnMapper != null) return columnMapper;
        }
        return null;
    }
1349693
public static Map<String, PropertyIndex> getIndexesOnEmbeddable(Class<?> entityClazz)
    {
        Map<String, PropertyIndex> pis = new HashMap<String, PropertyIndex>();
       
        IndexCollection indexes = entityClazz.getAnnotation(IndexCollection.class);
        List<String> columnsNameToBeIndexed = null;
        Map<String, com.impetus.kundera.index.Index> columnsToBeIndexed = null;
        if (null != indexes)
        {
            columnsToBeIndexed = new HashMap<String, com.impetus.kundera.index.Index>();
            if (indexes.columns() != null && indexes.columns().length != 0)
            {
                for (com.impetus.kundera.index.Index indexedColumn : indexes.columns())
                {
                    columnsToBeIndexed.put(indexedColumn.name(), indexedColumn);
                }
            }
        }
       
        getPropertyIndexes(entityClazz, pis, columnsNameToBeIndexed, columnsToBeIndexed);
        return pis;
    }
971307
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WTableRowRenderer renderer = (WTableRowRenderer) component;
		XmlStringBuilder xml = renderContext.getWriter();
		WTable table = renderer.getTable();
		TableModel dataModel = table.getTableModel();

		int[] columnOrder = table.getColumnOrder();
		final int numCols = columnOrder == null ? table.getColumnCount() : columnOrder.length;

		// Get current row details
		RowIdWrapper wrapper = renderer.getCurrentRowIdWrapper();
		List<Integer> rowIndex = wrapper.getRowIndex();

		boolean tableSelectable = table.getSelectMode() != SelectMode.NONE;
		boolean rowSelectable = tableSelectable && dataModel.isSelectable(rowIndex);
		boolean rowSelected = rowSelectable && table.getSelectedRows().contains(wrapper.getRowKey());

		boolean tableExpandable = table.getExpandMode() != WTable.ExpandMode.NONE;
		boolean rowExpandable = tableExpandable && dataModel.isExpandable(rowIndex) && wrapper.
				hasChildren();
		boolean rowExpanded = rowExpandable && table.getExpandedRows().contains(wrapper.getRowKey());

		String rowIndexAsString = TableUtil.rowIndexListToString(rowIndex);

		xml.appendTagOpen("ui:tr");
		xml.appendAttribute("rowIndex", rowIndexAsString);
		xml.appendOptionalAttribute("unselectable", !rowSelectable, "true");
		xml.appendOptionalAttribute("selected", rowSelected, "true");
		xml.appendOptionalAttribute("expandable", rowExpandable && !rowExpanded, "true");
		xml.appendClose();

		// wrote the column cell.
		boolean isRowHeader = table.isRowHeaders(); // need this before we get into the loop
		for (int i = 0; i < numCols; i++) {
			int colIndex = columnOrder == null ? i : columnOrder[i];
			WTableColumn col = table.getColumn(colIndex);
			String cellTag = "ui:td";

			if (col.isVisible()) {
				if (isRowHeader) { // The first rendered column will be the row header.
					cellTag = "ui:th";
					isRowHeader = false; // only set one col as the row header.
				}
				xml.appendTag(cellTag);
				renderer.getRenderer(colIndex).paint(renderContext);
				xml.appendEndTag(cellTag);
			}
		}

		if (rowExpandable) {
			xml.appendTagOpen("ui:subtr");
			xml.appendOptionalAttribute("open", rowExpanded, "true");
			xml.appendClose();

			if (rowExpanded || table.getExpandMode() == ExpandMode.CLIENT) {
				renderChildren(renderer, renderContext, wrapper.getChildren());
			}

			xml.appendEndTag("ui:subtr");
		}

		xml.appendEndTag("ui:tr");
	}
1000540
function getIndexOfColumn(tableStructure, column) {
  for (var i = 0; i < tableStructure.columns.length; i++) {
    if (tableStructure.columns[i] === column) {
      return i;
    }
  }
}
441653
public int getColumnIndex(String columnName) {
		Integer index = nameToIndex.get(columnName);
		if (index == null) {
			throw new GeoPackageException("Column does not exist in table '"
					+ tableName + "', column: " + columnName);
		}
		return index;
	}
754334
private void paintColumnHeadings(final WDataTable table, final WebXmlRenderContext renderContext) {
		XmlStringBuilder xml = renderContext.getWriter();
		int[] columnOrder = table.getColumnOrder();
		TableDataModel model = table.getDataModel();
		final int columnCount = table.getColumnCount();

		xml.appendTagOpen("ui:thead");
		xml.appendOptionalAttribute("hidden", !table.isShowColumnHeaders(), "true");
		xml.appendClose();

		if (table.isShowRowHeaders()) {
			paintColumnHeading(table.getRowHeaderColumn(), false, renderContext);
		}

		for (int i = 0; i < columnCount; i++) {
			int colIndex = columnOrder == null ? i : columnOrder[i];
			WTableColumn col = table.getColumn(colIndex);

			if (col.isVisible()) {
				boolean sortable = model.isSortable(colIndex);
				paintColumnHeading(col, sortable, renderContext);
			}
		}

		xml.appendEndTag("ui:thead");
	}
107219
Index getIndexForColumn(int col) {

        int i = bestIndexForColumn[col];

        return i == -1 ? null
                       : this.indexList[i];
    }
440555
protected Map<String, List<Element>> elementsIndexByName() {
        HashMap<String, List<Element>> index = new HashMap<>();
        for (Object part : renderingParts) {//We have to use the rendering order of elements for multiple elements with same name
            if (part instanceof Element) {
                Element element = (Element) part;
                String name = element.getProperty("name");
                if (name != null && !name.trim().isEmpty()) {
                    boolean multiValued = element.isMultiValue();
                    if (multiValued && index.containsKey(name)) {
                        throw new IllegalStateException("Name '" + name + "' cannot be repeated in the form if any of the elements is multi-valued");
                    }

                    if (name.contains("[") && name.contains("]")) {
                        throw new IllegalStateException("Name '" + name + "' cannot be in array form");
                    }

                    if (!index.containsKey(name)) {
                        index.put(name, new ArrayList<Element>());
                    } else {
                        Class<?> expectedType = index.get(name).get(0).getValueType();
                        if (!element.getValueType().equals(expectedType)) {
                            //This is necessary for calling fillBeanProperties
                            throw new IllegalStateException("Multiple elements with same name '" + name + "' should all have the same value type");
                        }
                    }

                    index.get(name).add(element);
                }
            }

        }

        return index;
    }
633905
public SQLSelect addColumnPart(final Integer _tableIndex,
                                   final String _columnName)
    {
        parts.add(new Column(tablePrefix, _tableIndex, _columnName));
        return this;
    }
366869
public static List<Integer> getCurrentRowIndex(final WComponent component) {
		UIContext uic = UIContextHolder.getCurrent();
		// Check have correct context
		if (!(uic instanceof SubUIContext)) {
			return null;
		}

		// Find the table
		WTable table = WebUtilities.getAncestorOfClass(WTable.class, component);
		if (table == null) {
			return null;
		}

		int repeaterIdx = ((SubUIContext) uic).getRowIndex();
		RowIdWrapper wrapper = table.getRepeater().getBeanList().get(repeaterIdx);
		return wrapper.getRowIndex();
	}
1185610
private Map<String, Integer> createMapOfColumnIndex(String[] columns)
    {
        int i = 0;
        Map<String, Integer> map = new HashMap<String, Integer>();
        for (String column : columns)
        {
            map.put(column, i++);
        }
        return map;
    }
736571
private ColumnInfo getColumn(TableInfo tableInfo, Attribute column, PropertyIndex indexedColumn,
            String[] orderByColumns)
    {
        ColumnInfo columnInfo = new ColumnInfo();

        if (column.getJavaType().isAnnotationPresent(OrderBy.class))
        {
            OrderBy order = (OrderBy) column.getJavaType().getAnnotation(OrderBy.class);
            orderByColumns = order.value().split("\\s*,\\s*");

        }
        columnInfo.setOrderBy(getOrderByColumn(orderByColumns, column));

        if (column.getJavaType().isEnum())
        {
            columnInfo.setType(String.class);
        }
        else
        {
            columnInfo.setType(column.getJavaType());
        }
        columnInfo.setColumnName(((AbstractAttribute) column).getJPAColumnName());
        if (indexedColumn != null && indexedColumn.getName() != null)
        {
            columnInfo.setIndexable(true);
            IndexInfo indexInfo = new IndexInfo(((AbstractAttribute) column).getJPAColumnName(), indexedColumn.getMax(),
                    indexedColumn.getMin(), indexedColumn.getIndexType(), indexedColumn.getName());
            tableInfo.addToIndexedColumnList(indexInfo);
            // Add more if required
        }

        return columnInfo;
    }
267712
private IndexMetadata buildLegacyIndex(RawColumn raw, ColumnMetadata column) {
    if (raw.indexName == null) {
      return null;
    }
    return new DefaultIndexMetadata(
        column.getKeyspace(),
        column.getParent(),
        CqlIdentifier.fromInternal(raw.indexName),
        IndexKind.valueOf(raw.indexType),
        buildLegacyIndexTarget(column, raw.indexOptions),
        raw.indexOptions);
  }
249868
public static UserCustomColumn createDataColumn(int index) {
		return UserCustomColumn.createColumn(index, COLUMN_DATA,
				GeoPackageDataType.BLOB, true, null);
	}