Starting recent documents functionality.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2015-03-25 19:33:45 +00:00
parent 6740d526fe
commit 9920c8a1a1
2 changed files with 49 additions and 21 deletions

View File

@ -28,7 +28,8 @@ Class {
'DefaultUbakyeBrowser', 'DefaultUbakyeBrowser',
'dockingBar', 'dockingBar',
'fossil', 'fossil',
'pandoc' 'pandoc',
'recentTrees'
], ],
#category : #'Grafoscopio-UI' #category : #'Grafoscopio-UI'
} }
@ -118,6 +119,23 @@ GrafoscopioBrowser class >> open [
^ self new open ^ self new open
] ]
{ #category : #'as yet unclassified' }
GrafoscopioBrowser class >> openFromRecentlyUsed [
"Tags the node passed as argument with a value from the collection of tags available"
| selection |
recentTrees isNil
ifFalse: [
selection := UIManager default chooseFrom: recentTrees title: 'Elija una documento'.
"aNode tagAs: (tagsAvailable at: selection)"
]
ifTrue: [self messageNoTagsAvailable].
"browser update".
]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
GrafoscopioBrowser class >> openHelpInHtml [ GrafoscopioBrowser class >> openHelpInHtml [
"Launches the help manual in PDF format in an external viewer." "Launches the help manual in PDF format in an external viewer."
@ -169,29 +187,29 @@ GrafoscopioBrowser class >> startDockingBar [
launchMenu := MenuMorph new. launchMenu := MenuMorph new.
launchMenu launchMenu
add: 'Documento interactivo nuevo' target: GrafoscopioBrowser action: #open; add: 'Documento interactivo nuevo' target: GrafoscopioBrowser selector: #open;
add: 'Documentos interactivos recientes' target: GrafoscopioBrowser action: #messageNotImplementedYet; add: 'Documentos interactivos recientes' target: GrafoscopioBrowser selector: #openFromRecentlyUsed;
add: 'Documentos interactivos de ejemplo' target: GrafoscopioBrowser action: #messageNotImplementedYet; add: 'Documentos interactivos de ejemplo' target: GrafoscopioBrowser selector: #messageNotImplementedYet;
add: 'Ejemplos de visualizaciones en Roassal' target: (RTExampleBrowserGT new) action: #open; add: 'Ejemplos de visualizaciones en Roassal' target: (RTExampleBrowser new) selector: #open;
add: 'Playground' target: (Smalltalk tools) action: #openWorkspace. add: 'Playground' target: (Smalltalk tools) selector: #openWorkspace.
updateMenu := MenuMorph new. updateMenu := MenuMorph new.
updateMenu updateMenu
add: 'Documentación' target: GrafoscopioBrowser action: #updateDocumentation; add: 'Documentación' target: GrafoscopioBrowser selector: #updateDocumentation;
add: 'Grafoscopio' target: GrafoscopioBrowser action: #updateGrafoscopio; add: 'Grafoscopio' target: GrafoscopioBrowser selector: #updateGrafoscopio;
add: 'Prerrequisitos' target: GrafoscopioBrowser action: #updatePrerrequisites; add: 'Prerrequisitos' target: GrafoscopioBrowser selector: #updatePrerrequisites;
add: 'Herramientas externas' target: GrafoscopioBrowser action: #messageNotImplementedYet; add: 'Herramientas externas' target: GrafoscopioBrowser selector: #messageNotImplementedYet;
add: 'Ruta a pandoc' target: GrafoscopioBrowser action: #configurePandoc; add: 'Ruta a pandoc' target: GrafoscopioBrowser selector: #configurePandoc;
add: 'Ruta a fossil' target: GrafoscopioBrowser action: #configureFossil; add: 'Ruta a fossil' target: GrafoscopioBrowser selector: #configureFossil;
add: 'Todo el sistema' target: GrafoscopioBrowser action: #updateSystem. add: 'Todo el sistema' target: GrafoscopioBrowser selector: #updateSystem.
helpMenu := MenuMorph new. helpMenu := MenuMorph new.
helpMenu helpMenu
add: 'Manual en PDF' target: GrafoscopioBrowser action: #openHelpInPdf; add: 'Manual en PDF' target: GrafoscopioBrowser selector: #openHelpInPdf;
add: 'Manual en HTML' target: GrafoscopioBrowser action: #openHelpInHtml; add: 'Manual en HTML' target: GrafoscopioBrowser selector: #openHelpInHtml;
add: 'Manual en grafoscopio' target: (GrafoscopioBrowser new) action: #openHelpInGrafoscopio; add: 'Manual en grafoscopio' target: (GrafoscopioBrowser new) selector: #openHelpInGrafoscopio;
add: 'Ir a la documentación en línea' target: GrafoscopioBrowser action: #messageNotImplementedYet; add: 'Ir a la documentación en línea' target: GrafoscopioBrowser selector: #messageNotImplementedYet;
add: 'Acerca de Grafoscopio' target: GrafoscopioBrowser action: #messageAbout. add: 'Acerca de Grafoscopio' target: GrafoscopioBrowser selector: #messageAbout.
dockingBar := DockingBarMorph new. dockingBar := DockingBarMorph new.
dockingBar dockingBar
@ -338,8 +356,8 @@ GrafoscopioBrowser >> addToTagsAvailable [
{ #category : #'graphical interface' } { #category : #'graphical interface' }
GrafoscopioBrowser >> bodyForCodeIn: constructor for: aNode [ GrafoscopioBrowser >> bodyForCodeIn: 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 "Shows the body of a node as an interactive playground. If node is not tagged it will return itself,
properly for other messages" so it can be rendered properly for other messages"
| innerBrowser | | innerBrowser |
@ -374,7 +392,7 @@ GrafoscopioBrowser >> bodyIn: constructor [
"Shows the body of a selected node" "Shows the body of a selected node"
(constructor text) (constructor text)
title: 'Texto '; title: 'Texto';
format:[:eachNode | format:[:eachNode |
(eachNode body) isNil (eachNode body) isNil
ifTrue: [ '' ] ifTrue: [ '' ]
@ -791,6 +809,9 @@ GrafoscopioBrowser >> openFromFile: aFileName [
header: 'Arbol principal'; header: 'Arbol principal';
level: 0. level: 0.
mainTree children: currentChildren. mainTree children: currentChildren.
recentTrees isNil
ifTrue:[recentTrees := OrderedCollection new].
recentTrees add: workingFile.
browser openOn: mainTree children. browser openOn: mainTree children.
] ]

View File

@ -486,6 +486,13 @@ GrafoscopioNode >> returnConfig [
^configDict ^configDict
] ]
{ #category : #accessing }
GrafoscopioNode >> saveContent: anObject [
"Sets the receivers body to the given object"
body := anObject
]
{ #category : #accessing } { #category : #accessing }
GrafoscopioNode >> tagAs: aTag [ GrafoscopioNode >> tagAs: aTag [
"Tags the recipient node with aTag. For the moment we will have only one tag. In the future we will have several and there will be rules to "Tags the recipient node with aTag. For the moment we will have only one tag. In the future we will have several and there will be rules to