Skip to content

Commit

Permalink
add All methods item to Instance slots filter widget
Browse files Browse the repository at this point in the history
  • Loading branch information
JurajKubelka committed Oct 25, 2024
1 parent 7254593 commit 6f61fe8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ Extension { #name : #GtSearchInstanceSlotReferenceFilter }
{ #category : #'*GToolkit-Pharo-Coder-UI' }
GtSearchInstanceSlotReferenceFilter >> filterDescriptor2For: aMethodsCoder [
^ (super filterDescriptor2For: aMethodsCoder)
ifNotNil: [ :aFilterModel | aFilterModel selectedItem: self variableName ]
ifNotNil: [ :aFilterModel |
aFilterModel
selectedItem: (self variableName ifEmpty: [ GtFilterModelAllItem methodsLabel ]) ]
]

{ #category : #'*GToolkit-Pharo-Coder-UI' }
Expand All @@ -17,8 +19,9 @@ GtSearchInstanceSlotReferenceFilter class >> filterDescriptor2For: aMethodsCoder
ifNone: [ self forClassAndHierarchy: aMethodsCoder classOrMetaClass andVariable: '' ] ];
named: 'Instance slots';
order: 25;
items: aMethodsCoder classOrMetaClass allInstVarNames;
selectFirstItem
items: [ GtFilterModelAllItem methodsLabel withAll: aMethodsCoder classOrMetaClass allInstVarNames ];
selectedItem: GtFilterModelAllItem methodsLabel;
displayAllItems
]

{ #category : #'*GToolkit-Pharo-Coder-UI' }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ GtSearchInstanceSlotReferenceFilter >> includeWriters: aBoolean [
GtSearchInstanceSlotReferenceFilter >> includesMethod: aCompiledMethod [
| index |
(super includesMethod: aCompiledMethod) ifFalse: [ ^ false ].
variableName ifEmpty: [ ^ true ].
index := filterClass instVarIndexFor: variableName ifAbsent: [ ^ false ].
^ (includeReaders and: [ aCompiledMethod readsField: index ])
or: [ includeWriters and: [ aCompiledMethod writesField: index ] ]
Expand All @@ -154,6 +155,7 @@ GtSearchInstanceSlotReferenceFilter >> includesMethod: aCompiledMethod [
{ #category : #'initialize-release' }
GtSearchInstanceSlotReferenceFilter >> initialize [
super initialize.
variableName := '' asSymbol.
includeSubclasses := true.
includeReaders := true.
includeWriters := true
Expand Down

0 comments on commit 6f61fe8

Please sign in to comment.