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:
Offray Vladimir Luna Cárdenas 2015-02-06 20:03:36 +00:00
parent 02bb6c72a4
commit 25bcbdbb17

View File

@ -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' }
GrafoscopioBrowser >> bodyForCodeIn: constructor for: aNode [
"Shows the body of a selected node as executable code."
@ -122,10 +133,9 @@ GrafoscopioBrowser >> bodyForCodeOn: constructor [
GrafoscopioBrowser >> bodyForTransmediaIn: constructor for: aNode [
"Shows the body of a transmedia type of nodes, which are tagged as 'original' and 'transmediado'"
aNode tags notNil
ifTrue: [aNode tags = 'original'
ifFalse: [^self ]
ifTrue: [constructor custom: (self panelTransmediaFor: aNode)]]
aNode tags = 'original'
ifFalse: [^self ]
ifTrue: [constructor custom: (self panelTransmediaFor: aNode)]
]
@ -248,13 +258,13 @@ browser
andShow: [:a | self treeOn: a].
"Creating a self updatable body pane"
(browser transmit)
from: #tree port: #selection;
to: #nodeBody;
andShow: [ :a :node |
from: #tree port: #selection;
to: #nodeBody;
when: [:selection | selection notNil];
andShow: [ :a :node |
self bodyIn: a for: node.
self bodyForCodeIn: a for: node.
self bodyForTransmediaIn: a for: node ];
when: [:selection | selection notNil].
self body2ForCodeIn: a for: node.
self bodyForTransmediaIn: a for: node ].
(browser transmit )
from: #tree port: #selection;
from: #nodeBody port: #text;
@ -268,8 +278,8 @@ browser
(browser transmit )
from: #tree port: #selection;
from: #nodeHeader port: #text;
when: [:node :text | text notNil & node notNil];
to: #nodeHeader port: #neverland1;
when: [:node :text | text notNil & node notNil];
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' }
GrafoscopioBrowser >> panelBrowserForTransmediaton [
"**Experimental feature.**