Skip to content

Commit

Permalink
Initialize the phlow data source when creating a view specification
Browse files Browse the repository at this point in the history
  • Loading branch information
chisandrei committed Jun 25, 2024
1 parent 07c3106 commit 601f20a
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ GtPhlowViewSpecification class >> fromDictionary: viewDictionary [
"Answer the view specified by viewDictionary"
| viewName |

viewName := viewDictionary at: #viewName.
viewName := viewDictionary at: 'viewName'.
(viewName -> viewDictionary) asBeaconSignal emit.
^(Smalltalk globals at: viewName asSymbol) fromJSONDictionary: viewDictionary.
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ TGtRemoteLanguageProxyViewsAttachment >> declarativeViews [
declarativeViewDeclarations := declarativeData at: 'views' ifAbsent: [ #() ].
rawViews := declarativeViewDeclarations collect: [ :declarativeViewData |
| declarativeView |
declarativeView := GtPhlowViewSpecification fromDictionary: declarativeViewData.
declarativeView := GtPhlowViewSpecification
fromDictionary: declarativeViewData.
declarativeView
initializeFromInspector: remoteInspectorProxy.
declarativeView ] ].
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ GtPhlowBitmapViewSpecification class >> fromJSONDictionary: aDictionary [

editor := super fromJSONDictionary: aDictionary.
editor dataTransport = self dataIncluded
ifTrue: [ editor bitmap: (GtRemotePhlowBitmapSpecification fromJSONDictionary: (aDictionary at: #bitmap)) ].
ifTrue: [ editor bitmap: (GtRemotePhlowBitmapSpecification fromJSONDictionary: (aDictionary at: 'bitmap')) ].

^ editor
]
Expand All @@ -25,7 +25,7 @@ GtPhlowBitmapViewSpecification >> asDictionaryForExport [

dictionary := super asDictionaryForExport.
self dataTransport = self class dataIncluded ifTrue: [
dictionary at: #bitmap put: bitmap asDictionaryForExport ].
dictionary at: 'bitmap' put: bitmap asDictionaryForExport ].

^ dictionary
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ GtPhlowBasicColumnedViewSpecification class >> fromJSONDictionary: aDictionary [

list := super fromJSONDictionary: aDictionary.
list
columnSpecifications: ((aDictionary at: #columnSpecifications)
columnSpecifications: ((aDictionary at: 'columnSpecifications')
collect: [ :aColumnSpecificationJson |
GtRemotePhlowColumnSpecification
fromJSONDictionary: aColumnSpecificationJson ]).
Expand All @@ -25,7 +25,7 @@ GtPhlowBasicColumnedViewSpecification class >> fromJSONDictionary: aDictionary [
{ #category : #converting }
GtPhlowBasicColumnedViewSpecification >> asDictionaryForExport [
^ super asDictionaryForExport
at: #columnSpecifications put: (self columnSpecifications
at: 'columnSpecifications' put: (self columnSpecifications
collect: [ :aColumnSpecification |
aColumnSpecification asDictionaryForExport ]);
yourself
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ Class {
GtPhlowColumnedListViewSpecification class >> fromJSONDictionary: aDictionary [
^ (super fromJSONDictionary: aDictionary)
horizontalScrollingEnabled: (aDictionary
at: #horizontalScrollingEnabled
at: 'horizontalScrollingEnabled'
ifAbsent: [ nil ])
]

{ #category : #converting }
GtPhlowColumnedListViewSpecification >> asDictionaryForExport [
^ super asDictionaryForExport
at: #horizontalScrollingEnabled put: horizontalScrollingEnabled;
at: 'horizontalScrollingEnabled' put: horizontalScrollingEnabled;
yourself
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ GtPhlowForwardViewSpecification >> getDeclarativeViewFor: aViewSelector [

{ #category : #accessing }
GtPhlowForwardViewSpecification >> initializeFromInspector: anInspector [
self phlowDataSource: (anInspector
getDeclarativeViewFor: self methodSelector)
self phlowDataSource ifNil: [
self phlowDataSource: (anInspector
getDeclarativeViewFor: self methodSelector) ]
]

{ #category : #'api - accessing' }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ GtPhlowListingViewSpecification >> flushItemsIterator [

{ #category : #initialization }
GtPhlowListingViewSpecification >> initializeFromInspector: anInspector [
self phlowDataSource: (anInspector getDeclarativeViewFor: self methodSelector)
self phlowDataSource ifNil: [
self phlowDataSource: (anInspector
getDeclarativeViewFor: self methodSelector) ]
]

{ #category : #accessing }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ GtPhlowTextualViewSpecification >> getText [
GtPhlowTextualViewSpecification >> initializeFromInspector: anInspector [
self dataTransport = self class dataIncluded ifTrue: [ ^ self ].

phlowDataSource ifNil: [
self phlowDataSource ifNil: [
self phlowDataSource: (anInspector
getDeclarativeViewFor: self methodSelector) ]
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ Class {
GtPhlowViewErrorViewSpecification class >> fromJSONDictionary: aDictionary [

^ (super fromJSONDictionary: aDictionary)
errorMessage: (aDictionary at: #errorMessage ifAbsent: [ nil ])
errorMessage: (aDictionary at: 'errorMessage' ifAbsent: [ nil ])
]

{ #category : #converting }
GtPhlowViewErrorViewSpecification >> asDictionaryForExport [
^ super asDictionaryForExport
at: #errorMessage put: errorMessage;
at: 'errorMessage' put: errorMessage;
yourself
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,12 @@ GtPhlowViewSpecification class >> fromJSONDictionary: aDictionary [
Subclasses will override this to add their specific attributes"

^self new
title: (aDictionary at: #title);
priority: (aDictionary at: #priority);
dataTransport: (aDictionary at: #dataTransport);
methodSelector: (aDictionary at: #methodSelector);
title: (aDictionary at: 'title');
priority: (aDictionary at: 'priority');
dataTransport: (aDictionary at: 'dataTransport');
methodSelector: (aDictionary at: 'methodSelector');
phlowDataSource: (aDictionary
at: 'phlowDataSource' ifAbsent: [ nil ]);
yourself
]

Expand All @@ -72,11 +74,11 @@ GtPhlowViewSpecification >> asDictionaryForExport [
Subclasses will override and add to the dictionary"

^ Dictionary new
at: #viewName put: self viewName;
at: #title put: title;
at: #priority put: priority;
at: #dataTransport put: dataTransport;
at: #methodSelector put: methodSelector;
at: 'viewName' put: self viewName;
at: 'title' put: title;
at: 'priority' put: priority;
at: 'dataTransport' put: dataTransport;
at: 'methodSelector' put: methodSelector;
yourself
]

Expand Down

0 comments on commit 601f20a

Please sign in to comment.