Skip to content

Commit

Permalink
build coder composite phlows with listeners [feenkcom/gtoolkit#4142]
Browse files Browse the repository at this point in the history
  • Loading branch information
JurajKubelka committed Nov 5, 2024
1 parent 696f0f7 commit 1c61904
Showing 1 changed file with 22 additions and 23 deletions.
45 changes: 22 additions & 23 deletions src/GToolkit-Pharo-Coder-UI/GtPharoBehaviorCoderElement.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,29 @@ GtPharoBehaviorCoderElement >> buildContentPane [
{ #category : #'building ui' }
GtPharoBehaviorCoderElement >> buildContentTabs [
<return: #BrTabGroup>

| classCoder context object aListener |
classCoder := behaviorCoderViewModel coder.
context := GtPhlowContext new.
context optionAt: #behaviorCoder put: behaviorCoderViewModel.
object := classCoder theClass.
contentTabs := GtPhlowCompositeView new
views: self classViewItems;
asElementDo: [ :aBrTabGroup | aBrTabGroup ].
object: object
arguments: {GtPhlowView empty.
context};
collectorDo: [ :aCollector |
aCollector
context: context;
fromObject: object;
from: object class;
to: Behavior;
pragmaName: #gtClassView ];
asElementDo: [ :aBrTabGroup | aBrTabGroup ].

aListener := GtPhlowChangeMethodSystemAnnouncerListener
installOnCompositeElement: contentTabs.
aListener
interestingPragmas: { #gtClassView }
andObject: object.

^ contentTabs
]
Expand All @@ -163,26 +182,6 @@ GtPharoBehaviorCoderElement >> classCoder [
^ behaviorCoderViewModel classCoder
]

{ #category : #private }
GtPharoBehaviorCoderElement >> classViewItems [
| classCoder collector context |

classCoder := behaviorCoderViewModel coder.

collector := GtPhlowViewsCollector new
fromObject: classCoder theClass;
from: classCoder theClass class;
to: Behavior;
pragmaName: #gtClassView.

context := GtPhlowContext new.
context optionAt: #behaviorCoder put: behaviorCoderViewModel.

collector context: context.

^ collector collect
]

{ #category : #accessing }
GtPharoBehaviorCoderElement >> coderViewModel [
^ behaviorCoderViewModel
Expand Down

0 comments on commit 1c61904

Please sign in to comment.