[squeak-dev] The Inbox: Tools-ct.901.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Oct 2 21:19:38 UTC 2019


A new version of Tools was added to project The Inbox:
http://source.squeak.org/inbox/Tools-ct.901.mcz

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

Name: Tools-ct.901
Author: ct
Time: 2 October 2019, 11:19:39.149682 pm
UUID: 2641031f-a660-7642-8fae-5f415cf51f6d
Ancestors: Tools-ul.899

Deduplicates the InspectorBrowser by adapting to a real Browser and respecting to super. This also enhances look + functionality noticeably. Increases initialExtent for a nicer sight.

You can open an InspectorBrowser by doing:
InspectorBrowser openOn: Morph new.

=============== Diff against Tools-ul.899 ===============

Item was changed:
  Inspector subclass: #InspectorBrowser
+ 	instanceVariableNames: 'browser'
- 	instanceVariableNames: 'fieldList msgList msgListIndex'
  	classVariableNames: ''
  	poolDictionaries: ''
  	category: 'Tools-Inspector'!
  
  !InspectorBrowser commentStamp: 'tcj 3/12/2018 07:55' prior: 0!
  I am an inspector that also shows all messages the inspected objects can understand. I combine inspector and code browser.
  
  InspectorBrowser openOn: Smalltalk!

Item was added:
+ ----- Method: InspectorBrowser>>browser (in category 'initialize-release') -----
+ browser
+ 
+ 	^ browser ifNil: [browser := Browser new]!

Item was changed:
+ ----- Method: InspectorBrowser>>buildWith: (in category 'toolbuilder') -----
- ----- Method: InspectorBrowser>>buildWith: (in category 'tool builder') -----
  buildWith: builder
  
+ 	| windowSpec |
+ 	windowSpec := self buildWindowWith: builder specs: {
+ 		(0 at 0 corner: 0.3 at 0.3) -> [self buildFieldListWith: builder].
+ 		(0.3 at 0 corner: 1.0 at 0.3) -> [self buildValuePaneWith: builder].
+ 		(0 at 0.3 corner: 0.3 at 1.0) -> [browser buildMessageListWith: builder].
+ 		(0.3 at 0.3 corner: 1.0 at 1.0) -> [browser buildCodePaneWith: builder].
+ 	}.
+ 	^ builder build: windowSpec!
- 	| window fieldSpec valueSpec msgSpec codeSpec |
- 	
- 	window := builder pluggableWindowSpec new
- 		model: self;
- 		children: OrderedCollection new;
- 		yourself.
- 		
- 	fieldSpec := builder pluggableListSpec new
- 		model: self;
- 		list: #fieldList;
- 		getIndex: #selectionIndex;
- 		setIndex: #toggleIndex:;
- 		menu: #fieldListMenu:;
- 		frame: (0 at 0 corner: 0.3 at 0.5).
- 	
- 	valueSpec := builder pluggableTextSpec new
- 		model: self;
- 		getText: #contents;
- 		setText: #accept:;
- 		menu: #codePaneMenu:shifted:;
- 		frame: (0.3 at 0 corner: 1.0 at 0.5).
- 
- 	msgSpec := builder pluggableListSpec new
- 		model: self;
- 		list: #msgList;
- 		getIndex: #msgListIndex;
- 		setIndex: #msgListIndex:;
- 		menu: #msgListMenu;
- 		frame: (0 at 0.5 corner: 0.3 at 1.0).
- 		
- 	codeSpec := builder pluggableTextSpec new
- 		model: self;
- 		getText: #msgText;
- 		setText: #msgAccept:from:;
- 		menu: #msgPaneMenu:shifted:;
- 		frame: (0.3 at 0.5 corner: 1.0 at 1.0).
- 	
- 	window children addAll: {fieldSpec. valueSpec. msgSpec. codeSpec}.
- 	^ builder build: window!

Item was removed:
- ----- Method: InspectorBrowser>>fieldList (in category 'accessing') -----
- fieldList
- 	fieldList ifNotNil: [^ fieldList].
- 	^ (fieldList := super fieldList)!

Item was added:
+ ----- Method: InspectorBrowser>>initialExtent (in category 'toolbuilder') -----
+ initialExtent
+ 
+ 	^ super initialExtent * 3/2!

Item was removed:
- ----- Method: InspectorBrowser>>initialize (in category 'initialize-release') -----
- initialize
- 
- 	super initialize.
- 	fieldList := nil.
- 	msgListIndex := 0.
- 	self changed: #msgText
- !

Item was changed:
  ----- Method: InspectorBrowser>>inspect: (in category 'initialize-release') -----
  inspect: anObject 
  	"Initialize the receiver so that it is inspecting anObject. There is no current selection.
  	Overriden so that my class is not changed to 'anObject inspectorClass'."
  	
  	object := anObject.
+ 	self browser selectClass: anObject class.
  	self initialize
  !

Item was removed:
- ----- Method: InspectorBrowser>>msgAccept:from: (in category 'messages') -----
- msgAccept: newText from: editor
- 	| category |
- 	category := msgListIndex = 0
- 		ifTrue: [ClassOrganizer default]
- 		ifFalse: [object class organization categoryOfElement: (msgList at: msgListIndex)].
- 	^ (object class compile: newText classified: category notifying: editor) ~~ nil!

Item was removed:
- ----- Method: InspectorBrowser>>msgList (in category 'messages') -----
- msgList
- 
- 	^msgList ifNil: [ msgList := object class selectors sort ]!

Item was removed:
- ----- Method: InspectorBrowser>>msgListIndex (in category 'messages') -----
- msgListIndex 
- 	^msgListIndex!

Item was removed:
- ----- Method: InspectorBrowser>>msgListIndex: (in category 'messages') -----
- msgListIndex: anInteger
- 	"A selection has been made in the message pane"
- 
- 	msgListIndex := anInteger.
- 	self changed: #msgText.!

Item was removed:
- ----- Method: InspectorBrowser>>msgListMenu: (in category 'messages') -----
- msgListMenu: aMenu 
- 	^ aMenu labels: 'Not yet implemented' lines: #(0) selections: #(flash)!

Item was removed:
- ----- Method: InspectorBrowser>>msgPaneMenu:shifted: (in category 'messages') -----
- msgPaneMenu: aMenu shifted: shifted
- 	^ aMenu labels: 
- 'find... (f)
- find again (g)
- find and replace...
- do/replace again (j)
- undo (z)
- redo (Z)
- copy (c)
- cut (x)
- paste (v)
- do it (d)
- print it (p)
- inspect it (i)
- accept (s)
- cancel (l)' 
- 		lines: #(0 4 6 9 12)
- 		selections: #(find findAgain findReplace again undo redo copySelection cut paste doIt printIt inspectIt accept cancel)!

Item was removed:
- ----- Method: InspectorBrowser>>msgText (in category 'messages') -----
- msgText
- 	msgListIndex = 0 ifTrue: [^ nil].
- 	^ object class sourceCodeAt: (msgList at: msgListIndex)!

Item was removed:
- ----- Method: InspectorBrowser>>step (in category 'stepping and presenter') -----
- step
- 	| list fieldString msg |
- 	(list := super fieldList) = fieldList ifFalse:
- 		[fieldString := selectionIndex > 0 ifTrue: [fieldList at: selectionIndex] ifFalse: [nil].
- 		fieldList := list.
- 		selectionIndex := fieldList indexOf: fieldString.
- 		self changed: #fieldList.
- 		self changed: #selectionIndex].
- 	list := msgList.  msgList := nil.  "force recomputation"
- 		list = self msgList ifFalse:
- 		[msg := msgListIndex > 0 ifTrue: [list at: msgListIndex] ifFalse: [nil].
- 		msgListIndex := msgList indexOf: msg.
- 		self changed: #msgList.
- 		self changed: #msgListIndex].
- 	super step!

Item was added:
+ ----- Method: InspectorBrowser>>stepAt:in: (in category 'stepping and presenter') -----
+ stepAt: millisecondClockValue in: aWindow
+ 	
+ 	super stepAt: millisecondClockValue in: aWindow.
+ 	browser stepAt: millisecondClockValue in: aWindow.!

Item was removed:
- ----- Method: InspectorBrowser>>wantsSteps (in category 'accessing') -----
- wantsSteps
- 	^ true!



More information about the Squeak-dev mailing list