Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stash proxies #198

Merged
merged 7 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 48 additions & 18 deletions src/Pyramid-Bloc/PyramidTreePlugin.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -45,36 +45,46 @@ PyramidTreePlugin class >> addDefaultOnLibrary: library [
PyramidTreePlugin class >> addOnLibrary: aLibrary [

self addDefaultOnLibrary: aLibrary.
self addPystonOnLibrary: aLibrary
self addPystonOnLibrary: aLibrary.
self addPystashOnLibrary: aLibrary
]

{ #category : #'as yet unclassified' }
PyramidTreePlugin class >> addPystonOnLibrary: library [
PyramidTreePlugin class >> addPragma: aSymbol onLibrary: aLibrary withIcon: anIcon [

| pragmas methods packages |
pragmas := Pragma allNamed: #pySTON.
pragmas := Pragma allNamed: aSymbol.
methods := (pragmas collect: #method) asSet.
packages := (methods collect: #package) asSet.

packages do: [ :package |
| factories |
factories := methods
select: [ :method | method package = package ]
thenCollect: [ :method |
PyramidElementToAddFactory new
elementIcon: (Smalltalk ui icons iconNamed:
method methodClass soleInstance systemIconName);
elementName: method selector;
elementBlock: [
(method methodClass soleInstance perform:
method selector) materializeAsBlElement ];
yourself ].
library
factories := self factoriesFromMethods: methods inPackage: package.
factories ifNotEmpty: [ aLibrary
addCategoryWithName: package name
withIcon: (Smalltalk ui icons iconNamed: #smallInfo)
withAllFactories: factories asArray sorted ].
withIcon: anIcon
withAllFactories: factories asArray sorted ]
].

^ library
^ aLibrary
]

{ #category : #'as yet unclassified' }
PyramidTreePlugin class >> addPystashOnLibrary: library [

^ self
addPragma: #pyStash
onLibrary: library
withIcon: (Smalltalk ui icons iconNamed: #smallSave).
]

{ #category : #'as yet unclassified' }
PyramidTreePlugin class >> addPystonOnLibrary: library [

^ self
addPragma: #pySTON
onLibrary: library
withIcon: (Smalltalk ui icons iconNamed: #smallSave)
]

{ #category : #accessing }
Expand All @@ -85,6 +95,26 @@ PyramidTreePlugin class >> columnsBuildersClasses [
^ ColumnsBuildersClasses
]

{ #category : #'as yet unclassified' }
PyramidTreePlugin class >> factoriesFromMethods: methods inPackage: package [

package ifNil: [ ^ { } ].

^ methods
select: [ :method |
method package = package and: [
method methodClass isObsolete not ] ]
thenCollect: [ :method |
PyramidElementToAddFactory new
elementIcon: (Smalltalk ui icons iconNamed:
method methodClass soleInstance systemIconName);
elementName: method selector;
elementBlock: [
(method methodClass soleInstance perform: method selector)
materializeAsBlElement ];
yourself ]
]

{ #category : #initialization }
PyramidTreePlugin class >> install [
"Do some stuff here when the plugin used class oriented behavior"
Expand Down
Loading
Loading