Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

SelectAllEvent.java 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * Copyright 2000-2016 Vaadin Ltd.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  5. * use this file except in compliance with the License. You may obtain a copy of
  6. * the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  12. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  13. * License for the specific language governing permissions and limitations under
  14. * the License.
  15. */
  16. package com.vaadin.client.widget.grid.events;
  17. import com.google.gwt.event.shared.GwtEvent;
  18. import com.vaadin.client.widget.grid.selection.SelectionModel;
  19. /**
  20. * A select all event, fired by the Grid when it needs all rows in data source
  21. * to be selected.
  22. *
  23. * @since 7.4
  24. * @author Vaadin Ltd
  25. */
  26. public class SelectAllEvent<T> extends GwtEvent<SelectAllHandler<T>> {
  27. /**
  28. * Handler type.
  29. */
  30. private final static Type<SelectAllHandler<?>> TYPE = new Type<>();;
  31. private SelectionModel.Multi<T> selectionModel;
  32. public SelectAllEvent(SelectionModel.Multi<T> selectionModel) {
  33. this.selectionModel = selectionModel;
  34. }
  35. public static final Type<SelectAllHandler<?>> getType() {
  36. return TYPE;
  37. }
  38. @SuppressWarnings({ "rawtypes", "unchecked" })
  39. @Override
  40. public Type<SelectAllHandler<T>> getAssociatedType() {
  41. return (Type) TYPE;
  42. }
  43. @Override
  44. protected void dispatch(SelectAllHandler<T> handler) {
  45. handler.onSelectAll(this);
  46. }
  47. public SelectionModel.Multi<T> getSelectionModel() {
  48. return selectionModel;
  49. }
  50. }