The Trunk: Tools-mt.582.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Tools-mt.582.mcz

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

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

Name: Tools-mt.582
Author: mt
Time: 12 April 2015, 4:56:27.909 pm
UUID: 3ad55be5-74b1-f84f-98d1-b1cf671476d2
Ancestors: Tools-mt.581

Preserve expressions that were entered in the code pane in inspector/explorer when switching between those tools.

=============== Diff against Tools-mt.581 ===============

Item was changed:
  StringHolder subclass: #Inspector
+ instanceVariableNames: 'object selectionIndex timeOfLastListUpdate selectionUpdateTime context expression'
- instanceVariableNames: 'object selectionIndex timeOfLastListUpdate selectionUpdateTime context'
  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 changed:
  ----- Method: Inspector>>buildCodePaneWith: (in category 'toolbuilder') -----
  buildCodePaneWith: builder
  | textSpec |
  textSpec := builder pluggableTextSpec new.
  textSpec
  model: self;
+ getText: #expression;
+ editText: #expression:;
- getText: #trash;
- setText: #trash:;
  help: #helpText;
  selection: #contentsSelection;
  menu: #codePaneMenu:shifted:;
  askBeforeDiscardingEdits: false.
  ^textSpec!

Item was changed:
  ----- Method: Inspector>>exploreObject (in category 'toolbuilder') -----
  exploreObject
  "Switch to an explorer tool."
 
+ | window model |
+ window := self object explore.
+ model := window model.
+
+ model setExpression: self expression.
+ window bounds: self containingWindow bounds.
- self object explore
- bounds: self containingWindow bounds.
  self changed: #close.!

Item was added:
+ ----- Method: Inspector>>expression (in category 'accessing') -----
+ expression
+
+ ^ expression ifNil: ['']!

Item was added:
+ ----- Method: Inspector>>expression: (in category 'accessing') -----
+ expression: aString
+
+ expression := aString.!

Item was added:
+ ----- Method: Inspector>>setExpression: (in category 'code') -----
+ setExpression: aString
+
+ self expression: aString.
+ self changed: #expression.!

Item was changed:
  AbstractHierarchicalList subclass: #ObjectExplorer
+ instanceVariableNames: 'root currentParent inspector monitorList expression'
- instanceVariableNames: 'root currentParent inspector monitorList'
  classVariableNames: ''
  poolDictionaries: ''
  category: 'Tools-Explorer'!
 
  !ObjectExplorer commentStamp: '<historical>' prior: 0!
  ObjectExplorer provides a hierarchical alternative to #inspect. Simply evaluate an expression like:
 
  World explore
 
  and enjoy.!

Item was changed:
  ----- Method: ObjectExplorer>>buildWith: (in category 'toolbuilder') -----
  buildWith: builder
 
  | windowSpec treeSpec textSpec buttonSpec buttonOffset |
  windowSpec := builder pluggableWindowSpec new.
  windowSpec
  model: self;
  children: OrderedCollection new;
  label: #label;
  extent: self initialExtent.
 
  treeSpec := builder pluggableTreeSpec new.
  treeSpec
  model: self;
  nodeClass: self class nodeClass;
  roots: #getList;
  keyPress: #explorerKey:from:event:;
  getSelected: #currentSelection;
  setSelected: #currentSelection:;
  setSelectedParent: #currentParent:;
  menu: #genericMenu:;
  autoDeselect: false;
  columns: (ObjectExplorerWrapper showContentsInColumns
  ifTrue: [{
  [:listMorph | (listMorph filteredItems collect: [:item |
  item preferredWidthOfColumn: 1]) max].
  nil "take all the space"}]);
  frame: (0@0 corner: 1@0.75).
  windowSpec children add: treeSpec.
 
  buttonOffset := (Preferences standardButtonFont widthOfString: 'inspect') * 3/2.
 
  textSpec := builder pluggableTextSpec new.
  textSpec
  model: self;
+ getText: #expression;
+ editText: #expression:;
  menu: #codePaneMenu:shifted:;
  help: 'Evaluate expressions for the current tree selection...' translated;
  frame: (LayoutFrame fractions: (0@0.75 corner: 1@1) offsets: (0@0 corner: buttonOffset negated@0)).
  windowSpec children add: textSpec.
 
  buttonSpec := builder pluggableButtonSpec new
  model: self;
  label: 'inspect';
  action: #inspectObject;
  help: 'Switch to an inspector tool';
  frame: (LayoutFrame fractions: (1@0.75 corner: 1@1) offsets: (buttonOffset negated@0 corner: 0 @ 0)).
  windowSpec children add: buttonSpec.
 
  [^ builder build: windowSpec]
  ensure: [self changed: #expandRootsRequested]!

Item was added:
+ ----- Method: ObjectExplorer>>expression (in category 'accessing') -----
+ expression
+
+ ^ expression!

Item was added:
+ ----- Method: ObjectExplorer>>expression: (in category 'accessing') -----
+ expression: aString
+
+ expression := aString.!

Item was changed:
  ----- Method: ObjectExplorer>>inspectObject (in category 'toolbuilder') -----
  inspectObject
  "Switch to an inspector tool."
 
+ | window model |
+ window := self object inspect.
+ model := window model.
+
+ model setExpression: self expression.
+ window bounds: self containingWindow bounds.
- self object inspect
- bounds: self containingWindow bounds.
  self changed: #close.!

Item was added:
+ ----- Method: ObjectExplorer>>setExpression: (in category 'accessing - other') -----
+ setExpression: aString
+
+ self expression: aString.
+ self changed: #expression.!


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Tools-mt.582.mcz

Karl Ramberg
Hi,
You are making really nice enhancements :-)

BTW : Could we preserve the selection in the list as well ? 
Or are the list models too different for it to make sense ?
First level selection should probably work...

Karl



On Sun, Apr 12, 2015 at 4:56 PM, <[hidden email]> wrote:
Marcel Taeumel uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-mt.582.mcz

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

Name: Tools-mt.582
Author: mt
Time: 12 April 2015, 4:56:27.909 pm
UUID: 3ad55be5-74b1-f84f-98d1-b1cf671476d2
Ancestors: Tools-mt.581

Preserve expressions that were entered in the code pane in inspector/explorer when switching between those tools.

=============== Diff against Tools-mt.581 ===============

Item was changed:
  StringHolder subclass: #Inspector
+       instanceVariableNames: 'object selectionIndex timeOfLastListUpdate selectionUpdateTime context expression'
-       instanceVariableNames: 'object selectionIndex timeOfLastListUpdate selectionUpdateTime context'
        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 changed:
  ----- Method: Inspector>>buildCodePaneWith: (in category 'toolbuilder') -----
  buildCodePaneWith: builder
        | textSpec |
        textSpec := builder pluggableTextSpec new.
        textSpec
                model: self;
+               getText: #expression;
+               editText: #expression:;
-               getText: #trash;
-               setText: #trash:;
                help: #helpText;
                selection: #contentsSelection;
                menu: #codePaneMenu:shifted:;
                askBeforeDiscardingEdits: false.
        ^textSpec!

Item was changed:
  ----- Method: Inspector>>exploreObject (in category 'toolbuilder') -----
  exploreObject
        "Switch to an explorer tool."

+       | window model |
+       window := self object explore.
+       model := window model.
+
+       model setExpression: self expression.
+       window bounds: self containingWindow bounds.
-       self object explore
-               bounds: self containingWindow bounds.
        self changed: #close.!

Item was added:
+ ----- Method: Inspector>>expression (in category 'accessing') -----
+ expression
+
+       ^ expression ifNil: ['']!

Item was added:
+ ----- Method: Inspector>>expression: (in category 'accessing') -----
+ expression: aString
+
+       expression := aString.!

Item was added:
+ ----- Method: Inspector>>setExpression: (in category 'code') -----
+ setExpression: aString
+
+       self expression: aString.
+       self changed: #expression.!

Item was changed:
  AbstractHierarchicalList subclass: #ObjectExplorer
+       instanceVariableNames: 'root currentParent inspector monitorList expression'
-       instanceVariableNames: 'root currentParent inspector monitorList'
        classVariableNames: ''
        poolDictionaries: ''
        category: 'Tools-Explorer'!

  !ObjectExplorer commentStamp: '<historical>' prior: 0!
  ObjectExplorer provides a hierarchical alternative to #inspect. Simply evaluate an expression like:

  World explore

  and enjoy.!

Item was changed:
  ----- Method: ObjectExplorer>>buildWith: (in category 'toolbuilder') -----
  buildWith: builder

        | windowSpec treeSpec textSpec buttonSpec buttonOffset |
        windowSpec := builder pluggableWindowSpec new.
        windowSpec
                model: self;
                children: OrderedCollection new;
                label: #label;
                extent: self initialExtent.

        treeSpec := builder pluggableTreeSpec new.
        treeSpec
                model: self;
                nodeClass: self class nodeClass;
                roots: #getList;
                keyPress: #explorerKey:from:event:;
                getSelected: #currentSelection;
                setSelected: #currentSelection:;
                setSelectedParent: #currentParent:;
                menu: #genericMenu:;
                autoDeselect: false;
                columns: (ObjectExplorerWrapper showContentsInColumns
                        ifTrue: [{
                                [:listMorph | (listMorph filteredItems collect: [:item |
                                        item preferredWidthOfColumn: 1]) max].
                                nil "take all the space"}]);
                frame: (0@0 corner: 1@0.75).
        windowSpec children add: treeSpec.

        buttonOffset := (Preferences standardButtonFont widthOfString: 'inspect') * 3/2.

        textSpec := builder pluggableTextSpec new.
        textSpec
                model: self;
+               getText: #expression;
+               editText: #expression:;
                menu: #codePaneMenu:shifted:;
                help: 'Evaluate expressions for the current tree selection...' translated;
                frame: (LayoutFrame fractions: (0@0.75 corner: 1@1) offsets: (0@0 corner: buttonOffset negated@0)).
        windowSpec children add: textSpec.

        buttonSpec := builder pluggableButtonSpec new
                model: self;
                label: 'inspect';
                action: #inspectObject;
                help: 'Switch to an inspector tool';
                frame: (LayoutFrame fractions: (1@0.75 corner: 1@1) offsets: (buttonOffset negated@0 corner: 0 @ 0)).
        windowSpec children add: buttonSpec.

        [^ builder build: windowSpec]
                ensure: [self changed: #expandRootsRequested]!

Item was added:
+ ----- Method: ObjectExplorer>>expression (in category 'accessing') -----
+ expression
+
+       ^ expression!

Item was added:
+ ----- Method: ObjectExplorer>>expression: (in category 'accessing') -----
+ expression: aString
+
+       expression := aString.!

Item was changed:
  ----- Method: ObjectExplorer>>inspectObject (in category 'toolbuilder') -----
  inspectObject
        "Switch to an inspector tool."

+       | window model |
+       window := self object inspect.
+       model := window model.
+
+       model setExpression: self expression.
+       window bounds: self containingWindow bounds.
-       self object inspect
-               bounds: self containingWindow bounds.
        self changed: #close.!

Item was added:
+ ----- Method: ObjectExplorer>>setExpression: (in category 'accessing - other') -----
+ setExpression: aString
+
+       self expression: aString.
+       self changed: #expression.!





Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Tools-mt.582.mcz

Karl Ramberg
Hmm. 
I seems when you click explore/ inspect the current selection you "jump up" a level and then you lose the inspector/ explorer for the object you had in the previous tool.

Eg:
Inspect a object. 
Select it's instance variable
Click Explore
A explorer for the instance variable opens
You can't go back to original object

Karl


On Sun, Apr 12, 2015 at 6:27 PM, karl ramberg <[hidden email]> wrote:
Hi,
You are making really nice enhancements :-)

BTW : Could we preserve the selection in the list as well ? 
Or are the list models too different for it to make sense ?
First level selection should probably work...

Karl



On Sun, Apr 12, 2015 at 4:56 PM, <[hidden email]> wrote:
Marcel Taeumel uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-mt.582.mcz

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

Name: Tools-mt.582
Author: mt
Time: 12 April 2015, 4:56:27.909 pm
UUID: 3ad55be5-74b1-f84f-98d1-b1cf671476d2
Ancestors: Tools-mt.581

Preserve expressions that were entered in the code pane in inspector/explorer when switching between those tools.

=============== Diff against Tools-mt.581 ===============

Item was changed:
  StringHolder subclass: #Inspector
+       instanceVariableNames: 'object selectionIndex timeOfLastListUpdate selectionUpdateTime context expression'
-       instanceVariableNames: 'object selectionIndex timeOfLastListUpdate selectionUpdateTime context'
        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 changed:
  ----- Method: Inspector>>buildCodePaneWith: (in category 'toolbuilder') -----
  buildCodePaneWith: builder
        | textSpec |
        textSpec := builder pluggableTextSpec new.
        textSpec
                model: self;
+               getText: #expression;
+               editText: #expression:;
-               getText: #trash;
-               setText: #trash:;
                help: #helpText;
                selection: #contentsSelection;
                menu: #codePaneMenu:shifted:;
                askBeforeDiscardingEdits: false.
        ^textSpec!

Item was changed:
  ----- Method: Inspector>>exploreObject (in category 'toolbuilder') -----
  exploreObject
        "Switch to an explorer tool."

+       | window model |
+       window := self object explore.
+       model := window model.
+
+       model setExpression: self expression.
+       window bounds: self containingWindow bounds.
-       self object explore
-               bounds: self containingWindow bounds.
        self changed: #close.!

Item was added:
+ ----- Method: Inspector>>expression (in category 'accessing') -----
+ expression
+
+       ^ expression ifNil: ['']!

Item was added:
+ ----- Method: Inspector>>expression: (in category 'accessing') -----
+ expression: aString
+
+       expression := aString.!

Item was added:
+ ----- Method: Inspector>>setExpression: (in category 'code') -----
+ setExpression: aString
+
+       self expression: aString.
+       self changed: #expression.!

Item was changed:
  AbstractHierarchicalList subclass: #ObjectExplorer
+       instanceVariableNames: 'root currentParent inspector monitorList expression'
-       instanceVariableNames: 'root currentParent inspector monitorList'
        classVariableNames: ''
        poolDictionaries: ''
        category: 'Tools-Explorer'!

  !ObjectExplorer commentStamp: '<historical>' prior: 0!
  ObjectExplorer provides a hierarchical alternative to #inspect. Simply evaluate an expression like:

  World explore

  and enjoy.!

Item was changed:
  ----- Method: ObjectExplorer>>buildWith: (in category 'toolbuilder') -----
  buildWith: builder

        | windowSpec treeSpec textSpec buttonSpec buttonOffset |
        windowSpec := builder pluggableWindowSpec new.
        windowSpec
                model: self;
                children: OrderedCollection new;
                label: #label;
                extent: self initialExtent.

        treeSpec := builder pluggableTreeSpec new.
        treeSpec
                model: self;
                nodeClass: self class nodeClass;
                roots: #getList;
                keyPress: #explorerKey:from:event:;
                getSelected: #currentSelection;
                setSelected: #currentSelection:;
                setSelectedParent: #currentParent:;
                menu: #genericMenu:;
                autoDeselect: false;
                columns: (ObjectExplorerWrapper showContentsInColumns
                        ifTrue: [{
                                [:listMorph | (listMorph filteredItems collect: [:item |
                                        item preferredWidthOfColumn: 1]) max].
                                nil "take all the space"}]);
                frame: (0@0 corner: 1@0.75).
        windowSpec children add: treeSpec.

        buttonOffset := (Preferences standardButtonFont widthOfString: 'inspect') * 3/2.

        textSpec := builder pluggableTextSpec new.
        textSpec
                model: self;
+               getText: #expression;
+               editText: #expression:;
                menu: #codePaneMenu:shifted:;
                help: 'Evaluate expressions for the current tree selection...' translated;
                frame: (LayoutFrame fractions: (0@0.75 corner: 1@1) offsets: (0@0 corner: buttonOffset negated@0)).
        windowSpec children add: textSpec.

        buttonSpec := builder pluggableButtonSpec new
                model: self;
                label: 'inspect';
                action: #inspectObject;
                help: 'Switch to an inspector tool';
                frame: (LayoutFrame fractions: (1@0.75 corner: 1@1) offsets: (buttonOffset negated@0 corner: 0 @ 0)).
        windowSpec children add: buttonSpec.

        [^ builder build: windowSpec]
                ensure: [self changed: #expandRootsRequested]!

Item was added:
+ ----- Method: ObjectExplorer>>expression (in category 'accessing') -----
+ expression
+
+       ^ expression!

Item was added:
+ ----- Method: ObjectExplorer>>expression: (in category 'accessing') -----
+ expression: aString
+
+       expression := aString.!

Item was changed:
  ----- Method: ObjectExplorer>>inspectObject (in category 'toolbuilder') -----
  inspectObject
        "Switch to an inspector tool."

+       | window model |
+       window := self object inspect.
+       model := window model.
+
+       model setExpression: self expression.
+       window bounds: self containingWindow bounds.
-       self object inspect
-               bounds: self containingWindow bounds.
        self changed: #close.!

Item was added:
+ ----- Method: ObjectExplorer>>setExpression: (in category 'accessing - other') -----
+ setExpression: aString
+
+       self expression: aString.
+       self changed: #expression.!






Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Tools-mt.582.mcz

marcel.taeumel (old)
Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Tools-mt.582.mcz

Karl Ramberg
Great

Karl

On Sun, Apr 12, 2015 at 9:18 PM, Marcel Taeumel <[hidden email]> wrote:
Thanks. :)

http://forum.world.st/The-Trunk-Tools-mt-586-mcz-td4819216.html

Best,
Marcel



--
View this message in context: http://forum.world.st/The-Trunk-Tools-mt-582-mcz-tp4819168p4819217.html
Sent from the Squeak - Dev mailing list archive at Nabble.com.