46 lines
988 B
Smalltalk
46 lines
988 B
Smalltalk
Class {
|
|
#name : #GrafoscopioViewportVisitor,
|
|
#superclass : #GrafoscopioVisitor,
|
|
#instVars : [
|
|
'viewport',
|
|
'stack',
|
|
'items',
|
|
'presenter'
|
|
],
|
|
#category : #'Grafoscopio-New-UI'
|
|
}
|
|
|
|
{ #category : #visiting }
|
|
GrafoscopioViewportVisitor >> createViewportFor: aDocumentNode into: aPresenter [
|
|
presenter := aPresenter.
|
|
items := OrderedCollection new.
|
|
aDocumentNode acceptVisitor: self.
|
|
viewport := aPresenter instantiate: SpComponentListPresenter.
|
|
viewport items: items.
|
|
^ viewport
|
|
]
|
|
|
|
{ #category : #visiting }
|
|
GrafoscopioViewportVisitor >> visitCodeNode: aNode [
|
|
| code |
|
|
code := presenter newCode.
|
|
code text: aNode text.
|
|
items add: code.
|
|
]
|
|
|
|
{ #category : #visiting }
|
|
GrafoscopioViewportVisitor >> visitTextNode: aNode [
|
|
| text |
|
|
text := presenter newText .
|
|
text text: aNode text.
|
|
items add: text.
|
|
]
|
|
|
|
{ #category : #visiting }
|
|
GrafoscopioViewportVisitor >> visitUrlNode: aNode [
|
|
| text |
|
|
text := presenter newText .
|
|
text text: aNode content.
|
|
items add: text.
|
|
]
|