com.google.gwt.user.cellview.client.DataGrid.setSelectionModel()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(5.1k)|赞(0)|评价(0)|浏览(136)

本文整理了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

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);
}

相关文章