Skip to content

Commit

Permalink
Clean up + better name
Browse files Browse the repository at this point in the history
  • Loading branch information
Nyan11 committed Feb 4, 2025
1 parent 0044760 commit f7775c9
Show file tree
Hide file tree
Showing 6 changed files with 173 additions and 238 deletions.
67 changes: 12 additions & 55 deletions src/Molecule-IDE/MolComponentImpl.extension.st
Original file line number Diff line number Diff line change
@@ -1,54 +1,5 @@
Extension { #name : #MolComponentImpl }

{ #category : #'*Molecule-IDE' }
MolComponentImpl >> allComponentClients [

| clients allComponents |
clients := Set new.
allComponents := MolComponentManager default homeServices
deployedComponents flatCollect: #values.
^ allComponents select: [ :each |
each allComponentProviders includes: self ]
]

{ #category : #'*Molecule-IDE' }
MolComponentImpl >> allComponentProviders [

| providers locatorServices |
providers := Set new.
locatorServices := MolComponentManager default locatorServices.
self servicesProviders keysAndValuesDo: [ :key :value |
providers add:
(locatorServices searchServicesProviderFor: key named: value) ].
self parametersProviders keysAndValuesDo: [ :key :value |
providers add:
(locatorServices searchParametersProviderFor: key named: value) ].
self eventsSubscribers keysAndValuesDo: [ :key :value |
providers addAll:
(locatorServices searchEventsSubscriberFor: key named: value)
originators ].
^ providers asArray
]

{ #category : #'*Molecule-IDE' }
MolComponentImpl >> allComponentProvidersRecursive [

| accumulator |
accumulator := Set new.
self allComponentProvidersRecursiveWithAccumulator: accumulator.
^ (accumulator reject: [ :each | each = self ]) asArray
]

{ #category : #'*Molecule-IDE' }
MolComponentImpl >> allComponentProvidersRecursiveWithAccumulator: anAccumulator [

| providers |
anAccumulator add: self.
providers := self allComponentProviders.
(providers difference: anAccumulator) do: [ :each |
each allComponentProvidersRecursiveWithAccumulator: anAccumulator ]
]

{ #category : #'*Molecule-IDE' }
MolComponentImpl >> asRSMoleculeShape [

Expand All @@ -65,7 +16,7 @@ MolComponentImpl >> asRSMoleculeShape [
fontSize: 18;
yourself.

contracts := MolComponentToRoassal contractFromMolComponentImpl: self.
contracts := MolComponentToRoassal makeContractShapesFor: self.

RSVerticalLineLayout new
alignCenter;
Expand All @@ -88,11 +39,17 @@ MolComponentImpl >> asRSMoleculeShape [
composite adjustToChildren.
composite extent: composite extent + (0 @ 20).
composite @ (RSMenuActivable new menuDo: [ :aMenuMorph :anRSBox |
aMenuMorph
add: 'Inspect'
target: self
selector: #inspect
argument: #( ) ]).
(aMenuMorph
add: 'Inspect component'
target: self
selector: #inspect
argument: #( )) icon:
(Smalltalk ui icons iconNamed: #smallInspectIt).
(aMenuMorph
add: 'Browse component'
target: self
selector: #browse
argument: #( )) icon: (Smalltalk ui icons iconNamed: #nautilus) ]).

^ composite
]
Expand Down
Loading

0 comments on commit f7775c9

Please sign in to comment.