本文整理匯總了Java中com.google.gwt.view.client.ListDataProvider.getList方法的典型用法代碼示例。如果您正苦於以下問題:Java ListDataProvider.getList方法的具體用法?Java ListDataProvider.getList怎麽用?Java ListDataProvider.getList使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.gwt.view.client.ListDataProvider
的用法示例。
在下文中一共展示了ListDataProvider.getList方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createColumns
import com.google.gwt.view.client.ListDataProvider; //導入方法依賴的package包/類
@Override
protected void createColumns(DefaultCellTable<Reference> table, ListDataProvider<Reference> dataProvider) {
Column<Reference, String> nameColumn = new Column<Reference, String>(new ClickableTextCell()) {
@Override
public String getValue(Reference reference) {
return reference.localName();
}
};
nameColumn.setFieldUpdater(new FieldUpdater<Reference, String>() {
@Override
public void update(int index, Reference object, String value) {
_presenter.onNavigateToReference(object, _application);
}
});
nameColumn.setSortable(true);
ColumnSortEvent.ListHandler<Reference> sortHandler = new ColumnSortEvent.ListHandler<Reference>(
dataProvider.getList());
sortHandler.setComparator(nameColumn, createColumnCommparator(nameColumn));
table.addColumn(nameColumn, Singleton.MESSAGES.label_name());
table.addColumnSortHandler(sortHandler);
table.getColumnSortList().push(nameColumn);
}
示例2: createColumns
import com.google.gwt.view.client.ListDataProvider; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
@Override
protected void createColumns(DefaultCellTable<Component> table, ListDataProvider<Component> dataProvider) {
final TextColumn<Component> nameColumn = new TextColumn<Component>() {
@Override
public String getValue(Component component) {
ComponentProviderProxy provider = _componentProviders.getExtensionProviderByComponentName(component
.getName());
if (provider == null) {
return component.getName();
}
return provider.getDisplayName();
}
};
nameColumn.setSortable(true);
ColumnSortEvent.ListHandler<Component> sortHandler = new ColumnSortEvent.ListHandler<Component>(
dataProvider.getList());
sortHandler.setComparator(nameColumn, createColumnCommparator(nameColumn));
table.addColumn(nameColumn, Singleton.MESSAGES.label_name());
table.addColumnSortHandler(sortHandler);
table.getColumnSortList().push(nameColumn);
}
示例3: redrawAllRowsInColumn
import com.google.gwt.view.client.ListDataProvider; //導入方法依賴的package包/類
public <C> void redrawAllRowsInColumn(int aIndex, ListDataProvider<T> aDataProvider) {
if (aIndex >= 0 && aIndex < getColumnCount()) {
int start = getVisibleRange().getStart();
Column<T, C> column = (Column<T, C>) getColumn(aIndex);
Cell<C> cell = column.getCell();
List<T> data = aDataProvider.getList();
ProvidesKey<T> keys = getKeyProvider();
NodeList<TableRowElement> rows = getTableBodyElement().getRows();
for (int i = 0; i < rows.getLength(); i++) {
TableRowElement row = rows.getItem(i);
NodeList<TableCellElement> cells = row.getCells();
if (aIndex >= 0 && aIndex < cells.getLength()) {
TableCellElement toRerender = cells.getItem(aIndex);
if (toRerender != null) {
SafeHtmlBuilder sb = new SafeHtmlBuilder();
int dataIdx = start + i;
if (dataIdx >= 0 && dataIdx < data.size()) {
T object = data.get(dataIdx);
Cell.Context cx = new Cell.Context(start + i, aIndex, keys.getKey(object));
cell.render(cx, column.getValue(object), sb);
// Take into account, that cell builder supports
// some
// maps
// to cells' divs
// and generates them. So we have to work with first
// <div>
// in <td>.
toRerender.getFirstChildElement().setInnerSafeHtml(sb.toSafeHtml());
}
}
}
}
}
}
示例4: checkLimit
import com.google.gwt.view.client.ListDataProvider; //導入方法依賴的package包/類
protected void checkLimit(Boolean value, CheckedDTO object, final ListDataProvider<? extends CheckedDTO> dataProvider, int limit) {
if (value) {
int cnt = 0;
for (CheckedDTO checkedDTO : dataProvider.getList()) {
if (checkedDTO.getChecked()) {
cnt++;
}
}
object.setChecked(cnt < limit);
dataProvider.refresh();
} else {
object.setChecked(false);
}
}
示例5: QCellTable
import com.google.gwt.view.client.ListDataProvider; //導入方法依賴的package包/類
public QCellTable(DataGridGVO gvo, String uuid, String parent){
setSize(gvo.getWidth(),gvo.getHeight());
String context = gvo.getContext();
String window = gvo.getWindow();
String component =gvo.getId();
Column<DataContainerGVO,String> [] columns = null;
if (gvo!=null){
if (gvo.getColumns()!=null){
int gvoColSize= gvo.getColumns().length;
columns = new Column[gvoColSize];
for (int i=0;i<gvoColSize;i++){
final String columnName= gvo.getColumns()[i].getFieldName();
String contentType = gvo.getColumns()[i].getContent();
if (CONTENT_STRING.equals(contentType)){
if (gvo.getColumns()[i].getComponent()!=null){
ComponentGVO c = gvo.getColumns()[i].getComponent();
if (c instanceof ButtonGVO){
ButtonGVO bc = (ButtonGVO)c;
columns[i] = new QButtonColumn<DataContainerGVO>(uuid,context,window,component,gvo.getColumns()[i].getId(),parent,gvo.getColumns()[i].getTooltip(), gvo.getColumns()[i],bc) {
@Override
public String getValue(DataContainerGVO map) {
return map.getDataMap().get(columnName)!=null ? map.getDataMap().get(columnName).toString(): null;
}
};
}
} else {
columns[i] = new TextColumn<DataContainerGVO>() {
@Override
public String getValue(DataContainerGVO map) {
return map.getDataMap().get(columnName)!=null ? map.getDataMap().get(columnName).toString(): null;
}
};
}
} else if (CONTENT_LINK.equals(contentType)){
columns[i] = new LinkColumn<DataContainerGVO>(uuid,context,window,component,gvo.getColumns()[i].getId(),parent,gvo.getColumns()[i].getTooltip(), gvo.getColumns()[i]) {
@Override
public String getValue(DataContainerGVO map) {
return map.getDataMap().get(columnName)!=null ? map.getDataMap().get(columnName).toString(): null;
}
};
}
if (columns[i]!=null){
if (gvo.getColumns()[i].getSortable()!=null && gvo.getColumns()[i].getSortable().booleanValue()){
//columns[i].
}
addColumn(columns[i],gvo.getColumns()[i].getDisplayname());
}
}
}
ListDataProvider<DataContainerGVO> adapter = new ListDataProvider<DataContainerGVO>();
list = adapter.getList();
if (gvo.getPageSize()!=null){
if (gvo.getPageSize()>0){
setPageSize(gvo.getPageSize());
}
}
SelectionModel<DataContainerGVO> selectionModel = null;
if (gvo.getMultipleSelect()!=null && gvo.getMultipleSelect().booleanValue()){
selectionModel = new MultiSelectionModel<DataContainerGVO>();
} else {
selectionModel = new SingleSelectionModel<DataContainerGVO>();
}
setSelectionModel(selectionModel);
adapter.addDataDisplay(this);
setPageStart(0);
}
}