The Trunk: Tools-pre.659.mcz

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

The Trunk: Tools-pre.659.mcz

commits-2
David T. Lewis uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-pre.659.mcz

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

Name: Tools-pre.659
Author: pre
Time: 8 December 2015, 7:16:41.034 pm
UUID: a7cb3cba-074b-46a6-8a83-fada58007b25
Ancestors: Tools-eem.658

This adds balloon help texts to the message list of the standard browser to explain the symbols shown in front of message names.

=============== Diff against Tools-eem.658 ===============

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 |
- | source formatted lineCount |
  Preferences balloonHelpInMessageLists ifFalse: [^ nil].
  self messageList size < anIndex ifTrue: [^ nil].
 
  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.
-
- lineCount := 0.
- source doWithIndex: [:char :index |
- char = Character cr ifTrue: [lineCount := lineCount + 1].
- lineCount > 10 ifTrue: [
- formatted := formatted copyFrom: 1 to: index-1.
- formatted append: ' [...]'.
- ^ formatted]].
 
+ ^ (Text newFrom: ((self messageIconHelpAt: anIndex) ifNotEmpty: [:t | t , Character cr, Character cr]))
+ append: formatted;
+ yourself!
- ^ formatted!

Item was added:
+ ----- Method: Browser>>messageIconHelpAt: (in category 'message list') -----
+ messageIconHelpAt: anIndex
+
+ self class showMessageIcons
+ ifFalse: [^ nil].
+
+ ^ ToolIconHelp iconHelpNamed: (ToolIcons
+ iconForClass: self selectedClassOrMetaClass
+ selector: (self messageList at: anIndex))!

Item was added:
+ Object subclass: #ToolIconHelp
+ instanceVariableNames: ''
+ classVariableNames: 'HelpTexts'
+ poolDictionaries: ''
+ category: 'Tools-Base'!

Item was added:
+ ----- Method: ToolIconHelp class>>abstract (in category 'as yet unclassified') -----
+ abstract
+
+ ^ 'This method is abstract.' !

Item was added:
+ ----- Method: ToolIconHelp class>>arrowDown (in category 'as yet unclassified') -----
+ arrowDown
+
+ ^ 'This method is overriden by another method.'!

Item was added:
+ ----- Method: ToolIconHelp class>>arrowUp (in category 'as yet unclassified') -----
+ arrowUp
+
+ ^ 'This method overrides a super method.'!

Item was added:
+ ----- Method: ToolIconHelp class>>arrowUpAndDown (in category 'as yet unclassified') -----
+ arrowUpAndDown
+
+ ^ 'This method overrides and is overridden by other methods.'!

Item was added:
+ ----- Method: ToolIconHelp class>>blank (in category 'as yet unclassified') -----
+ blank
+
+ ^ ''!

Item was added:
+ ----- Method: ToolIconHelp class>>breakpoint (in category 'as yet unclassified') -----
+ breakpoint
+
+ ^ 'This method contains a breakpoint.'!

Item was added:
+ ----- Method: ToolIconHelp class>>flag (in category 'as yet unclassified') -----
+ flag
+
+ ^ 'This method needs attention of some kind.' !

Item was added:
+ ----- Method: ToolIconHelp class>>helpTexts (in category 'as yet unclassified') -----
+ helpTexts
+
+ ^ HelpTexts ifNil: [HelpTexts := IdentityDictionary new]!

Item was added:
+ ----- Method: ToolIconHelp class>>iconHelpNamed: (in category 'as yet unclassified') -----
+ iconHelpNamed: aSymbol
+
+ (self respondsTo: aSymbol)
+ ifTrue: [^self helpTexts at: aSymbol ifAbsentPut: [self perform: aSymbol]]
+ ifFalse: [^ '']
+ !

Item was added:
+ ----- Method: ToolIconHelp class>>no (in category 'as yet unclassified') -----
+ no
+
+ ^  'This method should not be implemented.' !

Item was added:
+ ----- Method: ToolIconHelp class>>notOverridden (in category 'as yet unclassified') -----
+ notOverridden
+
+ ^ 'This method is abstract and has not been overridden.' !

Item was added:
+ ----- Method: ToolIconHelp class>>primitive (in category 'as yet unclassified') -----
+ primitive
+
+ ^ 'This method implements a primitive.'!