Two ways to get a link to the object that this editor is working on. Firstly, some simple data and a simple editor:
public class MyModel {
}
public class MyModelEditor implements Editor<MyModel> {
}
-: Editor , , (LeafValueEditor ). ValueAwareEditor:
public class MyModelEditor2 implements ValueAwareEditor<MyModel> {
public void setValue(MyModel value) {
}
public void flush() {
}
public void onPropertyChange(String... paths) {
}
public void setDelegate(EditorDelegate<MyModel> delegate) {
}
}
, , , , , setValue. , . flush , - , , , .
: SimpleEditor:
public class MyModelEditor2 implements ValueAwareEditor<MyModel> {
@Path("")
SimpleEditor self = SimpleEditor.of();
}
, self.getValue(), , .
. AnotherEditor, , , - GWT SimpleEditor, :
, -
public class AntoherClass implements Editor<Proxy>{
someMethod(){
}
}
ValueAwareEditor<Proxy> Editor<Proxy> , setValue Proxy .