[Pkg] The Trunk: Tools-topa.705.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Jun 23 07:55:53 UTC 2016


Tobias Pape uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-topa.705.mcz

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

Name: Tools-topa.705
Author: topa
Time: 23 June 2016, 9:55:41.768774 am
UUID: e819d324-b58e-4e35-b988-395da379fdb5
Ancestors: Tools-mt.704

disable buttons in the browser when they do not apply

=============== Diff against Tools-mt.704 ===============

Item was changed:
  ----- Method: CodeHolder>>buildOptionalButtonsWith: (in category 'toolbuilder') -----
  buildOptionalButtonsWith: builder
  
  	| panelSpec |
  	panelSpec := builder pluggablePanelSpec new.
  	panelSpec children: OrderedCollection new.
  	self optionalButtonPairs do:[:spec|
  		| buttonSpec |
  		buttonSpec := builder pluggableActionButtonSpec new.
  		buttonSpec model: self.
  		buttonSpec label: spec first.
  		buttonSpec action: spec second.
+ 		spec second == #methodHierarchy
+ 			ifTrue:[buttonSpec
+ 				enabled: #inheritanceButtonEnabled;
+ 				color: #inheritanceButtonColor].
+ 		spec second == #browseVersions
+ 			ifTrue:[buttonSpec enabled: #versionsButtonEnabled].
- 		spec second == #methodHierarchy ifTrue:[
- 			buttonSpec color: #inheritanceButtonColor.
- 		]. 
  		spec size > 2 ifTrue:[buttonSpec help: spec third].
+ 		panelSpec children add: buttonSpec].
- 		panelSpec children add: buttonSpec.
- 	].
  
  	"What to show"
  	panelSpec children add: builder pluggableSpacerSpec new.
  	self addCodeProvenanceButtonTo: panelSpec using: builder.
  
  	panelSpec layout: #horizontal. "buttons"
  	^panelSpec!

Item was added:
+ ----- Method: CodeHolder>>inheritanceButtonEnabled (in category 'toolbuilder') -----
+ inheritanceButtonEnabled
+ 	"The inheritance button is only enabled when a method is selected"
+ 
+ 	^  self selectedMessageName notNil
+ !

Item was added:
+ ----- Method: CodeHolder>>versionsButtonEnabled (in category 'toolbuilder') -----
+ versionsButtonEnabled
+ 	"The versions button is only enabled when a method is selected or we view the 
+ 	class comment."
+ 
+ 	^  self selectedMessageName notNil or: [self classCommentIndicated]!

Item was changed:
  ----- Method: StringHolder>>browseVersions (in category '*Tools') -----
  browseVersions
  	"Create and schedule a Versions Browser, showing all versions of the 
  	currently selected message. Answer the browser or nil."
+ 	^ self classCommentIndicated
+ 		ifTrue: [ClassCommentVersionsBrowser browseCommentOf: self selectedClass]
+ 		ifFalse: [self selectedMessageName ifNotNil: 
+ 			[:selector |
+ 				ToolSet browseVersionsOf: self selectedClassOrMetaClass selector: selector]]!
- 	| selector | 
- 	self classCommentIndicated ifTrue:
- 		[ClassCommentVersionsBrowser browseCommentOf: self selectedClass.
- 		 ^nil].
- 
- 	^(selector := self selectedMessageName)
- 		ifNil: [self inform: 'Sorry, only actual methods have retrievable versions.'. nil]
- 		ifNotNil: [ToolSet browseVersionsOf: self selectedClassOrMetaClass selector: selector]!



More information about the Packages mailing list