First version of executable auto-updateable playgrounds in a grafoscopio document tree. Almost ready for going wider in Internet :-). Integration of testing branch)
This commit is contained in:
parent
25bcbdbb17
commit
11cefd26b6
@ -96,6 +96,21 @@ GrafoscopioBrowser >> body2ForCodeIn: constructor for: aNode [
|
||||
|
||||
]
|
||||
|
||||
{ #category : #'graphical interface' }
|
||||
GrafoscopioBrowser >> body3ForCodeIn: constructor for: aNode [
|
||||
"Shows the body in a constructor for selected node, if node is not tagged. If it is tagged it will return itself, so it can be rendered
|
||||
properly for other messages"
|
||||
|
||||
| innerBrowser |
|
||||
|
||||
aNode tags = 'código'
|
||||
ifFalse: [^self].
|
||||
|
||||
innerBrowser := GTPlayground new.
|
||||
constructor custom: innerBrowser.
|
||||
|
||||
]
|
||||
|
||||
{ #category : #'graphical interface' }
|
||||
GrafoscopioBrowser >> bodyForCodeIn: constructor for: aNode [
|
||||
"Shows the body of a selected node as executable code."
|
||||
@ -164,8 +179,11 @@ GrafoscopioBrowser >> bodyIn: constructor for: aNode [
|
||||
"Shows the body in a constructor for selected node, if node is not tagged. If it is tagged it will return itself, so it can be rendered
|
||||
properly for other messages"
|
||||
|
||||
aNode tags isNil
|
||||
ifFalse: [^self ].
|
||||
| specialTags |
|
||||
|
||||
specialTags := #('código' 'original').
|
||||
(specialTags includes: aNode tags)
|
||||
ifTrue: [^self ].
|
||||
(constructor text)
|
||||
title: 'Texto ';
|
||||
format:[
|
||||
@ -263,14 +281,17 @@ browser
|
||||
when: [:selection | selection notNil];
|
||||
andShow: [ :a :node |
|
||||
self bodyIn: a for: node.
|
||||
self body2ForCodeIn: a for: node.
|
||||
self body3ForCodeIn: a for: node.
|
||||
self bodyForTransmediaIn: a for: node ].
|
||||
(browser transmit )
|
||||
from: #tree port: #selection;
|
||||
from: #nodeBody port: #text;
|
||||
when: [:node :text | text notNil & node notNil];
|
||||
to: #nodeBody port: #neverland;
|
||||
transformed: [:node :text | node body: text asString].
|
||||
from: #tree port: #selection;
|
||||
from: #nodeBody port: #text;
|
||||
when: [:node :text | text notNil & node notNil];
|
||||
to: #nodeBody port: #neverland;
|
||||
transformed: [:node :content |
|
||||
node tags = 'código'
|
||||
ifFalse: [node body: content asString]
|
||||
ifTrue: [node body: content]].
|
||||
(browser transmit)
|
||||
from: #tree;
|
||||
to: #nodeHeader;
|
||||
@ -683,23 +704,15 @@ GrafoscopioBrowser >> openWorking [
|
||||
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
|
||||
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."
|
||||
|
||||
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.
|
||||
transformed: [ GTPlayPage new content: aNode body ];
|
||||
andShow: [ :a | a custom: GTPlayground new ].
|
||||
browser sendToOutside: #nodeBody from: #code -> #text.
|
||||
^ browser.
|
||||
]
|
||||
|
||||
{ #category : #'graphical interface' }
|
||||
|
@ -186,6 +186,21 @@ GrafoscopioNode >> children: aCollection [
|
||||
children := aCollection.
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
GrafoscopioNode >> content [
|
||||
"Returns the receivers body"
|
||||
|
||||
^ body
|
||||
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
GrafoscopioNode >> content: anObject [
|
||||
"Sets the receivers body to the given object"
|
||||
|
||||
body := anObject
|
||||
]
|
||||
|
||||
{ #category : #movement }
|
||||
GrafoscopioNode >> demote [
|
||||
"Moves the current node down in the hierachy, making a children of its current previous slibing"
|
||||
@ -477,6 +492,8 @@ GrafoscopioNode >> tagAs: aTag [
|
||||
know if a tag excludes others from the same node"
|
||||
|
||||
tags := aTag.
|
||||
aTag = 'código'
|
||||
ifTrue: [self body: (GTPlayPage new content: self body) content]
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
@ -486,6 +503,13 @@ GrafoscopioNode >> tags [
|
||||
^ tags
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
GrafoscopioNode >> title [
|
||||
"Returns the receiver header"
|
||||
|
||||
^ header
|
||||
]
|
||||
|
||||
{ #category : #'add/remove nodes' }
|
||||
GrafoscopioNode >> visitedGoTo: aCollection [
|
||||
"Stores the current node in a collection and recursively stores its children"
|
||||
|
Loading…
Reference in New Issue
Block a user