[squeak-dev] The Trunk: Tools-nice.342.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Apr 20 00:15:06 UTC 2011


Nicolas Cellier uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-nice.342.mcz

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

Name: Tools-nice.342
Author: nice
Time: 20 April 2011, 2:14:29.495 am
UUID: af1dfe52-e9dd-46b4-bf53-13648c681443
Ancestors: Tools-cmm.341

Add a menu to inspect Workspace variables
Also always initialize the bindings ivar.
Remove protection against uninitialized bindings.

Note: no precaution was taken to initialize uninitialized bindings of already opened Workspace.
If you ever experience trouble while evaluating in an already opened Workspace, just select 'reset variables' in the command menu (white triangle in blue window smarties)

=============== Diff against Tools-cmm.341 ===============

Item was changed:
+ ----- Method: Workspace>>acceptDroppedMorphsWording (in category 'drag and drop') -----
- ----- Method: Workspace>>acceptDroppedMorphsWording (in category 'as yet unclassified') -----
  acceptDroppedMorphsWording
  
  	^ self acceptsDroppingMorphForReference
  		ifTrue: ['<yes> create textual references to dropped morphs' translated]
  		ifFalse: ['<no> create textual references to dropped morphs' translated]
  !

Item was changed:
  ----- Method: Workspace>>addModelItemsToWindowMenu: (in category 'menu commands') -----
  addModelItemsToWindowMenu: aMenu 
  	
  	aMenu addLine.
  	aMenu
  		add: 'save contents to file...'
  		target: self
  		action: #saveContentsInFile.
  	aMenu
+ 		add: 'inspect variables'
+ 		target: self
+ 		action: #inspectBindings.
+ 	aMenu
  		add: 'reset variables'
  		target: self
  		action: #initializeBindings.
  	aMenu
  		addUpdating: #mustDeclareVariableWording
  		target: self
  		action: #toggleVariableDeclarationMode.
  	aMenu
  		addUpdating: #acceptDroppedMorphsWording
  		target: self
  		action: #toggleDroppingMorphForReference.
  
  	self addToggleStylingMenuItemTo: aMenu.
  !

Item was changed:
  ----- Method: Workspace>>bindingOf: (in category 'binding') -----
  bindingOf: aString 
  	mustDeclareVariables ifTrue: [^ nil].
  	"I want to have workspace that force the user to declare  
  	variables. Still subclasses may want to do something else"
- 	bindings ifNil: [self initializeBindings].
  	(bindings includesKey: aString) ifFalse: [
+ 		(self lookupInPools: aString)
+ 			ifNotNil: [:val |
- 		| val |
- 		val := self lookupInPools: aString.
- 		val 
- 			ifNotNil: [
  				"Caveat: since we're not inserting the pool's Association into
  				 the dictionary, assigning a new value to the variable will only
  				 affect the one Workspace (i.e. you can't assign to a variable in a
  				 SharedPool)."
  				bindings at: aString put: val]
  			ifNil: [aString first isUppercase
  					ifTrue: [^nil]
  					ifFalse: [bindings at: aString put: nil]]
  	].
  	^ bindings associationAt: aString!

Item was changed:
  ----- Method: Workspace>>hasBindingOf: (in category 'binding') -----
  hasBindingOf: aString 
+ 	^bindings includesKey: aString!
- 	
- 	^bindings notNil and: [ bindings includesKey: aString ]!

Item was changed:
  ----- Method: Workspace>>initialize (in category 'initialize-release') -----
  initialize
  	
  	super initialize.
+ 	self initializeBindings.
  	acceptDroppedMorphs := false.
  	mustDeclareVariables := false!

Item was added:
+ ----- Method: Workspace>>inspectBindings (in category 'binding') -----
+ inspectBindings
+ 	
+ 	bindings inspect!

Item was changed:
+ ----- Method: Workspace>>saveContentsInFile (in category 'menu commands') -----
- ----- Method: Workspace>>saveContentsInFile (in category 'as yet unclassified') -----
  saveContentsInFile
  	"Pass along this message to the controller or morph.  (Possibly this Workspace menu item could be deleted, since it's now in the text menu.)"
  
  	self changed: #saveContents
  !




More information about the Squeak-dev mailing list