[squeak-dev] The Inbox: ToolBuilder-Kernel-dtl.46.mcz

commits at source.squeak.org commits at source.squeak.org
Sat Mar 5 18:11:04 UTC 2011


David T. Lewis uploaded a new version of ToolBuilder-Kernel to project The Inbox:
http://source.squeak.org/inbox/ToolBuilder-Kernel-dtl.46.mcz

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

Name: ToolBuilder-Kernel-dtl.46
Author: dtl
Time: 5 March 2011, 1:05:35.352 pm
UUID: 5a2e8628-078c-4aed-a441-b9f9fb844e32
Ancestors: ToolBuilder-Kernel-dtl.45

A Project has a UIManager, and a UIManager has a ToolBuilder, so add #toolBuilder ivar to UIManager and initialize accordingly. This facilitates setting up the appropriate UIManager and ToolBuilder to allow SMxMorphicProject to host a SimpleMorphic world.

Change Toolbuilder class>>default to always ask the default UI manager for its tool builder. Remove class var Default (this was provided in the ToolBuilder package but never used in Squeak). Deprecate ToolBuilder class>>default:

Background: In previous Squeak usage, ToolBuilder class>>default always invoked a search for the appropriate ToolBuilder subclass, and class var Default was unused (this is awkward if more than one kind of ToolBuilder could be used in a project that #isMorphic). This change makes the default tool builder an explicit attibute of the active UI manager.

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

Item was changed:
  Object subclass: #ToolBuilder
  	instanceVariableNames: 'parent'
+ 	classVariableNames: ''
- 	classVariableNames: 'Default'
  	poolDictionaries: ''
  	category: 'ToolBuilder-Kernel'!
  
  !ToolBuilder commentStamp: '<historical>' prior: 0!
  I am a tool builder, that is an object which knows how to create concrete widgets from abstract specifications. Those specifications are used by tools which want to be able to function in diverse user interface paradigms, such as MVC, Morphic, Tweak, wxWidgets etc.
  
  The following five specs must be supported by all implementations:
  	* PluggableButton
  	* PluggableList
  	* PluggableText
  	* PluggablePanel
  	* PluggableWindow
  
  The following specs are optional:
  	* PluggableTree: If not supported, the tool builder must answer nil when asked for a pluggableTreeSpec. Substitution will require client support so clients must be aware that some tool builders may not support trees (MVC for example, or Seaside). See examples in FileListPlus or TestRunnerPlus.
  	* PluggableMultiSelectionList: If multi-selection lists are not supported, tool builder will silently support regular single selection lists.
  	* PluggableInputField: Intended as a HINT for the builder that this widget will be used as a single line input field. Unless explicitly supported it will be automatically substituted by PluggableText.
  	* PluggableActionButton: Intended as a HINT for the builder that this widget will be used as push (action) button. Unless explicitly supported it will be automatically substituted by PluggableButton.
  	* PluggableRadioButton: Intended as a HINT for the builder that this widget will be used as radio button. Unless explicitly supported it will be automatically substituted by PluggableButton.
  	* PluggableCheckBox: Intended as a HINT for the builder that this widget will be used as check box. Unless explicitly supported it will be automatically substituted by PluggableButton.
  !

Item was changed:
  ----- Method: ToolBuilder class>>default (in category 'accessing') -----
  default
  	"Answer the default tool builder"
+ 	^ Project current uiManager toolBuilder
+ 		ifNil: [self findDefault]!
- 	| builderClass |
- 	^Default ifNil:[
- 		"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 new]]!

Item was changed:
  ----- Method: ToolBuilder class>>default: (in category 'accessing') -----
  default: aToolBuilder
  	"Set a new default tool builder"
+ 	self deprecated: 'The default ToolBuilder is an attribute of the UIManager'
+ !
- 	Default := aToolBuilder.!

Item was added:
+ ----- 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 new].
+ 	^self error: 'ToolBuilder not found'!

Item was changed:
  Object subclass: #UIManager
+ 	instanceVariableNames: 'toolBuilder'
- 	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>>toolBuilder (in category 'accessing') -----
+ toolBuilder
+ 	^toolBuilder!




More information about the Squeak-dev mailing list