summaryrefslogtreecommitdiffstats
path: root/compatibility-client
diff options
context:
space:
mode:
authorOlli Tietäväinen <ollit@vaadin.com>2018-11-13 12:46:46 +0200
committerSun Zhe <31067185+ZheSun88@users.noreply.github.com>2018-12-04 10:34:50 +0200
commit89f5052510560f278179c23af38f8abb73721625 (patch)
tree86cbe78f480413bdba5f12152a44e598f8405ece /compatibility-client
parente56718a4f4c4aa9bf65b6227f17f7236935e46a4 (diff)
downloadvaadin-framework-89f5052510560f278179c23af38f8abb73721625.tar.gz
vaadin-framework-89f5052510560f278179c23af38f8abb73721625.zip
picked fix to #10453 to compatibility package
Diffstat (limited to 'compatibility-client')
-rwxr-xr-xcompatibility-client/src/main/java/com/vaadin/v7/client/widget/escalator/events/SpacerVisibilityChangedEvent.java84
-rwxr-xr-xcompatibility-client/src/main/java/com/vaadin/v7/client/widget/escalator/events/SpacerVisibilityChangedHandler.java36
2 files changed, 120 insertions, 0 deletions
diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/widget/escalator/events/SpacerVisibilityChangedEvent.java b/compatibility-client/src/main/java/com/vaadin/v7/client/widget/escalator/events/SpacerVisibilityChangedEvent.java
new file mode 100755
index 0000000000..a36f0f5d7e
--- /dev/null
+++ b/compatibility-client/src/main/java/com/vaadin/v7/client/widget/escalator/events/SpacerVisibilityChangedEvent.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright 2000-2018 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.vaadin.v7.client.widget.escalator.events;
+
+import com.google.gwt.event.shared.GwtEvent;
+
+/**
+ * Event fired when a spacer element is hidden or shown in Escalator.
+ *
+ * @author Vaadin Ltd
+ * @since 7.7.13
+ */
+public class SpacerVisibilityChangedEvent
+ extends GwtEvent<SpacerVisibilityChangedHandler> {
+
+ /**
+ * Handler type.
+ */
+ public static final Type<SpacerVisibilityChangedHandler> TYPE = new Type<SpacerVisibilityChangedHandler>();
+
+ public static final Type<SpacerVisibilityChangedHandler> getType() {
+ return TYPE;
+ }
+
+ private final int rowIndex;
+ private final boolean visible;
+
+ /**
+ * Creates a spacer visibility changed event.
+ *
+ * @param rowIndex
+ * index of row to which the spacer belongs
+ * @param visible
+ * {@code true} if the spacer element is shown, {@code false} if the
+ * spacer element is hidden
+ */
+ public SpacerVisibilityChangedEvent(int rowIndex, boolean visible) {
+ this.rowIndex = rowIndex;
+ this.visible = visible;
+ }
+
+ /**
+ * Gets the row index to which the spacer element belongs.
+ *
+ * @return the row index to which the spacer element belongs
+ */
+ public int getRowIndex() {
+ return rowIndex;
+ }
+
+ /**
+ * Gets whether the spacer element is displayed.
+ *
+ * @return {@code true} if the spacer element is shown, {@code false} if the
+ * spacer element is hidden
+ */
+ public boolean isVisible() {
+ return visible;
+ }
+
+ @Override
+ public Type<SpacerVisibilityChangedHandler> getAssociatedType() {
+ return TYPE;
+ }
+
+ @Override
+ protected void dispatch(SpacerVisibilityChangedHandler handler) {
+ handler.onSpacerVisibilityChanged(this);
+ }
+
+} \ No newline at end of file
diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/widget/escalator/events/SpacerVisibilityChangedHandler.java b/compatibility-client/src/main/java/com/vaadin/v7/client/widget/escalator/events/SpacerVisibilityChangedHandler.java
new file mode 100755
index 0000000000..1be3975aeb
--- /dev/null
+++ b/compatibility-client/src/main/java/com/vaadin/v7/client/widget/escalator/events/SpacerVisibilityChangedHandler.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2000-2018 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.vaadin.v7.client.widget.escalator.events;
+
+import com.google.gwt.event.shared.EventHandler;
+
+/**
+ * Event handler for a spacer visibility changed event.
+ *
+ * @author Vaadin Ltd
+ * @since 7.7.13
+ */
+public interface SpacerVisibilityChangedHandler extends EventHandler {
+
+ /**
+ * Called when a spacer visibility changed event is fired, when a spacer's
+ * visibility changes.
+ *
+ * @param event
+ * the spacer visibility changed event
+ */
+ public void onSpacerVisibilityChanged(SpacerVisibilityChangedEvent event);
+} \ No newline at end of file