A new version of HelpSystem-Core was added to project The Inbox: http://source.squeak.org/inbox/HelpSystem-Core-kfr.60.mcz
==================== Summary ====================
Name: HelpSystem-Core-kfr.60 Author: kfr Time: 2 July 2014, 9:24:54.717 pm UUID: 4aca0aab-3091-9245-ac35-efe868da9974 Ancestors: HelpSystem-Core-kfr.59
Add search to HelpBrowser
=============== Diff against HelpSystem-Core-kfr.59 ===============
Item was changed: Object subclass: #HelpBrowser + instanceVariableNames: 'rootTopic window treeMorph contentMorph topicClass topicMethod topic result' - instanceVariableNames: 'rootTopic window treeMorph contentMorph topicClass topicMethod topic' classVariableNames: 'DefaultHelpBrowser' poolDictionaries: '' category: 'HelpSystem-Core-UI'!
!HelpBrowser commentStamp: 'tbn 3/8/2010 09:33' prior: 0! A HelpBrowser is used to display a hierarchy of help topics and their contents.
Instance Variables rootTopic: <HelpTopic> window: <StandardWindow> treeMorph: <PluggableTreeMorph> contentMorph: <Morph>
rootTopic - xxxxx
window - xxxxx
treeMorph - xxxxx
contentMorph - xxxxx
!
Item was added: + ----- Method: HelpBrowser>>find (in category 'actions') ----- + find + "Prompt the user for a string to search for, and search the receiver from the current selection onward for it." + + | reply | + reply := UIManager default request: 'Find what? ' initialAnswer: ''. + reply size = 0 ifTrue: [ + ^ self]. + self findStringInHelpTopic: reply + !
Item was changed: ----- Method: HelpBrowser>>find: (in category 'actions') ----- find: aString ^SystemNavigation allMethodsSelect: [:method | method hasLiteralSuchThat: [:lit | (lit isString and: [lit isSymbol not]) and: + [lit includesSubstring: aString caseSensitive: false]]] + localTo: CustomHelp - [lit includesSubstring: aString caseSensitive: true]]] !
Item was added: + ----- Method: HelpBrowser>>findStringInHelpTopic: (in category 'actions') ----- + findStringInHelpTopic: aString + | list | + result := OrderedCollection new. + list := treeMorph scroller submorphs collect: [ :each | each complexContents]. + list do:[ : topic | self inSubtopic: topic find: aString ]. + self onItemClicked: result first. + !
Item was added: + ----- Method: HelpBrowser>>inSubtopic:find: (in category 'actions') ----- + inSubtopic: aTopic find: aString + ((aTopic asString includesSubString: aString) + or: [aTopic item contents asString includesSubString: aString]) + ifTrue: [result add: aTopic item]. + aTopic contents + do: [:sub | self inSubtopic: sub find: aString]!
Item was changed: ----- Method: HelpBrowser>>initWindow (in category 'initialize-release') ----- initWindow window := SystemWindow labelled: 'Help Browser'. window model: self. "Tree" treeMorph := PluggableTreeMorph new. + treeMorph model: self; setSelectedSelector: #onItemClicked:; getMenuSelector: #codePaneMenu:shifted:. - treeMorph model: self; setSelectedSelector: #onItemClicked:. window addMorph: treeMorph frame: (0@0 corner: 0.3@1). "Text" contentMorph := self defaultViewerClass on: self text: nil accept: #accept: readSelection: nil menu: #codePaneMenu:shifted:. window addMorph: contentMorph frame: (0.3@0 corner: 1@1). !
Item was changed: ----- Method: HelpBrowser>>onItemClicked: (in category 'events') ----- onItemClicked: anItem | classList | anItem isNil ifTrue: [^contentMorph setText: rootTopic asHelpTopic contents]. contentMorph setText: anItem contents. topic := anItem. + classList := (self find: anItem contents) asOrderedCollection. - classList := self find: anItem contents. classList ifNotEmpty:[ topicClass := classList first actualClass theNonMetaClass. + topicMethod := classList first selector]. + ! - topicMethod := classList first selector]!
squeak-dev@lists.squeakfoundation.org