diff options
author | Teemu Suo-Anttila <teemusa@vaadin.com> | 2015-10-07 11:48:02 +0300 |
---|---|---|
committer | Johannes Dahlström <johannesd@vaadin.com> | 2015-10-07 09:29:59 +0000 |
commit | 548ee39a92ae3f148940e47cccc13d9679572b53 (patch) | |
tree | cb64d40464f42d3b4149d14b464f72053a8b0965 /client | |
parent | 869b795e6478c34e6593b5f6ace2fe265973ebbd (diff) | |
download | vaadin-framework-548ee39a92ae3f148940e47cccc13d9679572b53.tar.gz vaadin-framework-548ee39a92ae3f148940e47cccc13d9679572b53.zip |
Remove Grid EditorEvents and Listeners
The EditorEvent API is not mature and useful enough to be present in a
stable release.
Change-Id: Ia982cb1a6e7b6a3518ea0f187993a964aafa1d53
Diffstat (limited to 'client')
8 files changed, 0 insertions, 323 deletions
diff --git a/client/src/com/vaadin/client/connectors/GridConnector.java b/client/src/com/vaadin/client/connectors/GridConnector.java index 9e57b17714..237d026e5a 100644 --- a/client/src/com/vaadin/client/connectors/GridConnector.java +++ b/client/src/com/vaadin/client/connectors/GridConnector.java @@ -64,10 +64,6 @@ import com.vaadin.client.widget.grid.events.ColumnReorderEvent; import com.vaadin.client.widget.grid.events.ColumnReorderHandler; import com.vaadin.client.widget.grid.events.ColumnVisibilityChangeEvent; import com.vaadin.client.widget.grid.events.ColumnVisibilityChangeHandler; -import com.vaadin.client.widget.grid.events.EditorCloseEvent; -import com.vaadin.client.widget.grid.events.EditorEventHandler; -import com.vaadin.client.widget.grid.events.EditorMoveEvent; -import com.vaadin.client.widget.grid.events.EditorOpenEvent; import com.vaadin.client.widget.grid.events.GridClickEvent; import com.vaadin.client.widget.grid.events.GridDoubleClickEvent; import com.vaadin.client.widget.grid.sort.SortEvent; @@ -752,32 +748,6 @@ public class GridConnector extends AbstractHasComponentsConnector implements getWidget().setDetailsGenerator(customDetailsGenerator); getLayoutManager().registerDependency(this, getWidget().getElement()); - getWidget().addEditorEventHandler(new EditorEventHandler() { - @Override - public void onEditorOpen(EditorOpenEvent e) { - if (hasEventListener(GridConstants.EDITOR_OPEN_EVENT_ID)) { - String rowKey = getRowKey((JsonObject) e.getRow()); - getRpcProxy(GridServerRpc.class).editorOpen(rowKey); - } - } - - @Override - public void onEditorMove(EditorMoveEvent e) { - if (hasEventListener(GridConstants.EDITOR_MOVE_EVENT_ID)) { - String rowKey = getRowKey((JsonObject) e.getRow()); - getRpcProxy(GridServerRpc.class).editorMove(rowKey); - } - } - - @Override - public void onEditorClose(EditorCloseEvent e) { - if (hasEventListener(GridConstants.EDITOR_CLOSE_EVENT_ID)) { - String rowKey = getRowKey((JsonObject) e.getRow()); - getRpcProxy(GridServerRpc.class).editorClose(rowKey); - } - } - }); - layout(); } diff --git a/client/src/com/vaadin/client/widget/grid/DefaultEditorEventHandler.java b/client/src/com/vaadin/client/widget/grid/DefaultEditorEventHandler.java index cfe56c3775..5089f2f15c 100644 --- a/client/src/com/vaadin/client/widget/grid/DefaultEditorEventHandler.java +++ b/client/src/com/vaadin/client/widget/grid/DefaultEditorEventHandler.java @@ -23,8 +23,6 @@ import com.google.gwt.user.client.Event; import com.google.gwt.user.client.ui.Widget; import com.vaadin.client.WidgetUtil; import com.vaadin.client.ui.FocusUtil; -import com.vaadin.client.widget.grid.events.EditorMoveEvent; -import com.vaadin.client.widget.grid.events.EditorOpenEvent; import com.vaadin.client.widgets.Grid.Editor; import com.vaadin.client.widgets.Grid.EditorDomEvent; @@ -114,9 +112,6 @@ public class DefaultEditorEventHandler<T> implements Editor.EventHandler<T> { editRow(event, cell.getRowIndex(), cell.getColumnIndexDOM()); - // FIXME should be in editRow - event.getGrid().fireEvent(new EditorOpenEvent(cell)); - event.getDomEvent().preventDefault(); return true; @@ -147,9 +142,6 @@ public class DefaultEditorEventHandler<T> implements Editor.EventHandler<T> { editRow(event, cell.getRowIndex(), cell.getColumnIndexDOM()); - // FIXME should be in editRow - event.getGrid().fireEvent(new EditorMoveEvent(cell)); - return true; } @@ -188,9 +180,6 @@ public class DefaultEditorEventHandler<T> implements Editor.EventHandler<T> { } editRow(event, rowIndex + rowDelta, colIndex); - - // FIXME should be in editRow - event.getGrid().fireEvent(new EditorMoveEvent(cell)); } return changed; @@ -219,9 +208,6 @@ public class DefaultEditorEventHandler<T> implements Editor.EventHandler<T> { editRow(event, event.getRowIndex(), event.getCell() .getColumnIndexDOM()); - // FIXME should be in editRow - event.getGrid().fireEvent(new EditorMoveEvent(cell)); - return true; } else if (e.getType().equals(BrowserEvents.KEYDOWN) @@ -230,9 +216,6 @@ public class DefaultEditorEventHandler<T> implements Editor.EventHandler<T> { editRow(event, event.getRowIndex(), event.getFocusedColumnIndex() + (e.getShiftKey() ? -1 : +1)); - // FIXME should be in editRow - event.getGrid().fireEvent(new EditorMoveEvent(cell)); - return true; } diff --git a/client/src/com/vaadin/client/widget/grid/events/EditorCloseEvent.java b/client/src/com/vaadin/client/widget/grid/events/EditorCloseEvent.java deleted file mode 100644 index 99f59aa82a..0000000000 --- a/client/src/com/vaadin/client/widget/grid/events/EditorCloseEvent.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2000-2014 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.client.widget.grid.events; - -import com.vaadin.client.widget.grid.CellReference; - -/** - * Event that gets fired when an open editor is closed (and not reopened - * elsewhere) - */ -public class EditorCloseEvent extends EditorEvent { - - public EditorCloseEvent(CellReference<?> cell) { - super(cell); - } - - @Override - protected void dispatch(EditorEventHandler handler) { - handler.onEditorClose(this); - } -}
\ No newline at end of file diff --git a/client/src/com/vaadin/client/widget/grid/events/EditorEvent.java b/client/src/com/vaadin/client/widget/grid/events/EditorEvent.java deleted file mode 100644 index eb34033197..0000000000 --- a/client/src/com/vaadin/client/widget/grid/events/EditorEvent.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright 2000-2014 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.client.widget.grid.events; - -import com.google.gwt.event.shared.GwtEvent; -import com.vaadin.client.widget.grid.CellReference; -import com.vaadin.client.widgets.Grid; -import com.vaadin.client.widgets.Grid.Column; - -/** - * Base class for editor events. - */ -public abstract class EditorEvent extends GwtEvent<EditorEventHandler> { - public static final Type<EditorEventHandler> TYPE = new Type<EditorEventHandler>(); - - private CellReference<?> cell; - - protected EditorEvent(CellReference<?> cell) { - this.cell = cell; - } - - @Override - public Type<EditorEventHandler> getAssociatedType() { - return TYPE; - } - - /** - * Get a reference to the Grid that fired this Event. - * - * @return a Grid reference - */ - @SuppressWarnings("unchecked") - public <T> Grid<T> getGrid() { - return (Grid<T>) cell.getGrid(); - } - - /** - * Get a reference to the cell that was active when this Event was fired. - * NOTE: do <i>NOT</i> rely on this information remaining accurate after - * leaving the event handler. - * - * @return a cell reference - */ - @SuppressWarnings("unchecked") - public <T> CellReference<T> getCell() { - return (CellReference<T>) cell; - } - - /** - * Get a reference to the row that was active when this Event was fired. - * NOTE: do <i>NOT</i> rely on this information remaining accurate after - * leaving the event handler. - * - * @return a row data object - */ - @SuppressWarnings("unchecked") - public <T> T getRow() { - return (T) cell.getRow(); - } - - /** - * Get the index of the row that was active when this Event was fired. NOTE: - * do <i>NOT</i> rely on this information remaining accurate after leaving - * the event handler. - * - * @return an integer value - */ - public int getRowIndex() { - return cell.getRowIndex(); - } - - /** - * Get a reference to the column that was active when this Event was fired. - * NOTE: do <i>NOT</i> rely on this information remaining accurate after - * leaving the event handler. - * - * @return a column object - */ - @SuppressWarnings("unchecked") - public <C, T> Column<C, T> getColumn() { - return (Column<C, T>) cell.getColumn(); - } - - /** - * Get the index of the column that was active when this Event was fired. - * NOTE: do <i>NOT</i> rely on this information remaining accurate after - * leaving the event handler. - * - * @return an integer value - */ - public int getColumnIndex() { - return cell.getColumnIndex(); - } - -}
\ No newline at end of file diff --git a/client/src/com/vaadin/client/widget/grid/events/EditorEventHandler.java b/client/src/com/vaadin/client/widget/grid/events/EditorEventHandler.java deleted file mode 100644 index 4f9396a9f1..0000000000 --- a/client/src/com/vaadin/client/widget/grid/events/EditorEventHandler.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2000-2014 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.client.widget.grid.events; - -import com.google.gwt.event.shared.EventHandler; - -/** - * Common handler interface for editor events - */ -public interface EditorEventHandler extends EventHandler { - - /** - * Action to perform when the editor has been opened - * - * @param e - * an editor open event object - */ - public void onEditorOpen(EditorOpenEvent e); - - /** - * Action to perform when the editor is re-opened on another row - * - * @param e - * an editor move event object - */ - public void onEditorMove(EditorMoveEvent e); - - /** - * Action to perform when the editor is closed - * - * @param e - * an editor close event object - */ - public void onEditorClose(EditorCloseEvent e); - -}
\ No newline at end of file diff --git a/client/src/com/vaadin/client/widget/grid/events/EditorMoveEvent.java b/client/src/com/vaadin/client/widget/grid/events/EditorMoveEvent.java deleted file mode 100644 index 0e5e2dcd7b..0000000000 --- a/client/src/com/vaadin/client/widget/grid/events/EditorMoveEvent.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2000-2014 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.client.widget.grid.events; - -import com.vaadin.client.widget.grid.CellReference; - -/** - * Event that gets fired when an already open editor is closed and re-opened on - * another row - */ -public class EditorMoveEvent extends EditorEvent { - - public EditorMoveEvent(CellReference<?> cell) { - super(cell); - } - - @Override - protected void dispatch(EditorEventHandler handler) { - handler.onEditorMove(this); - } -}
\ No newline at end of file diff --git a/client/src/com/vaadin/client/widget/grid/events/EditorOpenEvent.java b/client/src/com/vaadin/client/widget/grid/events/EditorOpenEvent.java deleted file mode 100644 index df0171945f..0000000000 --- a/client/src/com/vaadin/client/widget/grid/events/EditorOpenEvent.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2000-2014 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.client.widget.grid.events; - -import com.vaadin.client.widget.grid.CellReference; - -/** - * Event that gets fired when the editor is opened - */ -public class EditorOpenEvent extends EditorEvent { - - public EditorOpenEvent(CellReference<?> cell) { - super(cell); - } - - @Override - protected void dispatch(EditorEventHandler handler) { - handler.onEditorOpen(this); - } - -}
\ No newline at end of file diff --git a/client/src/com/vaadin/client/widgets/Grid.java b/client/src/com/vaadin/client/widgets/Grid.java index 0a027349aa..2eefc87f44 100644 --- a/client/src/com/vaadin/client/widgets/Grid.java +++ b/client/src/com/vaadin/client/widgets/Grid.java @@ -123,9 +123,6 @@ import com.vaadin.client.widget.grid.events.ColumnReorderEvent; import com.vaadin.client.widget.grid.events.ColumnReorderHandler; import com.vaadin.client.widget.grid.events.ColumnVisibilityChangeEvent; import com.vaadin.client.widget.grid.events.ColumnVisibilityChangeHandler; -import com.vaadin.client.widget.grid.events.EditorCloseEvent; -import com.vaadin.client.widget.grid.events.EditorEvent; -import com.vaadin.client.widget.grid.events.EditorEventHandler; import com.vaadin.client.widget.grid.events.FooterClickHandler; import com.vaadin.client.widget.grid.events.FooterDoubleClickHandler; import com.vaadin.client.widget.grid.events.FooterKeyDownHandler; @@ -1586,7 +1583,6 @@ public class Grid<T> extends ResizeComposite implements focusedColumnIndex = -1; grid.getEscalator().setScrollLocked(Direction.VERTICAL, false); updateSelectionCheckboxesAsNeeded(true); - grid.fireEvent(new EditorCloseEvent(grid.eventCell)); } private void updateSelectionCheckboxesAsNeeded(boolean isEnabled) { @@ -6358,19 +6354,6 @@ public class Grid<T> extends ResizeComposite implements return editor; } - /** - * Add handler for editor open/move/close events - * - * @param handler - * editor handler object - * @return a {@link HandlerRegistration} object that can be used to remove - * the event handler - */ - public HandlerRegistration addEditorEventHandler(EditorEventHandler handler) { - return addHandler(handler, EditorEvent.TYPE); - - } - protected Escalator getEscalator() { return escalator; } |