[squeak-dev] The Trunk: ToolBuilder-Kernel-dtl.67.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Mar 25 01:08:59 UTC 2015


David T. Lewis uploaded a new version of ToolBuilder-Kernel to project The Trunk:
http://source.squeak.org/trunk/ToolBuilder-Kernel-dtl.67.mcz

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

Name: ToolBuilder-Kernel-dtl.67
Author: dtl
Time: 21 March 2015, 12:07:23.671 pm
UUID: d0d0c324-e12d-4424-a1dd-7b4a1cf1f946
Ancestors: ToolBuilder-Kernel-dtl.66

Remove the toolBuilder instance variable from UIManager, replacing it with builderClass. The builderClass for a UIManager is determined by ToolBuilder class>>findDefault, possibly influenced by local project preferences. This will normally be established at first use following creation of a new MVC or Morphic project.

ToolBuilder instances are created as required, so that a UIManager does not reuse a single instance (which would accumulate garbage it its registries).

=============== Diff against ToolBuilder-Kernel-dtl.66 ===============

Item was changed:
  ----- Method: ToolBuilder class>>findDefault (in category 'accessing') -----
  findDefault
  	"Answer a default tool builder"
  	| builderClass |
  	"Note: The way the following is phrased ensures that you can always make 'more specific' builders merely by subclassing a tool builder and implementing a more specific way of reacting to #isActiveBuilder. For example, a BobsUIToolBuilder can subclass MorphicToolBuilder and (if enabled, say Preferences useBobsUITools) will be considered before the parent (generic MorphicToolBuilder)."
  	builderClass := self allSubclasses 
  		detect:[:any| any isActiveBuilder and:[
  			any subclasses noneSatisfy:[:sub| sub isActiveBuilder]]] ifNone:[nil].
+ 	builderClass ifNotNil: [^builderClass ].
- 	builderClass ifNotNil: [^builderClass new].
  	^self error: 'ToolBuilder not found'!

Item was changed:
  Object subclass: #UIManager
+ 	instanceVariableNames: 'builderClass'
- 	instanceVariableNames: ''
  	classVariableNames: ''
  	poolDictionaries: ''
  	category: 'ToolBuilder-Kernel'!
  
  !UIManager commentStamp: 'dtl 5/2/2010 16:06' prior: 0!
  UIManager is a dispatcher for various user interface requests, such as menu and dialog interactions. An instance of UIManager is associated with each Project to implement the appropriate functions for Morphic, MVC or other user interfaces.!

Item was added:
+ ----- Method: UIManager>>builderClass (in category 'builder') -----
+ builderClass
+ 	"Answer the kind of tool builder to use, possibly influenced by project preferences"
+ 	^ builderClass ifNil: [ builderClass := ToolBuilder findDefault ]!

Item was changed:
  ----- Method: UIManager>>toolBuilder (in category 'builder') -----
  toolBuilder
+ 	^ self builderClass new!
- 	"Answer a ToolBuilder for this kind of UIManager"
- 	^ self subclassResponsibility!



More information about the Squeak-dev mailing list