Eliot Miranda uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-eem.1721.mcz
==================== Summary ====================
Name: Morphic-eem.1721
Author: eem
Time: 3 February 2021, 6:52:27.309661 pm
UUID: 3fa83dbf-de0f-4bb8-a461-57416e66b6cf
Ancestors: Morphic-eem.1720
And make sure that we find the right model when searching for classes in multi-window browsers.
=============== Diff against Morphic-eem.1720 ===============
Item was changed:
----- Method: Browser>>displayClass: (in category '*Morphic-Menus-DockingBar-accessing') -----
displayClass: aClass
"Assuming the receiver has answered true to isDisplayingClass:, come to the front and select the given class."
| index |
+ index := self multiWindowIndexForClassName: aClass name.
+ index ~= 0 ifTrue:
+ [multiWindowState selectWindowIndex: index.
+ ^(multiWindowState models at: index) selectClass: aClass].
- index := self multiWindowIndexForClassName: aClass.
- index ~= 0 ifTrue:
- [multiWindowState selectWindowIndex: index].
self selectClass: aClass!
Eliot Miranda uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-eem.1720.mcz
==================== Summary ====================
Name: Morphic-eem.1720
Author: eem
Time: 3 February 2021, 6:41:54.512365 pm
UUID: d5ad36ce-7228-4bbe-8c99-a5bcef5e9bef
Ancestors: Morphic-eem.1719
Avoid Symbol interning dulication in SearchBar>>smartSearch:in:
=============== Diff against Morphic-eem.1719 ===============
Item was changed:
----- Method: SearchBar>>smartSearch:in: (in category 'searching') -----
smartSearch: text in: morph
"Take the user input and perform an appropriate search"
| input newContents |
self removeResultsWidget.
input := text asString ifEmpty:[^self].
self class useSmartSearch ifFalse: [^ ToolSet default browseMessageNames: input].
(Symbol findInterned: input) ifNotNil:
[:symbol| input := symbol].
"If it is a global or a full class name, browse that class."
(Smalltalk bindingOf: input) ifNotNil:
[:assoc| | class |
class := (assoc value isBehavior ifTrue:[assoc value] ifFalse:[assoc value class]) theNonMetaClass.
Project current world submorphs do:
[:windowMorph|
(windowMorph isSystemWindow
and: [(windowMorph model isKindOf: Browser)
and: [windowMorph model isDisplayingClass: class]]) ifTrue:
[windowMorph beKeyWindow.
^windowMorph model displayClass: class]].
^ToolSet browse: class selector: nil].
"If it is a symbol and there are implementors of it, browse those implementors."
+ input isSymbol ifTrue:
+ [(SystemNavigation new allImplementorsOf: input) ifNotEmpty:
+ [:list|
- Symbol hasInterned: input ifTrue: [:selector |
- (SystemNavigation new allImplementorsOf: selector) ifNotEmpty:[:list|
^SystemNavigation new
browseMessageList: list
name: 'Implementors of ' , input]].
"If it starts uppercase, browse classes if any. Otherwise, just search for messages."
input first isUppercase ifTrue:
+ [(UIManager default classFromPattern: input withCaption: '') ifNotNil:
+ [:aClass| ^ToolSet browse: aClass selector: nil].
- [(UIManager default classFromPattern: input withCaption: '')
- ifNotNil:[:aClass| ^ToolSet browse: aClass selector: nil].
newContents := input, ' -- not found.'.
self searchTerm: newContents.
self selection: (input size+1 to: newContents size).
self currentHand newKeyboardFocus: morph textMorph.
^ self].
"Default to browse message names..."
ToolSet default browseMessageNames: input!
Eliot Miranda uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-eem.1719.mcz
==================== Summary ====================
Name: Morphic-eem.1719
Author: eem
Time: 3 February 2021, 6:38:11.11355 pm
UUID: ffb981b1-7c53-4fbe-b6f4-4c8f27c79f5a
Ancestors: Morphic-mt.1718
Make SearchBar>>#smartSearch:in: search existing browsers for a class name being searched for, bringing the first such browser to the front and selecting the class. This allows one to find classes in browsers either when one has very many, or when one is using multi-window browsers containing many many classes.
=============== Diff against Morphic-mt.1718 ===============
Item was added:
+ ----- Method: Browser>>displayClass: (in category '*Morphic-Menus-DockingBar-accessing') -----
+ displayClass: aClass
+ "Assuming the receiver has answered true to isDisplayingClass:, come to the front and select the given class."
+ | index |
+ index := self multiWindowIndexForClassName: aClass.
+ index ~= 0 ifTrue:
+ [multiWindowState selectWindowIndex: index].
+ self selectClass: aClass!
Item was added:
+ ----- Method: Browser>>isDisplayingClass: (in category '*Morphic-Menus-DockingBar-accessing') -----
+ isDisplayingClass: aClass
+ | className |
+ className := aClass name.
+ (self multiWindowIndexForClassName: className) ~= 0 ifTrue: [^true].
+ ^selectedClassName = className!
Item was added:
+ ----- Method: Browser>>multiWindowIndexForClassName: (in category '*Morphic-Menus-DockingBar-accessing') -----
+ multiWindowIndexForClassName: className
+ "Answer the index of a browser displaying className in multiWindowState, if any.
+ Otherwise answer zero."
+ multiWindowState ifNil: [^0].
+ multiWindowState models withIndexDo:
+ [:browser :index|
+ browser selectedClassName = className ifTrue: [^index]].
+ ^0!
Item was changed:
----- Method: SearchBar>>smartSearch:in: (in category 'searching') -----
smartSearch: text in: morph
"Take the user input and perform an appropriate search"
| input newContents |
self removeResultsWidget.
input := text asString ifEmpty:[^self].
self class useSmartSearch ifFalse: [^ ToolSet default browseMessageNames: input].
+ (Symbol findInterned: input) ifNotNil:
+ [:symbol| input := symbol].
"If it is a global or a full class name, browse that class."
+ (Smalltalk bindingOf: input) ifNotNil:
+ [:assoc| | class |
+ class := (assoc value isBehavior ifTrue:[assoc value] ifFalse:[assoc value class]) theNonMetaClass.
+ Project current world submorphs do:
+ [:windowMorph|
+ (windowMorph isSystemWindow
+ and: [(windowMorph model isKindOf: Browser)
+ and: [windowMorph model isDisplayingClass: class]]) ifTrue:
+ [windowMorph beKeyWindow.
+ ^windowMorph model displayClass: class]].
+ ^ToolSet browse: class selector: nil].
- (Smalltalk bindingOf: input) ifNotNil:[:assoc| | global |
- global := assoc value.
- ^ToolSet browse: (global isBehavior ifTrue:[global] ifFalse:[global class]) selector: nil].
"If it is a symbol and there are implementors of it, browse those implementors."
Symbol hasInterned: input ifTrue: [:selector |
(SystemNavigation new allImplementorsOf: selector) ifNotEmpty:[:list|
^SystemNavigation new
browseMessageList: list
name: 'Implementors of ' , input]].
"If it starts uppercase, browse classes if any. Otherwise, just search for messages."
+ input first isUppercase ifTrue:
+ [(UIManager default classFromPattern: input withCaption: '')
+ ifNotNil:[:aClass| ^ToolSet browse: aClass selector: nil].
+ newContents := input, ' -- not found.'.
+ self searchTerm: newContents.
+ self selection: (input size+1 to: newContents size).
+ self currentHand newKeyboardFocus: morph textMorph.
+ ^ self].
+
+ "Default to browse message names..."
+ ToolSet default browseMessageNames: input!
- input first isUppercase
- ifTrue: [
- (UIManager default classFromPattern: input withCaption: '')
- ifNotNil:[:aClass| ^ToolSet browse: aClass selector: nil]
- ifNil: [
- newContents := input, ' -- not found.'.
- self searchTerm: newContents.
- self selection: (input size+1 to: newContents size).
- self currentHand newKeyboardFocus: morph textMorph.
- ^ self]]
- ifFalse: [
- ToolSet default browseMessageNames: input].!
Eliot Miranda uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-eem.1367.mcz
==================== Summary ====================
Name: Kernel-eem.1367
Author: eem
Time: 1 February 2021, 6:57:09.713484 pm
UUID: def9aaa1-eb71-4da5-8f86-85856d9b88ad
Ancestors: Kernel-eem.1366
Fix mistake in the previous commit. Thanks Levente!
=============== Diff against Kernel-eem.1366 ===============
Item was changed:
----- Method: Context>>isPrimFailToken: (in category 'private') -----
+ isPrimFailToken: contextOrPrimFailToken
+ "Answer if contextOrPrimFailToken, which will either be a Context object or
+ a primitive fail token (a tuple of the PrimitiveFailToken unique object and
+ a primitive failure code), is the latter. This should only be used with the
+ (possibly indirect) results of Context>>doPrimitive:method:receiver:args:"
+ ^contextOrPrimFailToken isArray
+ and: [contextOrPrimFailToken size = 2
+ and: [(contextOrPrimFailToken at: 1) == PrimitiveFailToken]]!
- isPrimFailToken: anObject
- ^(self objectClass: anObject) isArray
- and: [anObject size = 2
- and: [(anObject at: 1) == PrimitiveFailToken]]!