Embeddable playgrounds as node "executable visualizations" finally! :-). **Pending | Bug**: Storing properly the playground contents because when the node is revisited, they become nill.
This commit is contained in:
parent
02bb6c72a4
commit
25bcbdbb17
@ -85,6 +85,17 @@ GrafoscopioBrowser >> addToTagsAvailable [
|
|||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
{ #category : #'graphical interface' }
|
||||||
|
GrafoscopioBrowser >> body2ForCodeIn: constructor for: aNode [
|
||||||
|
"Shows the body of a selected node as executable code."
|
||||||
|
|
||||||
|
aNode tags = 'código'
|
||||||
|
ifFalse: [ ^self ]
|
||||||
|
ifTrue: [constructor custom: (self panelAsCodeFor: aNode)].
|
||||||
|
|
||||||
|
|
||||||
|
]
|
||||||
|
|
||||||
{ #category : #'graphical interface' }
|
{ #category : #'graphical interface' }
|
||||||
GrafoscopioBrowser >> bodyForCodeIn: constructor for: aNode [
|
GrafoscopioBrowser >> bodyForCodeIn: constructor for: aNode [
|
||||||
"Shows the body of a selected node as executable code."
|
"Shows the body of a selected node as executable code."
|
||||||
@ -122,10 +133,9 @@ GrafoscopioBrowser >> bodyForCodeOn: constructor [
|
|||||||
GrafoscopioBrowser >> bodyForTransmediaIn: constructor for: aNode [
|
GrafoscopioBrowser >> bodyForTransmediaIn: constructor for: aNode [
|
||||||
"Shows the body of a transmedia type of nodes, which are tagged as 'original' and 'transmediado'"
|
"Shows the body of a transmedia type of nodes, which are tagged as 'original' and 'transmediado'"
|
||||||
|
|
||||||
aNode tags notNil
|
aNode tags = 'original'
|
||||||
ifTrue: [aNode tags = 'original'
|
|
||||||
ifFalse: [^self ]
|
ifFalse: [^self ]
|
||||||
ifTrue: [constructor custom: (self panelTransmediaFor: aNode)]]
|
ifTrue: [constructor custom: (self panelTransmediaFor: aNode)]
|
||||||
|
|
||||||
|
|
||||||
]
|
]
|
||||||
@ -250,11 +260,11 @@ browser
|
|||||||
(browser transmit)
|
(browser transmit)
|
||||||
from: #tree port: #selection;
|
from: #tree port: #selection;
|
||||||
to: #nodeBody;
|
to: #nodeBody;
|
||||||
|
when: [:selection | selection notNil];
|
||||||
andShow: [ :a :node |
|
andShow: [ :a :node |
|
||||||
self bodyIn: a for: node.
|
self bodyIn: a for: node.
|
||||||
self bodyForCodeIn: a for: node.
|
self body2ForCodeIn: a for: node.
|
||||||
self bodyForTransmediaIn: a for: node ];
|
self bodyForTransmediaIn: a for: node ].
|
||||||
when: [:selection | selection notNil].
|
|
||||||
(browser transmit )
|
(browser transmit )
|
||||||
from: #tree port: #selection;
|
from: #tree port: #selection;
|
||||||
from: #nodeBody port: #text;
|
from: #nodeBody port: #text;
|
||||||
@ -268,8 +278,8 @@ browser
|
|||||||
(browser transmit )
|
(browser transmit )
|
||||||
from: #tree port: #selection;
|
from: #tree port: #selection;
|
||||||
from: #nodeHeader port: #text;
|
from: #nodeHeader port: #text;
|
||||||
when: [:node :text | text notNil & node notNil];
|
|
||||||
to: #nodeHeader port: #neverland1;
|
to: #nodeHeader port: #neverland1;
|
||||||
|
when: [:node :text | text notNil & node notNil];
|
||||||
transformed: [:node :text | node header: text asString]
|
transformed: [:node :text | node header: text asString]
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -669,6 +679,29 @@ GrafoscopioBrowser >> openWorking [
|
|||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
{ #category : #'graphical interface' }
|
||||||
|
GrafoscopioBrowser >> panelAsCodeFor: aNode [
|
||||||
|
"Shows an interactive playground for Smalltalk code in a node body"
|
||||||
|
|
||||||
|
" browser := GLMTabulator new.
|
||||||
|
browser title: 'Playground'.
|
||||||
|
browser row: #code.
|
||||||
|
browser transmit
|
||||||
|
to: #code;
|
||||||
|
transformed: [GTPlayPage new content: aNode body];
|
||||||
|
andShow: [ :a | a custom GTPlayground new ].
|
||||||
|
^ browser."
|
||||||
|
|
||||||
|
browser := GLMTabulator new.
|
||||||
|
browser title: 'Código'.
|
||||||
|
browser column: #code.
|
||||||
|
browser transmit
|
||||||
|
to: #code;
|
||||||
|
transformed: [ GTPlayPage new content: aNode body ];
|
||||||
|
andShow: [ :a | a custom: GTPlayground new ].
|
||||||
|
^ browser.
|
||||||
|
]
|
||||||
|
|
||||||
{ #category : #'graphical interface' }
|
{ #category : #'graphical interface' }
|
||||||
GrafoscopioBrowser >> panelBrowserForTransmediaton [
|
GrafoscopioBrowser >> panelBrowserForTransmediaton [
|
||||||
"**Experimental feature.**
|
"**Experimental feature.**
|
||||||
|
Loading…
Reference in New Issue
Block a user