Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

SpacerVisibilityChangedEvent.java 2.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /*
  2. * Copyright 2000-2018 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.escalator.events;
  17. import com.google.gwt.event.shared.GwtEvent;
  18. /**
  19. * Event fired when a spacer element is hidden or shown in Escalator.
  20. *
  21. * @author Vaadin Ltd
  22. * @since 7.7.13
  23. */
  24. public class SpacerVisibilityChangedEvent
  25. extends GwtEvent<SpacerVisibilityChangedHandler> {
  26. /**
  27. * Handler type.
  28. */
  29. public static final Type<SpacerVisibilityChangedHandler> TYPE = new Type<SpacerVisibilityChangedHandler>();
  30. public static final Type<SpacerVisibilityChangedHandler> getType() {
  31. return TYPE;
  32. }
  33. private final int rowIndex;
  34. private final boolean visible;
  35. /**
  36. * Creates a spacer visibility changed event.
  37. *
  38. * @param rowIndex
  39. * index of row to which the spacer belongs
  40. * @param visible
  41. * {@code true} if the spacer element is shown, {@code false} if the
  42. * spacer element is hidden
  43. */
  44. public SpacerVisibilityChangedEvent(int rowIndex, boolean visible) {
  45. this.rowIndex = rowIndex;
  46. this.visible = visible;
  47. }
  48. /**
  49. * Gets the row index to which the spacer element belongs.
  50. *
  51. * @return the row index to which the spacer element belongs
  52. */
  53. public int getRowIndex() {
  54. return rowIndex;
  55. }
  56. /**
  57. * Gets whether the spacer element is displayed.
  58. *
  59. * @return {@code true} if the spacer element is shown, {@code false} if the
  60. * spacer element is hidden
  61. */
  62. public boolean isVisible() {
  63. return visible;
  64. }
  65. @Override
  66. public Type<SpacerVisibilityChangedHandler> getAssociatedType() {
  67. return TYPE;
  68. }
  69. @Override
  70. protected void dispatch(SpacerVisibilityChangedHandler handler) {
  71. handler.onSpacerVisibilityChanged(this);
  72. }
  73. }