Class MockEditorDelegate<T>

java.lang.Object
com.google.gwt.editor.client.testing.MockEditorDelegate<T>
Type Parameters:
T - the type being edited
All Implemented Interfaces:
EditorDelegate<T>

public class MockEditorDelegate<T> extends Object implements EditorDelegate<T>
A mock implementation of EditorDelegate.
  • Constructor Details

    • MockEditorDelegate

      public MockEditorDelegate()
  • Method Details

    • getPath

      public String getPath()
      Returns a zero-length string or the last value passed to setPath(java.lang.String).
      Specified by:
      getPath in interface EditorDelegate<T>
      Returns:
      the path as a String
    • isDirty

      public boolean isDirty()
      Returns false or the last value passed to setDirty(boolean).
    • recordError

      public void recordError(String message, Object value, Object userData)
      No-op.
      Specified by:
      recordError in interface EditorDelegate<T>
      Parameters:
      message - a textual description of the error
      value - the value to be returned by EditorError.getValue() or null if the value currently associated with the Editor should be used
      userData - an arbitrary object, possibly null, that can be retrieved with EditorError.getUserData()
    • setDirty

      public void setDirty(boolean dirty)
      Records the value of dirty which can be retrieved from isDirty().
      Specified by:
      setDirty in interface EditorDelegate<T>
      Parameters:
      dirty - the dirty state of the Editor
    • setPath

      public void setPath(String path)
      Controls the return value of getPath().
    • subscribe

      public HandlerRegistration subscribe()
      Returns a no-op HandlerRegistration instance.
      Specified by:
      subscribe in interface EditorDelegate<T>
      Returns:
      a HandlerRegistration to unsubscribe from the notifications or null if the delegate does not support subscription