Skip to content

Commit

Permalink
Add class hierarchy and class scopes [feenkcom/gtoolkit#3983]
Browse files Browse the repository at this point in the history
  • Loading branch information
JurajKubelka committed Oct 21, 2024
1 parent c36ca3f commit e0e6ef9
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
Class {
#name : #GtSearchScopedMethodsClassHierarchyScope,
#superclass : #GtSearchScopedMethodsScope,
#instVars : [
'itemClass',
'filter'
],
#category : #'GToolkit-Pharo-SearchFilters-Support'
}

{ #category : #factory }
GtSearchScopedMethodsClassHierarchyScope class >> itemInstancesForFilterContext: aFilterContext into: aStream [
aFilterContext
behaviorDo: [ :aBehavior | aStream nextPut: (self new itemClass: aBehavior) ]
]

{ #category : #accessing }
GtSearchScopedMethodsClassHierarchyScope class >> order [
^ 300
]

{ #category : #accessing }
GtSearchScopedMethodsClassHierarchyScope >> gtIconName [
^ #class
]

{ #category : #accessing }
GtSearchScopedMethodsClassHierarchyScope >> icon [
^ BrGlamorousIcons verticaltree asElement
]

{ #category : #testing }
GtSearchScopedMethodsClassHierarchyScope >> includesMethod: aCompiledMethod [
<return: #Boolean>
^ filter includesMethod: aCompiledMethod
]

{ #category : #initialization }
GtSearchScopedMethodsClassHierarchyScope >> initialize [
super initialize.

filter := GtSearchInheritedMethodsFilter new
withSubclasses;
withSuperclasses
]

{ #category : #accessing }
GtSearchScopedMethodsClassHierarchyScope >> itemClass [
^ itemClass
]

{ #category : #accessing }
GtSearchScopedMethodsClassHierarchyScope >> itemClass: aClass [
itemClass := aClass.
filter forClass: aClass
]

{ #category : #accessing }
GtSearchScopedMethodsClassHierarchyScope >> itemValue [
^ self itemClass
]

{ #category : #accessing }
GtSearchScopedMethodsClassHierarchyScope >> label [
^ 'Hierarchy: ' , (self itemClass ifNotNil: #name ifNil: [ 'none' ])
]
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ GtSearchScopedMethodsClassScope class >> itemInstancesForFilterContext: aFilterC

{ #category : #accessing }
GtSearchScopedMethodsClassScope class >> order [
^ 300
^ 400
]

{ #category : #accessing }
GtSearchScopedMethodsClassScope >> gtIconName [
^ #class
^ self itemClass gtSystemIconName ifNil: #class
]

{ #category : #testing }
Expand All @@ -34,9 +34,7 @@ GtSearchScopedMethodsClassScope >> includesMethod: aCompiledMethod [
GtSearchScopedMethodsClassScope >> initialize [
super initialize.

filter := GtSearchInheritedMethodsFilter new
withSubclasses;
withSuperclasses
filter := GtSearchMethodsInClassFilter new
]

{ #category : #accessing }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ Class {
#category : #'GToolkit-Pharo-SearchFilters-Support'
}

{ #category : #testing }
GtSearchScopedMethodsScope class >> isAbstract [
^ self name = #GtSearchScopedMethodsScope
]

{ #category : #factory }
GtSearchScopedMethodsScope class >> itemInstancesForFilterContext: aFilterContext into: aStream [
self subclassResponsibility
Expand Down

0 comments on commit e0e6ef9

Please sign in to comment.