Tobias Pape uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-topa.560.mcz ==================== Summary ==================== Name: Tools-topa.560 Author: topa Time: 26 March 2015, 5:39:25.846 pm UUID: caa9616b-fd72-4989-9491-56602ffcb862 Ancestors: Tools-topa.559 Change tool icons to allow dynamicity. Classes can now control their icon and these of their methods. =============== Diff against Tools-topa.559 =============== Item was added: + ----- Method: Behavior>>toolIcon (in category '*Tools-icons') ----- + toolIcon + "Tools can annotate me with an icon identified by the symbol this method returns. + Defaults to no icon" + ^ #blank! Item was added: + ----- Method: Behavior>>toolIconSelector: (in category '*Tools-icons') ----- + toolIconSelector: aSymbol + "Tools can annotate the method identified by aSymbol with an icon identified by the symbol this method returns. + We customize this for, eg, overriden methods or methods with breaks. + Defaults to no icon" + + self methodDictionary at: aSymbol ifPresent: [ :method | + method literalsDo: [ :literal | + (#(halt halt: haltIfNil haltIf: haltOnce haltOnce: haltOnCount: halt:onCount:) includes: literal) + ifTrue: [^ #breakpoint]. + (#(flag: needsWork notYetImplemented) includes: literal) + ifTrue: [^ #flag]. + (#(shouldBeImplemented subclassResponsibility) includes: literal) + ifTrue: [ + (self isSelectorOverridden: aSymbol) + ifTrue: [^ #abstract] + ifFalse: [^ #notOverridden]]. + literal == #shouldNotImplement + ifTrue: [^ #no]]]. + + (self isSelectorOverride: aSymbol) + ifTrue: [ + (self isSelectorOverridden: aSymbol) + ifTrue: [ ^ #arrowUpAndDown ] + ifFalse: [ ^ #arrowUp ] ] + ifFalse: [ + (self isSelectorOverridden: aSymbol) + ifTrue: [^ #arrowDown ]]. + + self methodDictionary at: aSymbol ifPresent: [ :method | + (method primitive ~= 0 and: [method isQuick not]) + ifTrue: [^ #primitive]]. + + + ^ #blank! Item was added: + ----- Method: Collection class>>toolIcon (in category '*Tools-icons') ----- + toolIcon + + ^ #collection! Item was added: + ----- Method: Exception class>>toolIcon (in category '*Tools-icons') ----- + toolIcon + + ^ #exception! Item was added: + ----- Method: Magnitude class>>toolIcon (in category '*Tools-icons') ----- + toolIcon + + ^ #magnitude! Item was added: + ----- Method: Morph class>>toolIcon (in category '*Tools-icons') ----- + toolIcon + + ^ #morph! Item was added: + ----- Method: PseudoClass>>toolIcon (in category '*Tools-icons') ----- + toolIcon + "For polymorphy with behaviors" + ^ self realClass ifNil: [#blank] ifNotNil: [:real | real toolIcon]! Item was added: + ----- Method: PseudoClass>>toolIconSelector: (in category '*Tools-icons') ----- + toolIconSelector: aSymbol + "For polymorphy with behaviors" + ^ self realClass ifNil: [#blank] ifNotNil: [:real | real toolIconSelector: aSymbol]! Item was added: + ----- Method: Stream class>>toolIcon (in category '*Tools-icons') ----- + toolIcon + + ^ #stream! Item was added: + ----- Method: String class>>toolIcon (in category '*Tools-icons') ----- + toolIcon + + ^ #string! Item was changed: ----- Method: ToolIcons class>>iconForClass: (in category 'support') ----- iconForClass: aClassNameSymbol - + self environment + at: aClassNameSymbol + ifPresent: [:global | + (global respondsTo: #toolIcon) ifTrue: [ + ^ global toolIcon]] + ifAbsent: [^ #blank]. - (Smalltalk at: aClassNameSymbol ifAbsent: [^ #blank]) withAllSuperclassesDo: [:class | - (self class includesSelector: class name asLowercase asSymbol) - ifTrue: [^ class name asLowercase asSymbol]]. ^ #blank! Item was changed: ----- Method: ToolIcons class>>iconForClass:selector: (in category 'support') ----- + iconForClass: aBehavior selector: aSelector + "Answer an icon to be shown for the selector aSymbol in aBehavior." + (aBehavior respondsTo: #toolIconSelector:) ifTrue: [ + ^ aBehavior toolIconSelector: aSelector]. + ^ #blank + ! - iconForClass: aClassDescription selector: aSelector - "Answer an icon to be shown for the selector aSymbol in aClassDescription." - | classDescription | - classDescription := (aClassDescription isKindOf: PseudoClass) - ifTrue: [aClassDescription realClass ifNil: [^ #blank ]] - ifFalse: [aClassDescription]. - classDescription methodDictionary at: aSelector ifPresent: [ :method | - method literalsDo: [ :literal | - (#(halt halt: haltIfNil haltIf: haltOnce haltOnce: haltOnCount: halt:onCount:) includes: literal) - ifTrue: [^ #breakpoint]. - (#(flag: needsWork notYetImplemented) includes: literal) - ifTrue: [^ #flag]. - (#(shouldBeImplemented subclassResponsibility) includes: literal) - ifTrue: [ - (classDescription isSelectorOverridden: aSelector) - ifTrue: [^ #abstract] - ifFalse: [^ #notOverridden]]. - literal == #shouldNotImplement - ifTrue: [^ #no]]]. - - (classDescription isSelectorOverride: aSelector) - ifTrue: [ - (classDescription isSelectorOverridden: aSelector) - ifTrue: [ ^ #arrowUpAndDown ] - ifFalse: [ ^ #arrowUp ] ] - ifFalse: [ - (classDescription isSelectorOverridden: aSelector) - ifTrue: [^ #arrowDown ]]. - - classDescription methodDictionary at: aSelector ifPresent: [ :method | - (method primitive ~= 0 and: [method isQuick not]) - ifTrue: [^ #primitive]]. - - - ^ #blank! Item was added: + ----- Method: ToolIcons class>>stream (in category 'private') ----- + stream + + ^ Form + extent: 12@12 + depth: 32 + fromArray: #( 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4294967295 4294967295 0 0 4294967295 4294967295 0 0 0 0 0 4294967295 4290038244 4292075503 4294967295 4294967295 4290038244 4292075503 4294967295 0 0 0 0 4294967295 4288921054 4284189380 4292535794 4294967295 4288921054 4284189380 4292535794 4294967295 0 0 0 4294967295 4288921054 4283597761 4284386245 4293850105 4289183968 4283597761 4284386245 4292995828 4294967295 0 0 4294967295 4288921054 4283597761 4283597761 4288461275 4289381089 4283597761 4283597761 4284583622 4293784313 4294967295 0 4294967295 4288921054 4283597761 4283597761 4288198106 4289381088 4283597761 4283597761 4284123588 4293192949 4294967295 0 4294967295 4288921054 4283597761 4283926211 4293127157 4289183968 4283597761 4283926211 4291812590 4294967295 0 0 4294967295 4288921054 4283794882 4291155690 4294967295 4288921054 4283794882 4291155690 4294967295 0 0 0 4294967295 4289381088 4290629607 4294967295 4294967295 4289381088 4290629607 4294967295 0 0 0 0 4294967295 4294967295 4294967295 0 4294967295 4294967295 4294967295 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0) + offset: 0@0! |
Free forum by Nabble | Edit this page |