Skip to content
Permalink
Browse files

Merge pull request #710 from jecisc/709-SpExecutableLayoutresolvePres…

…entermodelbindings-should-be-SpExecutableLayoutresolvePresenterpresenterbindings

709-SpExecutableLayoutresolvePresentermodelbindings-should-be-SpExecutableLayoutresolvePresenterpresenterbindings
  • Loading branch information...
jecisc committed Aug 13, 2019
2 parents b0c0de2 + 58650bf commit caa37dba4df51134a0add0ef372cb29a12a78c80
Showing with 6 additions and 6 deletions.
  1. +6 −6 src/Spec2-Layout/SpExecutableLayout.class.st
@@ -57,7 +57,7 @@ SpExecutableLayout >> buildAdapterFor: aPresenter bindings: bindings [
adapter
add: (self
resolvePresenter: presenterNameOrLayout
model: aPresenter
presenter: aPresenter
bindings: bindings)
constraints: constraints ].

@@ -96,20 +96,20 @@ SpExecutableLayout >> presenters [
]

{ #category : #private }
SpExecutableLayout >> resolvePresenter: presenterNameOrLayout model: aModel bindings: bindings [
SpExecutableLayout >> resolvePresenter: presenterNameOrLayout presenter: aPresenter bindings: bindings [

"most common case: I receive a symbol that I need to convert into a presenter"
presenterNameOrLayout isSymbol ifTrue: [
^ (self subpresenterOrLayoutNamed: presenterNameOrLayout of: aModel)
ifNil: [ self error: 'You presenter named "', presenterNameOrLayout , '" from ', aModel printString ,' was not initialized.' ] ].
^ (self subpresenterOrLayoutNamed: presenterNameOrLayout of: aPresenter)
ifNil: [ self error: 'You presenter named "', presenterNameOrLayout , '" from ', aPresenter printString ,' was not initialized.' ] ].

"I receive a layout: dig inside."
presenterNameOrLayout isSpLayout ifTrue: [
^ presenterNameOrLayout buildAdapterFor: aModel bindings: bindings ].
^ presenterNameOrLayout buildAdapterFor: aPresenter bindings: bindings ].

"I receive an arbitrary object (needs to understand #asPresenter)"
^ presenterNameOrLayout asPresenter
owner: aModel;
owner: aPresenter;
yourself
]

0 comments on commit caa37db

Please sign in to comment.
You can’t perform that action at this time.