You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ColumnResizeEvent.java 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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.v7.client.widget.grid.events;
  17. import com.google.gwt.event.shared.GwtEvent;
  18. import com.vaadin.v7.client.widgets.Grid.Column;
  19. /**
  20. * An event for notifying that the columns in the Grid have been resized.
  21. *
  22. * @param <T>
  23. * The row type of the grid. The row type is the POJO type from where
  24. * the data is retrieved into the column cells.
  25. * @since 7.6
  26. * @author Vaadin Ltd
  27. */
  28. public class ColumnResizeEvent<T> extends GwtEvent<ColumnResizeHandler<T>> {
  29. /**
  30. * Handler type.
  31. */
  32. private static final Type<ColumnResizeHandler<?>> TYPE = new Type<ColumnResizeHandler<?>>();
  33. private Column<?, T> column;
  34. /**
  35. * @param column
  36. */
  37. public ColumnResizeEvent(Column<?, T> column) {
  38. this.column = column;
  39. }
  40. public static final Type<ColumnResizeHandler<?>> getType() {
  41. return TYPE;
  42. }
  43. @SuppressWarnings({ "rawtypes", "unchecked" })
  44. @Override
  45. public Type<ColumnResizeHandler<T>> getAssociatedType() {
  46. return (Type) TYPE;
  47. }
  48. @Override
  49. protected void dispatch(ColumnResizeHandler<T> handler) {
  50. handler.onColumnResize(this);
  51. }
  52. /**
  53. * @return the column
  54. */
  55. public Column<?, T> getColumn() {
  56. return column;
  57. }
  58. }