本文整理了Java中com.google.gwt.user.cellview.client.DataGrid.setSelectionModel()
方法的一些代码示例,展示了DataGrid.setSelectionModel()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。DataGrid.setSelectionModel()
方法的具体详情如下:
包路径:com.google.gwt.user.cellview.client.DataGrid
类名称:DataGrid
方法名:setSelectionModel
暂无
代码示例来源:origin: org.eclipse.che.core/che-core-ide-app
@Inject
public ExtensionManagerViewImpl(
ToolbarPresenter toolbarPresenter, ActionManager actionManager, Resources resources) {
dataGrid = new DataGrid<>(100, resources);
rootElement = ourUiBinder.createAndBindUi(this);
DefaultActionGroup actionGroup =
new DefaultActionGroup("extensionManager", false, actionManager);
actionManager.registerAction("extensionManagerGroup", actionGroup);
toolbarPresenter.bindMainGroup(actionGroup);
UIObject.ensureDebugId(descriptionArea, "window-preferences-extensions-descriptionArea");
Column<ExtensionDescription, String> titleColumn =
new Column<ExtensionDescription, String>(new TextCell()) {
@Override
public String getValue(ExtensionDescription object) {
return object.getTitle();
}
};
titleColumn.setCellStyleNames(style.titleColumn());
dataGrid.addColumn(titleColumn);
SingleSelectionModel<ExtensionDescription> selectionModel =
new SingleSelectionModel<ExtensionDescription>();
dataGrid.setSelectionModel(selectionModel);
selectionModel.addSelectionChangeHandler(
new SelectionChangeEvent.Handler() {
@Override
public void onSelectionChange(SelectionChangeEvent event) {}
});
}
代码示例来源:origin: org.geomajas/geomajas-puregwt-example-base
public SampleListView(List<ShowcaseSampleDefinition> data, final SampleOverviewPage overviewPage) {
initWidget(UIBINDER.createAndBindUi(this));
ProvidesKey<ShowcaseSampleDefinition> sampleKeyProvider = new ProvidesKey<ShowcaseSampleDefinition>() {
public Object getKey(ShowcaseSampleDefinition item) {
return item.getTitle();
}
};
// We fill the grid through a list of SamplePanelFactory objects:
dataProvider = new ListDataProvider<ShowcaseSampleDefinition>(sampleKeyProvider);
dataProvider.addDataDisplay(grid);
// Selection: show sample on click
final SingleSelectionModel<ShowcaseSampleDefinition> selectionModel;
selectionModel = new SingleSelectionModel<ShowcaseSampleDefinition>(sampleKeyProvider);
grid.setSelectionModel(selectionModel);
selectionModel.addSelectionChangeHandler(new SelectionChangeEvent.Handler() {
public void onSelectionChange(SelectionChangeEvent event) {
ExampleBase.showSample(selectionModel.getSelectedObject());
}
});
// Add a sort handler:
sortHandler = new ListHandler<ShowcaseSampleDefinition>(dataProvider.getList());
grid.addColumnSortHandler(sortHandler);
// Initialize the grid columns:
initColumns();
// Apply the entire data-set:
setData(data);
}
代码示例来源:origin: org.geomajas/geomajas-gwt-example-base
public SampleListView(List<ShowcaseSampleDefinition> data, final SampleOverviewPage overviewPage) {
initWidget(UIBINDER.createAndBindUi(this));
ProvidesKey<ShowcaseSampleDefinition> sampleKeyProvider = new ProvidesKey<ShowcaseSampleDefinition>() {
public Object getKey(ShowcaseSampleDefinition item) {
return item.getTitle();
}
};
// We fill the grid through a list of SamplePanelFactory objects:
dataProvider = new ListDataProvider<ShowcaseSampleDefinition>(sampleKeyProvider);
dataProvider.addDataDisplay(grid);
// Selection: show sample on click
final SingleSelectionModel<ShowcaseSampleDefinition> selectionModel;
selectionModel = new SingleSelectionModel<ShowcaseSampleDefinition>(sampleKeyProvider);
grid.setSelectionModel(selectionModel);
selectionModel.addSelectionChangeHandler(new SelectionChangeEvent.Handler() {
public void onSelectionChange(SelectionChangeEvent event) {
ExampleBase.showSample(selectionModel.getSelectedObject());
}
});
// Add a sort handler:
sortHandler = new ListHandler<ShowcaseSampleDefinition>(dataProvider.getList());
grid.addColumnSortHandler(sortHandler);
// Initialize the grid columns:
initColumns();
// Apply the entire data-set:
setData(data);
}
代码示例来源:origin: org.geomajas/geomajas-client-gwt2-example-base
public SampleListView(List<ShowcaseSampleDefinition> data, final SampleOverviewPage overviewPage) {
initWidget(UIBINDER.createAndBindUi(this));
ProvidesKey<ShowcaseSampleDefinition> sampleKeyProvider = new ProvidesKey<ShowcaseSampleDefinition>() {
public Object getKey(ShowcaseSampleDefinition item) {
return item.getTitle();
}
};
// We fill the grid through a list of SamplePanelFactory objects:
dataProvider = new ListDataProvider<ShowcaseSampleDefinition>(sampleKeyProvider);
dataProvider.addDataDisplay(grid);
// Selection: show sample on click
final SingleSelectionModel<ShowcaseSampleDefinition> selectionModel;
selectionModel = new SingleSelectionModel<ShowcaseSampleDefinition>(sampleKeyProvider);
grid.setSelectionModel(selectionModel);
selectionModel.addSelectionChangeHandler(new SelectionChangeEvent.Handler() {
public void onSelectionChange(SelectionChangeEvent event) {
ExampleBase.showSample(selectionModel.getSelectedObject());
}
});
// Add a sort handler:
sortHandler = new ListHandler<ShowcaseSampleDefinition>(dataProvider.getList());
grid.addColumnSortHandler(sortHandler);
// Initialize the grid columns:
initColumns();
// Apply the entire data-set:
setData(data);
}
内容来源于网络,如有侵权,请联系作者删除!