Skip to content

Commit

Permalink
Incubator : Fix browse all components classes panel
Browse files Browse the repository at this point in the history
  • Loading branch information
labordep committed Oct 28, 2023
1 parent edd1004 commit 7456159
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 53 deletions.
111 changes: 59 additions & 52 deletions src/Molecule-IDE-Incubator/RSMolEvents.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -13,65 +13,72 @@ Class {
{ #category : #hooks }
RSMolEvents >> onShape: aShape [

aShape when: RSMouseDoubleLeftClick do: [ :evt |
| usedComponentServices usedComponentParameters consumedComponentEvents providedComponentServices providedComponentParameters producedComponentEvents showComponent |
showComponent := SpMolShowComponent new.
aShape model haveComponentType ifTrue: [
usedComponentServices := OrderedCollection new.
aShape model usedComponentServices do: [ :compo |
compo users do: [ :comp |
comp == aShape model ifFalse: [ usedComponentServices add: comp ] ] ].
aShape
when: RSMouseDoubleLeftClick
do: [ :evt |
| usedComponentServices usedComponentParameters consumedComponentEvents providedComponentServices providedComponentParameters producedComponentEvents showComponent |
showComponent := SpMolShowComponent new.
aShape model haveComponentType ifTrue: [
usedComponentServices := OrderedCollection new.
aShape model usedComponentServices do: [ :compo |
compo users do: [ :comp |
comp == aShape model ifFalse: [ usedComponentServices add: comp ] ] ].

usedComponentParameters := OrderedCollection new.
aShape model usedComponentParameters do: [ :compo |
compo users do: [ :comp |
comp == aShape model ifFalse: [
usedComponentParameters add: comp ] ] ].
usedComponentParameters := OrderedCollection new.
aShape model usedComponentParameters do: [ :compo |
compo users do: [ :comp |
comp == aShape model ifFalse: [
usedComponentParameters add: comp ] ] ].

consumedComponentEvents := OrderedCollection new.
aShape model consumedComponentEvents do: [ :compo |
compo users do: [ :comp |
comp == aShape model ifFalse: [
consumedComponentEvents add: comp ] ] ].
consumedComponentEvents := OrderedCollection new.
aShape model consumedComponentEvents do: [ :compo |
compo users do: [ :comp |
comp == aShape model ifFalse: [
consumedComponentEvents add: comp ] ] ].

providedComponentServices := OrderedCollection new.
aShape model providedComponentServices do: [ :compo |
compo users do: [ :comp |
comp == aShape model ifFalse: [
providedComponentServices add: comp ] ] ].
providedComponentServices := OrderedCollection new.
aShape model providedComponentServices do: [ :compo |
compo users do: [ :comp |
comp == aShape model ifFalse: [
providedComponentServices add: comp ] ] ].

providedComponentParameters := OrderedCollection new.
aShape model providedComponentParameters do: [ :compo |
compo users do: [ :comp |
comp == aShape model ifFalse: [
providedComponentParameters add: comp ] ] ].
providedComponentParameters := OrderedCollection new.
aShape model providedComponentParameters do: [ :compo |
compo users do: [ :comp |
comp == aShape model ifFalse: [
providedComponentParameters add: comp ] ] ].

producedComponentEvents := OrderedCollection new.
aShape model producedComponentEvents do: [ :compo |
compo users do: [ :comp |
comp == aShape model ifFalse: [
producedComponentEvents add: comp ] ] ].
producedComponentEvents := OrderedCollection new.
aShape model producedComponentEvents do: [ :compo |
compo users do: [ :comp |
comp == aShape model ifFalse: [
producedComponentEvents add: comp ] ] ].

showComponent usedComponentServicesConnected: usedComponentServices.
showComponent usedComponentParametersConnected:
usedComponentParameters.
showComponent providedComponentServicesConnected:
providedComponentServices.
showComponent providedComponentParametersConnected:
providedComponentParameters.
showComponent producedComponentEventsConnected:
producedComponentEvents.
showComponent consumedComponentEventsConnected:
consumedComponentEvents ].
showComponent component: aShape model.
showComponent open ].
showComponent usedComponentServicesConnected:
usedComponentServices.
showComponent usedComponentParametersConnected:
usedComponentParameters.
showComponent providedComponentServicesConnected:
providedComponentServices.
showComponent providedComponentParametersConnected:
providedComponentParameters.
showComponent producedComponentEventsConnected:
producedComponentEvents.
showComponent consumedComponentEventsConnected:
consumedComponentEvents ].
showComponent component: aShape model.
showComponent open ]
for: self.

aShape when: RSMouseRightClick do: [ :evt |
| molMenu |
self selectedShape: aShape model.
molMenu := MolMenu new.
molMenu selectedComponent: selectedShape.
molMenu open: molMenu ]
aShape
when: RSMouseRightClick
do: [ :evt |
| molMenu |
self selectedShape: aShape model.
molMenu := MolMenu new.
molMenu selectedComponent: selectedShape.
molMenu open: molMenu ]
for: self
]

{ #category : #accessing }
Expand Down
2 changes: 1 addition & 1 deletion src/Molecule-IDE-Incubator/SpMolInspect.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ SpMolInspect >> initializePresenters [
table := self newTreeTable.
table addColumn: (SpCompositeTableColumn new
title: 'Component';
addColumn: ((SpImageTableColumn evaluated: #systemIcon)
addColumn: ((SpImageTableColumn evaluated: [ :e | e iconNamed: e systemIconName])
width: 20;
yourself);
addColumn: (SpStringTableColumn evaluated: #name);
Expand Down

0 comments on commit 7456159

Please sign in to comment.