No warnings on opening new notebook with spec2.

This commit is contained in:
Santiago Bragagnolo 2020-02-23 00:18:57 +00:00 committed by Offray Luna
parent 9a7f45d8b3
commit 1fa30ba524
7 changed files with 30 additions and 53 deletions

View File

@ -20,7 +20,7 @@ ui openWithSpec
"
Class {
#name : #GlamourPresentationModel,
#superclass : #ComposablePresenter,
#superclass : #SpPresenter,
#instVars : [
'presentation',
'glmPres'
@ -31,28 +31,9 @@ Class {
{ #category : #specs }
GlamourPresentationModel class >> defaultSpec [
<spec: #default>
^ SpecLayout composed add: #presentation
]
{ #category : #example }
GlamourPresentationModel class >> example [
|ui lay|
ui := DynamicComposableModel new.
ui title: 'Too Much Glamour!'.
ui instantiateModels: #(
play GlamourPresentationModel
insp GlamourPresentationModel).
ui insp presentationClass: GTInspector startOn: 42.
lay := SpecLayout composed
newColumn: [ :c |
c newRow: [ :r | r add: #play];
newRow: [ :r | r add: #insp ]];
yourself.
ui openWithSpecLayout: lay.
^ SpBoxLayout newHorizontal
add: #presentation;
yourself
]
{ #category : #deprecation }
@ -72,7 +53,7 @@ GlamourPresentationModel >> initializeWidgets [
This is because we cannot create the morph and later set the presentation.
So we will do all of this in the presentation: accessor.
"
self presentation.
]
{ #category : #accessing }

View File

@ -34,17 +34,6 @@ GrafoscopioAbstractNode >> addTag: aTag [
]
{ #category : #exporting }
GrafoscopioAbstractNode >> asTreeNodePresenter [
| node |
node := SpTreeNodePresenter new.
node
hasChildren: [ false ];
children: [ {} ];
content: self.
^ node
]
{ #category : #'as yet unclassified' }
GrafoscopioAbstractNode >> content [
self subclassResponsibility

View File

@ -30,10 +30,7 @@ GrafoscopioCodeModel >> body: anObject [
{ #category : #API }
GrafoscopioCodeModel >> content: aGrafoscopioNodeContent [
body
presentationClass: GTPlayground
startOn: (GTPlayPage new saveContent: aGrafoscopioNodeContent)
body text: aGrafoscopioNodeContent
]
{ #category : #'as yet unclassified' }
@ -65,5 +62,5 @@ GrafoscopioCodeModel >> extractHtmlImages [
{ #category : #initialization }
GrafoscopioCodeModel >> initializeWidgets [
body := GlamourPresentationModel new.
body := self newCode.
]

View File

@ -32,3 +32,8 @@ GrafoscopioCodeNode >> header [
GrafoscopioCodeNode >> shouldAskBeforeRemove [
^ self content isNotEmpty
]
{ #category : #'as yet unclassified' }
GrafoscopioCodeNode >> specModelClass [
^ GrafoscopioCodeModel
]

View File

@ -518,11 +518,8 @@ GrafoscopioNewNotebook >> importLinkContent [
{ #category : #initialization }
GrafoscopioNewNotebook >> initialize [
super initialize.
self
notebook: (self createNewExample );
title: ' New | Grafoscopio notebook'.
self notebookContent: self notebook.
self notebook: self createNewExample.
self notebookContent: self notebook
]
{ #category : #initialization }
@ -564,7 +561,16 @@ GrafoscopioNewNotebook >> initializeWidgets [
add: header;
add: body;
add: links.
self askOkToClose: true
]
{ #category : #persistence }
GrafoscopioNewNotebook >> initializeWindow: aWindowPresenter [
super initializeWindow: aWindowPresenter.
aWindowPresenter
title: ' New | Grafoscopio notebook';
windowIcon: self taskbarIcon;
askOkToClose: true
]
{ #category : #persistence }

View File

@ -1055,9 +1055,10 @@ GrafoscopioNode >> selectMarkupSubtreesToExport [
{ #category : #accessing }
GrafoscopioNode >> specModelClass [
(self isTaggedAs: 'código') ifTrue: [^GrafoscopioCodeModel].
(self isTaggedAs: 'johan') ifTrue:[^GrafoscopioButtonModel].
(self isTaggedAs: 'código')
ifTrue: [ ^ GrafoscopioCodeModel ].
(self isTaggedAs: 'johan')
ifTrue: [ ^ GrafoscopioButtonModel ].
"por defecto"
^ GrafoscopioTextModel
]

View File

@ -896,10 +896,8 @@ GrafoscopioTextNode >> shouldAskBeforeRemove [
{ #category : #accessing }
GrafoscopioTextNode >> specModelClass [
(self isTaggedAs: 'código') ifTrue: [^GrafoscopioCodeModel].
(self isTaggedAs: 'johan') ifTrue:[^GrafoscopioButtonModel].
"por defecto"
^ GrafoscopioTextModel
]