Preliminary support for embedded sub-browsers. I need to quit the independent openning of a new browser each time a new node is selected.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2014-11-26 17:06:23 +00:00
parent 9f7422969c
commit 0ea75a5888
1 changed files with 95 additions and 31 deletions

View File

@ -70,6 +70,19 @@ GrafoscopioBrowser >> addFileToRepository [
'echo "Added file to enabled repository"'.
]
{ #category : #'graphical interface' }
GrafoscopioBrowser >> bodyForTransmediaOn: constructor [
"Shows the body of a transmedia type of node"
"(constructor text)
title: 'Cuerpo | Body ';
format:[:eachNode |
(eachNode body) isNil
ifTrue: [ '' ]
ifFalse: [ eachNode body]]."
constructor custom: self panelBrowserForTransmedia.
]
{ #category : #'graphical interface' }
GrafoscopioBrowser >> bodyOn: constructor [
"Shows the body of a selected node"
@ -84,7 +97,7 @@ GrafoscopioBrowser >> bodyOn: constructor [
{ #category : #'graphical interface' }
GrafoscopioBrowser >> buildBrowser [
"Main method for building the interface for trees. Is getting long. Needs refactoring"
"Main method for building the interface for trees and its nodes"
browser := GLMTabulator new
title: 'Grafoscopio'.
@ -140,6 +153,49 @@ browser
]
{ #category : #'graphical interface' }
GrafoscopioBrowser >> buildBrowserTransmedia [
"Main method for building the interface for trees and its nodes"
browser := GLMTabulator new
title: 'Transmediaton | Grafoscopio'.
browser
column: [:c |
c row: #tree;
row: #nodeHeader] span: 2;
column: [ :c |
c row: #nodeBody span: 2] span: 4.
browser
updateOn: GLMItemAdded from: #yourself;
updateOn: GLMItemRemoved from: #yourself.
(browser transmit)
to: #tree;
andShow: [:a | self treeOn: a].
"Creating a self updatable body pane"
(browser transmit)
to: #nodeBody;
from: #tree;
andShow: [ :a | self bodyForTransmediaOn: a].
(browser transmit )
from: #tree port: #selection;
from: #nodeBody port: #text;
when: [:node :text | text notNil];
to: #nodeBody port: #neverland;
transformed: [:node :text | node body: text asString].
(browser transmit)
from: #tree;
to: #nodeHeader;
andShow: [ :h | self headerOn: h ].
(browser transmit )
from: #tree port: #selection;
from: #nodeHeader port: #text;
when: [:node :text | text notNil];
to: #nodeHeader port: #neverland1;
transformed: [:node :text | node header: text asString]
]
{ #category : #'system-support' }
GrafoscopioBrowser >> configureFossil [
"Stablish where is located fossil according to the operative system and the input of the user"
@ -385,36 +441,15 @@ GrafoscopioBrowser >> openInModeTransmediaton [
Opens grafoscopio in several 'modes'. Each mode corresponds to a operation way, with an specific interface.
We will start with a 'transmediaton' mode to let the people create some transmedia content.
After that we will enable other modes"
browser := GLMTabulator new
title: 'Transmediatón ', ' | Grafoscopio'.
browser
column: #tree span: 2;
column: [ :c |
c row: [ :r | r column: #original; column: #transmediado];
row: #buttons].
browser
updateOn: GLMItemAdded from: #yourself;
updateOn: GLMItemRemoved from: #yourself.
(browser transmit)
to: #tree;
andShow: [:a | self treeOn: a].
(browser transmit)
to: #original;
andShow: [ :a | a text title: 'Original' ].
(browser transmit)
to: #transmediado;
andShow: [ :a | a text title: 'Transmediado' ].
(browser transmit)
to: #buttons;
andShow: [ :a |
a actionList
act: [:entity | entity inspect ] entitled: 'Subir';
act: [:entity | entity explore ] entitled: 'Previsualizar';
act: [:entity | entity explore ] entitled: 'Publicar'].
browser openOn: ''
| draftsLocation |
"self configureSettings."
self buildBrowserTransmedia.
mainTree := GrafoscopioNode new.
mainTree becomeDefaultTree.
draftsLocation := FileSystem disk workingDirectory / 'Grafoscopio' / 'Drafts'.
draftsLocation ensureCreateDirectory.
workingFile := draftsLocation / 'draft.ston'.
browser openOn: mainTree children.
]
@ -452,6 +487,35 @@ GrafoscopioBrowser >> openWorking [
]
{ #category : #'graphical interface' }
GrafoscopioBrowser >> panelBrowserForTransmedia [
"**Experimental feature.**
Opens grafoscopio in several 'modes'. Each mode corresponds to a operation way, with an specific interface.
We will start with a 'transmediaton' mode to let the people create some transmedia content.
After that we will enable other modes"
browser := GLMTabulator new.
browser
column: [ :c |
c row: [ :r | r column: #original; column: #transmediado];
row: #buttons].
(browser transmit)
to: #original;
andShow: [ :a | a text title: 'Original' ].
(browser transmit)
to: #transmediado;
andShow: [ :a | a text title: 'Transmediado' ].
(browser transmit)
to: #buttons;
andShow: [ :a |
a actionList
act: [:entity | entity inspect ] entitled: 'Subir';
act: [:entity | entity explore ] entitled: 'Previsualizar';
act: [:entity | entity explore ] entitled: 'Publicar'].
browser openOn: ''.
^ browser.
]
{ #category : #persistence }
GrafoscopioBrowser >> replaceContentsFromCache: aNode [
"Replaces the contents of aNode from the ones in cacheNode. It doesn't work recursively yet, so it doen't copy the children of the nodes"