[squeak-dev] The Trunk: Tools-ct.853.mcz

commits at source.squeak.org commits at source.squeak.org
Sun Aug 4 09:45:27 UTC 2019


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

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

Name: Tools-ct.853
Author: ct
Time: 7 July 2019, 7:58:37.726178 pm
UUID: a11f70d4-3f36-894a-89e7-78011f6ab2e2
Ancestors: Tools-ct.852

Refine styling in Inspector & Debugger

This commit is based on ToolBuilder-Morphic-ct.228 (#aboutToStyle:forMorph:).
- Introduce a state for Inspector (shouldStyleValuePane) that indicates whether to style the value pane
- Name the value pane to identify it
- Allow styling in every inspector window
- Refactor the debugger toolbuilding and refer to inspector's building methods (they shared many common properties)
Also see the following thread: http://forum.world.st/The-Inbox-Tools-ct-852-mcz-td5100784.html

=============== Diff against Tools-ct.851 ===============

Item was changed:
  ----- Method: Debugger>>buildFullWith: (in category 'toolbuilder') -----
  buildFullWith: builder
  	| windowSpec listSpec textSpec |
  	windowSpec := builder pluggableWindowSpec new
  		model: self;
  		label: 'Debugger';
  		children: OrderedCollection new.
  
  	listSpec := builder pluggableListSpec new.
  	listSpec 
  		model: self;
  		list: #contextStackList; 
  		getIndex: #contextStackIndex; 
  		setIndex: #toggleContextStackIndex:; 
  		menu: #contextStackMenu:shifted:; 
  		icon: #messageIconAt:;
  		helpItem: #messageHelpAt:;
  		keyPress: #contextStackKey:from:;
  		frame: (0 at 0 corner: 1 at 0.22).
  	windowSpec children add: listSpec.
  
  
  	textSpec := self buildCodePaneWith: builder.
  	textSpec frame: (0 at 0.22corner: 1 at 0.8).
  	windowSpec children add: textSpec.
  
+ 	listSpec := self receiverInspector buildFieldListWith: builder.
- 	listSpec := builder pluggableListSpec new.
  	listSpec 
- 		model: self receiverInspector;
- 		list: #fieldList; 
- 		getIndex: #selectionIndex; 
- 		setIndex: #toggleIndex:; 
- 		menu: #fieldListMenu:; 
- 		keyPress: #inspectorKey:from:;
  		frame: (0 at 0.8 corner: 0.2 at 1);
  		help: 'Receiver''s\Instance\Variables' withCRs.
  	windowSpec children add: listSpec.
  
+ 	textSpec := self receiverInspector buildValuePaneWith: builder.
- 	textSpec := builder pluggableTextSpec new.
  	textSpec 
- 		model: self receiverInspector;
- 		getText: #contents; 
- 		setText: #accept:; 
  		help: '<- Select receiver''s field' translated;
- 		selection: #contentsSelection; 
- 		menu: #codePaneMenu:shifted:;
  		frame: (0.2 at 0.8 corner: 0.5 at 1).
  	windowSpec children add: textSpec.
  
+ 	listSpec := self contextVariablesInspector buildFieldListWith: builder.
- 	listSpec := builder pluggableListSpec new.
  	listSpec 
- 		model: self contextVariablesInspector;
- 		list: #fieldList; 
- 		getIndex: #selectionIndex; 
- 		setIndex: #toggleIndex:; 
- 		menu: #fieldListMenu:; 
- 		keyPress: #inspectorKey:from:;
  		frame: (0.5 at 0.8 corner: 0.7 at 1);
  		help: 'Other\Context\Bindings' withCRs.
  	windowSpec children add: listSpec.
  
+ 	textSpec := self contextVariablesInspector buildValuePaneWith: builder.
- 	textSpec := builder pluggableTextSpec new.
  	textSpec 
- 		model: self contextVariablesInspector;
- 		getText: #contents; 
- 		setText: #accept:; 
  		help: '<- Select context''s field' translated;
- 		selection: #contentsSelection; 
- 		menu: #codePaneMenu:shifted:;
  		frame: (0.7 at 0.8 corner: 1 at 1).
  	windowSpec children add: textSpec.
  
  	^builder build: windowSpec!

Item was changed:
  StringHolder subclass: #Inspector
+ 	instanceVariableNames: 'object selectionIndex timeOfLastListUpdate selectionUpdateTime context expression shouldStyleValuePane'
- 	instanceVariableNames: 'object selectionIndex timeOfLastListUpdate selectionUpdateTime context expression'
  	classVariableNames: ''
  	poolDictionaries: ''
  	category: 'Tools-Inspector'!
  
  !Inspector commentStamp: '<historical>' prior: 0!
  I represent a query path into the internal representation of an object. As a StringHolder, the string I represent is the value of the currently selected variable of the observed object.!

Item was removed:
- ----- Method: Inspector>>aboutToStyle: (in category 'styling') -----
- aboutToStyle: aStyler
- 
- 	aStyler 
- 		classOrMetaClass: object class;
- 		parseAMethod: false.
- 	^true!

Item was added:
+ ----- Method: Inspector>>aboutToStyle:forMorph: (in category 'styling') -----
+ aboutToStyle: aStyler forMorph: aMorph
+ 
+ 	(aMorph knownName = #valuePane and: [shouldStyleValuePane not])
+ 		ifTrue: [^ false].
+ 	
+ 	aStyler 
+ 		classOrMetaClass: object class;
+ 		parseAMethod: false.
+ 	^true!

Item was changed:
  ----- Method: Inspector>>buildValuePaneWith: (in category 'toolbuilder') -----
  buildValuePaneWith: builder
  	| textSpec |
+ 	textSpec := builder pluggableCodePaneSpec new.
- 	textSpec := builder pluggableTextSpec new.
  	textSpec 
  		model: self;
+ 		name: #valuePane;
  		getText: #contents; 
  		setText: #accept:; 
+ 		editText: #typeValue:;
  		help: 'Selection details.';
  		selection: #contentsSelection; 
  		menu: #codePaneMenu:shifted:.
  	^textSpec!

Item was changed:
  ----- Method: Inspector>>initialize (in category 'initialize-release') -----
  initialize
  	
  	selectionIndex := 0.
+ 	shouldStyleValuePane := true.
  	super initialize!

Item was changed:
  ----- Method: Inspector>>toggleIndex: (in category 'selecting') -----
  toggleIndex: anInteger
  	"The receiver has a list of variables of its inspected object. One of these 
  	is selected. If anInteger is the index of this variable, then deselect it. 
  	Otherwise, make the variable whose index is anInteger be the selected 
  	item."
  
  	selectionUpdateTime := 0.
  	selectionIndex = anInteger
  		ifTrue: 
  			["same index, turn off selection"
  			selectionIndex := 0.
  			contents := '']
  		ifFalse:
  			["different index, new selection"
+ 			shouldStyleValuePane := false.
  			selectionIndex := anInteger.
  			self contentsIsString
  				ifTrue: [contents := self selection]
  				ifFalse: [contents := self selectionPrintString]].
  	self changed: #selection.
  	self changed: #contents.
  	self changed: #selectionIndex.!

Item was added:
+ ----- Method: Inspector>>typeValue: (in category 'selecting') -----
+ typeValue: aTextOrString
+ 
+ 	shouldStyleValuePane := true.
+ 	self changed: #style!



More information about the Squeak-dev mailing list