From 548ee39a92ae3f148940e47cccc13d9679572b53 Mon Sep 17 00:00:00 2001 From: Teemu Suo-Anttila Date: Wed, 7 Oct 2015 11:48:02 +0300 Subject: Remove Grid EditorEvents and Listeners The EditorEvent API is not mature and useful enough to be present in a stable release. Change-Id: Ia982cb1a6e7b6a3518ea0f187993a964aafa1d53 --- server/src/com/vaadin/ui/Grid.java | 143 ------------------------------------- 1 file changed, 143 deletions(-) (limited to 'server') diff --git a/server/src/com/vaadin/ui/Grid.java b/server/src/com/vaadin/ui/Grid.java index 102b38e588..06a3c16fd7 100644 --- a/server/src/com/vaadin/ui/Grid.java +++ b/server/src/com/vaadin/ui/Grid.java @@ -587,100 +587,6 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, } - /** - * Interface for an editor event listener - */ - public interface EditorListener extends Serializable { - - public static final Method EDITOR_OPEN_METHOD = ReflectTools - .findMethod(EditorListener.class, "editorOpened", - EditorOpenEvent.class); - public static final Method EDITOR_MOVE_METHOD = ReflectTools - .findMethod(EditorListener.class, "editorMoved", - EditorMoveEvent.class); - public static final Method EDITOR_CLOSE_METHOD = ReflectTools - .findMethod(EditorListener.class, "editorClosed", - EditorCloseEvent.class); - - /** - * Called when an editor is opened - * - * @param e - * an editor open event object - */ - public void editorOpened(EditorOpenEvent e); - - /** - * Called when an editor is reopened without closing it first - * - * @param e - * an editor move event object - */ - public void editorMoved(EditorMoveEvent e); - - /** - * Called when an editor is closed - * - * @param e - * an editor close event object - */ - public void editorClosed(EditorCloseEvent e); - - } - - /** - * Base class for editor related events - */ - public static abstract class EditorEvent extends Component.Event { - - private Object itemID; - - protected EditorEvent(Grid source, Object itemID) { - super(source); - this.itemID = itemID; - } - - /** - * Get the item (row) for which this editor was opened - */ - public Object getItem() { - return itemID; - } - - } - - /** - * This event gets fired when an editor is opened - */ - public static class EditorOpenEvent extends EditorEvent { - - public EditorOpenEvent(Grid source, Object itemID) { - super(source, itemID); - } - } - - /** - * This event gets fired when an editor is opened while another row is being - * edited (i.e. editor focus moves elsewhere) - */ - public static class EditorMoveEvent extends EditorEvent { - - public EditorMoveEvent(Grid source, Object itemID) { - super(source, itemID); - } - } - - /** - * This event gets fired when an editor is dismissed or closed by other - * means. - */ - public static class EditorCloseEvent extends EditorEvent { - - public EditorCloseEvent(Grid source, Object itemID) { - super(source, itemID); - } - } - /** * Default error handler for the editor * @@ -4301,24 +4207,6 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, } } - @Override - public void editorOpen(String rowKey) { - fireEvent(new EditorOpenEvent(Grid.this, getKeyMapper().get( - rowKey))); - } - - @Override - public void editorMove(String rowKey) { - fireEvent(new EditorMoveEvent(Grid.this, getKeyMapper().get( - rowKey))); - } - - @Override - public void editorClose(String rowKey) { - fireEvent(new EditorCloseEvent(Grid.this, getKeyMapper().get( - rowKey))); - } - @Override public void contextClick(int rowIndex, String rowKey, String columnId, Section section, MouseEventDetails details) { @@ -6512,37 +6400,6 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, return getState(false).editorCancelCaption; } - /** - * Add an editor event listener - * - * @param listener - * the event listener object to add - */ - public void addEditorListener(EditorListener listener) { - addListener(GridConstants.EDITOR_OPEN_EVENT_ID, EditorOpenEvent.class, - listener, EditorListener.EDITOR_OPEN_METHOD); - addListener(GridConstants.EDITOR_MOVE_EVENT_ID, EditorMoveEvent.class, - listener, EditorListener.EDITOR_MOVE_METHOD); - addListener(GridConstants.EDITOR_CLOSE_EVENT_ID, - EditorCloseEvent.class, listener, - EditorListener.EDITOR_CLOSE_METHOD); - } - - /** - * Remove an editor event listener - * - * @param listener - * the event listener object to remove - */ - public void removeEditorListener(EditorListener listener) { - removeListener(GridConstants.EDITOR_OPEN_EVENT_ID, - EditorOpenEvent.class, listener); - removeListener(GridConstants.EDITOR_MOVE_EVENT_ID, - EditorMoveEvent.class, listener); - removeListener(GridConstants.EDITOR_CLOSE_EVENT_ID, - EditorCloseEvent.class, listener); - } - /** * Sets the buffered editor mode. The default mode is buffered ( * true). -- cgit v1.2.3