本文整理汇总了Java中com.google.gwt.gen2.table.client.TableModel类的典型用法代码示例。如果您正苦于以下问题:Java TableModel类的具体用法?Java TableModel怎么用?Java TableModel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TableModel类属于com.google.gwt.gen2.table.client包,在下文中一共展示了TableModel类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: gotoPage
import com.google.gwt.gen2.table.client.TableModel; //导入依赖的package包/类
public void gotoPage(int page, int pageSize, final int hlRowIdx) {
dataModel.clearCache();
if (dataModel.getPageSize() != pageSize) {
dataModel.setPageSize(pageSize);
basicPagingImageGrid.setPageSize(pageSize);
}
page = Math.min(page, dataModel.getTotalRows()/pageSize);
basicPagingImageGrid.getTableModel().setRowCount(TableModel.UNKNOWN_ROW_COUNT);
basicPagingImageGrid.gotoPage(page, true);
WebEventListener doHL = new WebEventListener() {
public void eventNotify(WebEvent ev) {
ImageGridPanel.this.getEventManager().removeListener(ON_PAGE_LOAD,this);
}
};
getEventManager().addListener(ON_PAGE_LOAD, doHL);
}
示例2: setSenderId
import com.google.gwt.gen2.table.client.TableModel; //导入依赖的package包/类
private void setSenderId(final String sender) {
final TableModel<DataContainerGVO> m = getTableModel();
if (m instanceof QTableModel) {
final QTableModel qm = (QTableModel) m;
if (QPagingOptions.PAGING_FIRSTPAGE.equals(sender)) {
qm.setSender(pagingOptions.getFirstImage());
} else if (QPagingOptions.PAGING_NEXTPAGE.equals(sender)) {
qm.setSender(pagingOptions.getNextImage());
} else if (QPagingOptions.PAGING_LASTPAGE.equals(sender)) {
qm.setSender(pagingOptions.getLastImage());
} else if (QPagingOptions.PAGING_PREVIOUSPAGE.equals(sender)) {
qm.setSender(pagingOptions.getPrevImage());
} else if (QPagingScrollTableOperation.CONTROLS_DELETE.equals(sender)) {
qm.setSender(pagingScrollTableOperations.getDeleteImage());
} else if (QPagingScrollTableOperation.CONTROLS_ADD.equals(sender)) {
qm.setSender(pagingScrollTableOperations.getAddImage());
} else if (QPagingScrollTableOperation.CONTROLS_SAVE.equals(sender)) {
qm.setSender(pagingScrollTableOperations.getSaveImage());
} else if (QPagingScrollTableOperation.CONTROLS_REFRESH.equals(sender)) {
qm.setSender(pagingScrollTableOperations.getRefreshImage());
} else if (QPagingScrollTableOperation.CONTROLS_CANCEL.equals(sender)) {
qm.setSender(pagingScrollTableOperations.getCancelImage());
}
}
}
示例3: requestRows
import com.google.gwt.gen2.table.client.TableModel; //导入依赖的package包/类
@Override
public void requestRows(final Request request, final TableModel.Callback<List<PropertiesDTO>> callback) {
CompareProperties action = new CompareProperties(pList, request.getNumRows(), request.getStartRow());
// Window.alert("numRows = " + request.getNumRows() + " startRow=" +
// request.getStartRow());
dispatcher.execute(action, new AsyncCallback<ComparePropertiesResult>() {
@Override
public void onFailure(Throwable caught) {
}
@Override
public void onSuccess(final ComparePropertiesResult result) {
TableModelHelper.Response<List<PropertiesDTO>> response = new TableModelHelper.Response<List<PropertiesDTO>>() {
@Override
public Iterator<List<PropertiesDTO>> getRowValues() {
if (result != null && result.getCompareProperties() != null) {
return result.getCompareProperties().iterator();
} else {
return new ArrayList<List<PropertiesDTO>>().iterator();
}
}
};
callback.onRowsReady(request, response);
}
});
}
示例4: getTableModel
import com.google.gwt.gen2.table.client.TableModel; //导入依赖的package包/类
/**
* @return the table model
*/
public TableModel<TableData.Row> getTableModel() {
return tableModel;
}
示例5: reloadTable
import com.google.gwt.gen2.table.client.TableModel; //导入依赖的package包/类
/**
* This method clear out cache, then reload the table plus its data.
*
* @param page after loaded, goto the given page if possible. if page is out of range, goto first page or last
* page.
* @param pageSize use the given pageSize
* @param hlRowIdx highlight the given row index. index is the index of the whole table, not relative to a page.
*/
public void reloadTable(int page, int pageSize, final int hlRowIdx) {
if (table.getDataModel() == null) return;
table.getDataModel().clearCache();
SortInfo sortInfo = dataModel.getSortInfo();
if (sortInfo != null) {
int cidx = 0;
List<ColumnDefinition<TableData.Row, ?>> vcol = table.getTableDefinition().getVisibleColumnDefinitions();
for (cidx = 0; cidx < vcol.size(); cidx++) {
ColDef col = (ColDef) vcol.get(cidx);
if (col.getName() != null && col.getName().equals(sortInfo.getPrimarySortColumn())) {
break;
}
}
if (cidx >= 0) {
TableModelHelper.ColumnSortList sl = new TableModelHelper.ColumnSortList();
sl.add(new TableModelHelper.ColumnSortInfo(cidx, sortInfo.getDirection() == SortInfo.Direction.ASC));
getTable().getDataTable().setColumnSortList(sl);
}
} else {
table.getDataTable().getColumnSortList().clear();
table.clearSortIndicator();
}
if (dataModel.getPageSize() != pageSize) {
dataModel.setPageSize(pageSize);
table.setPageSize(pageSize);
}
page = Math.min(page, getDataset().getTotalRows() / pageSize);
table.getTableModel().setRowCount(TableModel.UNKNOWN_ROW_COUNT); // this line is needed to force loader to load when previous results in zero rows.
table.gotoPage(page, true);
WebEventListener doHL = new WebEventListener() {
public void eventNotify(WebEvent ev) {
int hlidx = hlRowIdx < 0 ? getTable().getAbsoluteFirstRowIndex() : hlRowIdx;
getTable().highlightRow(hlidx);
syncTableUI();
TablePanel.this.getEventManager().removeListener(ON_PAGE_LOAD, this);
}
};
getEventManager().addListener(ON_PAGE_LOAD, doHL);
}
示例6: QPagingScrollTable
import com.google.gwt.gen2.table.client.TableModel; //导入依赖的package包/类
public QPagingScrollTable(final TableModel<DataContainerGVO> tableModel, final FixedWidthGrid dataTable, final FixedWidthFlexTable headerTable, final TableDefinition<DataContainerGVO> tableDefinition, final DataGridGVO vo, final String uuid, final String parent) {
super(tableModel, dataTable, headerTable, tableDefinition);
initParameters(vo, uuid, parent);
// Listen for selection events
dataTable.addRowSelectionHandler(this);
}