18.5.3 Text presentation
A TextPresentation offers the possibility to display a text in an editor. For example, suppose we have a class at hand, we can display the source code in the following way:
browser transmit to: #source; andShow: [ :a |
a text
display: [ :class | class sourceText ] ].
The presentation offers control over the setting and retrieving the currently selected text. The selected text is provided via the port named #selectedText
. It is not provided through the port, because in most cases, it is not text that we want as an abstraction to pass forward to other ports. Furthermore, we can also set the currently selected text through the #selection
#selectionInterval
port.