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

Marcel Taeumel marcel.taeumel at hpi.de
Tue Oct 8 07:01:03 UTC 2019


Hmm... there is already ObjectExplorer and InspectorBrowser. I like these ideas but they should manifest in a *new* tool. :-) Less interference with existing working habits that way.

Best,
Marcel
Am 07.10.2019 20:24:04 schrieb Chris Muller <asqueaker at gmail.com>:
Christoph, this is very nice, but I actually have (had?) plans to do a similar enhancement, only:

  - instead of the source code, show the result of evaluating the selected message.
  - The pane would show the printString of the result, but prefixed by a small embedded Morph (via TextAnchor) as the first character which, itself, can:

        - be clicked to open a new InspectorBrowser on that object, OR
        - dragged, (just as inspector variables can) as an argument to another binary or keyword selector in the messages pane of the same or other InspectorBrowser (enabling that result to be displayed and used, likewise)

I've always wanted Smalltalk's Inspector to be better at *working* with objects, instead of only inspecting their physical state and only allowing access via their API by typing expressions.  Smalltalk is overdue to have an "Object browser" for users that presents its API properly and usably.


Best,
  Chris


On Wed, Oct 2, 2019 at 4:21 PM Thiede, Christoph <Christoph.Thiede at student.hpi.uni-potsdam.de [mailto:Christoph.Thiede at student.hpi.uni-potsdam.de]> wrote:

Should all the removed methods here be to moved into *60Deprecated, or would you consider them an implementation detail?
Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org [mailto:squeak-dev-bounces at lists.squeakfoundation.org]> im Auftrag von commits at source.squeak.org [mailto:commits at source.squeak.org] <commits at source.squeak.org [mailto:commits at source.squeak.org]>
Gesendet: Mittwoch, 2. Oktober 2019 23:19:38
An: squeak-dev at lists.squeakfoundation.org [mailto:squeak-dev at lists.squeakfoundation.org]
Betreff: [squeak-dev] The Inbox: Tools-ct.901.mcz
 
A new version of Tools was added to project The Inbox:
http://source.squeak.org/inbox/Tools-ct.901.mcz [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!



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20191008/bca395f2/attachment.html>


More information about the Squeak-dev mailing list