[squeak-dev] The Trunk: Tools-mt.1074.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Nov 25 10:44:04 UTC 2021


Marcel Taeumel uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-mt.1074.mcz

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

Name: Tools-mt.1074
Author: mt
Time: 25 November 2021, 11:44:01.944354 am
UUID: 39954290-b416-f242-a5b0-c7aea0e3c6a6
Ancestors: Tools-mt.1073

Adds a property protocol to Workspace to avoid having to go through #containingWindow to store extra stuff, which does not even work for MVC, just for morphs (i.e., SystemWindow, not StandardSystemView). Reuses a workspace's "bindings" with each property being prefixed with a "_" to not interfere with regular bindings.

Note that such extra properties have already been added to #containingWindow in the past.

=============== Diff against Tools-mt.1073 ===============

Item was added:
+ ----- Method: Workspace>>hasProperty: (in category 'binding - properties') -----
+ hasProperty: aSymbol
+ 
+ 	| propertyValue |
+ 	propertyValue := self valueOfProperty: aSymbol.
+ 	propertyValue ifNil: [^ false].
+ 	propertyValue == false ifTrue: [^ false].
+ 	^ true!

Item was changed:
  ----- Method: Workspace>>initialize (in category 'initialize-release') -----
  initialize
  	
  	super initialize.
+ 	bindings := Dictionary new.
- 	self initializeBindings.
  	acceptDroppedMorphs := false.
  	mustDeclareVariables := self class declareVariablesAutomatically not.
  	environment := Environment current!

Item was removed:
- ----- Method: Workspace>>initializeBindings (in category 'binding') -----
- initializeBindings
- 	
- 	bindings := Dictionary new!

Item was added:
+ ----- Method: Workspace>>removeProperty: (in category 'binding - properties') -----
+ removeProperty: aSymbol
+ 
+ 	bindings removeKey: ('_', aSymbol) asSymbol ifAbsent: [].!

Item was added:
+ ----- Method: Workspace>>resetBindings (in category 'binding') -----
+ resetBindings
+ 	"Remove all bindings that are not prefixed with an $_. See #setProperty:toValue:."
+ 
+ 	bindings keysAndValuesRemove: [:key :value | key first ~= $_]!

Item was added:
+ ----- Method: Workspace>>setProperty:toValue: (in category 'binding - properties') -----
+ setProperty: aSymbol toValue: anObject
+ 
+ 	anObject ifNil: [^ self removeProperty: aSymbol].
+ 	bindings at: ('_', aSymbol) asSymbol put: anObject.!

Item was added:
+ ----- Method: Workspace>>valueOfProperty: (in category 'binding - properties') -----
+ valueOfProperty: aSymbol
+ 
+ 	^ self valueOfProperty: aSymbol ifAbsent: nil!

Item was added:
+ ----- Method: Workspace>>valueOfProperty:ifAbsent: (in category 'binding - properties') -----
+ valueOfProperty: aSymbol ifAbsent: aBlock
+ 
+ 	^ bindings at: ('_', aSymbol) asSymbol ifAbsent: aBlock!



More information about the Squeak-dev mailing list