How to implement GWT editors for subclasses of a type?

后端 未结 2 1459
不思量自难忘°
不思量自难忘° 2020-12-11 10:21

Let\'s say I have an object hierarchy like this:

Account > Site > Supply

An Account is an actual company, a Site is a building they have, an

2条回答
  •  南笙
    南笙 (楼主)
    2020-12-11 11:01

    You can have your SupplyEditor implement ValueAwareEditor.

    This way, the editor framework will pass you the actual value being edited in the setValue(Supply supply); In the implementation of setValue(Supply supply) you can inspect the type of Supply and choose to show/hide any additional relevant fields.

提交回复
热议问题