本文整理匯總了Java中com.google.gwt.view.client.ListDataProvider類的典型用法代碼示例。如果您正苦於以下問題:Java ListDataProvider類的具體用法?Java ListDataProvider怎麽用?Java ListDataProvider使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ListDataProvider類屬於com.google.gwt.view.client包,在下文中一共展示了ListDataProvider類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setupAnalyzeResultDisplayPanel
import com.google.gwt.view.client.ListDataProvider; //導入依賴的package包/類
private void setupAnalyzeResultDisplayPanel(CellTable<AnalyzerResultDTO> table,
final ListDataProvider<AnalyzerResultDTO> dataProvider) {
final ClickableTextCellRuleID clickableIDcell = new ClickableTextCellRuleID();
Column<AnalyzerResultDTO,String> ruleIDColumn = new Column<AnalyzerResultDTO,String>(clickableIDcell) {
@Override
public String getValue (AnalyzerResultDTO dr) {
if (dr.getRefRuleId() == null)
return "none";
else
return dr.getRefRuleId().toString();
}
};
table.addColumn(ruleIDColumn, "Ref Rule ID");
table.addColumnStyleName(2, "ar_number_column_style");
ruleIDColumn.setFieldUpdater(new FieldUpdater<AnalyzerResultDTO,String> () {
public void update(int index, AnalyzerResultDTO ar, String value) {
showRuleDetailDialog(ar);
}
});
}
示例2: NotesTable
import com.google.gwt.view.client.ListDataProvider; //導入依賴的package包/類
public NotesTable() {
selectionModel = new MultiSelectionModel<Note>();
table.setSelectionModel(selectionModel, DefaultSelectionEventManager.<Note> createDefaultManager());
info.setCellStyleNames(AppStyles.NOTE_TEXT);
list.setCellStyleNames(AppStyles.NOTE_LIST_NAME);
table.addColumn(info, "Note");
// table.addColumn(list, "List");
initWidget(table);
dataProvider = new ListDataProvider<Note>();
dataProvider.addDataDisplay(table);
table.addCellPreviewHandler(new CellPreviewEvent.Handler() {
@Override
public void onCellPreview(CellPreviewEvent event) {
if (BrowserEvents.CLICK.equalsIgnoreCase(event.getNativeEvent().getType())) {
selectedColumn = event.getColumn();
selectedRow = event.getIndex();
//used to prepare double click info
}
}
});
}
示例3: DomainList
import com.google.gwt.view.client.ListDataProvider; //導入依賴的package包/類
public DomainList() {
table = new CellTable<>(15, (Resources) GWT.create(TableResources.class));
table.addColumn( new Column<String,SafeHtml>(new SafeHtmlCell() ) {
@Override
public SafeHtml getValue(String domain) {
return new LinkHtml( domain, "javascript:selectDomain(\"" + domain + "\")" ); };
}, "Domain");
dataProvider = new ListDataProvider<String>();
dataProvider.addDataDisplay( table );
SimplePager pager = new SimplePager();
pager.setDisplay( table );
table.setWidth("100%");
tablePanel.add( table );
tablePanel.add( pager );
tablePanel.setWidth("100%");
}
示例4: reloadTable
import com.google.gwt.view.client.ListDataProvider; //導入依賴的package包/類
private void reloadTable(List<Pair<RiskAnalysisSessionInfo, Boolean>> sessions) {
table.setRowData(0, sessions);
dataProvider = new ListDataProvider<Pair<RiskAnalysisSessionInfo, Boolean>>();
dataProvider.addDataDisplay( table );
for( int i = 0; i < sessions.size(); i++ ) {
dataProvider.getList().add( sessions.get(i) );
}
pager = new SimplePager();
pager.setDisplay( table );
table.setWidth("100%");
tablePanel.clear();
tablePanel.add( table );
tablePanel.add( pager );
}
示例5: 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);
}
示例6: 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);
}
示例7: AbstractDataTable
import com.google.gwt.view.client.ListDataProvider; //導入依賴的package包/類
protected AbstractDataTable(String label) {
_layout = new VerticalPanel();
_layout.setStyleName("fill-layout-width"); //$NON-NLS-1$
_layout.getElement().setAttribute("style", "padding-top:5px;"); //$NON-NLS-1$ //$NON-NLS-2$
_table = new DefaultCellTable<T>(5);
ProvidesKey<T> keyProvider = createKeyProvider();
_selectionModel = createSelectionModel(keyProvider);
_table.setSelectionModel(_selectionModel);
_dataProvider = new ListDataProvider<T>(keyProvider);
_dataProvider.addDataDisplay(_table);
createColumns(_table, _dataProvider);
DefaultPager pager = new DefaultPager();
pager.setDisplay(_table);
_layout.add(new ContentGroupLabel(label));
_layout.add(_table);
_layout.add(pager);
}
示例8: DefaultResourceListViewImpl
import com.google.gwt.view.client.ListDataProvider; //導入依賴的package包/類
public DefaultResourceListViewImpl() {
initWidget(uiBinder.createAndBindUi(this));
m_layoutPanel.setSize("100%", "335px");
m_dataProvider = new ListDataProvider<ResourceListItem>();
m_dataProvider.addDataDisplay(m_resourceTable);
SimplePager pager = new SimplePager(TextLocation.CENTER);
pager.setStyleName("onms-table-no-borders-margin");
pager.getElement().getStyle().setBackgroundColor("#E0E0E0");
pager.getElement().getStyle().setWidth(100, Unit.PCT);
pager.setDisplay(m_resourceTable);
m_simplePagerContainer.add(pager);
m_resourceTable.getSelectionModel().addSelectionChangeHandler(new Handler() {
@Override
public void onSelectionChange(SelectionChangeEvent event) {
m_presenter.onResourceItemSelected();
}
});
m_resourceTable.setWidth("100%");
}
示例9: SnmpSelectListViewImpl
import com.google.gwt.view.client.ListDataProvider; //導入依賴的package包/類
public SnmpSelectListViewImpl() {
initWidget(uiBinder.createAndBindUi(this));
m_layoutPanel.setSize("100%", "500px");
m_layoutPanel.getElement().getStyle().setBorderStyle(BorderStyle.SOLID);
m_layoutPanel.getElement().getStyle().setBorderWidth(1, Unit.PX);
m_layoutPanel.getElement().getStyle().setBorderColor("#D0D0D0");
m_snmpSelectTable.setWidth("100%");
m_snmpSelectTable.setCollectUpdateHandler(new SnmpSelectTableCollectUpdateHandler() {
@Override
public void onSnmpInterfaceCollectUpdated(int ifIndex, String oldValue, String newValue) {
m_presenter.onSnmpInterfaceCollectUpdated(ifIndex, oldValue, newValue);
}
});
m_simplePager = new SimplePager(TextLocation.CENTER, (Resources) GWT.create(OnmsSimplePagerResources.class), true, 1000, false);
m_simplePager.setWidth("100%");
m_simplePager.setDisplay(m_snmpSelectTable);
m_pagerContainer.add(m_simplePager);
m_dataList = new ListDataProvider<SnmpCellListItem>();
m_dataList.addDataDisplay(m_snmpSelectTable);
}
示例10: scrollToTheEnd
import com.google.gwt.view.client.ListDataProvider; //導入依賴的package包/類
public static <T extends Hierarchic> void scrollToTheEnd(T newItem, SingleSelectionModel<T> selectionModel,
ListDataProvider<? extends Hierarchic> listDataProvider, ResizableDataGrid<? extends Hierarchic> resizableDataGrid) {
if (selectionModel.getSelectedObject() != null) {
T selectedObject = selectionModel.getSelectedObject();
selectionModel.setSelected(selectedObject, false);
}
Long oldId = newItem.getId();
newItem.setId(-1L);
selectionModel.setSelected(newItem, true);
newItem.setId(oldId);
int provSize = listDataProvider.getList().size();
int pageSize = resizableDataGrid.getPageSize();
int start = provSize < pageSize ? 0 : provSize - pageSize + 1;
resizableDataGrid.setVisibleRange(start, pageSize);
listDataProvider.refresh();
resizableDataGrid.getScrollPanel().scrollToBottom();
}
示例11: StudentEditorPresenter
import com.google.gwt.view.client.ListDataProvider; //導入依賴的package包/類
public StudentEditorPresenter(final GwtPreferences preferences) {
this.preferences = preferences;
initWidget(uiBinder.createAndBindUi(this));
TextCell textCell = new TextCell();
studentDisplay = new CellList<String>(textCell);
studentList = new ListDataProvider<>(preferences.getStudentNames());
studentList.addDataDisplay(studentDisplay);
selectionModel = new SingleSelectionModel<>();
studentDisplay.setSelectionModel(selectionModel);
selectionModel.addSelectionChangeHandler(new SelectionChangeEvent.Handler() {
@Override
public void onSelectionChange(SelectionChangeEvent event) {
updateSelectedStudent();
oldStudentName = selectionModel.getSelectedObject();
studentName.setText(oldStudentName);
}
});
studentPanel.add(studentDisplay);
selectionModel.setSelected(studentList.getList().get(0), true);
}
示例12: setUp
import com.google.gwt.view.client.ListDataProvider; //導入依賴的package包/類
@Before
public void setUp() {
okCommandCaptor = ArgumentCaptor.forClass(ParameterizedCommand.class);
cancelCommandCaptor = ArgumentCaptor.forClass(Command.class);
presenter = new ContainerConfigParamsPresenter(view,
containerConfigPopup,
configParamsChangeEvent,
translationService) {
@Override
ListDataProvider<ContainerConfig> createDataProvider() {
return ContainerConfigParamsPresenterTest.this.dataProvider;
}
};
presenter.addContentChangeHandler(contentChangeHandler);
when(dataProvider.getList()).thenReturn(dataProviderList);
when(view.getDisplay()).thenReturn(dataGrid);
presenter.init();
verify(view,
times(1)).init(presenter);
verify(view,
times(1)).getDisplay();
verify(dataProvider,
times(1)).addDataDisplay(dataGrid);
}
示例13: setUp
import com.google.gwt.view.client.ListDataProvider; //導入依賴的package包/類
@Before
public void setUp() {
when(view.getDisplay()).thenReturn(dataDisplay);
when(dataProvider.getList()).thenReturn(dataProviderList);
presenter = new TemplateParamsTablePresenter(view) {
@Override
ListDataProvider<TemplateParam> createDataProvider() {
return TemplateParamsTablePresenterTest.this.dataProvider;
}
};
presenter.init();
verify(view,
times(1)).init(presenter);
verify(dataProvider,
times(1)).addDataDisplay(dataDisplay);
}
示例14: ValidationPopupViewImpl
import com.google.gwt.view.client.ListDataProvider; //導入依賴的package包/類
@Inject
public ValidationPopupViewImpl( final Div view,
final Button yesButton,
final Button cancelButton,
final TranslationService translationService ) {
this.view = view;
this.yesButton = yesButton;
this.cancelButton = cancelButton;
this.translationService = translationService;
this.validationTable = new MessageTableWidget<>( MessageTableWidget.Mode.PAGED );
validationTable.setDataProvider( new ListDataProvider<>() );
validationTable.addLevelColumn( 75,
row -> {
final Level level = ( (ValidationMessage) row ).getLevel();
return level != null ? level : Level.ERROR;
} );
validationTable.addTextColumn( 90,
row -> ( (ValidationMessage) row ).getText() );
validationTableDataProvider = new ListDataProvider<>();
validationTableDataProvider.addDataDisplay( validationTable );
}
示例15: initListDataProvider
import com.google.gwt.view.client.ListDataProvider; //導入依賴的package包/類
private void initListDataProvider(DataGrid<PersonDto> dataGrid) {
dataProviderList = new ListDataProvider<>(new ArrayList<PersonDto>(0));
dataProviderList.addDataDisplay(dataGrid);
// Set the message to display when the table is empty.
dataGrid.setEmptyTableWidget(new Label("No Data"));
}