Ver código fonte

Dive and refresh works. Self is the selected instVar. Inspecting evaluated code works (opens a new inspector on the result).

Sebastian Sastre 11 anos atrás
pai
commit
535871eef9

+ 15 - 0
js/Helios-Inspector.deploy.js

@@ -279,6 +279,9 @@ $1=smalltalk.send(smalltalk.send(self,"_variables",[]),"_announcer",[]);
 smalltalk.send($1,"_on_do_",[(smalltalk.HLRefreshRequested || HLRefreshRequested),(function(ann){
 return smalltalk.send(self,"_onRefresh",[]);
 })]);
+smalltalk.send($1,"_on_do_",[(smalltalk.HLDiveRequested || HLDiveRequested),(function(){
+return smalltalk.send(self,"_onDive",[]);
+})]);
 $2=smalltalk.send($1,"_yourself",[]);
 $3=smalltalk.send(smalltalk.send(self,"_model",[]),"_announcer",[]);
 smalltalk.send($3,"_on_do_",[(smalltalk.HLInstanceVariableSelected || HLInstanceVariableSelected),(function(ann){
@@ -289,6 +292,17 @@ return self}
 }),
 smalltalk.HLInspector);
 
+smalltalk.addMethod(
+"_onDive",
+smalltalk.method({
+selector: "onDive",
+fn: function (){
+var self=this;
+smalltalk.send(self,"_inspect_",[smalltalk.send(smalltalk.send(self,"_model",[]),"_selectedInstVarObject",[])]);
+return self}
+}),
+smalltalk.HLInspector);
+
 smalltalk.addMethod(
 "_onDoIt",
 smalltalk.method({
@@ -326,6 +340,7 @@ smalltalk.method({
 selector: "onInstanceVariableSelected",
 fn: function (){
 var self=this;
+smalltalk.send(smalltalk.send(self,"_code",[]),"_receiver_",[smalltalk.send(smalltalk.send(self,"_model",[]),"_selectedInstVarObject",[])]);
 smalltalk.send(self,"_refreshDisplay",[]);
 return self}
 }),

+ 26 - 6
js/Helios-Inspector.js

@@ -370,6 +370,9 @@ $1=smalltalk.send(smalltalk.send(self,"_variables",[]),"_announcer",[]);
 smalltalk.send($1,"_on_do_",[(smalltalk.HLRefreshRequested || HLRefreshRequested),(function(ann){
 return smalltalk.send(self,"_onRefresh",[]);
 })]);
+smalltalk.send($1,"_on_do_",[(smalltalk.HLDiveRequested || HLDiveRequested),(function(){
+return smalltalk.send(self,"_onDive",[]);
+})]);
 $2=smalltalk.send($1,"_yourself",[]);
 $3=smalltalk.send(smalltalk.send(self,"_model",[]),"_announcer",[]);
 smalltalk.send($3,"_on_do_",[(smalltalk.HLInstanceVariableSelected || HLInstanceVariableSelected),(function(ann){
@@ -378,9 +381,25 @@ return smalltalk.send(self,"_onInstanceVariableSelected",[]);
 $4=smalltalk.send($3,"_yourself",[]);
 return self},
 args: [],
-source: "observeVariables\x0a\x0a\x09self variables announcer \x0a    \x09on: HLRefreshRequested do:[:ann| self onRefresh];\x0a        yourself.\x0a\x0a\x09self model announcer\x0a        on: HLInstanceVariableSelected do:[:ann| self onInstanceVariableSelected];\x0a        yourself.\x0a        ",
-messageSends: ["on:do:", "onRefresh", "announcer", "variables", "yourself", "onInstanceVariableSelected", "model"],
-referencedClasses: ["HLRefreshRequested", "HLInstanceVariableSelected"]
+source: "observeVariables\x0a\x0a\x09self variables announcer \x0a    \x09on: HLRefreshRequested do:[:ann| self onRefresh];\x0a        on: HLDiveRequested do:[self onDive];\x0a        yourself.\x0a\x0a\x09self model announcer\x0a        on: HLInstanceVariableSelected do:[:ann| self onInstanceVariableSelected];\x0a        yourself.\x0a        ",
+messageSends: ["on:do:", "onRefresh", "announcer", "variables", "onDive", "yourself", "onInstanceVariableSelected", "model"],
+referencedClasses: ["HLRefreshRequested", "HLDiveRequested", "HLInstanceVariableSelected"]
+}),
+smalltalk.HLInspector);
+
+smalltalk.addMethod(
+"_onDive",
+smalltalk.method({
+selector: "onDive",
+category: 'reactions',
+fn: function (){
+var self=this;
+smalltalk.send(self,"_inspect_",[smalltalk.send(smalltalk.send(self,"_model",[]),"_selectedInstVarObject",[])]);
+return self},
+args: [],
+source: "onDive\x0a\x0a\x09self inspect: self model selectedInstVarObject",
+messageSends: ["inspect:", "selectedInstVarObject", "model"],
+referencedClasses: []
 }),
 smalltalk.HLInspector);
 
@@ -437,11 +456,12 @@ selector: "onInstanceVariableSelected",
 category: 'reactions',
 fn: function (){
 var self=this;
+smalltalk.send(smalltalk.send(self,"_code",[]),"_receiver_",[smalltalk.send(smalltalk.send(self,"_model",[]),"_selectedInstVarObject",[])]);
 smalltalk.send(self,"_refreshDisplay",[]);
 return self},
 args: [],
-source: "onInstanceVariableSelected\x0a\x0a\x09self refreshDisplay",
-messageSends: ["refreshDisplay"],
+source: "onInstanceVariableSelected\x0a\x0a\x09self code receiver: self model selectedInstVarObject.\x0a\x09self refreshDisplay",
+messageSends: ["receiver:", "selectedInstVarObject", "model", "code", "refreshDisplay"],
 referencedClasses: []
 }),
 smalltalk.HLInspector);
@@ -1057,7 +1077,7 @@ var self=this;
 smalltalk.send(self,"_selection_",[anInstVarName]);
 return self},
 args: ["anInstVarName"],
-source: "selectedInstVar: anInstVarName\x0a\x0a    self selection: anInstVarName\x0a\x0a\x09\x22self selection: (self variables keyAtValue: anInstVarObject)\x22",
+source: "selectedInstVar: anInstVarName\x0a\x0a    self selection: anInstVarName",
 messageSends: ["selection:"],
 referencedClasses: []
 }),

+ 2 - 4
js/Helios-Workspace.deploy.js

@@ -250,11 +250,9 @@ smalltalk.method({
 selector: "inspectIt",
 fn: function (){
 var self=this;
-var result;
 var newInspector;
-result=smalltalk.send(self,"_doIt",[]);
 smalltalk.send(smalltalk.send(self,"_announcer",[]),"_announce_",[smalltalk.send((smalltalk.HLInspectItRequested || HLInspectItRequested),"_on_",[self["@model"]])]);
-newInspector=smalltalk.send(self,"_makeInspectorOn_",[result]);
+newInspector=smalltalk.send(self,"_makeInspectorOn_",[smalltalk.send(self,"_doIt",[])]);
 smalltalk.send(newInspector,"_open",[]);
 return self}
 }),
@@ -268,7 +266,7 @@ fn: function (anObject){
 var self=this;
 var $2,$3,$1;
 $2=smalltalk.send((smalltalk.HLInspector || HLInspector),"_new",[]);
-smalltalk.send($2,"_inspect_",[self]);
+smalltalk.send($2,"_inspect_",[anObject]);
 $3=smalltalk.send($2,"_yourself",[]);
 $1=$3;
 return $1;

+ 5 - 7
js/Helios-Workspace.js

@@ -341,16 +341,14 @@ selector: "inspectIt",
 category: 'actions',
 fn: function (){
 var self=this;
-var result;
 var newInspector;
-result=smalltalk.send(self,"_doIt",[]);
 smalltalk.send(smalltalk.send(self,"_announcer",[]),"_announce_",[smalltalk.send((smalltalk.HLInspectItRequested || HLInspectItRequested),"_on_",[self["@model"]])]);
-newInspector=smalltalk.send(self,"_makeInspectorOn_",[result]);
+newInspector=smalltalk.send(self,"_makeInspectorOn_",[smalltalk.send(self,"_doIt",[])]);
 smalltalk.send(newInspector,"_open",[]);
 return self},
 args: [],
-source: "inspectIt\x0a\x0a\x09| result newInspector |\x0a\x0a\x09result:=  self doIt.\x0a       \x0a\x09self announcer announce: (HLInspectItRequested on: model).\x0a\x09newInspector := self makeInspectorOn: result.\x0a\x09newInspector open",
-messageSends: ["doIt", "announce:", "on:", "announcer", "makeInspectorOn:", "open"],
+source: "inspectIt\x0a\x0a\x09| newInspector |\x0a       \x0a\x09self announcer announce: (HLInspectItRequested on: model).\x0a\x09newInspector := self makeInspectorOn: self doIt.\x0a\x09newInspector open",
+messageSends: ["announce:", "on:", "announcer", "makeInspectorOn:", "doIt", "open"],
 referencedClasses: ["HLInspectItRequested"]
 }),
 smalltalk.HLCodeWidget);
@@ -364,13 +362,13 @@ fn: function (anObject){
 var self=this;
 var $2,$3,$1;
 $2=smalltalk.send((smalltalk.HLInspector || HLInspector),"_new",[]);
-smalltalk.send($2,"_inspect_",[self]);
+smalltalk.send($2,"_inspect_",[anObject]);
 $3=smalltalk.send($2,"_yourself",[]);
 $1=$3;
 return $1;
 },
 args: ["anObject"],
-source: "makeInspectorOn: anObject\x0a\x0a\x09^ HLInspector new \x0a\x09\x09inspect: self;\x0a\x09\x09yourself",
+source: "makeInspectorOn: anObject\x0a\x0a\x09^ HLInspector new \x0a\x09\x09inspect: anObject;\x0a\x09\x09yourself",
 messageSends: ["inspect:", "new", "yourself"],
 referencedClasses: ["HLInspector"]
 }),

+ 7 - 2
st/Helios-Inspector.st

@@ -107,6 +107,7 @@ observeVariables
 
 	self variables announcer 
     	on: HLRefreshRequested do:[:ann| self onRefresh];
+        on: HLDiveRequested do:[self onDive];
         yourself.
 
 	self model announcer
@@ -169,6 +170,11 @@ initializeVariables
 
 !HLInspector methodsFor: 'reactions'!
 
+onDive
+
+	self inspect: self model selectedInstVarObject
+!
+
 onDoIt
 !
 
@@ -182,6 +188,7 @@ onInspectIt
 
 onInstanceVariableSelected
 
+	self code receiver: self model selectedInstVarObject.
 	self refreshDisplay
 !
 
@@ -344,8 +351,6 @@ instVarObjectAt: anInstVarName
 selectedInstVar: anInstVarName
 
     self selection: anInstVarName
-
-	"self selection: (self variables keyAtValue: anInstVarObject)"
 !
 
 subscribe: aWidget

+ 3 - 5
st/Helios-Workspace.st

@@ -158,19 +158,17 @@ focus
 
 inspectIt
 
-	| result newInspector |
-
-	result:=  self doIt.
+	| newInspector |
        
 	self announcer announce: (HLInspectItRequested on: model).
-	newInspector := self makeInspectorOn: result.
+	newInspector := self makeInspectorOn: self doIt.
 	newInspector open
 !
 
 makeInspectorOn: anObject
 
 	^ HLInspector new 
-		inspect: self;
+		inspect: anObject;
 		yourself
 !