本文整理汇总了Java中com.google.gwt.gen2.table.client.ColumnDefinition类的典型用法代码示例。如果您正苦于以下问题:Java ColumnDefinition类的具体用法?Java ColumnDefinition怎么用?Java ColumnDefinition使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ColumnDefinition类属于com.google.gwt.gen2.table.client包,在下文中一共展示了ColumnDefinition类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createCheckboxRenderer
import com.google.gwt.gen2.table.client.ColumnDefinition; //导入依赖的package包/类
private static CellRenderer<DataContainerGVO, String> createCheckboxRenderer(final DataGridGVO source, final DataGridColumnGVO column, final String uuid, final String parent, final HasDataGridMethods uiParent) {
return new CellRenderer<DataContainerGVO, String>() {
public void renderRowValue(DataContainerGVO rowValue, ColumnDefinition<DataContainerGVO, String> columnDef, AbstractCellView<DataContainerGVO> view) {
boolean alreadyRendered = false;
String value = simpleObjectToText(columnDef.getCellValue(rowValue));
int rowIndex = view.getRowIndex();
String generatedId = generateIdBasedOnIndex(column, rowIndex);
CheckBox renderedComponent = (CheckBox)getRenderedComponent(column, generatedId, uuid, parent);
if (renderedComponent != null) {
renderedComponent.setText(value);
alreadyRendered = true;
} else {
renderedComponent = new CheckBox(value);
}
view.setWidget(renderedComponent);
CellRendererHelper.addBasicInfoToUIObject(renderedComponent, uuid, parent, source, column, rowValue, rowIndex, null, alreadyRendered);
handleCellSet(uiParent, columnDef, renderedComponent, rowValue);
}
};
}
示例2: createRenderer
import com.google.gwt.gen2.table.client.ColumnDefinition; //导入依赖的package包/类
private static CellRenderer<DataContainerGVO, String> createRenderer(final DataGridGVO source, final DataGridColumnGVO column, final String uuid, final String parent, final ComponentGVO component) {
CellRenderer<DataContainerGVO, String> cellRenderer;
cellRenderer = new CellRenderer<DataContainerGVO, String>() {
public void renderRowValue(DataContainerGVO rowValue, ColumnDefinition<DataContainerGVO, String> columnDef, AbstractCellView<DataContainerGVO> view) {
boolean alreadyRendered = false;
UIObject uiObject = null;
int rowIndex = view.getRowIndex();
String generatedId = generateIdBasedOnIndex(column, rowIndex);
if (isRenderedComponent(column, component, generatedId, uuid, parent)) {
uiObject = getRenderedComponent(column, generatedId, uuid, parent);
alreadyRendered = true;
} else {
uiObject = AnyComponentRenderer.getInstance().render(component, uuid, parent, column.getContext());
}
if (uiObject instanceof Widget) {
view.setWidget((Widget) uiObject);
}
CellRendererHelper.addBasicInfoToUIObject(uiObject, uuid, parent, source, column, rowValue, rowIndex, null, alreadyRendered);
}
};
return cellRenderer;
}
示例3: createLinkRenderer
import com.google.gwt.gen2.table.client.ColumnDefinition; //导入依赖的package包/类
private static CellRenderer<DataContainerGVO, String> createLinkRenderer(final DataGridGVO source, final DataGridColumnGVO column, final String uuid, final String parent, final String targetHistoryToken, final HasDataGridMethods uiParent) {
CellRenderer<DataContainerGVO, String> cellRenderer;
cellRenderer = new CellRenderer<DataContainerGVO, String>() {
public void renderRowValue(DataContainerGVO rowValue, ColumnDefinition<DataContainerGVO, String> columnDef, AbstractCellView<DataContainerGVO> view) {
boolean alreadyRendered = false;
String value = simpleObjectToText(columnDef.getCellValue(rowValue));
int rowIndex = view.getRowIndex();
String generatedId = generateIdBasedOnIndex(column, rowIndex);
Hyperlink renderedComponent = (Hyperlink)getRenderedComponent(column, generatedId, uuid, parent);
if (renderedComponent != null) {
renderedComponent.setText(value);
alreadyRendered = true;
} else {
renderedComponent = new Hyperlink(value, targetHistoryToken);
}
view.setWidget(renderedComponent);
CellRendererHelper.addBasicInfoToUIObject(renderedComponent, uuid, parent, source, column, rowValue, rowIndex, null, alreadyRendered);
handleCellSet(uiParent, columnDef, renderedComponent, rowValue);
}
};
return cellRenderer;
}
示例4: createSpreadSheetCellRenderer
import com.google.gwt.gen2.table.client.ColumnDefinition; //导入依赖的package包/类
private static CellRenderer<DataContainerGVO, String> createSpreadSheetCellRenderer(final DataGridGVO source, final DataGridColumnGVO column, final String uuid, final String parent, final HasDataGridMethods uiParent){
return new CellRenderer<DataContainerGVO, String>() {
public void renderRowValue(DataContainerGVO rowValue, ColumnDefinition<DataContainerGVO, String> columnDef, AbstractCellView<DataContainerGVO> view) {
boolean alreadyRendered = false;
String value = simpleObjectToText(columnDef.getCellValue(rowValue));
int rowIndex = view.getRowIndex();
String generatedId = generateIdBasedOnIndex(column, rowIndex);
SpreadsheetCell renderedComponent = (SpreadsheetCell)getRenderedComponent(column, generatedId, uuid, parent);
if (renderedComponent != null) {
// Update the data model
renderedComponent.setRowValue(rowValue);
renderedComponent.setText(value);
alreadyRendered = true;
} else {
renderedComponent = new SpreadsheetCell(value, uiParent, rowValue, columnDef, column);
}
view.setWidget(renderedComponent);
CellRendererHelper.addBasicInfoToUIObject(renderedComponent, uuid, parent, source, column, rowValue, rowIndex, null, alreadyRendered);
// spreadsheetcell have a focuslabel inside(which is a container
// of html component). So we have apply the style for that also.
RendererHelper.addStyle(column, renderedComponent.getLabel());
}
};
}
示例5: createDefaulHTMLRenderer
import com.google.gwt.gen2.table.client.ColumnDefinition; //导入依赖的package包/类
private static CellRenderer<DataContainerGVO, String> createDefaulHTMLRenderer(final DataGridGVO source, final DataGridColumnGVO column, final String uuid, final String parent, final HasDataGridMethods uiParent){
return new CellRenderer<DataContainerGVO, String>() {
public void renderRowValue(DataContainerGVO rowValue, ColumnDefinition<DataContainerGVO, String> columnDef, AbstractCellView<DataContainerGVO> view) {
boolean alreadyRendered = false;
String value = simpleObjectToText(columnDef.getCellValue(rowValue));
int rowIndex = view.getRowIndex();
String generatedId = generateIdBasedOnIndex(column, rowIndex);
HTML renderedComponent = (HTML)getRenderedComponent(column, generatedId, uuid, parent);
if (renderedComponent != null) {
renderedComponent.setHTML(value);
alreadyRendered = true;
} else {
renderedComponent = new HTML(value);
}
view.setWidget(renderedComponent);
CellRendererHelper.addBasicInfoToUIObject(renderedComponent, uuid, parent, source, column, rowValue, rowIndex, null, alreadyRendered);
handleCellSet(uiParent, columnDef, renderedComponent, rowValue);
}
};
}
示例6: hasMatchedColumns
import com.google.gwt.gen2.table.client.ColumnDefinition; //导入依赖的package包/类
private boolean hasMatchedColumns(final Iterator<DataContainerGVO> rows) {
boolean columnMatched = false;
final Iterator<DataContainerGVO> itr = rows;
if ((itr != null) && itr.hasNext()) {
final DataContainerGVO row = itr.next();
if (row != null) {
final List<ColumnDefinition<DataContainerGVO, ?>> columnDefinitionList = getTableDefinition().getVisibleColumnDefinitions();
for (final ColumnDefinition<DataContainerGVO, ?> columnDefinition : columnDefinitionList) {
if (columnDefinition instanceof QColumnDefinition) {
final QColumnDefinition qColumnDefinition = (QColumnDefinition)columnDefinition;
if (row.getDataMap().containsKey(qColumnDefinition.getField())) {
columnMatched = true;
break;
}
}
}
}
}
return columnMatched;
}
示例7: setModified
import com.google.gwt.gen2.table.client.ColumnDefinition; //导入依赖的package包/类
@Override
public void setModified(final ColumnDefinition<DataContainerGVO, String> columnDefinition, final UIObject uiObject, final DataContainerGVO rowValue, final Object newValue, final boolean changedByUser) {
if (columnDefinition instanceof QColumnDefinition) {
if(rowValue != null && rowValue.isMap()) {
final QColumnDefinition colDefinition = (QColumnDefinition)columnDefinition;
final String columnName = colDefinition.getField();
DataContainerGVO dataContainerGVO = rowValue.getDataMap().get(columnName);
if (dataContainerGVO == null) {
dataContainerGVO = new DataContainerGVO();
dataContainerGVO.setKind(DataContainerGVO.KIND_STRING);
rowValue.getDataMap().put(columnName, dataContainerGVO);
}
Object oldValue = null;
if (newValue instanceof Date) {
oldValue = dataContainerGVO.getDateData();
dataContainerGVO.setDateData((Date)newValue);
dataContainerGVO.setStringDataType(DataContainerGVO.TYPE_DATE);
} else if(newValue instanceof Double) {
dataContainerGVO.setStringDataType(DataContainerGVO.TYPE_DOUBLE);
}
final String newValueOfStr = (newValue == null) ? null : newValue.toString();
dataContainerGVO.setDataString(newValueOfStr);
doColumnDataChange(columnDefinition, uiObject, rowValue.getDataMap(), oldValue, newValue, changedByUser);
}
}
}
示例8: doColumnDataChange
import com.google.gwt.gen2.table.client.ColumnDefinition; //导入依赖的package包/类
private void doColumnDataChange(final ColumnDefinition<DataContainerGVO, String> columnDefinition, final UIObject uiObject, final DataMap rowValue, final Object oldValue, final Object newValue, final boolean changedByUser) {
if ((source != null) && (source.getColumns() != null) && (columnDefinition instanceof QColumnDefinition)) {
final QColumnDefinition qColumnDefinition = (QColumnDefinition)columnDefinition;
DataGridColumnGVO dataGridColumnGVO = null;
for (final DataGridColumnGVO columnGVO: source.getColumns()) {
final String fieldName = columnGVO.getFieldName();
if ((fieldName != null) && (fieldName.equals(qColumnDefinition.getField()))) {
dataGridColumnGVO = columnGVO;
break;
}
}
ComponentRendererHelper.handleDataChange(dataGridColumnGVO, uiObject, oldValue, newValue);
if (changedByUser) {
changeRowStatus(rowValue, DataMap.ROW_STATUS_MODIFIED);
}
}
}
示例9: renderRowValue
import com.google.gwt.gen2.table.client.ColumnDefinition; //导入依赖的package包/类
@Override
public void renderRowValue(List<PropertiesDTO> rowValue, ColumnDefinition<List<PropertiesDTO>, Integer> columnDef,
AbstractCellView<List<PropertiesDTO>> view) {
String locale = PropertyOptions.getCurrentLocale();
String val = "<div class=\"innercontent_compare\"> "
+ "<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">"
+ " <tbody> <tr> "
+ "<td valign=\"top\" align=\"left\"> "
+ "<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">" + "<tbody><tr>"
+ getProperties(rowValue, locale) + "</tr></tbody></table></td></tr></tbody></table></div>";
// String val = getProperties(rowValue);
view.setHTML(val);
}
示例10: setData
import com.google.gwt.gen2.table.client.ColumnDefinition; //导入依赖的package包/类
@Override
protected void setData(int firstRow, Iterator<TableData.Row> rows) {
super.setData(firstRow, rows);
// Get the visible column definitions
List<ColumnDefinition<TableData.Row, ?>> colDefs = getTableDefinition().getVisibleColumnDefinitions();
updateHeaderTable(colDefs);
}
示例11: updateHeaderTable
import com.google.gwt.gen2.table.client.ColumnDefinition; //导入依赖的package包/类
protected void updateHeaderTable(List<ColumnDefinition<TableData.Row, ?>> colDefs, boolean force) {
if (!colDefs.equals(lastColDefs) || force) {
lastColDefs = colDefs;
int numColumns = colDefs.size();
// clear the headers
clearTable(headers, numColumns);
// Add the column and group headers
for (int i = 0; i < numColumns; i++) {
// Add the name
ColDef colDef = (ColDef) colDefs.get(i);
if (colDef == null) continue; // skip if colDef is null
String title = colDef.isImmutable() ? "" : "<b>" + colDef.getTitle() + "</b>";
HTML label = new HTML(title, false);
label.setTitle(colDef.getShortDesc());
label.setWidth("10px");
DOM.setStyleAttribute(label.getElement(), "display", "inline");
headers.setWidget(LABEL_IDX, i, label);
setColumnWidth(i, colDef.getPreferredColumnWidth());
headers.getFlexCellFormatter().setHorizontalAlignment(LABEL_IDX, i, HorizontalPanel.ALIGN_CENTER);
if (isShowUnits()) {
String u = colDef.getColumn() == null || StringUtils.isEmpty(colDef.getColumn().getUnits()) ? " " : "(" + colDef.getColumn().getUnits() + ")";
label.setHTML(label.getHTML() + "<br>" + u);
}
GwtUtil.setStyle(label, "display", "inline-table");
}
filterSupport.onUpdateHeaders(colDefs);
}
filterSupport.ensureFilterShow();
}
示例12: updateHeaderTable
import com.google.gwt.gen2.table.client.ColumnDefinition; //导入依赖的package包/类
/**
* Update the header table to match the data table.
*/
protected void updateHeaderTable(List<ColumnDefinition<TableData.Row, ?>> colDefs, boolean force) {
super.updateHeaderTable(colDefs, force);
setColumnWidth(0, colDefs.get(0).getPreferredColumnWidth());
recalculateSelectAllBox();
}
示例13: SpreadsheetCell
import com.google.gwt.gen2.table.client.ColumnDefinition; //导入依赖的package包/类
public SpreadsheetCell(String text, HasDataGridMethods parent, DataContainerGVO rowValue, ColumnDefinition<DataContainerGVO, String> columnDefinition, DataGridColumnGVO column) {
this.rowValue = rowValue;
this.columnDefinition = columnDefinition;
this.parentContainer = parent;
this.isEditable = !Boolean.FALSE.equals(column.getEditable());
init(text);
}
示例14: setModified
import com.google.gwt.gen2.table.client.ColumnDefinition; //导入依赖的package包/类
public void setModified(
ColumnDefinition<DataContainerGVO, String> columnDefinition,
UIObject uiObject, DataContainerGVO rowValue, Object newValue,
boolean changedByUser) {
// TODO Auto-generated method stub
}
示例15: getCellCleaner
import com.google.gwt.gen2.table.client.ColumnDefinition; //导入依赖的package包/类
public static CellCleaner getCellCleaner(final DataGridGVO source, final DataGridColumnGVO column, final String uuid, final String parent, final HasDataGridMethods parentWidget) {
CellCleaner cellCleaner = new CellCleaner() {
public void cleanRow(int rowIndex, ColumnDefinition<DataContainerGVO, ?> columnDefinition) {
String generatedId = generateIdBasedOnIndex(column, rowIndex);
String renderedComponentId = RendererHelper.generateId(generatedId, parent, column.getContext());
RendererHelper.removeComponent(renderedComponentId);
}
};
return cellCleaner;
}