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 { Class {
#name : #GlamourPresentationModel, #name : #GlamourPresentationModel,
#superclass : #ComposablePresenter, #superclass : #SpPresenter,
#instVars : [ #instVars : [
'presentation', 'presentation',
'glmPres' 'glmPres'
@ -31,28 +31,9 @@ Class {
{ #category : #specs } { #category : #specs }
GlamourPresentationModel class >> defaultSpec [ GlamourPresentationModel class >> defaultSpec [
<spec: #default> <spec: #default>
^ SpecLayout composed add: #presentation ^ SpBoxLayout newHorizontal
] add: #presentation;
yourself
{ #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.
] ]
{ #category : #deprecation } { #category : #deprecation }
@ -72,7 +53,7 @@ GlamourPresentationModel >> initializeWidgets [
This is because we cannot create the morph and later set the presentation. This is because we cannot create the morph and later set the presentation.
So we will do all of this in the presentation: accessor. So we will do all of this in the presentation: accessor.
" "
self presentation.
] ]
{ #category : #accessing } { #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' } { #category : #'as yet unclassified' }
GrafoscopioAbstractNode >> content [ GrafoscopioAbstractNode >> content [
self subclassResponsibility self subclassResponsibility

View File

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

View File

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

View File

@ -516,13 +516,10 @@ GrafoscopioNewNotebook >> importLinkContent [
] ]
{ #category : #initialization } { #category : #initialization }
GrafoscopioNewNotebook >> initialize [ GrafoscopioNewNotebook >> initialize [
super initialize. super initialize.
self self notebook: self createNewExample.
notebook: (self createNewExample ); self notebookContent: self notebook
title: ' New | Grafoscopio notebook'.
self notebookContent: self notebook.
] ]
{ #category : #initialization } { #category : #initialization }
@ -564,7 +561,16 @@ GrafoscopioNewNotebook >> initializeWidgets [
add: header; add: header;
add: body; add: body;
add: links. 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 } { #category : #persistence }

View File

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

View File

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