2 * Copyright 2000-2021 Vaadin Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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
16 package com.vaadin.v7.client.widget.escalator.events;
18 import com.google.gwt.event.shared.GwtEvent;
21 * Event fired when a spacer element is hidden or shown in Escalator.
26 public class SpacerVisibilityChangedEvent
27 extends GwtEvent<SpacerVisibilityChangedHandler> {
32 public static final Type<SpacerVisibilityChangedHandler> TYPE = new Type<SpacerVisibilityChangedHandler>();
34 public static final Type<SpacerVisibilityChangedHandler> getType() {
38 private final int rowIndex;
39 private final boolean visible;
42 * Creates a spacer visibility changed event.
45 * index of row to which the spacer belongs
47 * {@code true} if the spacer element is shown, {@code false} if the
48 * spacer element is hidden
50 public SpacerVisibilityChangedEvent(int rowIndex, boolean visible) {
51 this.rowIndex = rowIndex;
52 this.visible = visible;
56 * Gets the row index to which the spacer element belongs.
58 * @return the row index to which the spacer element belongs
60 public int getRowIndex() {
65 * Gets whether the spacer element is displayed.
67 * @return {@code true} if the spacer element is shown, {@code false} if the
68 * spacer element is hidden
70 public boolean isVisible() {
75 public Type<SpacerVisibilityChangedHandler> getAssociatedType() {
80 protected void dispatch(SpacerVisibilityChangedHandler handler) {
81 handler.onSpacerVisibilityChanged(this);