+++ /dev/null
-/*
- * Copyright 2000-2016 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.data;
-
-import java.io.Serializable;
-
-/**
- * Marker for events which provides information of the event origin.
- *
- * @since
- */
-public interface HasUserOriginated extends Serializable {
- /**
- * Returns whether this event was triggered by user interaction, on the
- * client side, or programmatically, on the server side.
- *
- * @return {@code true} if this event originates from the client,
- * {@code false} otherwise.
- */
- public boolean isUserOriginated();
-
-}
import java.util.Objects;
import java.util.Optional;
+import com.vaadin.event.HasUserOriginated;
import com.vaadin.event.SerializableEventListener;
import com.vaadin.server.Setter;
import com.vaadin.shared.Registration;
* @param <T>
* collapsed item type
*/
-public class CollapseEvent<T> extends Component.Event {
+public class CollapseEvent<T> extends Component.Event implements HasUserOriginated {
private final T collapsedItem;
return collapsedItem;
}
- /**
- * Returns whether this event was triggered by user interaction, on the
- * client side, or programmatically, on the server side.
- *
- * @return {@code true} if this event originates from the client,
- * {@code false} otherwise.
- */
+ @Override
public boolean isUserOriginated() {
return userOriginated;
}
* @param <T>
* the expanded item's type
*/
-public class ExpandEvent<T> extends Component.Event {
+public class ExpandEvent<T> extends Component.Event
+ implements HasUserOriginated {
private final T expandedItem;
return expandedItem;
}
- /**
- * Returns whether this event was triggered by user interaction, on the
- * client side, or programmatically, on the server side.
- *
- * @return {@code true} if this event originates from the client,
- * {@code false} otherwise.
- */
+ @Override
public boolean isUserOriginated() {
return userOriginated;
}
--- /dev/null
+/*
+ * Copyright 2000-2016 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.event;
+
+import java.io.Serializable;
+
+/**
+ * Marker for events which provides information of the event origin.
+ *
+ * @since 8.1
+ */
+public interface HasUserOriginated extends Serializable {
+ /**
+ * Returns whether this event was triggered by user interaction, on the
+ * client side, or programmatically, on the server side.
+ *
+ * @return {@code true} if this event originates from the client,
+ * {@code false} otherwise.
+ */
+ public boolean isUserOriginated();
+
+}
* @since 8.0
* @author Vaadin Ltd
*/
-public class SortEvent<T extends SortOrder<?>> extends Component.Event {
+public class SortEvent<T extends SortOrder<?>> extends Component.Event
+ implements HasUserOriginated {
private final List<T> sortOrder;
private final boolean userOriginated;
return sortOrder;
}
- /**
- * Returns whether this event originated from actions done by the user.
- *
- * @return true if sort event originated from user interaction
- */
+ @Override
public boolean isUserOriginated() {
return userOriginated;
}
import java.util.Optional;
import java.util.Set;
+import com.vaadin.event.HasUserOriginated;
+
/**
* A selection event that unifies the way to access to selection event for multi
* selection and single selection components (in case when only one selected
* @param <T>
* the data type of the selection model
*/
-public interface SelectionEvent<T> extends Serializable {
+public interface SelectionEvent<T> extends HasUserOriginated, Serializable {
/**
* Get first selected data item.
* @return return all the selected items, if any, never {@code null}
*/
Set<T> getAllSelectedItems();
-
- /**
- * Returns whether this selection event was triggered by user interaction,
- * on the client side, or programmatically, on the server side.
- *
- * @return {@code true} if this event originates from the client,
- * {@code false} otherwise.
- */
- boolean isUserOriginated();
}
import org.jsoup.nodes.Element;
import com.vaadin.event.ConnectorEventListener;
+import com.vaadin.event.HasUserOriginated;
import com.vaadin.event.MouseEvents.ClickEvent;
import com.vaadin.server.SizeWithUnit;
import com.vaadin.server.Sizeable;
getSplitterState().position = position;
- fireEvent(new SplitPositionChangeEvent(AbstractSplitPanel.this, true,
- oldPosition, getSplitPositionUnit(), position, getSplitPositionUnit()));
+ fireEvent(new SplitPositionChangeEvent(AbstractSplitPanel.this,
+ true, oldPosition, getSplitPositionUnit(), position,
+ getSplitPositionUnit()));
}
};
*
* @since 7.5.0
*/
- public static class SplitPositionChangeEvent extends Component.Event {
+ public static class SplitPositionChangeEvent extends Component.Event
+ implements HasUserOriginated {
private final float oldPosition;
private final Unit oldUnit;
private final boolean userOriginated;
public SplitPositionChangeEvent(final Component source,
- final boolean userOriginated,
- final float oldPosition, final Unit oldUnit,
- final float position, final Unit unit) {
+ final boolean userOriginated, final float oldPosition,
+ final Unit oldUnit, final float position, final Unit unit) {
super(source);
this.userOriginated = userOriginated;
this.oldUnit = oldUnit;
/**
* Returns the new split position that triggered this change event.
*
- * @since 7.5.0
- *
* @return the new value of split position
*/
public float getSplitPosition() {
/**
* Returns the new split position unit that triggered this change event.
*
- * @since 7.5.0
- *
* @return the new value of split position
*/
public Unit getSplitPositionUnit() {
*
* @since 8.1
*
- * @return the split position unit previously set to the source of
- * this event
+ * @return the split position unit previously set to the source of this
+ * event
*/
public Unit getOldSplitPositionUnit() {
return oldUnit;
}
- /**
- * Returns whether this event was triggered by user interaction, on the
- * client side, or programmatically, on the server side.
- *
- * @since 8.1
- *
- * @return {@code true} if this event originates from the client,
- * {@code false} otherwise.
- */
+ @Override
public boolean isUserOriginated() {
return userOriginated;
}
import com.vaadin.data.provider.QuerySortOrder;
import com.vaadin.event.ConnectorEvent;
import com.vaadin.event.ContextClickEvent;
+import com.vaadin.event.HasUserOriginated;
import com.vaadin.event.SortEvent;
import com.vaadin.event.SortEvent.SortListener;
import com.vaadin.event.SortEvent.SortNotifier;
/**
* An event that is fired when the columns are reordered.
*/
- public static class ColumnReorderEvent extends Component.Event {
+ public static class ColumnReorderEvent extends Component.Event
+ implements HasUserOriginated {
private final boolean userOriginated;
*
* @return <code>true</code> if event is a result of user interaction
*/
+ @Override
public boolean isUserOriginated() {
return userOriginated;
}
* An event that is fired when a column is resized, either programmatically
* or by the user.
*/
- public static class ColumnResizeEvent extends Component.Event {
+ public static class ColumnResizeEvent extends Component.Event
+ implements HasUserOriginated {
private final Column<?, ?> column;
private final boolean userOriginated;
*
* @return <code>true</code> if event is a result of user interaction
*/
+ @Override
public boolean isUserOriginated() {
return userOriginated;
}
*
* @since 7.5.0
*/
- public static class ColumnVisibilityChangeEvent extends Component.Event {
+ public static class ColumnVisibilityChangeEvent extends Component.Event
+ implements HasUserOriginated {
private final Column<?, ?> column;
private final boolean userOriginated;
return hidden;
}
- /**
- * Returns <code>true</code> if the column reorder was done by the user,
- * <code>false</code> if not and it was triggered by server side code.
- *
- * @return <code>true</code> if event is a result of user interaction
- */
+ @Override
public boolean isUserOriginated() {
return userOriginated;
}
* <code>null</code>
* @param presentationProvider
* the function to get presentations from the value of this
- * column, not <code>null</code>. For more details, see {@link #setRenderer(ValueProvider, Renderer)}
+ * column, not <code>null</code>. For more details, see
+ * {@link #setRenderer(ValueProvider, Renderer)}
* @param renderer
* the presentation renderer, not <code>null</code>
* @param <P>
* the presentation type
- *
+ *
* @since 8.1
*/
protected <P> Column(ValueProvider<T, V> valueProvider,
* column, not {@code null}
* @param renderer
* the new renderer, not {@code null}
- *
+ *
* @param <P>
* the presentation type
- *
+ *
* @return this column
*
* @since 8.1
* the value presentation provider
* @param <V>
* the column value type
- *
+ *
* @see #addColumn(ValueProvider, ValueProvider, AbstractRenderer)
*
* @return the new column
/**
* Adds a new column to this {@link Grid} with value provider, presentation
* provider and typed renderer.
- *
+ *
* <p>
* The presentation provider is a method that takes the value from the value
* provider, and maps that to a value that the renderer accepts. This
* account.
*
* @param row
- * zero based index of the item to scroll to in the current
- * view.
+ * zero based index of the item to scroll to in the current view.
* @throws IllegalArgumentException
* if the provided id is not recognized by the data source.
*/
* account.
*
* @param row
- * zero based index of the item to scroll to in the current
- * view.
+ * zero based index of the item to scroll to in the current view.
* @param destination
* value specifying desired position of scrolled-to row, not
* {@code null}
import org.jsoup.nodes.Attributes;
import org.jsoup.nodes.Element;
-import com.vaadin.data.HasUserOriginated;
import com.vaadin.event.FieldEvents.BlurEvent;
import com.vaadin.event.FieldEvents.BlurListener;
import com.vaadin.event.FieldEvents.BlurNotifier;
import com.vaadin.event.FieldEvents.FocusEvent;
import com.vaadin.event.FieldEvents.FocusListener;
import com.vaadin.event.FieldEvents.FocusNotifier;
+import com.vaadin.event.HasUserOriginated;
import com.vaadin.server.ErrorMessage;
import com.vaadin.server.KeyMapper;
import com.vaadin.server.Resource;