Browse Source

Inspector shows instVars list by now

Sebastian Sastre 11 năm trước cách đây
mục cha
commit
ee55b7076e

+ 9 - 0
js/Helios-Announcements.deploy.js

@@ -52,6 +52,9 @@ smalltalk.addClass('HLInspectItRequested', smalltalk.HLCodeHandled, [], 'Helios-
 smalltalk.addClass('HLPrintItRequested', smalltalk.HLCodeHandled, [], 'Helios-Announcements');
 
 
+smalltalk.addClass('HLDiveRequested', smalltalk.HLAnnouncement, [], 'Helios-Announcements');
+
+
 smalltalk.addClass('HLItemSelected', smalltalk.HLAnnouncement, ['item'], 'Helios-Announcements');
 smalltalk.addMethod(
 "_item",
@@ -96,6 +99,9 @@ smalltalk.HLItemSelected.klass);
 smalltalk.addClass('HLClassSelected', smalltalk.HLItemSelected, [], 'Helios-Announcements');
 
 
+smalltalk.addClass('HLInstanceVariableSelected', smalltalk.HLItemSelected, [], 'Helios-Announcements');
+
+
 smalltalk.addClass('HLMethodSelected', smalltalk.HLItemSelected, [], 'Helios-Announcements');
 
 
@@ -105,6 +111,9 @@ smalltalk.addClass('HLPackageSelected', smalltalk.HLItemSelected, [], 'Helios-An
 smalltalk.addClass('HLProtocolSelected', smalltalk.HLItemSelected, [], 'Helios-Announcements');
 
 
+smalltalk.addClass('HLRefreshRequested', smalltalk.HLAnnouncement, [], 'Helios-Announcements');
+
+
 smalltalk.addClass('HLShowCommentToggled', smalltalk.HLAnnouncement, [], 'Helios-Announcements');
 
 

+ 9 - 0
js/Helios-Announcements.js

@@ -67,6 +67,9 @@ smalltalk.addClass('HLInspectItRequested', smalltalk.HLCodeHandled, [], 'Helios-
 smalltalk.addClass('HLPrintItRequested', smalltalk.HLCodeHandled, [], 'Helios-Announcements');
 
 
+smalltalk.addClass('HLDiveRequested', smalltalk.HLAnnouncement, [], 'Helios-Announcements');
+
+
 smalltalk.addClass('HLItemSelected', smalltalk.HLAnnouncement, ['item'], 'Helios-Announcements');
 smalltalk.addMethod(
 "_item",
@@ -126,6 +129,9 @@ smalltalk.HLItemSelected.klass);
 smalltalk.addClass('HLClassSelected', smalltalk.HLItemSelected, [], 'Helios-Announcements');
 
 
+smalltalk.addClass('HLInstanceVariableSelected', smalltalk.HLItemSelected, [], 'Helios-Announcements');
+
+
 smalltalk.addClass('HLMethodSelected', smalltalk.HLItemSelected, [], 'Helios-Announcements');
 
 
@@ -135,6 +141,9 @@ smalltalk.addClass('HLPackageSelected', smalltalk.HLItemSelected, [], 'Helios-An
 smalltalk.addClass('HLProtocolSelected', smalltalk.HLItemSelected, [], 'Helios-Announcements');
 
 
+smalltalk.addClass('HLRefreshRequested', smalltalk.HLAnnouncement, [], 'Helios-Announcements');
+
+
 smalltalk.addClass('HLShowCommentToggled', smalltalk.HLAnnouncement, [], 'Helios-Announcements');
 
 

+ 15 - 1
js/Helios-Core.deploy.js

@@ -949,6 +949,20 @@ return "";
 }),
 smalltalk.HLListWidget);
 
+smalltalk.addMethod(
+"_initializeItems",
+smalltalk.method({
+selector: "initializeItems",
+fn: function (){
+var self=this;
+var $1;
+self["@items"]=[];
+$1=self["@items"];
+return $1;
+}
+}),
+smalltalk.HLListWidget);
+
 smalltalk.addMethod(
 "_items",
 smalltalk.method({
@@ -957,7 +971,7 @@ fn: function (){
 var self=this;
 var $1;
 if(($receiver = self["@items"]) == nil || $receiver == undefined){
-$1=[];
+$1=smalltalk.send(self,"_initializeItems",[]);
 } else {
 $1=self["@items"];
 };

+ 22 - 3
js/Helios-Core.js

@@ -1286,6 +1286,25 @@ referencedClasses: []
 }),
 smalltalk.HLListWidget);
 
+smalltalk.addMethod(
+"_initializeItems",
+smalltalk.method({
+selector: "initializeItems",
+category: 'initializing',
+fn: function (){
+var self=this;
+var $1;
+self["@items"]=[];
+$1=self["@items"];
+return $1;
+},
+args: [],
+source: "initializeItems\x0a\x09^ items := #()",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLListWidget);
+
 smalltalk.addMethod(
 "_items",
 smalltalk.method({
@@ -1295,15 +1314,15 @@ fn: function (){
 var self=this;
 var $1;
 if(($receiver = self["@items"]) == nil || $receiver == undefined){
-$1=[];
+$1=smalltalk.send(self,"_initializeItems",[]);
 } else {
 $1=self["@items"];
 };
 return $1;
 },
 args: [],
-source: "items\x0a\x09^ items ifNil: [ #() ]",
-messageSends: ["ifNil:"],
+source: "items\x0a\x09^ items ifNil: [ self initializeItems ]",
+messageSends: ["ifNil:", "initializeItems"],
 referencedClasses: []
 }),
 smalltalk.HLListWidget);

+ 269 - 10
js/Helios-Inspector.deploy.js

@@ -1,5 +1,5 @@
 smalltalk.addPackage('Helios-Inspector', {});
-smalltalk.addClass('HLInspector', smalltalk.HLWidget, ['model', 'variables', 'display', 'code'], 'Helios-Inspector');
+smalltalk.addClass('HLInspector', smalltalk.HLWidget, ['model', 'variables', 'display', 'code', 'label'], 'Helios-Inspector');
 smalltalk.addMethod(
 "_code",
 smalltalk.method({
@@ -42,6 +42,7 @@ fn: function (){
 var self=this;
 if(($receiver = self["@model"]) == nil || $receiver == undefined){
 smalltalk.send(self,"_model_",[smalltalk.send(self,"_model",[])]);
+smalltalk.send(self,"_observeVariables",[]);
 } else {
 self["@model"];
 };
@@ -77,6 +78,20 @@ return $1;
 }),
 smalltalk.HLInspector);
 
+smalltalk.addMethod(
+"_initializeLabel",
+smalltalk.method({
+selector: "initializeLabel",
+fn: function (){
+var self=this;
+var $1;
+self["@label"]=smalltalk.send(smalltalk.send(self["@model"],"_inspectee",[]),"_printString",[]);
+$1=self["@label"];
+return $1;
+}
+}),
+smalltalk.HLInspector);
+
 smalltalk.addMethod(
 "_initializeModel",
 smalltalk.method({
@@ -111,7 +126,7 @@ smalltalk.method({
 selector: "inspect:",
 fn: function (anObject){
 var self=this;
-smalltalk.send(smalltalk.send(self,"_model",[]),"_inspectee_",[anObject]);
+smalltalk.send(smalltalk.send(self,"_model",[]),"_inspect_on_",[anObject,self]);
 return self}
 }),
 smalltalk.HLInspector);
@@ -140,6 +155,23 @@ return self}
 }),
 smalltalk.HLInspector);
 
+smalltalk.addMethod(
+"_label",
+smalltalk.method({
+selector: "label",
+fn: function (){
+var self=this;
+var $1;
+if(($receiver = self["@label"]) == nil || $receiver == undefined){
+$1=smalltalk.send(self,"_initializeLabel",[]);
+} else {
+$1=self["@label"];
+};
+return $1;
+}
+}),
+smalltalk.HLInspector);
+
 smalltalk.addMethod(
 "_makeCode",
 smalltalk.method({
@@ -231,6 +263,25 @@ return self}
 }),
 smalltalk.HLInspector);
 
+smalltalk.addMethod(
+"_observeVariables",
+smalltalk.method({
+selector: "observeVariables",
+fn: function (){
+var self=this;
+var $1,$2;
+$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.HLInstanceVariableSelected || HLInstanceVariableSelected),(function(ann){
+return smalltalk.send(self,"_onInstanceVariableSelected",[]);
+})]);
+$2=smalltalk.send($1,"_yourself",[]);
+return self}
+}),
+smalltalk.HLInspector);
+
 smalltalk.addMethod(
 "_onDoIt",
 smalltalk.method({
@@ -251,6 +302,17 @@ return self}
 }),
 smalltalk.HLInspector);
 
+smalltalk.addMethod(
+"_onInstanceVariableSelected",
+smalltalk.method({
+selector: "onInstanceVariableSelected",
+fn: function (){
+var self=this;
+smalltalk.send(self,"_halt",[]);
+return self}
+}),
+smalltalk.HLInspector);
+
 smalltalk.addMethod(
 "_onPrintIt",
 smalltalk.method({
@@ -261,6 +323,17 @@ return self}
 }),
 smalltalk.HLInspector);
 
+smalltalk.addMethod(
+"_onRefresh",
+smalltalk.method({
+selector: "onRefresh",
+fn: function (){
+var self=this;
+smalltalk.send(self,"_refresh",[]);
+return self}
+}),
+smalltalk.HLInspector);
+
 smalltalk.addMethod(
 "_open",
 smalltalk.method({
@@ -280,8 +353,30 @@ fn: function (){
 var self=this;
 var $1;
 smalltalk.send(self,"_inspect_",[smalltalk.send(self,"_inspectee",[])]);
-smalltalk.send(self,"_updateVariablesList",[]);
-$1=smalltalk.send(self,"_updateValueTextarea",[]);
+smalltalk.send(self,"_refreshVariables",[]);
+$1=smalltalk.send(self,"_refreshDisplay",[]);
+return self}
+}),
+smalltalk.HLInspector);
+
+smalltalk.addMethod(
+"_refreshDisplay",
+smalltalk.method({
+selector: "refreshDisplay",
+fn: function (){
+var self=this;
+smalltalk.send(smalltalk.send(self,"_display",[]),"_refresh",[]);
+return self}
+}),
+smalltalk.HLInspector);
+
+smalltalk.addMethod(
+"_refreshVariables",
+smalltalk.method({
+selector: "refreshVariables",
+fn: function (){
+var self=this;
+smalltalk.send(smalltalk.send(self,"_variables",[]),"_refresh",[]);
 return self}
 }),
 smalltalk.HLInspector);
@@ -298,6 +393,28 @@ return self}
 }),
 smalltalk.HLInspector);
 
+smalltalk.addMethod(
+"_setLabel_",
+smalltalk.method({
+selector: "setLabel:",
+fn: function (aString){
+var self=this;
+self["@label"]=aString;
+return self}
+}),
+smalltalk.HLInspector);
+
+smalltalk.addMethod(
+"_setVariables_",
+smalltalk.method({
+selector: "setVariables:",
+fn: function (aDictionary){
+var self=this;
+smalltalk.send(smalltalk.send(self,"_model",[]),"_variables_",[aDictionary]);
+return self}
+}),
+smalltalk.HLInspector);
+
 smalltalk.addMethod(
 "_tabLabel",
 smalltalk.method({
@@ -305,7 +422,7 @@ selector: "tabLabel",
 fn: function (){
 var self=this;
 var $1;
-$1=smalltalk.send(smalltalk.send(self["@model"],"_inspectee",[]),"_printString",[]);
+$1=smalltalk.send(self,"_label",[]);
 return $1;
 }
 }),
@@ -392,7 +509,7 @@ smalltalk.method({
 selector: "renderContentOn:",
 fn: function (html){
 var self=this;
-smalltalk.send(smalltalk.send(html,"_div",[]),"_with_",["display"]);
+smalltalk.send(smalltalk.send(html,"_div",[]),"_with_",[smalltalk.send(smalltalk.send(self["@model"],"_selection",[]),"_printString",[])]);
 return self}
 }),
 smalltalk.HLInspectorDisplay);
@@ -539,6 +656,19 @@ return $1;
 }),
 smalltalk.HLInspectorModel);
 
+smalltalk.addMethod(
+"_inspect_on_",
+smalltalk.method({
+selector: "inspect:on:",
+fn: function (anObject,anInspector){
+var self=this;
+self["@inspectee"]=anObject;
+self["@variables"]=[];
+smalltalk.send(self["@inspectee"],"_inspectOn_",[anInspector]);
+return self}
+}),
+smalltalk.HLInspectorModel);
+
 smalltalk.addMethod(
 "_inspectee",
 smalltalk.method({
@@ -628,6 +758,28 @@ return self}
 }),
 smalltalk.HLInspectorModel);
 
+smalltalk.addMethod(
+"_variables",
+smalltalk.method({
+selector: "variables",
+fn: function (){
+var self=this;
+return self["@variables"];
+}
+}),
+smalltalk.HLInspectorModel);
+
+smalltalk.addMethod(
+"_variables_",
+smalltalk.method({
+selector: "variables:",
+fn: function (aCollection){
+var self=this;
+self["@variables"]=aCollection;
+return self}
+}),
+smalltalk.HLInspectorModel);
+
 
 smalltalk.addMethod(
 "_on_",
@@ -646,7 +798,52 @@ return $1;
 smalltalk.HLInspectorModel.klass);
 
 
-smalltalk.addClass('HLInspectorVariables', smalltalk.HLNavigationListWidget, ['model'], 'Helios-Inspector');
+smalltalk.addClass('HLInspectorVariables', smalltalk.HLNavigationListWidget, ['announcer', 'model', 'list', 'diveButton'], 'Helios-Inspector');
+smalltalk.addMethod(
+"_announcer",
+smalltalk.method({
+selector: "announcer",
+fn: function (){
+var self=this;
+var $1;
+if(($receiver = self["@announcer"]) == nil || $receiver == undefined){
+$1=smalltalk.send(self,"_initializeAnnouncer",[]);
+} else {
+$1=self["@announcer"];
+};
+return $1;
+}
+}),
+smalltalk.HLInspectorVariables);
+
+smalltalk.addMethod(
+"_initializeAnnouncer",
+smalltalk.method({
+selector: "initializeAnnouncer",
+fn: function (){
+var self=this;
+var $1;
+self["@announcer"]=smalltalk.send((smalltalk.Announcer || Announcer),"_new",[]);
+$1=self["@announcer"];
+return $1;
+}
+}),
+smalltalk.HLInspectorVariables);
+
+smalltalk.addMethod(
+"_initializeItems",
+smalltalk.method({
+selector: "initializeItems",
+fn: function (){
+var self=this;
+var $1;
+self["@items"]=smalltalk.send(smalltalk.send(smalltalk.send(self,"_model",[]),"_variables",[]),"_keys",[]);
+$1=self["@items"];
+return $1;
+}
+}),
+smalltalk.HLInspectorVariables);
+
 smalltalk.addMethod(
 "_model",
 smalltalk.method({
@@ -670,15 +867,77 @@ return self}
 smalltalk.HLInspectorVariables);
 
 smalltalk.addMethod(
-"_renderContentOn_",
+"_refresh",
 smalltalk.method({
-selector: "renderContentOn:",
+selector: "refresh",
+fn: function (){
+var self=this;
+smalltalk.send(self,"_resetItems",[]);
+smalltalk.send(self,"_refresh",[],smalltalk.HLNavigationListWidget);
+return self}
+}),
+smalltalk.HLInspectorVariables);
+
+smalltalk.addMethod(
+"_renderButtonsOn_",
+smalltalk.method({
+selector: "renderButtonsOn:",
 fn: function (html){
 var self=this;
-smalltalk.send(smalltalk.send(html,"_div",[]),"_with_",["variables"]);
+var $1,$2,$3,$4;
+$1=smalltalk.send(html,"_button",[]);
+smalltalk.send($1,"_class_",["btn"]);
+smalltalk.send($1,"_with_",["Refresh"]);
+$2=smalltalk.send($1,"_onClick_",[(function(){
+return smalltalk.send(smalltalk.send(self,"_announcer",[]),"_announce_",[smalltalk.send((smalltalk.HLRefreshRequested || HLRefreshRequested),"_new",[])]);
+})]);
+$3=smalltalk.send(html,"_button",[]);
+smalltalk.send($3,"_class_",["btn"]);
+smalltalk.send($3,"_with_",["Dive"]);
+$4=smalltalk.send($3,"_onClick_",[(function(){
+return smalltalk.send(smalltalk.send(self,"_announcer",[]),"_announce_",[smalltalk.send((smalltalk.HLDiveRequested || HLDiveRequested),"_new",[])]);
+})]);
+self["@diveButton"]=$4;
+return self}
+}),
+smalltalk.HLInspectorVariables);
+
+smalltalk.addMethod(
+"_resetItems",
+smalltalk.method({
+selector: "resetItems",
+fn: function (){
+var self=this;
+self["@items"]=nil;
 return self}
 }),
 smalltalk.HLInspectorVariables);
 
+smalltalk.addMethod(
+"_selection",
+smalltalk.method({
+selector: "selection",
+fn: function (){
+var self=this;
+var $1;
+$1=smalltalk.send(self["@model"],"_selection",[]);
+return $1;
+}
+}),
+smalltalk.HLInspectorVariables);
+
+smalltalk.addMethod(
+"_variables",
+smalltalk.method({
+selector: "variables",
+fn: function (){
+var self=this;
+var $1;
+$1=smalltalk.send(self["@model"],"_variables",[]);
+return $1;
+}
+}),
+smalltalk.HLInspectorVariables);
+
 
 

+ 376 - 22
js/Helios-Inspector.js

@@ -1,5 +1,5 @@
 smalltalk.addPackage('Helios-Inspector', {});
-smalltalk.addClass('HLInspector', smalltalk.HLWidget, ['model', 'variables', 'display', 'code'], 'Helios-Inspector');
+smalltalk.addClass('HLInspector', smalltalk.HLWidget, ['model', 'variables', 'display', 'code', 'label'], 'Helios-Inspector');
 smalltalk.addMethod(
 "_code",
 smalltalk.method({
@@ -53,13 +53,14 @@ fn: function (){
 var self=this;
 if(($receiver = self["@model"]) == nil || $receiver == undefined){
 smalltalk.send(self,"_model_",[smalltalk.send(self,"_model",[])]);
+smalltalk.send(self,"_observeVariables",[]);
 } else {
 self["@model"];
 };
 return self},
 args: [],
-source: "ensureModel\x0a\x09\x22Sends the #model: initialization message if needed.\x22\x0a\x0a\x09model ifNil:[\x0a\x09\x09self model: self model]\x0a\x09",
-messageSends: ["ifNil:", "model:", "model"],
+source: "ensureModel\x0a\x09\x22Sends the #model: initialization message if needed.\x22\x0a\x0a\x09model ifNil:[\x0a\x09\x09self model: self model.\x0a\x09\x09self observeVariables]\x0a\x09",
+messageSends: ["ifNil:", "model:", "model", "observeVariables"],
 referencedClasses: []
 }),
 smalltalk.HLInspector);
@@ -102,6 +103,25 @@ referencedClasses: []
 }),
 smalltalk.HLInspector);
 
+smalltalk.addMethod(
+"_initializeLabel",
+smalltalk.method({
+selector: "initializeLabel",
+category: 'initialization',
+fn: function (){
+var self=this;
+var $1;
+self["@label"]=smalltalk.send(smalltalk.send(self["@model"],"_inspectee",[]),"_printString",[]);
+$1=self["@label"];
+return $1;
+},
+args: [],
+source: "initializeLabel\x0a\x09^ label := model inspectee printString",
+messageSends: ["printString", "inspectee"],
+referencedClasses: []
+}),
+smalltalk.HLInspector);
+
 smalltalk.addMethod(
 "_initializeModel",
 smalltalk.method({
@@ -147,11 +167,11 @@ selector: "inspect:",
 category: 'actions',
 fn: function (anObject){
 var self=this;
-smalltalk.send(smalltalk.send(self,"_model",[]),"_inspectee_",[anObject]);
+smalltalk.send(smalltalk.send(self,"_model",[]),"_inspect_on_",[anObject,self]);
 return self},
 args: ["anObject"],
-source: "inspect: anObject\x0a\x0a\x09self model inspectee: anObject",
-messageSends: ["inspectee:", "model"],
+source: "inspect: anObject\x0a\x0a\x09self model inspect: anObject on: self ",
+messageSends: ["inspect:on:", "model"],
 referencedClasses: []
 }),
 smalltalk.HLInspector);
@@ -190,6 +210,28 @@ referencedClasses: []
 }),
 smalltalk.HLInspector);
 
+smalltalk.addMethod(
+"_label",
+smalltalk.method({
+selector: "label",
+category: 'accessing',
+fn: function (){
+var self=this;
+var $1;
+if(($receiver = self["@label"]) == nil || $receiver == undefined){
+$1=smalltalk.send(self,"_initializeLabel",[]);
+} else {
+$1=self["@label"];
+};
+return $1;
+},
+args: [],
+source: "label\x0a\x09\x0a    ^ label ifNil:[self initializeLabel]",
+messageSends: ["ifNil:", "initializeLabel"],
+referencedClasses: []
+}),
+smalltalk.HLInspector);
+
 smalltalk.addMethod(
 "_makeCode",
 smalltalk.method({
@@ -311,6 +353,30 @@ referencedClasses: []
 }),
 smalltalk.HLInspector);
 
+smalltalk.addMethod(
+"_observeVariables",
+smalltalk.method({
+selector: "observeVariables",
+category: 'actions',
+fn: function (){
+var self=this;
+var $1,$2;
+$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.HLInstanceVariableSelected || HLInstanceVariableSelected),(function(ann){
+return smalltalk.send(self,"_onInstanceVariableSelected",[]);
+})]);
+$2=smalltalk.send($1,"_yourself",[]);
+return self},
+args: [],
+source: "observeVariables\x0a\x0a\x09self variables announcer \x0a    \x09on: HLRefreshRequested do:[:ann| self onRefresh];\x0a        on: HLInstanceVariableSelected do:[:ann| self onInstanceVariableSelected];\x0a        yourself ",
+messageSends: ["on:do:", "onRefresh", "announcer", "variables", "onInstanceVariableSelected", "yourself"],
+referencedClasses: ["HLRefreshRequested", "HLInstanceVariableSelected"]
+}),
+smalltalk.HLInspector);
+
 smalltalk.addMethod(
 "_onDoIt",
 smalltalk.method({
@@ -341,6 +407,22 @@ referencedClasses: []
 }),
 smalltalk.HLInspector);
 
+smalltalk.addMethod(
+"_onInstanceVariableSelected",
+smalltalk.method({
+selector: "onInstanceVariableSelected",
+category: 'reactions',
+fn: function (){
+var self=this;
+smalltalk.send(self,"_halt",[]);
+return self},
+args: [],
+source: "onInstanceVariableSelected\x0a\x0a\x09self halt.",
+messageSends: ["halt"],
+referencedClasses: []
+}),
+smalltalk.HLInspector);
+
 smalltalk.addMethod(
 "_onPrintIt",
 smalltalk.method({
@@ -356,6 +438,22 @@ referencedClasses: []
 }),
 smalltalk.HLInspector);
 
+smalltalk.addMethod(
+"_onRefresh",
+smalltalk.method({
+selector: "onRefresh",
+category: 'reactions',
+fn: function (){
+var self=this;
+smalltalk.send(self,"_refresh",[]);
+return self},
+args: [],
+source: "onRefresh\x0a\x0a\x09self refresh",
+messageSends: ["refresh"],
+referencedClasses: []
+}),
+smalltalk.HLInspector);
+
 smalltalk.addMethod(
 "_open",
 smalltalk.method({
@@ -381,12 +479,44 @@ fn: function (){
 var self=this;
 var $1;
 smalltalk.send(self,"_inspect_",[smalltalk.send(self,"_inspectee",[])]);
-smalltalk.send(self,"_updateVariablesList",[]);
-$1=smalltalk.send(self,"_updateValueTextarea",[]);
+smalltalk.send(self,"_refreshVariables",[]);
+$1=smalltalk.send(self,"_refreshDisplay",[]);
+return self},
+args: [],
+source: "refresh\x0a\x0a\x09self \x0a\x09\x09inspect: self inspectee; \x0a\x09\x09refreshVariables;\x0a\x09\x09refreshDisplay",
+messageSends: ["inspect:", "inspectee", "refreshVariables", "refreshDisplay"],
+referencedClasses: []
+}),
+smalltalk.HLInspector);
+
+smalltalk.addMethod(
+"_refreshDisplay",
+smalltalk.method({
+selector: "refreshDisplay",
+category: 'actions',
+fn: function (){
+var self=this;
+smalltalk.send(smalltalk.send(self,"_display",[]),"_refresh",[]);
+return self},
+args: [],
+source: "refreshDisplay\x0a\x0a\x09self display refresh",
+messageSends: ["refresh", "display"],
+referencedClasses: []
+}),
+smalltalk.HLInspector);
+
+smalltalk.addMethod(
+"_refreshVariables",
+smalltalk.method({
+selector: "refreshVariables",
+category: 'actions',
+fn: function (){
+var self=this;
+smalltalk.send(smalltalk.send(self,"_variables",[]),"_refresh",[]);
 return self},
 args: [],
-source: "refresh\x0a\x0a\x09self \x0a\x09\x09inspect: self inspectee; \x0a\x09\x09updateVariablesList;\x0a\x09\x09updateValueTextarea",
-messageSends: ["inspect:", "inspectee", "updateVariablesList", "updateValueTextarea"],
+source: "refreshVariables\x0a\x0a\x09self variables refresh",
+messageSends: ["refresh", "variables"],
 referencedClasses: []
 }),
 smalltalk.HLInspector);
@@ -408,6 +538,38 @@ referencedClasses: ["HLVerticalSplitter", "HLHorizontalSplitter", "HLContainer"]
 }),
 smalltalk.HLInspector);
 
+smalltalk.addMethod(
+"_setLabel_",
+smalltalk.method({
+selector: "setLabel:",
+category: 'actions',
+fn: function (aString){
+var self=this;
+self["@label"]=aString;
+return self},
+args: ["aString"],
+source: "setLabel: aString\x0a\x09label := aString",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLInspector);
+
+smalltalk.addMethod(
+"_setVariables_",
+smalltalk.method({
+selector: "setVariables:",
+category: 'actions',
+fn: function (aDictionary){
+var self=this;
+smalltalk.send(smalltalk.send(self,"_model",[]),"_variables_",[aDictionary]);
+return self},
+args: ["aDictionary"],
+source: "setVariables: aDictionary\x0a\x0a\x09self model variables: aDictionary",
+messageSends: ["variables:", "model"],
+referencedClasses: []
+}),
+smalltalk.HLInspector);
+
 smalltalk.addMethod(
 "_tabLabel",
 smalltalk.method({
@@ -416,12 +578,12 @@ category: 'accessing',
 fn: function (){
 var self=this;
 var $1;
-$1=smalltalk.send(smalltalk.send(self["@model"],"_inspectee",[]),"_printString",[]);
+$1=smalltalk.send(self,"_label",[]);
 return $1;
 },
 args: [],
-source: "tabLabel\x0a\x09\x0a    ^ model inspectee printString",
-messageSends: ["printString", "inspectee"],
+source: "tabLabel\x0a\x09\x0a    ^ self label",
+messageSends: ["label"],
 referencedClasses: []
 }),
 smalltalk.HLInspector);
@@ -538,11 +700,11 @@ selector: "renderContentOn:",
 category: 'rendering',
 fn: function (html){
 var self=this;
-smalltalk.send(smalltalk.send(html,"_div",[]),"_with_",["display"]);
+smalltalk.send(smalltalk.send(html,"_div",[]),"_with_",[smalltalk.send(smalltalk.send(self["@model"],"_selection",[]),"_printString",[])]);
 return self},
 args: ["html"],
-source: "renderContentOn: html\x0a\x09\x0a    html div with: 'display'\x0a    ",
-messageSends: ["with:", "div"],
+source: "renderContentOn: html\x0a\x09\x0a    html div with: model selection printString\x0a    ",
+messageSends: ["with:", "printString", "selection", "div"],
 referencedClasses: []
 }),
 smalltalk.HLInspectorDisplay);
@@ -739,6 +901,24 @@ referencedClasses: []
 }),
 smalltalk.HLInspectorModel);
 
+smalltalk.addMethod(
+"_inspect_on_",
+smalltalk.method({
+selector: "inspect:on:",
+category: 'actions',
+fn: function (anObject,anInspector){
+var self=this;
+self["@inspectee"]=anObject;
+self["@variables"]=[];
+smalltalk.send(self["@inspectee"],"_inspectOn_",[anInspector]);
+return self},
+args: ["anObject", "anInspector"],
+source: "inspect: anObject on: anInspector\x0a\x0a\x09inspectee := anObject.\x0a\x09variables := #().\x0a\x09inspectee inspectOn: anInspector    \x0a",
+messageSends: ["inspectOn:"],
+referencedClasses: []
+}),
+smalltalk.HLInspectorModel);
+
 smalltalk.addMethod(
 "_inspectee",
 smalltalk.method({
@@ -858,6 +1038,38 @@ referencedClasses: []
 }),
 smalltalk.HLInspectorModel);
 
+smalltalk.addMethod(
+"_variables",
+smalltalk.method({
+selector: "variables",
+category: 'accessing',
+fn: function (){
+var self=this;
+return self["@variables"];
+},
+args: [],
+source: "variables\x0a\x0a\x09^ variables",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLInspectorModel);
+
+smalltalk.addMethod(
+"_variables_",
+smalltalk.method({
+selector: "variables:",
+category: 'accessing',
+fn: function (aCollection){
+var self=this;
+self["@variables"]=aCollection;
+return self},
+args: ["aCollection"],
+source: "variables: aCollection\x0a\x0a\x09variables := aCollection\x0a    ",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLInspectorModel);
+
 
 smalltalk.addMethod(
 "_on_",
@@ -881,7 +1093,67 @@ referencedClasses: []
 smalltalk.HLInspectorModel.klass);
 
 
-smalltalk.addClass('HLInspectorVariables', smalltalk.HLNavigationListWidget, ['model'], 'Helios-Inspector');
+smalltalk.addClass('HLInspectorVariables', smalltalk.HLNavigationListWidget, ['announcer', 'model', 'list', 'diveButton'], 'Helios-Inspector');
+smalltalk.addMethod(
+"_announcer",
+smalltalk.method({
+selector: "announcer",
+category: 'accessing',
+fn: function (){
+var self=this;
+var $1;
+if(($receiver = self["@announcer"]) == nil || $receiver == undefined){
+$1=smalltalk.send(self,"_initializeAnnouncer",[]);
+} else {
+$1=self["@announcer"];
+};
+return $1;
+},
+args: [],
+source: "announcer\x0a\x0a\x09^ announcer ifNil:[self initializeAnnouncer]",
+messageSends: ["ifNil:", "initializeAnnouncer"],
+referencedClasses: []
+}),
+smalltalk.HLInspectorVariables);
+
+smalltalk.addMethod(
+"_initializeAnnouncer",
+smalltalk.method({
+selector: "initializeAnnouncer",
+category: 'initialization',
+fn: function (){
+var self=this;
+var $1;
+self["@announcer"]=smalltalk.send((smalltalk.Announcer || Announcer),"_new",[]);
+$1=self["@announcer"];
+return $1;
+},
+args: [],
+source: "initializeAnnouncer\x0a\x0a\x09^ announcer := Announcer new",
+messageSends: ["new"],
+referencedClasses: ["Announcer"]
+}),
+smalltalk.HLInspectorVariables);
+
+smalltalk.addMethod(
+"_initializeItems",
+smalltalk.method({
+selector: "initializeItems",
+category: 'initialization',
+fn: function (){
+var self=this;
+var $1;
+self["@items"]=smalltalk.send(smalltalk.send(smalltalk.send(self,"_model",[]),"_variables",[]),"_keys",[]);
+$1=self["@items"];
+return $1;
+},
+args: [],
+source: "initializeItems\x0a\x09^ items := self model variables keys",
+messageSends: ["keys", "variables", "model"],
+referencedClasses: []
+}),
+smalltalk.HLInspectorVariables);
+
 smalltalk.addMethod(
 "_model",
 smalltalk.method({
@@ -915,17 +1187,99 @@ referencedClasses: []
 smalltalk.HLInspectorVariables);
 
 smalltalk.addMethod(
-"_renderContentOn_",
+"_refresh",
 smalltalk.method({
-selector: "renderContentOn:",
+selector: "refresh",
+category: 'actions',
+fn: function (){
+var self=this;
+smalltalk.send(self,"_resetItems",[]);
+smalltalk.send(self,"_refresh",[],smalltalk.HLNavigationListWidget);
+return self},
+args: [],
+source: "refresh\x0a\x0a\x09self resetItems.\x0a    \x0a    super refresh\x0a    ",
+messageSends: ["resetItems", "refresh"],
+referencedClasses: []
+}),
+smalltalk.HLInspectorVariables);
+
+smalltalk.addMethod(
+"_renderButtonsOn_",
+smalltalk.method({
+selector: "renderButtonsOn:",
 category: 'rendering',
 fn: function (html){
 var self=this;
-smalltalk.send(smalltalk.send(html,"_div",[]),"_with_",["variables"]);
+var $1,$2,$3,$4;
+$1=smalltalk.send(html,"_button",[]);
+smalltalk.send($1,"_class_",["btn"]);
+smalltalk.send($1,"_with_",["Refresh"]);
+$2=smalltalk.send($1,"_onClick_",[(function(){
+return smalltalk.send(smalltalk.send(self,"_announcer",[]),"_announce_",[smalltalk.send((smalltalk.HLRefreshRequested || HLRefreshRequested),"_new",[])]);
+})]);
+$3=smalltalk.send(html,"_button",[]);
+smalltalk.send($3,"_class_",["btn"]);
+smalltalk.send($3,"_with_",["Dive"]);
+$4=smalltalk.send($3,"_onClick_",[(function(){
+return smalltalk.send(smalltalk.send(self,"_announcer",[]),"_announce_",[smalltalk.send((smalltalk.HLDiveRequested || HLDiveRequested),"_new",[])]);
+})]);
+self["@diveButton"]=$4;
 return self},
 args: ["html"],
-source: "renderContentOn: html\x0a\x09\x0a    html div with: 'variables'\x0a    ",
-messageSends: ["with:", "div"],
+source: "renderButtonsOn: html\x0a\x0a\x09html button\x0a\x09\x09\x09class: 'btn';\x0a\x09\x09\x09with: 'Refresh';\x0a\x09\x09\x09onClick: [self announcer announce: HLRefreshRequested new].\x0a\x0a\x09diveButton := html button \x0a\x09\x09\x09\x09class: 'btn';\x0a\x09\x09\x09\x09with: 'Dive'; \x0a\x09\x09\x09\x09onClick: [self announcer announce: HLDiveRequested new]",
+messageSends: ["class:", "button", "with:", "onClick:", "announce:", "new", "announcer"],
+referencedClasses: ["HLRefreshRequested", "HLDiveRequested"]
+}),
+smalltalk.HLInspectorVariables);
+
+smalltalk.addMethod(
+"_resetItems",
+smalltalk.method({
+selector: "resetItems",
+category: 'actions',
+fn: function (){
+var self=this;
+self["@items"]=nil;
+return self},
+args: [],
+source: "resetItems\x0a\x0a\x09items := nil",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLInspectorVariables);
+
+smalltalk.addMethod(
+"_selection",
+smalltalk.method({
+selector: "selection",
+category: 'accessing',
+fn: function (){
+var self=this;
+var $1;
+$1=smalltalk.send(self["@model"],"_selection",[]);
+return $1;
+},
+args: [],
+source: "selection\x0a\x0a\x09^ model selection",
+messageSends: ["selection"],
+referencedClasses: []
+}),
+smalltalk.HLInspectorVariables);
+
+smalltalk.addMethod(
+"_variables",
+smalltalk.method({
+selector: "variables",
+category: 'accessing',
+fn: function (){
+var self=this;
+var $1;
+$1=smalltalk.send(self["@model"],"_variables",[]);
+return $1;
+},
+args: [],
+source: "variables\x0a\x0a\x09^ model variables",
+messageSends: ["variables"],
 referencedClasses: []
 }),
 smalltalk.HLInspectorVariables);

+ 12 - 0
st/Helios-Announcements.st

@@ -40,6 +40,10 @@ HLCodeHandled subclass: #HLPrintItRequested
 	instanceVariableNames: ''
 	package: 'Helios-Announcements'!
 
+HLAnnouncement subclass: #HLDiveRequested
+	instanceVariableNames: ''
+	package: 'Helios-Announcements'!
+
 HLAnnouncement subclass: #HLItemSelected
 	instanceVariableNames: 'item'
 	package: 'Helios-Announcements'!
@@ -66,6 +70,10 @@ HLItemSelected subclass: #HLClassSelected
 	instanceVariableNames: ''
 	package: 'Helios-Announcements'!
 
+HLItemSelected subclass: #HLInstanceVariableSelected
+	instanceVariableNames: ''
+	package: 'Helios-Announcements'!
+
 HLItemSelected subclass: #HLMethodSelected
 	instanceVariableNames: ''
 	package: 'Helios-Announcements'!
@@ -78,6 +86,10 @@ HLItemSelected subclass: #HLProtocolSelected
 	instanceVariableNames: ''
 	package: 'Helios-Announcements'!
 
+HLAnnouncement subclass: #HLRefreshRequested
+	instanceVariableNames: ''
+	package: 'Helios-Announcements'!
+
 HLAnnouncement subclass: #HLShowCommentToggled
 	instanceVariableNames: ''
 	package: 'Helios-Announcements'!

+ 7 - 1
st/Helios-Core.st

@@ -445,7 +445,7 @@ iconForItem: anObject
 !
 
 items
-	^ items ifNil: [ #() ]
+	^ items ifNil: [ self initializeItems ]
 !
 
 items: aCollection
@@ -503,6 +503,12 @@ setupKeyBindings
 			self activateListItem: next ] ]
 ! !
 
+!HLListWidget methodsFor: 'initializing'!
+
+initializeItems
+	^ items := #()
+! !
+
 !HLListWidget methodsFor: 'rendering'!
 
 renderButtonsOn: html

+ 123 - 11
st/Helios-Inspector.st

@@ -1,6 +1,6 @@
 Smalltalk current createPackage: 'Helios-Inspector' properties: #{}!
 HLWidget subclass: #HLInspector
-	instanceVariableNames: 'model variables display code'
+	instanceVariableNames: 'model variables display code label'
 	package: 'Helios-Inspector'!
 
 !HLInspector methodsFor: 'accessing'!
@@ -25,6 +25,11 @@ inspectee: anObject
 	self model inspectee: anObject
 !
 
+label
+	
+    ^ label ifNil:[self initializeLabel]
+!
+
 model
 
 	^ model ifNil:[self initializeModel]
@@ -40,7 +45,7 @@ model: aModel
 
 tabLabel
 	
-    ^ model inspectee printString
+    ^ self label
 !
 
 variables
@@ -54,12 +59,13 @@ ensureModel
 	"Sends the #model: initialization message if needed."
 
 	model ifNil:[
-		self model: self model]
+		self model: self model.
+		self observeVariables]
 !
 
 inspect: anObject
 
-	self model inspectee: anObject
+	self model inspect: anObject on: self
 !
 
 makeCode
@@ -87,6 +93,14 @@ makeVariables
 observeCode
 !
 
+observeVariables
+
+	self variables announcer 
+    	on: HLRefreshRequested do:[:ann| self onRefresh];
+        on: HLInstanceVariableSelected do:[:ann| self onInstanceVariableSelected];
+        yourself
+!
+
 open
 
 	HLManager current addTab: (HLTab on: self labelled: self tabLabel)
@@ -96,8 +110,27 @@ refresh
 
 	self 
 		inspect: self inspectee; 
-		updateVariablesList;
-		updateValueTextarea
+		refreshVariables;
+		refreshDisplay
+!
+
+refreshDisplay
+
+	self display refresh
+!
+
+refreshVariables
+
+	self variables refresh
+!
+
+setLabel: aString
+	label := aString
+!
+
+setVariables: aDictionary
+
+	self model variables: aDictionary
 ! !
 
 !HLInspector methodsFor: 'initialization'!
@@ -111,6 +144,10 @@ initializeDisplay
 	^ display := self makeDisplay
 !
 
+initializeLabel
+	^ label := model inspectee printString
+!
+
 initializeModel
 
 	^ model := HLInspectorModel new
@@ -128,7 +165,17 @@ onDoIt
 onInspectIt
 !
 
+onInstanceVariableSelected
+
+	self halt.
+!
+
 onPrintIt
+!
+
+onRefresh
+
+	self refresh
 ! !
 
 !HLInspector methodsFor: 'rendering'!
@@ -180,7 +227,7 @@ model: aModel
 
 renderContentOn: html
 	
-    html div with: 'display'
+    html div with: model selection printString
 ! !
 
 Object subclass: #HLInspectorModel
@@ -224,6 +271,16 @@ selection
 selection: anObject
 
 	selection := anObject
+!
+
+variables
+
+	^ variables
+!
+
+variables: aCollection
+
+	variables := aCollection
 ! !
 
 !HLInspectorModel methodsFor: 'actions'!
@@ -242,6 +299,13 @@ beRemoteOn: anIPAddress port: aPort
     ...kind of stuff"
 !
 
+inspect: anObject on: anInspector
+
+	inspectee := anObject.
+	variables := #().
+	inspectee inspectOn: anInspector
+!
+
 subscribe: aWidget
 	aWidget subscribeTo: self announcer
 ! !
@@ -299,11 +363,16 @@ on: anEnvironment
 ! !
 
 HLNavigationListWidget subclass: #HLInspectorVariables
-	instanceVariableNames: 'model'
+	instanceVariableNames: 'announcer model list diveButton'
 	package: 'Helios-Inspector'!
 
 !HLInspectorVariables methodsFor: 'accessing'!
 
+announcer
+
+	^ announcer ifNil:[self initializeAnnouncer]
+!
+
 model
 	
     ^ model
@@ -312,12 +381,55 @@ model
 model: aModel
 	
     model := aModel
+!
+
+selection
+
+	^ model selection
+!
+
+variables
+
+	^ model variables
+! !
+
+!HLInspectorVariables methodsFor: 'actions'!
+
+refresh
+
+	self resetItems.
+    
+    super refresh
+!
+
+resetItems
+
+	items := nil
+! !
+
+!HLInspectorVariables methodsFor: 'initialization'!
+
+initializeAnnouncer
+
+	^ announcer := Announcer new
+!
+
+initializeItems
+	^ items := self model variables keys
 ! !
 
 !HLInspectorVariables methodsFor: 'rendering'!
 
-renderContentOn: html
-	
-    html div with: 'variables'
+renderButtonsOn: html
+
+	html button
+			class: 'btn';
+			with: 'Refresh';
+			onClick: [self announcer announce: HLRefreshRequested new].
+
+	diveButton := html button 
+				class: 'btn';
+				with: 'Dive'; 
+				onClick: [self announcer announce: HLDiveRequested new]
 ! !