Package com.google.gwt.editor.client.testing

## Class FakeEditorSource<T>

- java.lang.Object
- - com.google.gwt.editor.client.adapters.EditorSource<FakeLeafValueEditor<T>>
  - - com.google.gwt.editor.client.testing.FakeEditorSource<T>

- Type Parameters:
    `T` - the type being edited

      public class FakeEditorSource<T>
      extends EditorSource<FakeLeafValueEditor<T>>

  A trivial implementation of `EditorSource` that creates `FakeLeafValueEditor` instances.

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static int` | `DISPOSED` | Return value for `getLastKnownPosition(com.google.gwt.editor.client.testing.FakeLeafValueEditor<T>)` if the editor has been passed into `dispose(com.google.gwt.editor.client.testing.FakeLeafValueEditor<T>)`.
    `static int` | `UNKNOWN` | Return value for `getLastKnownPosition(com.google.gwt.editor.client.testing.FakeLeafValueEditor<T>)` if the editor was not created by this FakeEditorSource.

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `FakeEditorSource()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `FakeLeafValueEditor<T>` | `create​(int index)` | Create a new Editor.
    `FakeLeafValueEditor<T>` | `createEditorForTraversal()` | Creates a temporary sub-Editor to use for traversal.
    `void` | `dispose​(FakeLeafValueEditor<T> subEditor)` | Called when an Editor no longer requires a sub-Editor.
    `int` | `getLastKnownPosition​(FakeLeafValueEditor<T> editor)` |
    `void` | `setIndex​(FakeLeafValueEditor<T> editor, int index)` | Re-order a sub-Editor.

    - ### Methods inherited from class com.google.gwt.editor.client.adapters.EditorSource

      `create`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### DISPOSED

          public static final int DISPOSED

      Return value for `getLastKnownPosition(com.google.gwt.editor.client.testing.FakeLeafValueEditor<T>)` if the editor has been passed into `dispose(com.google.gwt.editor.client.testing.FakeLeafValueEditor<T>)`.
      See Also:
        Constant Field Values

    - #### UNKNOWN

          public static final int UNKNOWN

      Return value for `getLastKnownPosition(com.google.gwt.editor.client.testing.FakeLeafValueEditor<T>)` if the editor was not created by this FakeEditorSource.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### FakeEditorSource

          public FakeEditorSource()

  - ### Method Detail

    - #### create

          public FakeLeafValueEditor<T> create​(int index)

      Description copied from class: `EditorSource`
      Create a new Editor.
      Specified by:
        `create` in class `EditorSource<FakeLeafValueEditor<T>>`
      Parameters:
        `index` - the position at which the new Editor should be displayed
      Returns:
        an `Editor` of type E

    - #### createEditorForTraversal

          public FakeLeafValueEditor<T> createEditorForTraversal()

      Description copied from class: `EditorSource`
      Creates a temporary sub-Editor to use for traversal.

      For backwards compatibility with GWT 2.5.0 and earlier, the default implementation calls `create(0)` and `disposes` the editor right away.

      Overrides:
        `createEditorForTraversal` in class `EditorSource<FakeLeafValueEditor<T>>`
      Returns:
        an `Editor` of type E
      See Also:
        `ListEditor.createEditorForTraversal()`, `EditorContext.traverseSyntheticCompositeEditor(com.google.gwt.editor.client.EditorVisitor)`

    - #### dispose

          public void dispose​(FakeLeafValueEditor<T> subEditor)

      Description copied from class: `EditorSource`
      Called when an Editor no longer requires a sub-Editor. The default implementation is a no-op.
      Overrides:
        `dispose` in class `EditorSource<FakeLeafValueEditor<T>>`
      Parameters:
        `subEditor` - an `Editor` of type E

    - #### getLastKnownPosition

          public int getLastKnownPosition​(FakeLeafValueEditor<T> editor)

    - #### setIndex

          public void setIndex​(FakeLeafValueEditor<T> editor,
                               int index)

      Description copied from class: `EditorSource`
      Re-order a sub-Editor. The default implementation is a no-op.
      Overrides:
        `setIndex` in class `EditorSource<FakeLeafValueEditor<T>>`
      Parameters:
        `editor` - an `Editor` of type E
        `index` - the index of the Editor