The Trunk: Morphic-nice.1743.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Morphic-nice.1743.mcz

commits-2
Nicolas Cellier uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-nice.1743.mcz

==================== Summary ====================

Name: Morphic-nice.1743
Author: nice
Time: 13 April 2021, 11:46:40.70289 am
UUID: d369fef2-23fa-2c47-867b-e21b9615d22b
Ancestors: Morphic-eem.1742

Prefer Symbol lookup: to #findInterned:

=============== Diff against Morphic-eem.1742 ===============

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 lookup: input) ifNotNil:
- (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|
  ^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!