This comment is good, but the mention of "if they display a single ROS topic" begs the question of what to do with this if your display takes multiple topic inputs.  I would add a paragraph which mentions the motivation for this function (which is to support the "create display by topic type" GUI) and describes what a display needs to work with that.  Maybe something like:

getTopicTypes() and setTopic() are used by the "New display by topic" window.  In that window each incoming topic is shown with a list of display types that can visualize it.  If your Display subclass needs more than one input topic, you can still make this work by designating a "main" message type, and making all other input topics optional.  The main message type then dictates which topics your display will be paired with in the "new display by topic" window.  If the other "optional" input topics are not present, you can show an error in the Display's status.