Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
46 changes: 46 additions & 0 deletions src/Calypso-SystemQueries/ClyMatchingPackageScope.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
"
I am a subclass of scope of packages for matching patterns
"
Class {
#name : 'ClyMatchingPackageScope',
#superclass : 'ClyPackageScope',
#instVars : [
'prefix'
],
#category : 'Calypso-SystemQueries-Scopes',
#package : 'Calypso-SystemQueries',
#tag : 'Scopes'
}

{ #category : 'accessing' }
ClyMatchingPackageScope class >> defaultName [

^ 'matching packages'
]

{ #category : 'initialization' }
ClyMatchingPackageScope class >> ofAll: basisObjects in: aNavigationEnvironment withName: aName [

^ (self ofAll: basisObjects withName: aName) bindTo: aNavigationEnvironment
]

{ #category : 'initialization' }
ClyMatchingPackageScope class >> ofAll: basisObjects withName: aName [

^self new
basisObjects: basisObjects;
prefix: aName
]

{ #category : 'accessing' }
ClyMatchingPackageScope >> prefix: aName [

prefix := aName
]

{ #category : 'printing' }
ClyMatchingPackageScope >> printBasisOn: aStream [

basisObjects ifEmpty: [ ^ self ].
aStream nextPutAll: prefix , '* (...)'
]
26 changes: 22 additions & 4 deletions src/Calypso-SystemTools-FullBrowser/ClyFullBrowserMorph.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,23 @@ ClyFullBrowserMorph class >> taskbarIconName [
^#smallSystemBrowser
]

{ #category : 'adding' }
ClyFullBrowserMorph >> addMatchingScopes [

| name substrings partialName |
name := self packageSelection items first name.

substrings := name substrings: '-'.
partialName := ''.

^ (1 to: substrings size - 1) collect: [ :i |
partialName := partialName , (substrings at: i) , '-'.
ClyMatchingPackageScope
ofAll: (PackageOrganizer default packages select: [ :each | each name beginsWith: partialName ])
in: self packageSelection rootDataSource queryEnvironment
withName: partialName ]
]

{ #category : 'private' }
ClyFullBrowserMorph >> adoptForExtendedClass [

Expand Down Expand Up @@ -196,10 +213,11 @@ ClyFullBrowserMorph >> allNavigationScopes [
| classLocalScope |
classLocalScope := self classSelection asItemsScope: ClyBothMetaLevelClassScope.

^super allNavigationScopes, {
self packageSelection asItemsScope: ClyPackageScope.
classLocalScope asFullHierarchyScope.
classLocalScope }, ScopesManager availableScopes
^ (super allNavigationScopes , {
(self packageSelection asItemsScope: ClyPackageScope).
self addMatchingScopes.
classLocalScope asFullHierarchyScope.
classLocalScope } , ScopesManager availableScopes) flattened
]

{ #category : 'updating' }
Expand Down