Tobias Pape uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-topa.676.mcz ==================== Summary ==================== Name: Tools-topa.676 Author: topa Time: 1 March 2016, 5:32:00.896321 pm UUID: 9dd551d2-d6c4-4704-af6f-b3ec510732f8 Ancestors: Tools-topa.675 Generalize messageList callbacks to be usabe with message names, too. =============== Diff against Tools-topa.675 =============== Item was changed: ----- Method: Browser>>messageHelpAt: (in category 'message list') ----- messageHelpAt: anIndex "Show the first n lines of the sources code of the selected message." - - | source formatted iconHelp | - Preferences balloonHelpInMessageLists ifFalse: [^ nil]. self messageList size < anIndex ifTrue: [^ nil]. + ^ self messageHelpFor: (self messageList at: anIndex) + ! - - source := (self selectedClassOrMetaClass >> (self messageList at: anIndex)) getSource. - source lineCount > 5 ifTrue: [ - | sourceLines | - sourceLines := (source asString lines copyFrom: 1 to: 5) asOrderedCollection. - sourceLines add: ' [...]'. - source := sourceLines joinSeparatedBy: Character cr]. - - formatted := SHTextStylerST80 new - classOrMetaClass: self selectedClassOrMetaClass; - styledTextFor: source asText. - iconHelp := (self messageIconHelpAt: anIndex) ifNotEmpty: [:t | - t , Character cr, Character cr]. - ^ iconHelp asText - append: formatted; - yourself! Item was added: + ----- Method: Browser>>messageHelpFor: (in category 'message list') ----- + messageHelpFor: aSelector + "Show the first n lines of the sources code of the message behind aSelector." + + | source formatted iconHelp | + Preferences balloonHelpInMessageLists ifFalse: [^ nil]. + + source := (self selectedClassOrMetaClass >> aSelector) getSource. + source lineCount > 5 ifTrue: [ + | sourceLines | + sourceLines := (source asString lines copyFrom: 1 to: 5) asOrderedCollection. + sourceLines add: ' [...]'. + source := sourceLines joinSeparatedBy: Character cr]. + + formatted := SHTextStylerST80 new + classOrMetaClass: self selectedClassOrMetaClass; + styledTextFor: source asText. + iconHelp := (self messageIconHelpFor: aSelector) ifNotEmpty: [:t | + t , Character cr, Character cr]. + ^ iconHelp asText + append: formatted; + yourself! Item was changed: ----- Method: Browser>>messageIconAt: (in category 'message list') ----- messageIconAt: anIndex + ^ self messageIconFor: (self messageList at: anIndex)! - self class showMessageIcons - ifFalse: [^ nil]. - - ^ ToolIcons iconNamed: (ToolIcons - iconForClass: self selectedClassOrMetaClass - selector: (self messageList at: anIndex))! Item was added: + ----- Method: Browser>>messageIconFor: (in category 'message list') ----- + messageIconFor: aSelector + + self class showMessageIcons ifFalse: [^ nil]. + + ^ ToolIcons iconNamed: (ToolIcons + iconForClass: self selectedClassOrMetaClass + selector: aSelector)! Item was removed: - ----- Method: Browser>>messageIconHelpAt: (in category 'message list') ----- - messageIconHelpAt: anIndex - - self class showMessageIcons ifFalse: [^ String empty]. - - ^ ToolIconHelp iconHelpNamed: (ToolIcons - iconForClass: self selectedClassOrMetaClass - selector: (self messageList at: anIndex))! Item was added: + ----- Method: Browser>>messageIconHelpFor: (in category 'message list') ----- + messageIconHelpFor: aSelector + + self class showMessageIcons ifFalse: [^ String empty]. + + ^ ToolIconHelp iconHelpNamed: (ToolIcons + iconForClass: self selectedClassOrMetaClass + selector: aSelector)! Item was changed: ----- Method: Browser>>selectedMessageName: (in category 'message list') ----- selectedMessageName: aSelector "Make the given selector be the selected message name" | anIndex | anIndex := self messageList indexOf: aSelector. anIndex > 0 ifTrue: + [self messageListIndex: anIndex]. + self changed: #selectedMessageName. "inform interested parties"! - [self messageListIndex: anIndex]! |
Free forum by Nabble | Edit this page |