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 java.lang.Object implements EditorDelegate<T>
A mock implementation ofEditorDelegate
.
-
-
Constructor Summary
Constructors Constructor Description MockEditorDelegate()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getPath()
Returns a zero-length string or the last value passed tosetPath(java.lang.String)
.boolean
isDirty()
Returnsfalse
or the last value passed tosetDirty(boolean)
.void
recordError(java.lang.String message, java.lang.Object value, java.lang.Object userData)
No-op.void
setDirty(boolean dirty)
Records the value ofdirty
which can be retrieved fromisDirty()
.void
setPath(java.lang.String path)
Controls the return value ofgetPath()
.HandlerRegistration
subscribe()
Returns a no-op HandlerRegistration instance.
-
-
-
Method Detail
-
getPath
public java.lang.String getPath()
Returns a zero-length string or the last value passed tosetPath(java.lang.String)
.- Specified by:
getPath
in interfaceEditorDelegate<T>
- Returns:
- the path as a String
-
isDirty
public boolean isDirty()
Returnsfalse
or the last value passed tosetDirty(boolean)
.
-
recordError
public void recordError(java.lang.String message, java.lang.Object value, java.lang.Object userData)
No-op.- Specified by:
recordError
in interfaceEditorDelegate<T>
- Parameters:
message
- a textual description of the errorvalue
- the value to be returned byEditorError.getValue()
ornull
if the value currently associated with the Editor should be useduserData
- an arbitrary object, possiblynull
, that can be retrieved withEditorError.getUserData()
-
setDirty
public void setDirty(boolean dirty)
Records the value ofdirty
which can be retrieved fromisDirty()
.- Specified by:
setDirty
in interfaceEditorDelegate<T>
- Parameters:
dirty
- the dirty state of the Editor
-
setPath
public void setPath(java.lang.String path)
Controls the return value ofgetPath()
.
-
subscribe
public HandlerRegistration subscribe()
Returns a no-op HandlerRegistration instance.- Specified by:
subscribe
in interfaceEditorDelegate<T>
- Returns:
- a HandlerRegistration to unsubscribe from the notifications or
null
if the delegate does not support subscription
-
-