aboutsummaryrefslogtreecommitdiffstats
path: root/client/src
diff options
context:
space:
mode:
authorTeemu Suo-Anttila <teemusa@vaadin.com>2014-12-12 16:09:45 +0200
committerVaadin Code Review <review@vaadin.com>2014-12-12 15:17:12 +0000
commitfe0954a97d9f826f5beda38ba6c46d1c224d1f22 (patch)
treec09c9568768d36bee9df278040be3ed5b2b02751 /client/src
parenta539b4cd7becbd1aa370f9502e4f85912d7c2844 (diff)
downloadvaadin-framework-fe0954a97d9f826f5beda38ba6c46d1c224d1f22.tar.gz
vaadin-framework-fe0954a97d9f826f5beda38ba6c46d1c224d1f22.zip
Rename client side SelectionChangeEvent (#13334)
Change-Id: I317e7eaa0613e1ce87cef0f4e19f29110104ada7
Diffstat (limited to 'client/src')
-rw-r--r--client/src/com/vaadin/client/connectors/GridConnector.java12
-rw-r--r--client/src/com/vaadin/client/ui/grid/Grid.java20
-rw-r--r--client/src/com/vaadin/client/ui/grid/selection/HasSelectionHandlers.java (renamed from client/src/com/vaadin/client/ui/grid/selection/HasSelectionChangeHandlers.java)9
-rw-r--r--client/src/com/vaadin/client/ui/grid/selection/SelectionEvent.java (renamed from client/src/com/vaadin/client/ui/grid/selection/SelectionChangeEvent.java)20
-rw-r--r--client/src/com/vaadin/client/ui/grid/selection/SelectionHandler.java (renamed from client/src/com/vaadin/client/ui/grid/selection/SelectionChangeHandler.java)10
-rw-r--r--client/src/com/vaadin/client/ui/grid/selection/SelectionModel.java6
-rw-r--r--client/src/com/vaadin/client/ui/grid/selection/SelectionModelMulti.java8
-rw-r--r--client/src/com/vaadin/client/ui/grid/selection/SelectionModelSingle.java4
8 files changed, 44 insertions, 45 deletions
diff --git a/client/src/com/vaadin/client/connectors/GridConnector.java b/client/src/com/vaadin/client/connectors/GridConnector.java
index e076faeaaa..56903922bd 100644
--- a/client/src/com/vaadin/client/connectors/GridConnector.java
+++ b/client/src/com/vaadin/client/connectors/GridConnector.java
@@ -52,8 +52,8 @@ import com.vaadin.client.ui.grid.Renderer;
import com.vaadin.client.ui.grid.events.SelectAllEvent;
import com.vaadin.client.ui.grid.events.SelectAllHandler;
import com.vaadin.client.ui.grid.selection.AbstractRowHandleSelectionModel;
-import com.vaadin.client.ui.grid.selection.SelectionChangeEvent;
-import com.vaadin.client.ui.grid.selection.SelectionChangeHandler;
+import com.vaadin.client.ui.grid.selection.SelectionEvent;
+import com.vaadin.client.ui.grid.selection.SelectionHandler;
import com.vaadin.client.ui.grid.selection.SelectionModelMulti;
import com.vaadin.client.ui.grid.selection.SelectionModelNone;
import com.vaadin.client.ui.grid.selection.SelectionModelSingle;
@@ -320,9 +320,9 @@ public class GridConnector extends AbstractHasComponentsConnector implements
private RpcDataSource dataSource;
- private SelectionChangeHandler<JSONObject> internalSelectionChangeHandler = new SelectionChangeHandler<JSONObject>() {
+ private SelectionHandler<JSONObject> internalSelectionChangeHandler = new SelectionHandler<JSONObject>() {
@Override
- public void onSelectionChange(SelectionChangeEvent<JSONObject> event) {
+ public void onSelect(SelectionEvent<JSONObject> event) {
if (event.isBatchedSelection()) {
return;
}
@@ -377,7 +377,7 @@ public class GridConnector extends AbstractHasComponentsConnector implements
getWidget().setSelectionModel(selectionModel);
- getWidget().addSelectionChangeHandler(internalSelectionChangeHandler);
+ getWidget().addSelectionHandler(internalSelectionChangeHandler);
getWidget().addSortHandler(new SortHandler<JSONObject>() {
@Override
@@ -785,7 +785,7 @@ public class GridConnector extends AbstractHasComponentsConnector implements
// deselected row data. Some data is only stored as keys
updatedFromState = true;
getWidget().fireEvent(
- new SelectionChangeEvent<JSONObject>(getWidget(),
+ new SelectionEvent<JSONObject>(getWidget(),
(List<JSONObject>) null, null, false));
}
}
diff --git a/client/src/com/vaadin/client/ui/grid/Grid.java b/client/src/com/vaadin/client/ui/grid/Grid.java
index a930fcdc66..b9b9c3a623 100644
--- a/client/src/com/vaadin/client/ui/grid/Grid.java
+++ b/client/src/com/vaadin/client/ui/grid/Grid.java
@@ -89,9 +89,9 @@ import com.vaadin.client.ui.grid.events.SelectAllEvent;
import com.vaadin.client.ui.grid.events.SelectAllHandler;
import com.vaadin.client.ui.grid.renderers.ComplexRenderer;
import com.vaadin.client.ui.grid.renderers.WidgetRenderer;
-import com.vaadin.client.ui.grid.selection.HasSelectionChangeHandlers;
-import com.vaadin.client.ui.grid.selection.SelectionChangeEvent;
-import com.vaadin.client.ui.grid.selection.SelectionChangeHandler;
+import com.vaadin.client.ui.grid.selection.HasSelectionHandlers;
+import com.vaadin.client.ui.grid.selection.SelectionEvent;
+import com.vaadin.client.ui.grid.selection.SelectionHandler;
import com.vaadin.client.ui.grid.selection.SelectionModel;
import com.vaadin.client.ui.grid.selection.SelectionModel.Multi;
import com.vaadin.client.ui.grid.selection.SelectionModelMulti;
@@ -156,7 +156,7 @@ import com.vaadin.shared.util.SharedUtil;
* @author Vaadin Ltd
*/
public class Grid<T> extends ResizeComposite implements
- HasSelectionChangeHandlers<T>, SubPartAware, DeferredWorker {
+ HasSelectionHandlers<T>, SubPartAware, DeferredWorker {
/**
* Abstract base class for Grid header and footer sections.
@@ -3359,12 +3359,12 @@ public class Grid<T> extends ResizeComposite implements
}
});
- // Default action on SelectionChangeEvents. Refresh the body so changed
+ // Default action on SelectionEvents. Refresh the body so changed
// become visible.
- addSelectionChangeHandler(new SelectionChangeHandler<T>() {
+ addSelectionHandler(new SelectionHandler<T>() {
@Override
- public void onSelectionChange(SelectionChangeEvent<T> event) {
+ public void onSelect(SelectionEvent<T> event) {
refreshBody();
}
});
@@ -4959,9 +4959,9 @@ public class Grid<T> extends ResizeComposite implements
}
@Override
- public HandlerRegistration addSelectionChangeHandler(
- final SelectionChangeHandler<T> handler) {
- return addHandler(handler, SelectionChangeEvent.getType());
+ public HandlerRegistration addSelectionHandler(
+ final SelectionHandler<T> handler) {
+ return addHandler(handler, SelectionEvent.getType());
}
/**
diff --git a/client/src/com/vaadin/client/ui/grid/selection/HasSelectionChangeHandlers.java b/client/src/com/vaadin/client/ui/grid/selection/HasSelectionHandlers.java
index 342c426b55..1afdd016aa 100644
--- a/client/src/com/vaadin/client/ui/grid/selection/HasSelectionChangeHandlers.java
+++ b/client/src/com/vaadin/client/ui/grid/selection/HasSelectionHandlers.java
@@ -18,12 +18,12 @@ package com.vaadin.client.ui.grid.selection;
import com.google.gwt.event.shared.HandlerRegistration;
/**
- * Marker interface for widgets that fires selection change events.
+ * Marker interface for widgets that fires selection events.
*
* @author Vaadin Ltd
* @since
*/
-public interface HasSelectionChangeHandlers<T> {
+public interface HasSelectionHandlers<T> {
/**
* Register a selection change handler.
@@ -33,11 +33,10 @@ public interface HasSelectionChangeHandlers<T> {
* SelectionModel} detects a change in selection state.
*
* @param handler
- * a {@link SelectionChangeHandler}
+ * a {@link SelectionHandler}
* @return a handler registration object, which can be used to remove the
* handler.
*/
- public HandlerRegistration addSelectionChangeHandler(
- SelectionChangeHandler<T> handler);
+ public HandlerRegistration addSelectionHandler(SelectionHandler<T> handler);
}
diff --git a/client/src/com/vaadin/client/ui/grid/selection/SelectionChangeEvent.java b/client/src/com/vaadin/client/ui/grid/selection/SelectionEvent.java
index 4bebaf0fbb..6a36474d12 100644
--- a/client/src/com/vaadin/client/ui/grid/selection/SelectionChangeEvent.java
+++ b/client/src/com/vaadin/client/ui/grid/selection/SelectionEvent.java
@@ -30,9 +30,9 @@ import com.vaadin.client.ui.grid.Grid;
* @author Vaadin Ltd
*/
@SuppressWarnings("rawtypes")
-public class SelectionChangeEvent<T> extends GwtEvent<SelectionChangeHandler> {
+public class SelectionEvent<T> extends GwtEvent<SelectionHandler> {
- private static final Type<SelectionChangeHandler> eventType = new Type<SelectionChangeHandler>();
+ private static final Type<SelectionHandler> eventType = new Type<SelectionHandler>();
private final Grid<T> grid;
private final List<T> added;
@@ -53,7 +53,7 @@ public class SelectionChangeEvent<T> extends GwtEvent<SelectionChangeHandler> {
* a batched selection/deselection action
* @see SelectionModel.Multi.Batched
*/
- public SelectionChangeEvent(Grid<T> grid, T added, T removed,
+ public SelectionEvent(Grid<T> grid, T added, T removed,
boolean batched) {
this.grid = grid;
this.batched = batched;
@@ -87,7 +87,7 @@ public class SelectionChangeEvent<T> extends GwtEvent<SelectionChangeHandler> {
* a batched selection/deselection action
* @see SelectionModel.Multi.Batched
*/
- public SelectionChangeEvent(Grid<T> grid, Collection<T> added,
+ public SelectionEvent(Grid<T> grid, Collection<T> added,
Collection<T> removed, boolean batched) {
this.grid = grid;
this.batched = batched;
@@ -117,7 +117,7 @@ public class SelectionChangeEvent<T> extends GwtEvent<SelectionChangeHandler> {
/**
* Get all rows added to the selection since the last
- * {@link SelectionChangeEvent}.
+ * {@link SelectionEvent}.
*
* @return a collection of added rows. Empty collection if no rows were
* added.
@@ -128,7 +128,7 @@ public class SelectionChangeEvent<T> extends GwtEvent<SelectionChangeHandler> {
/**
* Get all rows removed from the selection since the last
- * {@link SelectionChangeEvent}.
+ * {@link SelectionEvent}.
*
* @return a collection of removed rows. Empty collection if no rows were
* removed.
@@ -142,19 +142,19 @@ public class SelectionChangeEvent<T> extends GwtEvent<SelectionChangeHandler> {
*
* @return a {@link Type} identifier.
*/
- public static Type<SelectionChangeHandler> getType() {
+ public static Type<SelectionHandler> getType() {
return eventType;
}
@Override
- public Type<SelectionChangeHandler> getAssociatedType() {
+ public Type<SelectionHandler> getAssociatedType() {
return eventType;
}
@Override
@SuppressWarnings("unchecked")
- protected void dispatch(SelectionChangeHandler handler) {
- handler.onSelectionChange(this);
+ protected void dispatch(SelectionHandler handler) {
+ handler.onSelect(this);
}
/**
diff --git a/client/src/com/vaadin/client/ui/grid/selection/SelectionChangeHandler.java b/client/src/com/vaadin/client/ui/grid/selection/SelectionHandler.java
index a469f5af1f..0f687cfac3 100644
--- a/client/src/com/vaadin/client/ui/grid/selection/SelectionChangeHandler.java
+++ b/client/src/com/vaadin/client/ui/grid/selection/SelectionHandler.java
@@ -18,22 +18,22 @@ package com.vaadin.client.ui.grid.selection;
import com.google.gwt.event.shared.EventHandler;
/**
- * Handler for {@link SelectionChangeEvent}s.
+ * Handler for {@link SelectionEvent}s.
*
* @since
* @author Vaadin Ltd
* @param <T>
* The row data type
*/
-public interface SelectionChangeHandler<T> extends EventHandler {
+public interface SelectionHandler<T> extends EventHandler {
/**
* Called when a selection model's selection state is changed.
*
* @param event
- * a selection change event, containing info about rows that have
- * been added to or removed from the selection.
+ * a selection event, containing info about rows that have been
+ * added to or removed from the selection.
*/
- public void onSelectionChange(SelectionChangeEvent<T> event);
+ public void onSelect(SelectionEvent<T> event);
}
diff --git a/client/src/com/vaadin/client/ui/grid/selection/SelectionModel.java b/client/src/com/vaadin/client/ui/grid/selection/SelectionModel.java
index 9f81f8f5f2..cfbe76b707 100644
--- a/client/src/com/vaadin/client/ui/grid/selection/SelectionModel.java
+++ b/client/src/com/vaadin/client/ui/grid/selection/SelectionModel.java
@@ -141,10 +141,10 @@ public interface SelectionModel<T> {
* into one, and a final selection event will be fired when
* {@link #commitBatchSelect()} is called.
* <p>
- * <em>Note:</em> {@link SelectionChangeEvent SelectionChangeEvents}
+ * <em>Note:</em> {@link SelectionEvent SelectionChangeEvents}
* will still be fired for each selection/deselection. You should
* check whether the event is a part of a batch or not with
- * {@link SelectionChangeEvent#isBatchedSelection()}.
+ * {@link SelectionEvent#isBatchedSelection()}.
*/
public void startBatchSelect();
@@ -153,7 +153,7 @@ public interface SelectionModel<T> {
* <p>
* Any and all selections and deselections since the last invocation
* of {@link #startBatchSelect()} will be fired at once as one
- * collated {@link SelectionChangeEvent}.
+ * collated {@link SelectionEvent}.
*/
public void commitBatchSelect();
diff --git a/client/src/com/vaadin/client/ui/grid/selection/SelectionModelMulti.java b/client/src/com/vaadin/client/ui/grid/selection/SelectionModelMulti.java
index 177e3bdca8..a00376fa6e 100644
--- a/client/src/com/vaadin/client/ui/grid/selection/SelectionModelMulti.java
+++ b/client/src/com/vaadin/client/ui/grid/selection/SelectionModelMulti.java
@@ -107,7 +107,7 @@ public class SelectionModelMulti<T> extends AbstractRowHandleSelectionModel<T>
@SuppressWarnings("unchecked")
final LinkedHashSet<RowHandle<T>> selectedRowsClone = (LinkedHashSet<RowHandle<T>>) selectedRows
.clone();
- SelectionChangeEvent<T> event = new SelectionChangeEvent<T>(grid,
+ SelectionEvent<T> event = new SelectionEvent<T>(grid,
null, getSelectedRows(), isBeingBatchSelected());
selectedRows.clear();
@@ -139,7 +139,7 @@ public class SelectionModelMulti<T> extends AbstractRowHandleSelectionModel<T>
}
if (added.size() > 0) {
- grid.fireEvent(new SelectionChangeEvent<T>(grid, added, null,
+ grid.fireEvent(new SelectionEvent<T>(grid, added, null,
isBeingBatchSelected()));
return true;
@@ -163,7 +163,7 @@ public class SelectionModelMulti<T> extends AbstractRowHandleSelectionModel<T>
}
if (removed.size() > 0) {
- grid.fireEvent(new SelectionChangeEvent<T>(grid, null, removed,
+ grid.fireEvent(new SelectionEvent<T>(grid, null, removed,
isBeingBatchSelected()));
return true;
}
@@ -244,7 +244,7 @@ public class SelectionModelMulti<T> extends AbstractRowHandleSelectionModel<T>
}
deselectionBatch.clear();
- grid.fireEvent(new SelectionChangeEvent<T>(grid, added, removed,
+ grid.fireEvent(new SelectionEvent<T>(grid, added, removed,
isBeingBatchSelected()));
}
diff --git a/client/src/com/vaadin/client/ui/grid/selection/SelectionModelSingle.java b/client/src/com/vaadin/client/ui/grid/selection/SelectionModelSingle.java
index 8778b65179..727da8d4af 100644
--- a/client/src/com/vaadin/client/ui/grid/selection/SelectionModelSingle.java
+++ b/client/src/com/vaadin/client/ui/grid/selection/SelectionModelSingle.java
@@ -83,7 +83,7 @@ public class SelectionModelSingle<T> extends AbstractRowHandleSelectionModel<T>
T removed = getSelectedRow();
if (selectByHandle(grid.getDataSource().getHandle(row))) {
- grid.fireEvent(new SelectionChangeEvent<T>(grid, row, removed,
+ grid.fireEvent(new SelectionEvent<T>(grid, row, removed,
false));
return true;
@@ -100,7 +100,7 @@ public class SelectionModelSingle<T> extends AbstractRowHandleSelectionModel<T>
if (isSelected(row)) {
deselectByHandle(selectedRow);
- grid.fireEvent(new SelectionChangeEvent<T>(grid, null, row, false));
+ grid.fireEvent(new SelectionEvent<T>(grid, null, row, false));
return true;
}