Browse Source

Merge pull request #243 from sebastianconcept/helios

Implementation of Workspace plus refactoring to prepare the terrain for ...
Nicolas Petton 12 years ago
parent
commit
7bc9e66544

+ 1 - 1
helios.html

@@ -14,7 +14,7 @@
   </head> 
   <body> 
     
-    <script type='text/javascript'> loadAmber({packages: ['Spaces', 'Helios-Core', 'Helios-Commands', 'Helios-Layout','Helios-KeyBindings', 'Helios-Browser', 'Helios-Announcements']}) </script> 
+    <script type='text/javascript'> loadAmber({packages: ['Spaces', 'Helios-Core', 'Helios-Commands', 'Helios-Layout','Helios-KeyBindings', 'Helios-Browser', 'Helios-Workspace', 'Helios-Inspector', 'Helios-Announcements']}) </script> 
     
   </body> 
 </html> 

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

@@ -2,6 +2,62 @@ smalltalk.addPackage('Helios-Announcements', {});
 smalltalk.addClass('HLAnnouncement', smalltalk.Object, [], 'Helios-Announcements');
 
 
+smalltalk.addClass('HLCodeHandled', smalltalk.HLAnnouncement, ['code'], 'Helios-Announcements');
+smalltalk.addMethod(
+"_code",
+smalltalk.method({
+selector: "code",
+fn: function (){
+var self=this;
+return self["@code"];
+}
+}),
+smalltalk.HLCodeHandled);
+
+smalltalk.addMethod(
+"_code_",
+smalltalk.method({
+selector: "code:",
+fn: function (aModel){
+var self=this;
+self["@code"]=aModel;
+return self}
+}),
+smalltalk.HLCodeHandled);
+
+
+smalltalk.addMethod(
+"_on_",
+smalltalk.method({
+selector: "on:",
+fn: function (aCodeModel){
+var self=this;
+var $2,$3,$1;
+$2=smalltalk.send(self,"_new",[]);
+smalltalk.send($2,"_code_",[aCodeModel]);
+$3=smalltalk.send($2,"_yourself",[]);
+$1=$3;
+return $1;
+}
+}),
+smalltalk.HLCodeHandled.klass);
+
+
+smalltalk.addClass('HLDoItExecuted', smalltalk.HLCodeHandled, [], 'Helios-Announcements');
+
+
+smalltalk.addClass('HLDoItRequested', smalltalk.HLCodeHandled, [], 'Helios-Announcements');
+
+
+smalltalk.addClass('HLInspectItRequested', smalltalk.HLCodeHandled, [], 'Helios-Announcements');
+
+
+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",
@@ -46,6 +102,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');
 
 
@@ -55,6 +114,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');
 
 

+ 77 - 0
js/Helios-Announcements.js

@@ -2,6 +2,77 @@ smalltalk.addPackage('Helios-Announcements', {});
 smalltalk.addClass('HLAnnouncement', smalltalk.Object, [], 'Helios-Announcements');
 
 
+smalltalk.addClass('HLCodeHandled', smalltalk.HLAnnouncement, ['code'], 'Helios-Announcements');
+smalltalk.addMethod(
+"_code",
+smalltalk.method({
+selector: "code",
+category: 'accessing',
+fn: function (){
+var self=this;
+return self["@code"];
+},
+args: [],
+source: "code\x0a\x0a\x09^ code",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLCodeHandled);
+
+smalltalk.addMethod(
+"_code_",
+smalltalk.method({
+selector: "code:",
+category: 'accessing',
+fn: function (aModel){
+var self=this;
+self["@code"]=aModel;
+return self},
+args: ["aModel"],
+source: "code: aModel\x0a\x0a\x09code := aModel",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLCodeHandled);
+
+
+smalltalk.addMethod(
+"_on_",
+smalltalk.method({
+selector: "on:",
+category: 'actions',
+fn: function (aCodeModel){
+var self=this;
+var $2,$3,$1;
+$2=smalltalk.send(self,"_new",[]);
+smalltalk.send($2,"_code_",[aCodeModel]);
+$3=smalltalk.send($2,"_yourself",[]);
+$1=$3;
+return $1;
+},
+args: ["aCodeModel"],
+source: "on: aCodeModel\x0a\x0a\x09^ self new \x0a    \x09code: aCodeModel;\x0a        yourself",
+messageSends: ["code:", "new", "yourself"],
+referencedClasses: []
+}),
+smalltalk.HLCodeHandled.klass);
+
+
+smalltalk.addClass('HLDoItExecuted', smalltalk.HLCodeHandled, [], 'Helios-Announcements');
+
+
+smalltalk.addClass('HLDoItRequested', smalltalk.HLCodeHandled, [], 'Helios-Announcements');
+
+
+smalltalk.addClass('HLInspectItRequested', smalltalk.HLCodeHandled, [], 'Helios-Announcements');
+
+
+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",
@@ -61,6 +132,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');
 
 
@@ -70,6 +144,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');
 
 

+ 60 - 10
js/Helios-Browser.deploy.js

@@ -965,20 +965,40 @@ fn: function () {
 }),
 smalltalk.HLBrowserModel);
 
+smalltalk.addMethod(
+"_beLocal",
+smalltalk.method({
+selector: "beLocal",
+fn: function (){
+var self=this;
+smalltalk.send(self,"_initializeEnvironment",[]);
+return self}
+}),
+smalltalk.HLBrowserModel);
+
+smalltalk.addMethod(
+"_beRemoteOn_port_",
+smalltalk.method({
+selector: "beRemoteOn:port:",
+fn: function (anIPAddress,aPort){
+var self=this;
+return self}
+}),
+smalltalk.HLBrowserModel);
+
 smalltalk.addMethod(
 "_environment",
 smalltalk.method({
 selector: "environment",
-fn: function () {
-    var self = this;
-    var $1;
-    if (($receiver = self['@environment']) == nil || $receiver == undefined) {
-        self['@environment'] = smalltalk.send(smalltalk.Smalltalk || Smalltalk, "_current", []);
-        $1 = self['@environment'];
-    } else {
-        $1 = self['@environment'];
-    }
-    return $1;
+fn: function (){
+var self=this;
+var $1;
+if(($receiver = self["@environment"]) == nil || $receiver == undefined){
+$1=smalltalk.send(self,"_initializeEnvironment",[]);
+} else {
+$1=self["@environment"];
+};
+return $1;
 }
 }),
 smalltalk.HLBrowserModel);
@@ -995,6 +1015,20 @@ fn: function (anEnvironment) {
 }),
 smalltalk.HLBrowserModel);
 
+smalltalk.addMethod(
+"_initializeEnvironment",
+smalltalk.method({
+selector: "initializeEnvironment",
+fn: function (){
+var self=this;
+var $1;
+self["@environment"]=smalltalk.send((smalltalk.HLLocalEnvironment || HLLocalEnvironment),"_new",[]);
+$1=self["@environment"];
+return $1;
+}
+}),
+smalltalk.HLBrowserModel);
+
 smalltalk.addMethod(
 "_packages",
 smalltalk.method({
@@ -1221,6 +1255,22 @@ fn: function (aWidget) {
 smalltalk.HLBrowserModel);
 
 
+smalltalk.addMethod(
+"_on_",
+smalltalk.method({
+selector: "on:",
+fn: function (anEnvironment){
+var self=this;
+var $2,$3,$1;
+$2=smalltalk.send(self,"_new",[]);
+smalltalk.send($2,"_environment_",[anEnvironment]);
+$3=smalltalk.send($2,"_yourself",[]);
+$1=$3;
+return $1;
+}
+}),
+smalltalk.HLBrowserModel.klass);
+
 
 smalltalk.addClass('HLBrowserSourceWidget', smalltalk.HLWidget, ['model', 'sourceArea'], 'Helios-Browser');
 smalltalk.addMethod(

+ 83 - 13
js/Helios-Browser.js

@@ -1280,26 +1280,56 @@ referencedClasses: ["Announcer"]
 }),
 smalltalk.HLBrowserModel);
 
+smalltalk.addMethod(
+"_beLocal",
+smalltalk.method({
+selector: "beLocal",
+category: 'actions',
+fn: function (){
+var self=this;
+smalltalk.send(self,"_initializeEnvironment",[]);
+return self},
+args: [],
+source: "beLocal\x0a\x0a\x09self initializeEnvironment\x0a",
+messageSends: ["initializeEnvironment"],
+referencedClasses: []
+}),
+smalltalk.HLBrowserModel);
+
+smalltalk.addMethod(
+"_beRemoteOn_port_",
+smalltalk.method({
+selector: "beRemoteOn:port:",
+category: 'actions',
+fn: function (anIPAddress,aPort){
+var self=this;
+return self},
+args: ["anIPAddress", "aPort"],
+source: "beRemoteOn: anIPAddress port: aPort\x0a\x0a\x09\x22to-do\x22\x0a    \x0a    \x22environment := HLRemoteEnvironment on: anIPAddress port: aPort\x0a    \x0a    ...kind of stuff\x22\x0a    \x0a",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLBrowserModel);
+
 smalltalk.addMethod(
 "_environment",
 smalltalk.method({
 selector: "environment",
 category: 'accessing',
-fn: function () {
-    var self = this;
-    var $1;
-    if (($receiver = self['@environment']) == nil || $receiver == undefined) {
-        self['@environment'] = smalltalk.send(smalltalk.Smalltalk || Smalltalk, "_current", []);
-        $1 = self['@environment'];
-    } else {
-        $1 = self['@environment'];
-    }
-    return $1;
+fn: function (){
+var self=this;
+var $1;
+if(($receiver = self["@environment"]) == nil || $receiver == undefined){
+$1=smalltalk.send(self,"_initializeEnvironment",[]);
+} else {
+$1=self["@environment"];
+};
+return $1;
 },
 args: [],
-source: "environment\x0a\x09^ environment ifNil: [ environment := Smalltalk current ]",
-messageSends: ["ifNil:", "current"],
-referencedClasses: ["Smalltalk"]
+source: "environment\x0a\x09^ environment ifNil: [ self initializeEnvironment ]",
+messageSends: ["ifNil:", "initializeEnvironment"],
+referencedClasses: []
 }),
 smalltalk.HLBrowserModel);
 
@@ -1320,6 +1350,25 @@ referencedClasses: []
 }),
 smalltalk.HLBrowserModel);
 
+smalltalk.addMethod(
+"_initializeEnvironment",
+smalltalk.method({
+selector: "initializeEnvironment",
+category: 'initialization',
+fn: function (){
+var self=this;
+var $1;
+self["@environment"]=smalltalk.send((smalltalk.HLLocalEnvironment || HLLocalEnvironment),"_new",[]);
+$1=self["@environment"];
+return $1;
+},
+args: [],
+source: "initializeEnvironment\x0a\x09^ environment := HLLocalEnvironment new",
+messageSends: ["new"],
+referencedClasses: ["HLLocalEnvironment"]
+}),
+smalltalk.HLBrowserModel);
+
 smalltalk.addMethod(
 "_packages",
 smalltalk.method({
@@ -1616,6 +1665,27 @@ referencedClasses: []
 smalltalk.HLBrowserModel);
 
 
+smalltalk.addMethod(
+"_on_",
+smalltalk.method({
+selector: "on:",
+category: 'actions',
+fn: function (anEnvironment){
+var self=this;
+var $2,$3,$1;
+$2=smalltalk.send(self,"_new",[]);
+smalltalk.send($2,"_environment_",[anEnvironment]);
+$3=smalltalk.send($2,"_yourself",[]);
+$1=$3;
+return $1;
+},
+args: ["anEnvironment"],
+source: "on: anEnvironment\x0a\x0a\x09^ self new\x0a    \x09environment: anEnvironment;\x0a        yourself",
+messageSends: ["environment:", "new", "yourself"],
+referencedClasses: []
+}),
+smalltalk.HLBrowserModel.klass);
+
 
 smalltalk.addClass('HLBrowserSourceWidget', smalltalk.HLWidget, ['model', 'sourceArea'], 'Helios-Browser');
 smalltalk.addMethod(

+ 143 - 40
js/Helios-Core.deploy.js

@@ -1,4 +1,132 @@
 smalltalk.addPackage('Helios-Core', {});
+smalltalk.addClass('HLEnvironment', smalltalk.Object, [], 'Helios-Core');
+smalltalk.addMethod(
+"_eval_on_",
+smalltalk.method({
+selector: "eval:on:",
+fn: function (someCode,aReceiver){
+var self=this;
+var $1;
+$1=smalltalk.send(self,"_subclassResponsibility",[]);
+return $1;
+}
+}),
+smalltalk.HLEnvironment);
+
+smalltalk.addMethod(
+"_packages",
+smalltalk.method({
+selector: "packages",
+fn: function (){
+var self=this;
+var $1;
+$1=smalltalk.send(self,"_subclassResponsibility",[]);
+return $1;
+}
+}),
+smalltalk.HLEnvironment);
+
+
+
+smalltalk.addClass('HLLocalEnvironment', smalltalk.HLEnvironment, [], 'Helios-Core');
+smalltalk.addMethod(
+"_eval_on_",
+smalltalk.method({
+selector: "eval:on:",
+fn: function (someCode,aReceiver){
+var self=this;
+var $1,$2;
+var $early={};
+try {
+var compiler;
+compiler=smalltalk.send((smalltalk.Compiler || Compiler),"_new",[]);
+smalltalk.send((function(){
+return smalltalk.send(compiler,"_parseExpression_",[someCode]);
+}),"_on_do_",[(smalltalk.Error || Error),(function(ex){
+$1=smalltalk.send(window,"_alert_",[smalltalk.send(ex,"_messageText",[])]);
+throw $early=[$1];
+})]);
+$2=smalltalk.send(smalltalk.send(smalltalk.send(compiler,"_eval_",[smalltalk.send(compiler,"_compile_forClass_",[smalltalk.send(smalltalk.send("doIt ^[","__comma",[someCode]),"__comma",["] value"]),(smalltalk.DoIt || DoIt)])]),"_fn",[]),"_applyTo_arguments_",[aReceiver,[]]);
+return $2;
+}
+catch(e) {if(e===$early)return e[0]; throw e}
+}
+}),
+smalltalk.HLLocalEnvironment);
+
+smalltalk.addMethod(
+"_packages",
+smalltalk.method({
+selector: "packages",
+fn: function (){
+var self=this;
+var $1;
+$1=smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk),"_current",[]),"_packages",[]);
+return $1;
+}
+}),
+smalltalk.HLLocalEnvironment);
+
+
+
+smalltalk.addClass('HLRemoteEnvironment', smalltalk.HLEnvironment, [], 'Helios-Core');
+smalltalk.addMethod(
+"_eval_on_",
+smalltalk.method({
+selector: "eval:on:",
+fn: function (someCode,aReceiver){
+var self=this;
+smalltalk.send(self,"_notYetImplemented",[]);
+return self}
+}),
+smalltalk.HLRemoteEnvironment);
+
+smalltalk.addMethod(
+"_packages",
+smalltalk.method({
+selector: "packages",
+fn: function (){
+var self=this;
+return self}
+}),
+smalltalk.HLRemoteEnvironment);
+
+
+
+smalltalk.addClass('HLRemoteObject', smalltalk.Object, [], 'Helios-Core');
+smalltalk.addMethod(
+"_doesNotUnderstand_",
+smalltalk.method({
+selector: "doesNotUnderstand:",
+fn: function (aMessage){
+var self=this;
+return self}
+}),
+smalltalk.HLRemoteObject);
+
+smalltalk.addMethod(
+"_inspectOn_",
+smalltalk.method({
+selector: "inspectOn:",
+fn: function (anInspector){
+var self=this;
+return self}
+}),
+smalltalk.HLRemoteObject);
+
+smalltalk.addMethod(
+"_printString",
+smalltalk.method({
+selector: "printString",
+fn: function (){
+var self=this;
+return "this is a remote object";
+}
+}),
+smalltalk.HLRemoteObject);
+
+
+
 smalltalk.addClass('HLSourceArea', smalltalk.Widget, ['editor', 'textarea', 'div', 'receiver', 'onDoIt'], 'Helios-Core');
 smalltalk.addMethod(
 "_clear",
@@ -821,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({
@@ -829,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"];
 };
@@ -1114,9 +1256,6 @@ smalltalk.HLNavigationListWidget);
 
 
 
-smalltalk.addClass('HLInspector', smalltalk.HLWidget, [], 'Helios-Core');
-
-
 smalltalk.addClass('HLManager', smalltalk.HLWidget, ['tabs', 'activeTab', 'keyBinder'], 'Helios-Core');
 smalltalk.addMethod(
 "_activate_",
@@ -1465,39 +1604,3 @@ return (600);
 smalltalk.HLTranscript.klass);
 
 
-smalltalk.addClass('HLWorkspace', smalltalk.HLWidget, [], 'Helios-Core');
-
-smalltalk.addMethod(
-"_canBeOpenAsTab",
-smalltalk.method({
-selector: "canBeOpenAsTab",
-fn: function (){
-var self=this;
-return true;
-}
-}),
-smalltalk.HLWorkspace.klass);
-
-smalltalk.addMethod(
-"_tabLabel",
-smalltalk.method({
-selector: "tabLabel",
-fn: function (){
-var self=this;
-return "Workspace";
-}
-}),
-smalltalk.HLWorkspace.klass);
-
-smalltalk.addMethod(
-"_tabPriority",
-smalltalk.method({
-selector: "tabPriority",
-fn: function (){
-var self=this;
-return (10);
-}
-}),
-smalltalk.HLWorkspace.klass);
-
-

+ 197 - 57
js/Helios-Core.js

@@ -1,4 +1,179 @@
 smalltalk.addPackage('Helios-Core', {});
+smalltalk.addClass('HLEnvironment', smalltalk.Object, [], 'Helios-Core');
+smalltalk.HLEnvironment.comment="Abstract class defining common behavior for local and remote environments"
+smalltalk.addMethod(
+"_eval_on_",
+smalltalk.method({
+selector: "eval:on:",
+category: 'actions',
+fn: function (someCode,aReceiver){
+var self=this;
+var $1;
+$1=smalltalk.send(self,"_subclassResponsibility",[]);
+return $1;
+},
+args: ["someCode", "aReceiver"],
+source: "eval: someCode on: aReceiver\x0a\x0a\x09^ self subclassResponsibility",
+messageSends: ["subclassResponsibility"],
+referencedClasses: []
+}),
+smalltalk.HLEnvironment);
+
+smalltalk.addMethod(
+"_packages",
+smalltalk.method({
+selector: "packages",
+category: 'accessing',
+fn: function (){
+var self=this;
+var $1;
+$1=smalltalk.send(self,"_subclassResponsibility",[]);
+return $1;
+},
+args: [],
+source: "packages\x0a\x0a\x09^ self subclassResponsibility",
+messageSends: ["subclassResponsibility"],
+referencedClasses: []
+}),
+smalltalk.HLEnvironment);
+
+
+
+smalltalk.addClass('HLLocalEnvironment', smalltalk.HLEnvironment, [], 'Helios-Core');
+smalltalk.addMethod(
+"_eval_on_",
+smalltalk.method({
+selector: "eval:on:",
+category: 'actions',
+fn: function (someCode,aReceiver){
+var self=this;
+var $1,$2;
+var $early={};
+try {
+var compiler;
+compiler=smalltalk.send((smalltalk.Compiler || Compiler),"_new",[]);
+smalltalk.send((function(){
+return smalltalk.send(compiler,"_parseExpression_",[someCode]);
+}),"_on_do_",[(smalltalk.Error || Error),(function(ex){
+$1=smalltalk.send(window,"_alert_",[smalltalk.send(ex,"_messageText",[])]);
+throw $early=[$1];
+})]);
+$2=smalltalk.send(smalltalk.send(smalltalk.send(compiler,"_eval_",[smalltalk.send(compiler,"_compile_forClass_",[smalltalk.send(smalltalk.send("doIt ^[","__comma",[someCode]),"__comma",["] value"]),(smalltalk.DoIt || DoIt)])]),"_fn",[]),"_applyTo_arguments_",[aReceiver,[]]);
+return $2;
+}
+catch(e) {if(e===$early)return e[0]; throw e}
+},
+args: ["someCode", "aReceiver"],
+source: "eval: someCode on: aReceiver\x0a\x09| compiler  |\x0a\x09compiler := Compiler new.\x0a\x09[compiler parseExpression: someCode] on: Error do: [:ex |\x0a\x09\x09^window alert: ex messageText].\x0a\x09^(compiler eval: (compiler compile: 'doIt ^[', someCode, '] value' forClass: DoIt)) fn applyTo: aReceiver arguments: #()",
+messageSends: ["new", "on:do:", "alert:", "messageText", "parseExpression:", "applyTo:arguments:", "fn", "eval:", "compile:forClass:", ","],
+referencedClasses: ["Compiler", "Error", "DoIt"]
+}),
+smalltalk.HLLocalEnvironment);
+
+smalltalk.addMethod(
+"_packages",
+smalltalk.method({
+selector: "packages",
+category: 'accessing',
+fn: function (){
+var self=this;
+var $1;
+$1=smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk),"_current",[]),"_packages",[]);
+return $1;
+},
+args: [],
+source: "packages\x0a\x0a\x09^ Smalltalk current packages",
+messageSends: ["packages", "current"],
+referencedClasses: ["Smalltalk"]
+}),
+smalltalk.HLLocalEnvironment);
+
+
+
+smalltalk.addClass('HLRemoteEnvironment', smalltalk.HLEnvironment, [], 'Helios-Core');
+smalltalk.addMethod(
+"_eval_on_",
+smalltalk.method({
+selector: "eval:on:",
+category: 'actions',
+fn: function (someCode,aReceiver){
+var self=this;
+smalltalk.send(self,"_notYetImplemented",[]);
+return self},
+args: ["someCode", "aReceiver"],
+source: "eval: someCode on: aReceiver\x0a\x0a\x09\x22Note for future self and friends:\x0a    whatever way this compilation happens on the other side, \x0a    it should return a proxy to the remote resulting object\x22\x0a    \x0a    self notYetImplemented",
+messageSends: ["notYetImplemented"],
+referencedClasses: []
+}),
+smalltalk.HLRemoteEnvironment);
+
+smalltalk.addMethod(
+"_packages",
+smalltalk.method({
+selector: "packages",
+category: 'accessing',
+fn: function (){
+var self=this;
+return self},
+args: [],
+source: "packages\x0a\x09\x22Answer the remote environment's packages\x22\x0a  \x0a\x09\x22to-do\x22\x0a    \x0a    \x22Note for future self and friends:\x0a    the problem with remote stuff is that the answers shouldn't be expected to be\x0a    received in a syncrhonous fashion. Everything network is asyc, so you *are going to deal with callbacks* here\x22",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLRemoteEnvironment);
+
+
+
+smalltalk.addClass('HLRemoteObject', smalltalk.Object, [], 'Helios-Core');
+smalltalk.HLRemoteObject.comment="This is a local proxy to a remote object.\x0aTipically useful for evaluating and inspecting and interacting with instances of a remote VM.\x0a"
+smalltalk.addMethod(
+"_doesNotUnderstand_",
+smalltalk.method({
+selector: "doesNotUnderstand:",
+category: 'actions',
+fn: function (aMessage){
+var self=this;
+return self},
+args: ["aMessage"],
+source: "doesNotUnderstand: aMessage\x0a\x0a\x09\x22to-do\x0a\x0a\x09aham, blah blah\x0a\x0a\x09super doesNotUnderstand: aMessage\x22",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLRemoteObject);
+
+smalltalk.addMethod(
+"_inspectOn_",
+smalltalk.method({
+selector: "inspectOn:",
+category: 'actions',
+fn: function (anInspector){
+var self=this;
+return self},
+args: ["anInspector"],
+source: "inspectOn: anInspector\x0a\x0a\x09\x22to-do\x22\x0a\x0a\x09\x22this is a source of so much fun...\x22\x0a",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLRemoteObject);
+
+smalltalk.addMethod(
+"_printString",
+smalltalk.method({
+selector: "printString",
+category: 'actions',
+fn: function (){
+var self=this;
+return "this is a remote object";
+},
+args: [],
+source: "printString\x0a\x09^ 'this is a remote object'",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLRemoteObject);
+
+
+
 smalltalk.addClass('HLSourceArea', smalltalk.Widget, ['editor', 'textarea', 'div', 'receiver', 'onDoIt'], 'Helios-Core');
 smalltalk.addMethod(
 "_clear",
@@ -1111,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({
@@ -1120,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);
@@ -1494,9 +1688,6 @@ smalltalk.HLNavigationListWidget);
 
 
 
-smalltalk.addClass('HLInspector', smalltalk.HLWidget, [], 'Helios-Core');
-
-
 smalltalk.addClass('HLManager', smalltalk.HLWidget, ['tabs', 'activeTab', 'keyBinder'], 'Helios-Core');
 smalltalk.addMethod(
 "_activate_",
@@ -1950,54 +2141,3 @@ referencedClasses: []
 smalltalk.HLTranscript.klass);
 
 
-smalltalk.addClass('HLWorkspace', smalltalk.HLWidget, [], 'Helios-Core');
-
-smalltalk.addMethod(
-"_canBeOpenAsTab",
-smalltalk.method({
-selector: "canBeOpenAsTab",
-category: 'testing',
-fn: function (){
-var self=this;
-return true;
-},
-args: [],
-source: "canBeOpenAsTab\x0a\x09^ true",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.HLWorkspace.klass);
-
-smalltalk.addMethod(
-"_tabLabel",
-smalltalk.method({
-selector: "tabLabel",
-category: 'accessing',
-fn: function (){
-var self=this;
-return "Workspace";
-},
-args: [],
-source: "tabLabel\x0a\x09^ 'Workspace'",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.HLWorkspace.klass);
-
-smalltalk.addMethod(
-"_tabPriority",
-smalltalk.method({
-selector: "tabPriority",
-category: 'accessing',
-fn: function (){
-var self=this;
-return (10);
-},
-args: [],
-source: "tabPriority\x0a\x09^ 10",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.HLWorkspace.klass);
-
-

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

@@ -0,0 +1,1043 @@
+smalltalk.addPackage('Helios-Inspector', {});
+smalltalk.addClass('HLInspector', smalltalk.HLWidget, ['model', 'variables', 'display', 'code', 'label'], 'Helios-Inspector');
+smalltalk.addMethod(
+"_code",
+smalltalk.method({
+selector: "code",
+fn: function (){
+var self=this;
+var $1;
+if(($receiver = self["@code"]) == nil || $receiver == undefined){
+$1=smalltalk.send(self,"_initializeCode",[]);
+} else {
+$1=self["@code"];
+};
+return $1;
+}
+}),
+smalltalk.HLInspector);
+
+smalltalk.addMethod(
+"_display",
+smalltalk.method({
+selector: "display",
+fn: function (){
+var self=this;
+var $1;
+if(($receiver = self["@display"]) == nil || $receiver == undefined){
+$1=smalltalk.send(self,"_initializeDisplay",[]);
+} else {
+$1=self["@display"];
+};
+return $1;
+}
+}),
+smalltalk.HLInspector);
+
+smalltalk.addMethod(
+"_ensureModel",
+smalltalk.method({
+selector: "ensureModel",
+fn: function (){
+var self=this;
+smalltalk.send(self,"_observeVariables",[]);
+if(($receiver = self["@model"]) == nil || $receiver == undefined){
+smalltalk.send(self,"_model_",[smalltalk.send(self,"_model",[])]);
+} else {
+self["@model"];
+};
+return self}
+}),
+smalltalk.HLInspector);
+
+smalltalk.addMethod(
+"_initializeCode",
+smalltalk.method({
+selector: "initializeCode",
+fn: function (){
+var self=this;
+var $1;
+self["@code"]=smalltalk.send(self,"_makeCode",[]);
+$1=self["@code"];
+return $1;
+}
+}),
+smalltalk.HLInspector);
+
+smalltalk.addMethod(
+"_initializeDisplay",
+smalltalk.method({
+selector: "initializeDisplay",
+fn: function (){
+var self=this;
+var $1;
+self["@display"]=smalltalk.send(self,"_makeDisplay",[]);
+$1=self["@display"];
+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({
+selector: "initializeModel",
+fn: function (){
+var self=this;
+var $1;
+self["@model"]=smalltalk.send((smalltalk.HLInspectorModel || HLInspectorModel),"_new",[]);
+$1=self["@model"];
+return $1;
+}
+}),
+smalltalk.HLInspector);
+
+smalltalk.addMethod(
+"_initializeVariables",
+smalltalk.method({
+selector: "initializeVariables",
+fn: function (){
+var self=this;
+var $1;
+self["@variables"]=smalltalk.send(self,"_makeVariables",[]);
+$1=self["@variables"];
+return $1;
+}
+}),
+smalltalk.HLInspector);
+
+smalltalk.addMethod(
+"_inspect_",
+smalltalk.method({
+selector: "inspect:",
+fn: function (anObject){
+var self=this;
+var $1;
+smalltalk.send(smalltalk.send(self,"_model",[]),"_inspect_on_",[anObject,self]);
+smalltalk.send(self,"_refreshVariables",[]);
+smalltalk.send(self,"_refreshDisplay",[]);
+$1=smalltalk.send(self,"_yourself",[]);
+return self}
+}),
+smalltalk.HLInspector);
+
+smalltalk.addMethod(
+"_inspectee",
+smalltalk.method({
+selector: "inspectee",
+fn: function (){
+var self=this;
+var $1;
+$1=smalltalk.send(smalltalk.send(self,"_model",[]),"_inspectee",[]);
+return $1;
+}
+}),
+smalltalk.HLInspector);
+
+smalltalk.addMethod(
+"_inspectee_",
+smalltalk.method({
+selector: "inspectee:",
+fn: function (anObject){
+var self=this;
+smalltalk.send(smalltalk.send(self,"_model",[]),"_inspectee_",[anObject]);
+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({
+selector: "makeCode",
+fn: function (){
+var self=this;
+var $2,$3,$1;
+$2=smalltalk.send((smalltalk.HLCodeWidget || HLCodeWidget),"_new",[]);
+smalltalk.send($2,"_model_",[smalltalk.send(self["@model"],"_code",[])]);
+smalltalk.send($2,"_receiver_",[smalltalk.send(self["@model"],"_inspectee",[])]);
+$3=smalltalk.send($2,"_yourself",[]);
+$1=$3;
+return $1;
+}
+}),
+smalltalk.HLInspector);
+
+smalltalk.addMethod(
+"_makeDisplay",
+smalltalk.method({
+selector: "makeDisplay",
+fn: function (){
+var self=this;
+var $2,$3,$1;
+$2=smalltalk.send((smalltalk.HLInspectorDisplay || HLInspectorDisplay),"_new",[]);
+smalltalk.send($2,"_model_",[smalltalk.send(self,"_model",[])]);
+$3=smalltalk.send($2,"_yourself",[]);
+$1=$3;
+return $1;
+}
+}),
+smalltalk.HLInspector);
+
+smalltalk.addMethod(
+"_makeVariables",
+smalltalk.method({
+selector: "makeVariables",
+fn: function (){
+var self=this;
+var $2,$3,$1;
+$2=smalltalk.send((smalltalk.HLInspectorVariables || HLInspectorVariables),"_new",[]);
+smalltalk.send($2,"_model_",[smalltalk.send(self,"_model",[])]);
+$3=smalltalk.send($2,"_yourself",[]);
+$1=$3;
+return $1;
+}
+}),
+smalltalk.HLInspector);
+
+smalltalk.addMethod(
+"_model",
+smalltalk.method({
+selector: "model",
+fn: function (){
+var self=this;
+var $1;
+if(($receiver = self["@model"]) == nil || $receiver == undefined){
+$1=smalltalk.send(self,"_initializeModel",[]);
+} else {
+$1=self["@model"];
+};
+return $1;
+}
+}),
+smalltalk.HLInspector);
+
+smalltalk.addMethod(
+"_model_",
+smalltalk.method({
+selector: "model:",
+fn: function (aModel){
+var self=this;
+self["@model"]=aModel;
+smalltalk.send(smalltalk.send(self,"_code",[]),"_model_",[smalltalk.send(aModel,"_code",[])]);
+smalltalk.send(self,"_observeCode",[]);
+return self}
+}),
+smalltalk.HLInspector);
+
+smalltalk.addMethod(
+"_observeCode",
+smalltalk.method({
+selector: "observeCode",
+fn: function (){
+var self=this;
+smalltalk.send(smalltalk.send(smalltalk.send(self,"_code",[]),"_announcer",[]),"_on_do_",[(smalltalk.HLDoItExecuted || HLDoItExecuted),(function(){
+return smalltalk.send(self,"_onDoneIt",[]);
+})]);
+return self}
+}),
+smalltalk.HLInspector);
+
+smalltalk.addMethod(
+"_observeVariables",
+smalltalk.method({
+selector: "observeVariables",
+fn: function (){
+var self=this;
+var $1,$2,$3,$4;
+$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){
+return smalltalk.send(self,"_onInstanceVariableSelected",[]);
+})]);
+$4=smalltalk.send($3,"_yourself",[]);
+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({
+selector: "onDoIt",
+fn: function (){
+var self=this;
+return self}
+}),
+smalltalk.HLInspector);
+
+smalltalk.addMethod(
+"_onDoneIt",
+smalltalk.method({
+selector: "onDoneIt",
+fn: function (){
+var self=this;
+smalltalk.send(self,"_refresh",[]);
+return self}
+}),
+smalltalk.HLInspector);
+
+smalltalk.addMethod(
+"_onInspectIt",
+smalltalk.method({
+selector: "onInspectIt",
+fn: function (){
+var self=this;
+return self}
+}),
+smalltalk.HLInspector);
+
+smalltalk.addMethod(
+"_onInstanceVariableSelected",
+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}
+}),
+smalltalk.HLInspector);
+
+smalltalk.addMethod(
+"_onPrintIt",
+smalltalk.method({
+selector: "onPrintIt",
+fn: function (){
+var self=this;
+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({
+selector: "open",
+fn: function (){
+var self=this;
+smalltalk.send(smalltalk.send((smalltalk.HLManager || HLManager),"_current",[]),"_addTab_",[smalltalk.send((smalltalk.HLTab || HLTab),"_on_labelled_",[self,smalltalk.send(self,"_tabLabel",[])])]);
+return self}
+}),
+smalltalk.HLInspector);
+
+smalltalk.addMethod(
+"_refresh",
+smalltalk.method({
+selector: "refresh",
+fn: function (){
+var self=this;
+smalltalk.send(self,"_inspect_",[smalltalk.send(self,"_inspectee",[])]);
+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);
+
+smalltalk.addMethod(
+"_renderContentOn_",
+smalltalk.method({
+selector: "renderContentOn:",
+fn: function (html){
+var self=this;
+smalltalk.send(self,"_ensureModel",[]);
+smalltalk.send(html,"_with_",[smalltalk.send((smalltalk.HLContainer || HLContainer),"_with_",[smalltalk.send((smalltalk.HLHorizontalSplitter || HLHorizontalSplitter),"_with_with_",[smalltalk.send((smalltalk.HLVerticalSplitter || HLVerticalSplitter),"_with_with_",[smalltalk.send(self,"_variables",[]),smalltalk.send(self,"_display",[])]),smalltalk.send(self,"_code",[])])])]);
+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({
+selector: "tabLabel",
+fn: function (){
+var self=this;
+var $1;
+$1=smalltalk.send(self,"_label",[]);
+return $1;
+}
+}),
+smalltalk.HLInspector);
+
+smalltalk.addMethod(
+"_variables",
+smalltalk.method({
+selector: "variables",
+fn: function (){
+var self=this;
+var $1;
+if(($receiver = self["@variables"]) == nil || $receiver == undefined){
+$1=smalltalk.send(self,"_initializeVariables",[]);
+} else {
+$1=self["@variables"];
+};
+return $1;
+}
+}),
+smalltalk.HLInspector);
+
+
+smalltalk.addMethod(
+"_canBeOpenAsTab",
+smalltalk.method({
+selector: "canBeOpenAsTab",
+fn: function (){
+var self=this;
+return false;
+}
+}),
+smalltalk.HLInspector.klass);
+
+smalltalk.addMethod(
+"_tabLabel",
+smalltalk.method({
+selector: "tabLabel",
+fn: function (){
+var self=this;
+return "Inspector";
+}
+}),
+smalltalk.HLInspector.klass);
+
+smalltalk.addMethod(
+"_tabPriority",
+smalltalk.method({
+selector: "tabPriority",
+fn: function (){
+var self=this;
+return (10);
+}
+}),
+smalltalk.HLInspector.klass);
+
+
+smalltalk.addClass('HLInspectorDisplay', smalltalk.HLNavigationListWidget, ['model'], 'Helios-Inspector');
+smalltalk.addMethod(
+"_model",
+smalltalk.method({
+selector: "model",
+fn: function (){
+var self=this;
+return self["@model"];
+}
+}),
+smalltalk.HLInspectorDisplay);
+
+smalltalk.addMethod(
+"_model_",
+smalltalk.method({
+selector: "model:",
+fn: function (aModel){
+var self=this;
+self["@model"]=aModel;
+return self}
+}),
+smalltalk.HLInspectorDisplay);
+
+smalltalk.addMethod(
+"_renderContentOn_",
+smalltalk.method({
+selector: "renderContentOn:",
+fn: function (html){
+var self=this;
+smalltalk.send(smalltalk.send(html,"_div",[]),"_with_",[smalltalk.send(self,"_selectionDisplayString",[])]);
+return self}
+}),
+smalltalk.HLInspectorDisplay);
+
+smalltalk.addMethod(
+"_selectionDisplayString",
+smalltalk.method({
+selector: "selectionDisplayString",
+fn: function (){
+var self=this;
+var $2,$1;
+var selection;
+selection=smalltalk.send(self["@model"],"_selection",[]);
+$2=smalltalk.send(smalltalk.send(smalltalk.send(self["@model"],"_variables",[]),"_keys",[]),"_includes_",[selection]);
+if(smalltalk.assert($2)){
+$1=smalltalk.send(smalltalk.send(self["@model"],"_instVarObjectAt_",[selection]),"_printString",[]);
+} else {
+$1="";
+};
+return $1;
+}
+}),
+smalltalk.HLInspectorDisplay);
+
+
+
+smalltalk.addClass('HLInspectorModel', smalltalk.Object, ['announcer', 'environment', 'inspectee', 'code', 'variables', 'selection'], '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.HLInspectorModel);
+
+smalltalk.addMethod(
+"_beLocal",
+smalltalk.method({
+selector: "beLocal",
+fn: function (){
+var self=this;
+smalltalk.send(self,"_initializeEnvironment",[]);
+return self}
+}),
+smalltalk.HLInspectorModel);
+
+smalltalk.addMethod(
+"_beRemoteOn_port_",
+smalltalk.method({
+selector: "beRemoteOn:port:",
+fn: function (anIPAddress,aPort){
+var self=this;
+return self}
+}),
+smalltalk.HLInspectorModel);
+
+smalltalk.addMethod(
+"_code",
+smalltalk.method({
+selector: "code",
+fn: function (){
+var self=this;
+var $1;
+if(($receiver = self["@code"]) == nil || $receiver == undefined){
+$1=smalltalk.send(self,"_initializeCode",[]);
+} else {
+$1=self["@code"];
+};
+return $1;
+}
+}),
+smalltalk.HLInspectorModel);
+
+smalltalk.addMethod(
+"_environment",
+smalltalk.method({
+selector: "environment",
+fn: function (){
+var self=this;
+var $1;
+if(($receiver = self["@environment"]) == nil || $receiver == undefined){
+$1=smalltalk.send(self,"_initializeEnvironment",[]);
+} else {
+$1=self["@environment"];
+};
+return $1;
+}
+}),
+smalltalk.HLInspectorModel);
+
+smalltalk.addMethod(
+"_environment_",
+smalltalk.method({
+selector: "environment:",
+fn: function (anEnvironment){
+var self=this;
+self["@environment"]=anEnvironment;
+return self}
+}),
+smalltalk.HLInspectorModel);
+
+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.HLInspectorModel);
+
+smalltalk.addMethod(
+"_initializeCode",
+smalltalk.method({
+selector: "initializeCode",
+fn: function (){
+var self=this;
+var $1;
+self["@code"]=smalltalk.send((smalltalk.HLCodeModel || HLCodeModel),"_on_",[smalltalk.send(self,"_environment",[])]);
+$1=self["@code"];
+return $1;
+}
+}),
+smalltalk.HLInspectorModel);
+
+smalltalk.addMethod(
+"_initializeEnvironment",
+smalltalk.method({
+selector: "initializeEnvironment",
+fn: function (){
+var self=this;
+var $1;
+self["@environment"]=smalltalk.send((smalltalk.HLLocalEnvironment || HLLocalEnvironment),"_new",[]);
+$1=self["@environment"];
+return $1;
+}
+}),
+smalltalk.HLInspectorModel);
+
+smalltalk.addMethod(
+"_initializeSelection",
+smalltalk.method({
+selector: "initializeSelection",
+fn: function (){
+var self=this;
+var $1;
+self["@selection"]="";
+$1=self["@selection"];
+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({
+selector: "inspectee",
+fn: function (){
+var self=this;
+return self["@inspectee"];
+}
+}),
+smalltalk.HLInspectorModel);
+
+smalltalk.addMethod(
+"_inspectee_",
+smalltalk.method({
+selector: "inspectee:",
+fn: function (anObject){
+var self=this;
+self["@inspectee"]=anObject;
+return self}
+}),
+smalltalk.HLInspectorModel);
+
+smalltalk.addMethod(
+"_instVarObjectAt_",
+smalltalk.method({
+selector: "instVarObjectAt:",
+fn: function (anInstVarName){
+var self=this;
+var $1;
+$1=smalltalk.send(smalltalk.send(self,"_variables",[]),"_at_",[anInstVarName]);
+return $1;
+}
+}),
+smalltalk.HLInspectorModel);
+
+smalltalk.addMethod(
+"_onKeyDown_",
+smalltalk.method({
+selector: "onKeyDown:",
+fn: function (anEvent){
+var self=this;
+if(anEvent.ctrlKey) {
+		if(anEvent.keyCode === 80) { //ctrl+p
+			self._printIt();
+			anEvent.preventDefault();
+			return false;
+		}
+		if(anEvent.keyCode === 68) { //ctrl+d
+			self._doIt();
+			anEvent.preventDefault();
+			return false;
+		}
+		if(anEvent.keyCode === 73) { //ctrl+i
+			self._inspectIt();
+			anEvent.preventDefault();
+			return false;
+		}
+	};
+;
+return self}
+}),
+smalltalk.HLInspectorModel);
+
+smalltalk.addMethod(
+"_selectedInstVar_",
+smalltalk.method({
+selector: "selectedInstVar:",
+fn: function (anInstVarName){
+var self=this;
+smalltalk.send(self,"_selection_",[anInstVarName]);
+return self}
+}),
+smalltalk.HLInspectorModel);
+
+smalltalk.addMethod(
+"_selectedInstVarObject",
+smalltalk.method({
+selector: "selectedInstVarObject",
+fn: function (){
+var self=this;
+var $1;
+$1=smalltalk.send(self,"_instVarObjectAt_",[smalltalk.send(self,"_selection",[])]);
+return $1;
+}
+}),
+smalltalk.HLInspectorModel);
+
+smalltalk.addMethod(
+"_selection",
+smalltalk.method({
+selector: "selection",
+fn: function (){
+var self=this;
+var $1;
+if(($receiver = self["@selection"]) == nil || $receiver == undefined){
+$1=smalltalk.send(self,"_initializeSelection",[]);
+} else {
+$1=self["@selection"];
+};
+return $1;
+}
+}),
+smalltalk.HLInspectorModel);
+
+smalltalk.addMethod(
+"_selection_",
+smalltalk.method({
+selector: "selection:",
+fn: function (anObject){
+var self=this;
+self["@selection"]=anObject;
+smalltalk.send(smalltalk.send(self,"_announcer",[]),"_announce_",[smalltalk.send((smalltalk.HLInstanceVariableSelected || HLInstanceVariableSelected),"_on_",[self["@selection"]])]);
+return self}
+}),
+smalltalk.HLInspectorModel);
+
+smalltalk.addMethod(
+"_subscribe_",
+smalltalk.method({
+selector: "subscribe:",
+fn: function (aWidget){
+var self=this;
+smalltalk.send(aWidget,"_subscribeTo_",[smalltalk.send(self,"_announcer",[])]);
+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_",
+smalltalk.method({
+selector: "on:",
+fn: function (anEnvironment){
+var self=this;
+var $2,$3,$1;
+$2=smalltalk.send(self,"_new",[]);
+smalltalk.send($2,"_environment_",[anEnvironment]);
+$3=smalltalk.send($2,"_yourself",[]);
+$1=$3;
+return $1;
+}
+}),
+smalltalk.HLInspectorModel.klass);
+
+
+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({
+selector: "model",
+fn: function (){
+var self=this;
+return self["@model"];
+}
+}),
+smalltalk.HLInspectorVariables);
+
+smalltalk.addMethod(
+"_model_",
+smalltalk.method({
+selector: "model:",
+fn: function (aModel){
+var self=this;
+self["@model"]=aModel;
+return self}
+}),
+smalltalk.HLInspectorVariables);
+
+smalltalk.addMethod(
+"_refresh",
+smalltalk.method({
+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;
+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(
+"_selectItem_",
+smalltalk.method({
+selector: "selectItem:",
+fn: function (anObject){
+var self=this;
+smalltalk.send(self,"_selectItem_",[anObject],smalltalk.HLNavigationListWidget);
+smalltalk.send(smalltalk.send(self,"_model",[]),"_selectedInstVar_",[anObject]);
+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);
+
+
+

+ 1423 - 0
js/Helios-Inspector.js

@@ -0,0 +1,1423 @@
+smalltalk.addPackage('Helios-Inspector', {});
+smalltalk.addClass('HLInspector', smalltalk.HLWidget, ['model', 'variables', 'display', 'code', 'label'], 'Helios-Inspector');
+smalltalk.addMethod(
+"_code",
+smalltalk.method({
+selector: "code",
+category: 'accessing',
+fn: function (){
+var self=this;
+var $1;
+if(($receiver = self["@code"]) == nil || $receiver == undefined){
+$1=smalltalk.send(self,"_initializeCode",[]);
+} else {
+$1=self["@code"];
+};
+return $1;
+},
+args: [],
+source: "code\x0a\x0a\x09^ code ifNil:[self initializeCode]",
+messageSends: ["ifNil:", "initializeCode"],
+referencedClasses: []
+}),
+smalltalk.HLInspector);
+
+smalltalk.addMethod(
+"_display",
+smalltalk.method({
+selector: "display",
+category: 'accessing',
+fn: function (){
+var self=this;
+var $1;
+if(($receiver = self["@display"]) == nil || $receiver == undefined){
+$1=smalltalk.send(self,"_initializeDisplay",[]);
+} else {
+$1=self["@display"];
+};
+return $1;
+},
+args: [],
+source: "display\x0a\x0a\x09^ display ifNil:[self initializeDisplay]",
+messageSends: ["ifNil:", "initializeDisplay"],
+referencedClasses: []
+}),
+smalltalk.HLInspector);
+
+smalltalk.addMethod(
+"_ensureModel",
+smalltalk.method({
+selector: "ensureModel",
+category: 'actions',
+fn: function (){
+var self=this;
+smalltalk.send(self,"_observeVariables",[]);
+if(($receiver = self["@model"]) == nil || $receiver == undefined){
+smalltalk.send(self,"_model_",[smalltalk.send(self,"_model",[])]);
+} else {
+self["@model"];
+};
+return self},
+args: [],
+source: "ensureModel\x0a\x09\x22Sends the #model: initialization message if needed.\x22\x0a\x0a\x09self observeVariables.\x0a        \x0a\x09model ifNil:[\x0a\x09\x09self model: self model]\x0a\x09",
+messageSends: ["observeVariables", "ifNil:", "model:", "model"],
+referencedClasses: []
+}),
+smalltalk.HLInspector);
+
+smalltalk.addMethod(
+"_initializeCode",
+smalltalk.method({
+selector: "initializeCode",
+category: 'initialization',
+fn: function (){
+var self=this;
+var $1;
+self["@code"]=smalltalk.send(self,"_makeCode",[]);
+$1=self["@code"];
+return $1;
+},
+args: [],
+source: "initializeCode\x0a\x0a\x09^ code := self makeCode.",
+messageSends: ["makeCode"],
+referencedClasses: []
+}),
+smalltalk.HLInspector);
+
+smalltalk.addMethod(
+"_initializeDisplay",
+smalltalk.method({
+selector: "initializeDisplay",
+category: 'initialization',
+fn: function (){
+var self=this;
+var $1;
+self["@display"]=smalltalk.send(self,"_makeDisplay",[]);
+$1=self["@display"];
+return $1;
+},
+args: [],
+source: "initializeDisplay\x0a\x09^ display := self makeDisplay",
+messageSends: ["makeDisplay"],
+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({
+selector: "initializeModel",
+category: 'initialization',
+fn: function (){
+var self=this;
+var $1;
+self["@model"]=smalltalk.send((smalltalk.HLInspectorModel || HLInspectorModel),"_new",[]);
+$1=self["@model"];
+return $1;
+},
+args: [],
+source: "initializeModel\x0a\x0a\x09^ model := HLInspectorModel new",
+messageSends: ["new"],
+referencedClasses: ["HLInspectorModel"]
+}),
+smalltalk.HLInspector);
+
+smalltalk.addMethod(
+"_initializeVariables",
+smalltalk.method({
+selector: "initializeVariables",
+category: 'initialization',
+fn: function (){
+var self=this;
+var $1;
+self["@variables"]=smalltalk.send(self,"_makeVariables",[]);
+$1=self["@variables"];
+return $1;
+},
+args: [],
+source: "initializeVariables\x0a\x09^ variables := self makeVariables",
+messageSends: ["makeVariables"],
+referencedClasses: []
+}),
+smalltalk.HLInspector);
+
+smalltalk.addMethod(
+"_inspect_",
+smalltalk.method({
+selector: "inspect:",
+category: 'actions',
+fn: function (anObject){
+var self=this;
+var $1;
+smalltalk.send(smalltalk.send(self,"_model",[]),"_inspect_on_",[anObject,self]);
+smalltalk.send(self,"_refreshVariables",[]);
+smalltalk.send(self,"_refreshDisplay",[]);
+$1=smalltalk.send(self,"_yourself",[]);
+return self},
+args: ["anObject"],
+source: "inspect: anObject\x0a\x0a\x09self model inspect: anObject on: self.\x0a    \x0a\x09self \x0a    \x09refreshVariables;\x0a\x09\x09refreshDisplay;\x0a        yourself",
+messageSends: ["inspect:on:", "model", "refreshVariables", "refreshDisplay", "yourself"],
+referencedClasses: []
+}),
+smalltalk.HLInspector);
+
+smalltalk.addMethod(
+"_inspectee",
+smalltalk.method({
+selector: "inspectee",
+category: 'accessing',
+fn: function (){
+var self=this;
+var $1;
+$1=smalltalk.send(smalltalk.send(self,"_model",[]),"_inspectee",[]);
+return $1;
+},
+args: [],
+source: "inspectee\x0a\x0a\x09^ self model inspectee",
+messageSends: ["inspectee", "model"],
+referencedClasses: []
+}),
+smalltalk.HLInspector);
+
+smalltalk.addMethod(
+"_inspectee_",
+smalltalk.method({
+selector: "inspectee:",
+category: 'accessing',
+fn: function (anObject){
+var self=this;
+smalltalk.send(smalltalk.send(self,"_model",[]),"_inspectee_",[anObject]);
+return self},
+args: ["anObject"],
+source: "inspectee: anObject\x0a\x0a\x09self model inspectee: anObject",
+messageSends: ["inspectee:", "model"],
+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({
+selector: "makeCode",
+category: 'actions',
+fn: function (){
+var self=this;
+var $2,$3,$1;
+$2=smalltalk.send((smalltalk.HLCodeWidget || HLCodeWidget),"_new",[]);
+smalltalk.send($2,"_model_",[smalltalk.send(self["@model"],"_code",[])]);
+smalltalk.send($2,"_receiver_",[smalltalk.send(self["@model"],"_inspectee",[])]);
+$3=smalltalk.send($2,"_yourself",[]);
+$1=$3;
+return $1;
+},
+args: [],
+source: "makeCode\x0a\x0a\x09^ HLCodeWidget new\x0a    \x09model: model code;\x0a        receiver: model inspectee;\x0a        yourself.\x0a        \x0a",
+messageSends: ["model:", "code", "new", "receiver:", "inspectee", "yourself"],
+referencedClasses: ["HLCodeWidget"]
+}),
+smalltalk.HLInspector);
+
+smalltalk.addMethod(
+"_makeDisplay",
+smalltalk.method({
+selector: "makeDisplay",
+category: 'actions',
+fn: function (){
+var self=this;
+var $2,$3,$1;
+$2=smalltalk.send((smalltalk.HLInspectorDisplay || HLInspectorDisplay),"_new",[]);
+smalltalk.send($2,"_model_",[smalltalk.send(self,"_model",[])]);
+$3=smalltalk.send($2,"_yourself",[]);
+$1=$3;
+return $1;
+},
+args: [],
+source: "makeDisplay\x0a\x0a\x09^ HLInspectorDisplay new\x0a    \x09model: self model;\x0a        yourself\x0a",
+messageSends: ["model:", "model", "new", "yourself"],
+referencedClasses: ["HLInspectorDisplay"]
+}),
+smalltalk.HLInspector);
+
+smalltalk.addMethod(
+"_makeVariables",
+smalltalk.method({
+selector: "makeVariables",
+category: 'actions',
+fn: function (){
+var self=this;
+var $2,$3,$1;
+$2=smalltalk.send((smalltalk.HLInspectorVariables || HLInspectorVariables),"_new",[]);
+smalltalk.send($2,"_model_",[smalltalk.send(self,"_model",[])]);
+$3=smalltalk.send($2,"_yourself",[]);
+$1=$3;
+return $1;
+},
+args: [],
+source: "makeVariables\x0a\x0a\x09^ HLInspectorVariables new\x0a    \x09model: self model;\x0a        yourself\x0a",
+messageSends: ["model:", "model", "new", "yourself"],
+referencedClasses: ["HLInspectorVariables"]
+}),
+smalltalk.HLInspector);
+
+smalltalk.addMethod(
+"_model",
+smalltalk.method({
+selector: "model",
+category: 'accessing',
+fn: function (){
+var self=this;
+var $1;
+if(($receiver = self["@model"]) == nil || $receiver == undefined){
+$1=smalltalk.send(self,"_initializeModel",[]);
+} else {
+$1=self["@model"];
+};
+return $1;
+},
+args: [],
+source: "model\x0a\x0a\x09^ model ifNil:[self initializeModel]",
+messageSends: ["ifNil:", "initializeModel"],
+referencedClasses: []
+}),
+smalltalk.HLInspector);
+
+smalltalk.addMethod(
+"_model_",
+smalltalk.method({
+selector: "model:",
+category: 'accessing',
+fn: function (aModel){
+var self=this;
+self["@model"]=aModel;
+smalltalk.send(smalltalk.send(self,"_code",[]),"_model_",[smalltalk.send(aModel,"_code",[])]);
+smalltalk.send(self,"_observeCode",[]);
+return self},
+args: ["aModel"],
+source: "model: aModel\x0a\x0a\x09model := aModel.\x0a     \x0a    self code model: aModel code.\x0a    self observeCode.\x0a    ",
+messageSends: ["model:", "code", "observeCode"],
+referencedClasses: []
+}),
+smalltalk.HLInspector);
+
+smalltalk.addMethod(
+"_observeCode",
+smalltalk.method({
+selector: "observeCode",
+category: 'actions',
+fn: function (){
+var self=this;
+smalltalk.send(smalltalk.send(smalltalk.send(self,"_code",[]),"_announcer",[]),"_on_do_",[(smalltalk.HLDoItExecuted || HLDoItExecuted),(function(){
+return smalltalk.send(self,"_onDoneIt",[]);
+})]);
+return self},
+args: [],
+source: "observeCode\x0a\x0a\x09self code announcer \x0a    \x09on: HLDoItExecuted \x0a        do: [self onDoneIt]\x0a",
+messageSends: ["on:do:", "onDoneIt", "announcer", "code"],
+referencedClasses: ["HLDoItExecuted"]
+}),
+smalltalk.HLInspector);
+
+smalltalk.addMethod(
+"_observeVariables",
+smalltalk.method({
+selector: "observeVariables",
+category: 'actions',
+fn: function (){
+var self=this;
+var $1,$2,$3,$4;
+$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){
+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        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);
+
+smalltalk.addMethod(
+"_onDoIt",
+smalltalk.method({
+selector: "onDoIt",
+category: 'reactions',
+fn: function (){
+var self=this;
+return self},
+args: [],
+source: "onDoIt",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLInspector);
+
+smalltalk.addMethod(
+"_onDoneIt",
+smalltalk.method({
+selector: "onDoneIt",
+category: 'reactions',
+fn: function (){
+var self=this;
+smalltalk.send(self,"_refresh",[]);
+return self},
+args: [],
+source: "onDoneIt\x0a\x0a\x09self refresh",
+messageSends: ["refresh"],
+referencedClasses: []
+}),
+smalltalk.HLInspector);
+
+smalltalk.addMethod(
+"_onInspectIt",
+smalltalk.method({
+selector: "onInspectIt",
+category: 'reactions',
+fn: function (){
+var self=this;
+return self},
+args: [],
+source: "onInspectIt",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLInspector);
+
+smalltalk.addMethod(
+"_onInstanceVariableSelected",
+smalltalk.method({
+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 code receiver: self model selectedInstVarObject.\x0a\x09self refreshDisplay",
+messageSends: ["receiver:", "selectedInstVarObject", "model", "code", "refreshDisplay"],
+referencedClasses: []
+}),
+smalltalk.HLInspector);
+
+smalltalk.addMethod(
+"_onPrintIt",
+smalltalk.method({
+selector: "onPrintIt",
+category: 'reactions',
+fn: function (){
+var self=this;
+return self},
+args: [],
+source: "onPrintIt",
+messageSends: [],
+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({
+selector: "open",
+category: 'actions',
+fn: function (){
+var self=this;
+smalltalk.send(smalltalk.send((smalltalk.HLManager || HLManager),"_current",[]),"_addTab_",[smalltalk.send((smalltalk.HLTab || HLTab),"_on_labelled_",[self,smalltalk.send(self,"_tabLabel",[])])]);
+return self},
+args: [],
+source: "open\x0a\x0a\x09HLManager current addTab: (HLTab on: self labelled: self tabLabel)\x0a",
+messageSends: ["addTab:", "on:labelled:", "tabLabel", "current"],
+referencedClasses: ["HLTab", "HLManager"]
+}),
+smalltalk.HLInspector);
+
+smalltalk.addMethod(
+"_refresh",
+smalltalk.method({
+selector: "refresh",
+category: 'actions',
+fn: function (){
+var self=this;
+smalltalk.send(self,"_inspect_",[smalltalk.send(self,"_inspectee",[])]);
+return self},
+args: [],
+source: "refresh\x0a\x0a\x09self inspect: self inspectee",
+messageSends: ["inspect:", "inspectee"],
+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: "refreshVariables\x0a\x0a\x09self variables refresh",
+messageSends: ["refresh", "variables"],
+referencedClasses: []
+}),
+smalltalk.HLInspector);
+
+smalltalk.addMethod(
+"_renderContentOn_",
+smalltalk.method({
+selector: "renderContentOn:",
+category: 'rendering',
+fn: function (html){
+var self=this;
+smalltalk.send(self,"_ensureModel",[]);
+smalltalk.send(html,"_with_",[smalltalk.send((smalltalk.HLContainer || HLContainer),"_with_",[smalltalk.send((smalltalk.HLHorizontalSplitter || HLHorizontalSplitter),"_with_with_",[smalltalk.send((smalltalk.HLVerticalSplitter || HLVerticalSplitter),"_with_with_",[smalltalk.send(self,"_variables",[]),smalltalk.send(self,"_display",[])]),smalltalk.send(self,"_code",[])])])]);
+return self},
+args: ["html"],
+source: "renderContentOn: html\x0a\x0a\x09self ensureModel.\x0a    \x0a   \x09html with: (HLContainer with: (HLHorizontalSplitter\x0a    \x09with: (HLVerticalSplitter \x0a            \x09\x09with: self variables\x0a            \x09    with: self display)\x0a        with: self code))\x0a ",
+messageSends: ["ensureModel", "with:", "with:with:", "variables", "display", "code"],
+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({
+selector: "tabLabel",
+category: 'accessing',
+fn: function (){
+var self=this;
+var $1;
+$1=smalltalk.send(self,"_label",[]);
+return $1;
+},
+args: [],
+source: "tabLabel\x0a\x09\x0a    ^ self label",
+messageSends: ["label"],
+referencedClasses: []
+}),
+smalltalk.HLInspector);
+
+smalltalk.addMethod(
+"_variables",
+smalltalk.method({
+selector: "variables",
+category: 'accessing',
+fn: function (){
+var self=this;
+var $1;
+if(($receiver = self["@variables"]) == nil || $receiver == undefined){
+$1=smalltalk.send(self,"_initializeVariables",[]);
+} else {
+$1=self["@variables"];
+};
+return $1;
+},
+args: [],
+source: "variables\x0a\x0a\x09^ variables ifNil:[self initializeVariables]",
+messageSends: ["ifNil:", "initializeVariables"],
+referencedClasses: []
+}),
+smalltalk.HLInspector);
+
+
+smalltalk.addMethod(
+"_canBeOpenAsTab",
+smalltalk.method({
+selector: "canBeOpenAsTab",
+category: 'testing',
+fn: function (){
+var self=this;
+return false;
+},
+args: [],
+source: "canBeOpenAsTab\x0a\x09^ false",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLInspector.klass);
+
+smalltalk.addMethod(
+"_tabLabel",
+smalltalk.method({
+selector: "tabLabel",
+category: 'accessing',
+fn: function (){
+var self=this;
+return "Inspector";
+},
+args: [],
+source: "tabLabel\x0a\x09^ 'Inspector'",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLInspector.klass);
+
+smalltalk.addMethod(
+"_tabPriority",
+smalltalk.method({
+selector: "tabPriority",
+category: 'accessing',
+fn: function (){
+var self=this;
+return (10);
+},
+args: [],
+source: "tabPriority\x0a\x09^ 10",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLInspector.klass);
+
+
+smalltalk.addClass('HLInspectorDisplay', smalltalk.HLNavigationListWidget, ['model'], 'Helios-Inspector');
+smalltalk.addMethod(
+"_model",
+smalltalk.method({
+selector: "model",
+category: 'accessing',
+fn: function (){
+var self=this;
+return self["@model"];
+},
+args: [],
+source: "model\x0a\x0a\x09^ model",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLInspectorDisplay);
+
+smalltalk.addMethod(
+"_model_",
+smalltalk.method({
+selector: "model:",
+category: 'accessing',
+fn: function (aModel){
+var self=this;
+self["@model"]=aModel;
+return self},
+args: ["aModel"],
+source: "model: aModel\x0a\x0a\x09model := aModel",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLInspectorDisplay);
+
+smalltalk.addMethod(
+"_renderContentOn_",
+smalltalk.method({
+selector: "renderContentOn:",
+category: 'rendering',
+fn: function (html){
+var self=this;
+smalltalk.send(smalltalk.send(html,"_div",[]),"_with_",[smalltalk.send(self,"_selectionDisplayString",[])]);
+return self},
+args: ["html"],
+source: "renderContentOn: html\x0a\x09\x0a    html div with: self selectionDisplayString\x0a    ",
+messageSends: ["with:", "selectionDisplayString", "div"],
+referencedClasses: []
+}),
+smalltalk.HLInspectorDisplay);
+
+smalltalk.addMethod(
+"_selectionDisplayString",
+smalltalk.method({
+selector: "selectionDisplayString",
+category: 'rendering',
+fn: function (){
+var self=this;
+var $2,$1;
+var selection;
+selection=smalltalk.send(self["@model"],"_selection",[]);
+$2=smalltalk.send(smalltalk.send(smalltalk.send(self["@model"],"_variables",[]),"_keys",[]),"_includes_",[selection]);
+if(smalltalk.assert($2)){
+$1=smalltalk.send(smalltalk.send(self["@model"],"_instVarObjectAt_",[selection]),"_printString",[]);
+} else {
+$1="";
+};
+return $1;
+},
+args: [],
+source: "selectionDisplayString\x0a\x09|selection|\x0a\x09selection := model selection.\x0a    ^ (model variables keys includes: selection)\x0a    \x09ifTrue:[(model instVarObjectAt: selection) printString]\x0a      \x09ifFalse:['']",
+messageSends: ["selection", "ifTrue:ifFalse:", "printString", "instVarObjectAt:", "includes:", "keys", "variables"],
+referencedClasses: []
+}),
+smalltalk.HLInspectorDisplay);
+
+
+
+smalltalk.addClass('HLInspectorModel', smalltalk.Object, ['announcer', 'environment', 'inspectee', 'code', 'variables', 'selection'], '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\x09^ announcer ifNil: [ self initializeAnnouncer ]",
+messageSends: ["ifNil:", "initializeAnnouncer"],
+referencedClasses: []
+}),
+smalltalk.HLInspectorModel);
+
+smalltalk.addMethod(
+"_beLocal",
+smalltalk.method({
+selector: "beLocal",
+category: 'actions',
+fn: function (){
+var self=this;
+smalltalk.send(self,"_initializeEnvironment",[]);
+return self},
+args: [],
+source: "beLocal\x0a\x0a\x09self initializeEnvironment\x0a",
+messageSends: ["initializeEnvironment"],
+referencedClasses: []
+}),
+smalltalk.HLInspectorModel);
+
+smalltalk.addMethod(
+"_beRemoteOn_port_",
+smalltalk.method({
+selector: "beRemoteOn:port:",
+category: 'actions',
+fn: function (anIPAddress,aPort){
+var self=this;
+return self},
+args: ["anIPAddress", "aPort"],
+source: "beRemoteOn: anIPAddress port: aPort\x0a\x0a\x09\x22to-do\x22\x0a    \x0a    \x22environment := HLRemoteEnvironment on: anIPAddress port: aPort\x0a    \x0a    ...kind of stuff\x22\x0a    \x0a",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLInspectorModel);
+
+smalltalk.addMethod(
+"_code",
+smalltalk.method({
+selector: "code",
+category: 'accessing',
+fn: function (){
+var self=this;
+var $1;
+if(($receiver = self["@code"]) == nil || $receiver == undefined){
+$1=smalltalk.send(self,"_initializeCode",[]);
+} else {
+$1=self["@code"];
+};
+return $1;
+},
+args: [],
+source: "code\x0a\x09\x22Answers the code model working for this workspace model\x22\x0a\x09^ code ifNil:[self initializeCode]",
+messageSends: ["ifNil:", "initializeCode"],
+referencedClasses: []
+}),
+smalltalk.HLInspectorModel);
+
+smalltalk.addMethod(
+"_environment",
+smalltalk.method({
+selector: "environment",
+category: 'accessing',
+fn: function (){
+var self=this;
+var $1;
+if(($receiver = self["@environment"]) == nil || $receiver == undefined){
+$1=smalltalk.send(self,"_initializeEnvironment",[]);
+} else {
+$1=self["@environment"];
+};
+return $1;
+},
+args: [],
+source: "environment\x0a\x09^ environment ifNil: [ self initializeEnvironment]",
+messageSends: ["ifNil:", "initializeEnvironment"],
+referencedClasses: []
+}),
+smalltalk.HLInspectorModel);
+
+smalltalk.addMethod(
+"_environment_",
+smalltalk.method({
+selector: "environment:",
+category: 'accessing',
+fn: function (anEnvironment){
+var self=this;
+self["@environment"]=anEnvironment;
+return self},
+args: ["anEnvironment"],
+source: "environment: anEnvironment\x0a\x09environment := anEnvironment",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLInspectorModel);
+
+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\x09^ announcer := Announcer new",
+messageSends: ["new"],
+referencedClasses: ["Announcer"]
+}),
+smalltalk.HLInspectorModel);
+
+smalltalk.addMethod(
+"_initializeCode",
+smalltalk.method({
+selector: "initializeCode",
+category: 'initialization',
+fn: function (){
+var self=this;
+var $1;
+self["@code"]=smalltalk.send((smalltalk.HLCodeModel || HLCodeModel),"_on_",[smalltalk.send(self,"_environment",[])]);
+$1=self["@code"];
+return $1;
+},
+args: [],
+source: "initializeCode\x0a\x0a\x09^ code := HLCodeModel on: self environment",
+messageSends: ["on:", "environment"],
+referencedClasses: ["HLCodeModel"]
+}),
+smalltalk.HLInspectorModel);
+
+smalltalk.addMethod(
+"_initializeEnvironment",
+smalltalk.method({
+selector: "initializeEnvironment",
+category: 'initialization',
+fn: function (){
+var self=this;
+var $1;
+self["@environment"]=smalltalk.send((smalltalk.HLLocalEnvironment || HLLocalEnvironment),"_new",[]);
+$1=self["@environment"];
+return $1;
+},
+args: [],
+source: "initializeEnvironment\x0a\x09^ environment := HLLocalEnvironment new",
+messageSends: ["new"],
+referencedClasses: ["HLLocalEnvironment"]
+}),
+smalltalk.HLInspectorModel);
+
+smalltalk.addMethod(
+"_initializeSelection",
+smalltalk.method({
+selector: "initializeSelection",
+category: 'initialization',
+fn: function (){
+var self=this;
+var $1;
+self["@selection"]="";
+$1=self["@selection"];
+return $1;
+},
+args: [],
+source: "initializeSelection\x0a\x0a\x09^ selection := ''",
+messageSends: [],
+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({
+selector: "inspectee",
+category: 'accessing',
+fn: function (){
+var self=this;
+return self["@inspectee"];
+},
+args: [],
+source: "inspectee \x0a\x0a\x09^ inspectee ",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLInspectorModel);
+
+smalltalk.addMethod(
+"_inspectee_",
+smalltalk.method({
+selector: "inspectee:",
+category: 'accessing',
+fn: function (anObject){
+var self=this;
+self["@inspectee"]=anObject;
+return self},
+args: ["anObject"],
+source: "inspectee: anObject \x0a\x0a\x09inspectee := anObject\x0a    ",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLInspectorModel);
+
+smalltalk.addMethod(
+"_instVarObjectAt_",
+smalltalk.method({
+selector: "instVarObjectAt:",
+category: 'actions',
+fn: function (anInstVarName){
+var self=this;
+var $1;
+$1=smalltalk.send(smalltalk.send(self,"_variables",[]),"_at_",[anInstVarName]);
+return $1;
+},
+args: ["anInstVarName"],
+source: "instVarObjectAt: anInstVarName\x0a\x0a\x09^ self variables at: anInstVarName",
+messageSends: ["at:", "variables"],
+referencedClasses: []
+}),
+smalltalk.HLInspectorModel);
+
+smalltalk.addMethod(
+"_onKeyDown_",
+smalltalk.method({
+selector: "onKeyDown:",
+category: 'reactions',
+fn: function (anEvent){
+var self=this;
+if(anEvent.ctrlKey) {
+		if(anEvent.keyCode === 80) { //ctrl+p
+			self._printIt();
+			anEvent.preventDefault();
+			return false;
+		}
+		if(anEvent.keyCode === 68) { //ctrl+d
+			self._doIt();
+			anEvent.preventDefault();
+			return false;
+		}
+		if(anEvent.keyCode === 73) { //ctrl+i
+			self._inspectIt();
+			anEvent.preventDefault();
+			return false;
+		}
+	};
+;
+return self},
+args: ["anEvent"],
+source: "onKeyDown: anEvent\x0a\x0a\x09<if(anEvent.ctrlKey) {\x0a\x09\x09if(anEvent.keyCode === 80) { //ctrl+p\x0a\x09\x09\x09self._printIt();\x0a\x09\x09\x09anEvent.preventDefault();\x0a\x09\x09\x09return false;\x0a\x09\x09}\x0a\x09\x09if(anEvent.keyCode === 68) { //ctrl+d\x0a\x09\x09\x09self._doIt();\x0a\x09\x09\x09anEvent.preventDefault();\x0a\x09\x09\x09return false;\x0a\x09\x09}\x0a\x09\x09if(anEvent.keyCode === 73) { //ctrl+i\x0a\x09\x09\x09self._inspectIt();\x0a\x09\x09\x09anEvent.preventDefault();\x0a\x09\x09\x09return false;\x0a\x09\x09}\x0a\x09}>",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLInspectorModel);
+
+smalltalk.addMethod(
+"_selectedInstVar_",
+smalltalk.method({
+selector: "selectedInstVar:",
+category: 'actions',
+fn: function (anInstVarName){
+var self=this;
+smalltalk.send(self,"_selection_",[anInstVarName]);
+return self},
+args: ["anInstVarName"],
+source: "selectedInstVar: anInstVarName\x0a\x0a    self selection: anInstVarName",
+messageSends: ["selection:"],
+referencedClasses: []
+}),
+smalltalk.HLInspectorModel);
+
+smalltalk.addMethod(
+"_selectedInstVarObject",
+smalltalk.method({
+selector: "selectedInstVarObject",
+category: 'accessing',
+fn: function (){
+var self=this;
+var $1;
+$1=smalltalk.send(self,"_instVarObjectAt_",[smalltalk.send(self,"_selection",[])]);
+return $1;
+},
+args: [],
+source: "selectedInstVarObject\x0a\x0a\x09^ self instVarObjectAt: self selection\x0a    ",
+messageSends: ["instVarObjectAt:", "selection"],
+referencedClasses: []
+}),
+smalltalk.HLInspectorModel);
+
+smalltalk.addMethod(
+"_selection",
+smalltalk.method({
+selector: "selection",
+category: 'accessing',
+fn: function (){
+var self=this;
+var $1;
+if(($receiver = self["@selection"]) == nil || $receiver == undefined){
+$1=smalltalk.send(self,"_initializeSelection",[]);
+} else {
+$1=self["@selection"];
+};
+return $1;
+},
+args: [],
+source: "selection\x0a\x0a\x09^ selection ifNil:[self initializeSelection] ",
+messageSends: ["ifNil:", "initializeSelection"],
+referencedClasses: []
+}),
+smalltalk.HLInspectorModel);
+
+smalltalk.addMethod(
+"_selection_",
+smalltalk.method({
+selector: "selection:",
+category: 'accessing',
+fn: function (anObject){
+var self=this;
+self["@selection"]=anObject;
+smalltalk.send(smalltalk.send(self,"_announcer",[]),"_announce_",[smalltalk.send((smalltalk.HLInstanceVariableSelected || HLInstanceVariableSelected),"_on_",[self["@selection"]])]);
+return self},
+args: ["anObject"],
+source: "selection: anObject\x0a\x0a\x09selection := anObject.\x0a\x0a\x09self announcer announce: (HLInstanceVariableSelected on: selection)\x0a    ",
+messageSends: ["announce:", "on:", "announcer"],
+referencedClasses: ["HLInstanceVariableSelected"]
+}),
+smalltalk.HLInspectorModel);
+
+smalltalk.addMethod(
+"_subscribe_",
+smalltalk.method({
+selector: "subscribe:",
+category: 'actions',
+fn: function (aWidget){
+var self=this;
+smalltalk.send(aWidget,"_subscribeTo_",[smalltalk.send(self,"_announcer",[])]);
+return self},
+args: ["aWidget"],
+source: "subscribe: aWidget\x0a\x09aWidget subscribeTo: self announcer",
+messageSends: ["subscribeTo:", "announcer"],
+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_",
+smalltalk.method({
+selector: "on:",
+category: 'actions',
+fn: function (anEnvironment){
+var self=this;
+var $2,$3,$1;
+$2=smalltalk.send(self,"_new",[]);
+smalltalk.send($2,"_environment_",[anEnvironment]);
+$3=smalltalk.send($2,"_yourself",[]);
+$1=$3;
+return $1;
+},
+args: ["anEnvironment"],
+source: "on: anEnvironment\x0a\x0a\x09^ self new\x0a    \x09environment: anEnvironment;\x0a        yourself",
+messageSends: ["environment:", "new", "yourself"],
+referencedClasses: []
+}),
+smalltalk.HLInspectorModel.klass);
+
+
+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({
+selector: "model",
+category: 'accessing',
+fn: function (){
+var self=this;
+return self["@model"];
+},
+args: [],
+source: "model\x0a\x09\x0a    ^ model\x0a        ",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLInspectorVariables);
+
+smalltalk.addMethod(
+"_model_",
+smalltalk.method({
+selector: "model:",
+category: 'accessing',
+fn: function (aModel){
+var self=this;
+self["@model"]=aModel;
+return self},
+args: ["aModel"],
+source: "model: aModel\x0a\x09\x0a    model := aModel\x0a        ",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLInspectorVariables);
+
+smalltalk.addMethod(
+"_refresh",
+smalltalk.method({
+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;
+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: "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(
+"_selectItem_",
+smalltalk.method({
+selector: "selectItem:",
+category: 'reactions',
+fn: function (anObject){
+var self=this;
+smalltalk.send(self,"_selectItem_",[anObject],smalltalk.HLNavigationListWidget);
+smalltalk.send(smalltalk.send(self,"_model",[]),"_selectedInstVar_",[anObject]);
+return self},
+args: ["anObject"],
+source: "selectItem: anObject\x0a\x09   \x0a\x09super selectItem: anObject.\x0a    \x0a    self model selectedInstVar: anObject",
+messageSends: ["selectItem:", "selectedInstVar:", "model"],
+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);
+
+
+

+ 941 - 0
js/Helios-Workspace.deploy.js

@@ -0,0 +1,941 @@
+smalltalk.addPackage('Helios-Workspace', {});
+smalltalk.addClass('HLCodeModel', smalltalk.Object, ['announcer', 'environment', 'receiver'], 'Helios-Workspace');
+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.HLCodeModel);
+
+smalltalk.addMethod(
+"_doIt_",
+smalltalk.method({
+selector: "doIt:",
+fn: function (someCode){
+var self=this;
+var $1;
+$1=smalltalk.send(smalltalk.send(self,"_environment",[]),"_eval_on_",[someCode,smalltalk.send(self,"_receiver",[])]);
+return $1;
+}
+}),
+smalltalk.HLCodeModel);
+
+smalltalk.addMethod(
+"_environment",
+smalltalk.method({
+selector: "environment",
+fn: function (){
+var self=this;
+var $1;
+if(($receiver = self["@environment"]) == nil || $receiver == undefined){
+$1=smalltalk.send(self,"_initializeEnvironment",[]);
+} else {
+$1=self["@environment"];
+};
+return $1;
+}
+}),
+smalltalk.HLCodeModel);
+
+smalltalk.addMethod(
+"_environment_",
+smalltalk.method({
+selector: "environment:",
+fn: function (anEnvironment){
+var self=this;
+self["@environment"]=anEnvironment;
+return self}
+}),
+smalltalk.HLCodeModel);
+
+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.HLCodeModel);
+
+smalltalk.addMethod(
+"_initializeEnvironment",
+smalltalk.method({
+selector: "initializeEnvironment",
+fn: function (){
+var self=this;
+var $1;
+self["@environment"]=smalltalk.send((smalltalk.Smalltalk || Smalltalk),"_current",[]);
+$1=self["@environment"];
+return $1;
+}
+}),
+smalltalk.HLCodeModel);
+
+smalltalk.addMethod(
+"_initializeReceiver",
+smalltalk.method({
+selector: "initializeReceiver",
+fn: function (){
+var self=this;
+var $1;
+self["@receiver"]=smalltalk.send((smalltalk.DoIt || DoIt),"_new",[]);
+$1=self["@receiver"];
+return $1;
+}
+}),
+smalltalk.HLCodeModel);
+
+smalltalk.addMethod(
+"_receiver",
+smalltalk.method({
+selector: "receiver",
+fn: function (){
+var self=this;
+return self["@receiver"];
+}
+}),
+smalltalk.HLCodeModel);
+
+smalltalk.addMethod(
+"_receiver_",
+smalltalk.method({
+selector: "receiver:",
+fn: function (anObject){
+var self=this;
+self["@receiver"]=anObject;
+return self}
+}),
+smalltalk.HLCodeModel);
+
+smalltalk.addMethod(
+"_subscribe_",
+smalltalk.method({
+selector: "subscribe:",
+fn: function (aWidget){
+var self=this;
+smalltalk.send(aWidget,"_subscribeTo_",[smalltalk.send(self,"_announcer",[])]);
+return self}
+}),
+smalltalk.HLCodeModel);
+
+
+smalltalk.addMethod(
+"_on_",
+smalltalk.method({
+selector: "on:",
+fn: function (anEnvironment){
+var self=this;
+var $2,$3,$1;
+$2=smalltalk.send(self,"_new",[]);
+smalltalk.send($2,"_environment_",[anEnvironment]);
+$3=smalltalk.send($2,"_yourself",[]);
+$1=$3;
+return $1;
+}
+}),
+smalltalk.HLCodeModel.klass);
+
+
+smalltalk.addClass('HLCodeWidget', smalltalk.HLWidget, ['model', 'wrapper', 'code', 'editor'], 'Helios-Workspace');
+smalltalk.addMethod(
+"_announcer",
+smalltalk.method({
+selector: "announcer",
+fn: function (){
+var self=this;
+var $1;
+$1=smalltalk.send(smalltalk.send(self,"_model",[]),"_announcer",[]);
+return $1;
+}
+}),
+smalltalk.HLCodeWidget);
+
+smalltalk.addMethod(
+"_clear",
+smalltalk.method({
+selector: "clear",
+fn: function (){
+var self=this;
+smalltalk.send(self,"_val_",[""]);
+return self}
+}),
+smalltalk.HLCodeWidget);
+
+smalltalk.addMethod(
+"_currentLine",
+smalltalk.method({
+selector: "currentLine",
+fn: function (){
+var self=this;
+var $1;
+$1=smalltalk.send(self["@editor"],"_getLine_",[smalltalk.send(smalltalk.send(self["@editor"],"_getCursor",[]),"_line",[])]);
+return $1;
+}
+}),
+smalltalk.HLCodeWidget);
+
+smalltalk.addMethod(
+"_currentLineOrSelection",
+smalltalk.method({
+selector: "currentLineOrSelection",
+fn: function (){
+var self=this;
+var $2,$1;
+$2=smalltalk.send(self["@editor"],"_somethingSelected",[]);
+if(smalltalk.assert($2)){
+$1=smalltalk.send(self,"_selection",[]);
+} else {
+$1=smalltalk.send(self,"_currentLine",[]);
+};
+return $1;
+}
+}),
+smalltalk.HLCodeWidget);
+
+smalltalk.addMethod(
+"_doIt",
+smalltalk.method({
+selector: "doIt",
+fn: function (){
+var self=this;
+var result;
+smalltalk.send(smalltalk.send(self,"_announcer",[]),"_announce_",[smalltalk.send((smalltalk.HLDoItRequested || HLDoItRequested),"_on_",[self["@model"]])]);
+result=smalltalk.send(self["@model"],"_doIt_",[smalltalk.send(self,"_currentLineOrSelection",[])]);
+smalltalk.send(smalltalk.send(self,"_announcer",[]),"_announce_",[smalltalk.send((smalltalk.HLDoItExecuted || HLDoItExecuted),"_on_",[self["@model"]])]);
+return result;
+}
+}),
+smalltalk.HLCodeWidget);
+
+smalltalk.addMethod(
+"_editor",
+smalltalk.method({
+selector: "editor",
+fn: function (){
+var self=this;
+return self["@editor"];
+}
+}),
+smalltalk.HLCodeWidget);
+
+smalltalk.addMethod(
+"_focus",
+smalltalk.method({
+selector: "focus",
+fn: function (){
+var self=this;
+smalltalk.send(smalltalk.send(self,"_editor",[]),"_focus",[]);
+return self}
+}),
+smalltalk.HLCodeWidget);
+
+smalltalk.addMethod(
+"_inspectIt",
+smalltalk.method({
+selector: "inspectIt",
+fn: function (){
+var self=this;
+var newInspector;
+smalltalk.send(smalltalk.send(self,"_announcer",[]),"_announce_",[smalltalk.send((smalltalk.HLInspectItRequested || HLInspectItRequested),"_on_",[self["@model"]])]);
+newInspector=smalltalk.send(self,"_makeInspectorOn_",[smalltalk.send(self,"_doIt",[])]);
+smalltalk.send(newInspector,"_open",[]);
+return self}
+}),
+smalltalk.HLCodeWidget);
+
+smalltalk.addMethod(
+"_makeInspectorOn_",
+smalltalk.method({
+selector: "makeInspectorOn:",
+fn: function (anObject){
+var self=this;
+var $2,$3,$1;
+$2=smalltalk.send((smalltalk.HLInspector || HLInspector),"_new",[]);
+smalltalk.send($2,"_inspect_",[anObject]);
+$3=smalltalk.send($2,"_yourself",[]);
+$1=$3;
+return $1;
+}
+}),
+smalltalk.HLCodeWidget);
+
+smalltalk.addMethod(
+"_model",
+smalltalk.method({
+selector: "model",
+fn: function (){
+var self=this;
+return self["@model"];
+}
+}),
+smalltalk.HLCodeWidget);
+
+smalltalk.addMethod(
+"_model_",
+smalltalk.method({
+selector: "model:",
+fn: function (aModel){
+var self=this;
+self["@model"]=aModel;
+return self}
+}),
+smalltalk.HLCodeWidget);
+
+smalltalk.addMethod(
+"_observeWrapper",
+smalltalk.method({
+selector: "observeWrapper",
+fn: function (){
+var self=this;
+smalltalk.send(self["@wrapper"],"_onKeyDown_",[(function(e){
+return smalltalk.send(self,"_onKeyDown_",[e]);
+})]);
+return self}
+}),
+smalltalk.HLCodeWidget);
+
+smalltalk.addMethod(
+"_onDoIt",
+smalltalk.method({
+selector: "onDoIt",
+fn: function (){
+var self=this;
+smalltalk.send(self,"_doIt",[]);
+return self}
+}),
+smalltalk.HLCodeWidget);
+
+smalltalk.addMethod(
+"_onInspectIt",
+smalltalk.method({
+selector: "onInspectIt",
+fn: function (){
+var self=this;
+smalltalk.send(self,"_inspectIt",[]);
+return self}
+}),
+smalltalk.HLCodeWidget);
+
+smalltalk.addMethod(
+"_onKeyDown_",
+smalltalk.method({
+selector: "onKeyDown:",
+fn: function (anEvent){
+var self=this;
+if(anEvent.ctrlKey) {
+		if(anEvent.keyCode === 80) { //ctrl+p
+			self._onPrintIt();
+			anEvent.preventDefault();
+			return false;
+		}
+		if(anEvent.keyCode === 68) { //ctrl+d
+			self._onDoIt();
+			anEvent.preventDefault();
+			return false;
+		}
+		if(anEvent.keyCode === 73) { //ctrl+i
+			self._onInspectIt();
+			anEvent.preventDefault();
+			return false;
+		}
+	};
+;
+return self}
+}),
+smalltalk.HLCodeWidget);
+
+smalltalk.addMethod(
+"_onPrintIt",
+smalltalk.method({
+selector: "onPrintIt",
+fn: function (){
+var self=this;
+smalltalk.send(self,"_printIt",[]);
+return self}
+}),
+smalltalk.HLCodeWidget);
+
+smalltalk.addMethod(
+"_print_",
+smalltalk.method({
+selector: "print:",
+fn: function (aString){
+var self=this;
+var start;
+var stop;
+start=smalltalk.send((smalltalk.HashedCollection || HashedCollection),"_new",[]);
+stop=smalltalk.send((smalltalk.HashedCollection || HashedCollection),"_new",[]);
+smalltalk.send(start,"_at_put_",["line",smalltalk.send(smalltalk.send(self["@editor"],"_getCursor_",[false]),"_line",[])]);
+smalltalk.send(start,"_at_put_",["ch",smalltalk.send(smalltalk.send(self["@editor"],"_getCursor_",[false]),"_ch",[])]);
+smalltalk.send(stop,"_at_put_",["line",smalltalk.send(start,"_at_",["line"])]);
+smalltalk.send(stop,"_at_put_",["ch",smalltalk.send(smalltalk.send(smalltalk.send(start,"_at_",["ch"]),"__plus",[smalltalk.send(aString,"_size",[])]),"__plus",[(2)])]);
+smalltalk.send(self["@editor"],"_replaceSelection_",[smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self["@editor"],"_getSelection",[]),"__comma",[" "]),"__comma",[aString]),"__comma",[" "])]);
+smalltalk.send(self["@editor"],"_setCursor_",[smalltalk.send(self["@editor"],"_getCursor_",[true])]);
+smalltalk.send(self["@editor"],"_setSelection_end_",[stop,start]);
+return self}
+}),
+smalltalk.HLCodeWidget);
+
+smalltalk.addMethod(
+"_printIt",
+smalltalk.method({
+selector: "printIt",
+fn: function (){
+var self=this;
+var result;
+result=smalltalk.send(self,"_doIt",[]);
+smalltalk.send(smalltalk.send(self,"_announcer",[]),"_announce_",[smalltalk.send((smalltalk.HLPrintItRequested || HLPrintItRequested),"_on_",[self["@model"]])]);
+smalltalk.send(self,"_print_",[smalltalk.send(result,"_printString",[])]);
+smalltalk.send(self,"_focus",[]);
+return self}
+}),
+smalltalk.HLCodeWidget);
+
+smalltalk.addMethod(
+"_receiver",
+smalltalk.method({
+selector: "receiver",
+fn: function (){
+var self=this;
+var $1;
+$1=smalltalk.send(smalltalk.send(self,"_model",[]),"_receiver",[]);
+return $1;
+}
+}),
+smalltalk.HLCodeWidget);
+
+smalltalk.addMethod(
+"_receiver_",
+smalltalk.method({
+selector: "receiver:",
+fn: function (anObject){
+var self=this;
+smalltalk.send(smalltalk.send(self,"_model",[]),"_receiver_",[anObject]);
+return self}
+}),
+smalltalk.HLCodeWidget);
+
+smalltalk.addMethod(
+"_renderOn_",
+smalltalk.method({
+selector: "renderOn:",
+fn: function (html){
+var self=this;
+self["@wrapper"]=smalltalk.send(smalltalk.send(html,"_div",[]),"_class_",["code"]);
+smalltalk.send(smalltalk.send(smalltalk.send(self,"_observeWrapper",[]),"_wrapper",[]),"_with_",[(function(){
+self["@code"]=smalltalk.send(html,"_textarea",[]);
+return self["@code"];
+})]);
+smalltalk.send(self,"_setEditorOn_",[smalltalk.send(self["@code"],"_element",[])]);
+return self}
+}),
+smalltalk.HLCodeWidget);
+
+smalltalk.addMethod(
+"_selection",
+smalltalk.method({
+selector: "selection",
+fn: function (){
+var self=this;
+var $1;
+$1=smalltalk.send(self["@editor"],"_getSelection",[]);
+return $1;
+}
+}),
+smalltalk.HLCodeWidget);
+
+smalltalk.addMethod(
+"_selectionEnd",
+smalltalk.method({
+selector: "selectionEnd",
+fn: function (){
+var self=this;
+var $1;
+$1=smalltalk.send(smalltalk.send(self["@code"],"_element",[]),"_selectionEnd",[]);
+return $1;
+}
+}),
+smalltalk.HLCodeWidget);
+
+smalltalk.addMethod(
+"_selectionEnd_",
+smalltalk.method({
+selector: "selectionEnd:",
+fn: function (anInteger){
+var self=this;
+smalltalk.send(smalltalk.send(self["@code"],"_element",[]),"_selectionEnd_",[anInteger]);
+return self}
+}),
+smalltalk.HLCodeWidget);
+
+smalltalk.addMethod(
+"_selectionStart",
+smalltalk.method({
+selector: "selectionStart",
+fn: function (){
+var self=this;
+var $1;
+$1=smalltalk.send(smalltalk.send(self["@code"],"_element",[]),"_selectionStart",[]);
+return $1;
+}
+}),
+smalltalk.HLCodeWidget);
+
+smalltalk.addMethod(
+"_selectionStart_",
+smalltalk.method({
+selector: "selectionStart:",
+fn: function (anInteger){
+var self=this;
+smalltalk.send(smalltalk.send(self["@code"],"_element",[]),"_selectionStart_",[anInteger]);
+return self}
+}),
+smalltalk.HLCodeWidget);
+
+smalltalk.addMethod(
+"_setEditorOn_",
+smalltalk.method({
+selector: "setEditorOn:",
+fn: function (aTextarea){
+var self=this;
+self['@editor'] = CodeMirror.fromTextArea(aTextarea, {
+		theme: 'amber',
+                lineNumbers: true,
+                enterMode: 'flat',
+                matchBrackets: true,
+                electricChars: false
+	});
+;
+return self}
+}),
+smalltalk.HLCodeWidget);
+
+smalltalk.addMethod(
+"_val",
+smalltalk.method({
+selector: "val",
+fn: function (){
+var self=this;
+var $1;
+$1=smalltalk.send(self["@code"],"_getValue",[]);
+return $1;
+}
+}),
+smalltalk.HLCodeWidget);
+
+smalltalk.addMethod(
+"_val_",
+smalltalk.method({
+selector: "val:",
+fn: function (aString){
+var self=this;
+smalltalk.send(self["@code"],"_setValue_",[aString]);
+return self}
+}),
+smalltalk.HLCodeWidget);
+
+smalltalk.addMethod(
+"_wrapper",
+smalltalk.method({
+selector: "wrapper",
+fn: function (){
+var self=this;
+return self["@wrapper"];
+}
+}),
+smalltalk.HLCodeWidget);
+
+
+
+smalltalk.addClass('HLWorkspace', smalltalk.HLWidget, ['model', 'code'], 'Helios-Workspace');
+smalltalk.addMethod(
+"_code",
+smalltalk.method({
+selector: "code",
+fn: function (){
+var self=this;
+var $1;
+if(($receiver = self["@code"]) == nil || $receiver == undefined){
+$1=smalltalk.send(self,"_initializeCode",[]);
+} else {
+$1=self["@code"];
+};
+return $1;
+}
+}),
+smalltalk.HLWorkspace);
+
+smalltalk.addMethod(
+"_ensureModel",
+smalltalk.method({
+selector: "ensureModel",
+fn: function (){
+var self=this;
+if(($receiver = self["@model"]) == nil || $receiver == undefined){
+smalltalk.send(self,"_model_",[smalltalk.send(self,"_model",[])]);
+} else {
+self["@model"];
+};
+return self}
+}),
+smalltalk.HLWorkspace);
+
+smalltalk.addMethod(
+"_initializeCode",
+smalltalk.method({
+selector: "initializeCode",
+fn: function (){
+var self=this;
+var $1;
+self["@code"]=smalltalk.send(self,"_makeCode",[]);
+$1=self["@code"];
+return $1;
+}
+}),
+smalltalk.HLWorkspace);
+
+smalltalk.addMethod(
+"_initializeModel",
+smalltalk.method({
+selector: "initializeModel",
+fn: function (){
+var self=this;
+var $1;
+self["@model"]=smalltalk.send((smalltalk.HLWorkspaceModel || HLWorkspaceModel),"_new",[]);
+$1=self["@model"];
+return $1;
+}
+}),
+smalltalk.HLWorkspace);
+
+smalltalk.addMethod(
+"_makeCode",
+smalltalk.method({
+selector: "makeCode",
+fn: function (){
+var self=this;
+var $2,$3,$1;
+$2=smalltalk.send((smalltalk.HLCodeWidget || HLCodeWidget),"_new",[]);
+smalltalk.send($2,"_model_",[smalltalk.send(self["@model"],"_code",[])]);
+$3=smalltalk.send($2,"_yourself",[]);
+$1=$3;
+return $1;
+}
+}),
+smalltalk.HLWorkspace);
+
+smalltalk.addMethod(
+"_model",
+smalltalk.method({
+selector: "model",
+fn: function (){
+var self=this;
+var $1;
+if(($receiver = self["@model"]) == nil || $receiver == undefined){
+$1=smalltalk.send(self,"_initializeModel",[]);
+} else {
+$1=self["@model"];
+};
+return $1;
+}
+}),
+smalltalk.HLWorkspace);
+
+smalltalk.addMethod(
+"_model_",
+smalltalk.method({
+selector: "model:",
+fn: function (aModel){
+var self=this;
+self["@model"]=aModel;
+smalltalk.send(smalltalk.send(self,"_code",[]),"_model_",[smalltalk.send(aModel,"_code",[])]);
+smalltalk.send(self,"_observeCode",[]);
+return self}
+}),
+smalltalk.HLWorkspace);
+
+smalltalk.addMethod(
+"_observeCode",
+smalltalk.method({
+selector: "observeCode",
+fn: function (){
+var self=this;
+return self}
+}),
+smalltalk.HLWorkspace);
+
+smalltalk.addMethod(
+"_onDoIt",
+smalltalk.method({
+selector: "onDoIt",
+fn: function (){
+var self=this;
+return self}
+}),
+smalltalk.HLWorkspace);
+
+smalltalk.addMethod(
+"_onInspectIt",
+smalltalk.method({
+selector: "onInspectIt",
+fn: function (){
+var self=this;
+return self}
+}),
+smalltalk.HLWorkspace);
+
+smalltalk.addMethod(
+"_onPrintIt",
+smalltalk.method({
+selector: "onPrintIt",
+fn: function (){
+var self=this;
+return self}
+}),
+smalltalk.HLWorkspace);
+
+smalltalk.addMethod(
+"_renderContentOn_",
+smalltalk.method({
+selector: "renderContentOn:",
+fn: function (html){
+var self=this;
+smalltalk.send(self,"_ensureModel",[]);
+smalltalk.send(html,"_with_",[smalltalk.send(self,"_code",[])]);
+return self}
+}),
+smalltalk.HLWorkspace);
+
+
+smalltalk.addMethod(
+"_canBeOpenAsTab",
+smalltalk.method({
+selector: "canBeOpenAsTab",
+fn: function (){
+var self=this;
+return true;
+}
+}),
+smalltalk.HLWorkspace.klass);
+
+smalltalk.addMethod(
+"_tabLabel",
+smalltalk.method({
+selector: "tabLabel",
+fn: function (){
+var self=this;
+return "Workspace";
+}
+}),
+smalltalk.HLWorkspace.klass);
+
+smalltalk.addMethod(
+"_tabPriority",
+smalltalk.method({
+selector: "tabPriority",
+fn: function (){
+var self=this;
+return (10);
+}
+}),
+smalltalk.HLWorkspace.klass);
+
+
+smalltalk.addClass('HLWorkspaceModel', smalltalk.Object, ['announcer', 'environment', 'code'], 'Helios-Workspace');
+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.HLWorkspaceModel);
+
+smalltalk.addMethod(
+"_beLocal",
+smalltalk.method({
+selector: "beLocal",
+fn: function (){
+var self=this;
+smalltalk.send(self,"_initializeEnvironment",[]);
+return self}
+}),
+smalltalk.HLWorkspaceModel);
+
+smalltalk.addMethod(
+"_beRemoteOn_port_",
+smalltalk.method({
+selector: "beRemoteOn:port:",
+fn: function (anIPAddress,aPort){
+var self=this;
+return self}
+}),
+smalltalk.HLWorkspaceModel);
+
+smalltalk.addMethod(
+"_code",
+smalltalk.method({
+selector: "code",
+fn: function (){
+var self=this;
+var $1;
+if(($receiver = self["@code"]) == nil || $receiver == undefined){
+$1=smalltalk.send(self,"_initializeCode",[]);
+} else {
+$1=self["@code"];
+};
+return $1;
+}
+}),
+smalltalk.HLWorkspaceModel);
+
+smalltalk.addMethod(
+"_environment",
+smalltalk.method({
+selector: "environment",
+fn: function (){
+var self=this;
+var $1;
+if(($receiver = self["@environment"]) == nil || $receiver == undefined){
+$1=smalltalk.send(self,"_initializeEnvironment",[]);
+} else {
+$1=self["@environment"];
+};
+return $1;
+}
+}),
+smalltalk.HLWorkspaceModel);
+
+smalltalk.addMethod(
+"_environment_",
+smalltalk.method({
+selector: "environment:",
+fn: function (anEnvironment){
+var self=this;
+self["@environment"]=anEnvironment;
+return self}
+}),
+smalltalk.HLWorkspaceModel);
+
+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.HLWorkspaceModel);
+
+smalltalk.addMethod(
+"_initializeCode",
+smalltalk.method({
+selector: "initializeCode",
+fn: function (){
+var self=this;
+var $1;
+self["@code"]=smalltalk.send((smalltalk.HLCodeModel || HLCodeModel),"_on_",[smalltalk.send(self,"_environment",[])]);
+$1=self["@code"];
+return $1;
+}
+}),
+smalltalk.HLWorkspaceModel);
+
+smalltalk.addMethod(
+"_initializeEnvironment",
+smalltalk.method({
+selector: "initializeEnvironment",
+fn: function (){
+var self=this;
+var $1;
+self["@environment"]=smalltalk.send((smalltalk.HLLocalEnvironment || HLLocalEnvironment),"_new",[]);
+$1=self["@environment"];
+return $1;
+}
+}),
+smalltalk.HLWorkspaceModel);
+
+smalltalk.addMethod(
+"_onKeyDown_",
+smalltalk.method({
+selector: "onKeyDown:",
+fn: function (anEvent){
+var self=this;
+if(anEvent.ctrlKey) {
+		if(anEvent.keyCode === 80) { //ctrl+p
+			self._printIt();
+			anEvent.preventDefault();
+			return false;
+		}
+		if(anEvent.keyCode === 68) { //ctrl+d
+			self._doIt();
+			anEvent.preventDefault();
+			return false;
+		}
+		if(anEvent.keyCode === 73) { //ctrl+i
+			self._inspectIt();
+			anEvent.preventDefault();
+			return false;
+		}
+	};
+;
+return self}
+}),
+smalltalk.HLWorkspaceModel);
+
+smalltalk.addMethod(
+"_subscribe_",
+smalltalk.method({
+selector: "subscribe:",
+fn: function (aWidget){
+var self=this;
+smalltalk.send(aWidget,"_subscribeTo_",[smalltalk.send(self,"_announcer",[])]);
+return self}
+}),
+smalltalk.HLWorkspaceModel);
+
+
+smalltalk.addMethod(
+"_on_",
+smalltalk.method({
+selector: "on:",
+fn: function (anEnvironment){
+var self=this;
+var $2,$3,$1;
+$2=smalltalk.send(self,"_new",[]);
+smalltalk.send($2,"_environment_",[anEnvironment]);
+$3=smalltalk.send($2,"_yourself",[]);
+$1=$3;
+return $1;
+}
+}),
+smalltalk.HLWorkspaceModel.klass);
+
+

+ 1281 - 0
js/Helios-Workspace.js

@@ -0,0 +1,1281 @@
+smalltalk.addPackage('Helios-Workspace', {});
+smalltalk.addClass('HLCodeModel', smalltalk.Object, ['announcer', 'environment', 'receiver'], 'Helios-Workspace');
+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\x09^ announcer ifNil: [ self initializeAnnouncer ]",
+messageSends: ["ifNil:", "initializeAnnouncer"],
+referencedClasses: []
+}),
+smalltalk.HLCodeModel);
+
+smalltalk.addMethod(
+"_doIt_",
+smalltalk.method({
+selector: "doIt:",
+category: 'actions',
+fn: function (someCode){
+var self=this;
+var $1;
+$1=smalltalk.send(smalltalk.send(self,"_environment",[]),"_eval_on_",[someCode,smalltalk.send(self,"_receiver",[])]);
+return $1;
+},
+args: ["someCode"],
+source: "doIt: someCode\x0a\x0a\x09^ self environment eval: someCode on: self receiver",
+messageSends: ["eval:on:", "receiver", "environment"],
+referencedClasses: []
+}),
+smalltalk.HLCodeModel);
+
+smalltalk.addMethod(
+"_environment",
+smalltalk.method({
+selector: "environment",
+category: 'accessing',
+fn: function (){
+var self=this;
+var $1;
+if(($receiver = self["@environment"]) == nil || $receiver == undefined){
+$1=smalltalk.send(self,"_initializeEnvironment",[]);
+} else {
+$1=self["@environment"];
+};
+return $1;
+},
+args: [],
+source: "environment\x0a\x09^ environment ifNil: [ self initializeEnvironment]",
+messageSends: ["ifNil:", "initializeEnvironment"],
+referencedClasses: []
+}),
+smalltalk.HLCodeModel);
+
+smalltalk.addMethod(
+"_environment_",
+smalltalk.method({
+selector: "environment:",
+category: 'accessing',
+fn: function (anEnvironment){
+var self=this;
+self["@environment"]=anEnvironment;
+return self},
+args: ["anEnvironment"],
+source: "environment: anEnvironment\x0a\x09environment := anEnvironment",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLCodeModel);
+
+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\x09^ announcer := Announcer new",
+messageSends: ["new"],
+referencedClasses: ["Announcer"]
+}),
+smalltalk.HLCodeModel);
+
+smalltalk.addMethod(
+"_initializeEnvironment",
+smalltalk.method({
+selector: "initializeEnvironment",
+category: 'initialization',
+fn: function (){
+var self=this;
+var $1;
+self["@environment"]=smalltalk.send((smalltalk.Smalltalk || Smalltalk),"_current",[]);
+$1=self["@environment"];
+return $1;
+},
+args: [],
+source: "initializeEnvironment\x0a\x09^ environment := Smalltalk current ",
+messageSends: ["current"],
+referencedClasses: ["Smalltalk"]
+}),
+smalltalk.HLCodeModel);
+
+smalltalk.addMethod(
+"_initializeReceiver",
+smalltalk.method({
+selector: "initializeReceiver",
+category: 'initialization',
+fn: function (){
+var self=this;
+var $1;
+self["@receiver"]=smalltalk.send((smalltalk.DoIt || DoIt),"_new",[]);
+$1=self["@receiver"];
+return $1;
+},
+args: [],
+source: "initializeReceiver\x0a\x09^receiver := DoIt new",
+messageSends: ["new"],
+referencedClasses: ["DoIt"]
+}),
+smalltalk.HLCodeModel);
+
+smalltalk.addMethod(
+"_receiver",
+smalltalk.method({
+selector: "receiver",
+category: 'accessing',
+fn: function (){
+var self=this;
+return self["@receiver"];
+},
+args: [],
+source: "receiver\x0a\x09^ receiver",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLCodeModel);
+
+smalltalk.addMethod(
+"_receiver_",
+smalltalk.method({
+selector: "receiver:",
+category: 'accessing',
+fn: function (anObject){
+var self=this;
+self["@receiver"]=anObject;
+return self},
+args: ["anObject"],
+source: "receiver: anObject\x0a\x09receiver := anObject",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLCodeModel);
+
+smalltalk.addMethod(
+"_subscribe_",
+smalltalk.method({
+selector: "subscribe:",
+category: 'actions',
+fn: function (aWidget){
+var self=this;
+smalltalk.send(aWidget,"_subscribeTo_",[smalltalk.send(self,"_announcer",[])]);
+return self},
+args: ["aWidget"],
+source: "subscribe: aWidget\x0a\x09aWidget subscribeTo: self announcer",
+messageSends: ["subscribeTo:", "announcer"],
+referencedClasses: []
+}),
+smalltalk.HLCodeModel);
+
+
+smalltalk.addMethod(
+"_on_",
+smalltalk.method({
+selector: "on:",
+category: 'actions',
+fn: function (anEnvironment){
+var self=this;
+var $2,$3,$1;
+$2=smalltalk.send(self,"_new",[]);
+smalltalk.send($2,"_environment_",[anEnvironment]);
+$3=smalltalk.send($2,"_yourself",[]);
+$1=$3;
+return $1;
+},
+args: ["anEnvironment"],
+source: "on: anEnvironment\x0a\x0a\x09^ self new\x0a    \x09environment: anEnvironment;\x0a        yourself",
+messageSends: ["environment:", "new", "yourself"],
+referencedClasses: []
+}),
+smalltalk.HLCodeModel.klass);
+
+
+smalltalk.addClass('HLCodeWidget', smalltalk.HLWidget, ['model', 'wrapper', 'code', 'editor'], 'Helios-Workspace');
+smalltalk.addMethod(
+"_announcer",
+smalltalk.method({
+selector: "announcer",
+category: 'accessing',
+fn: function (){
+var self=this;
+var $1;
+$1=smalltalk.send(smalltalk.send(self,"_model",[]),"_announcer",[]);
+return $1;
+},
+args: [],
+source: "announcer\x0a\x09^ self model announcer",
+messageSends: ["announcer", "model"],
+referencedClasses: []
+}),
+smalltalk.HLCodeWidget);
+
+smalltalk.addMethod(
+"_clear",
+smalltalk.method({
+selector: "clear",
+category: 'actions',
+fn: function (){
+var self=this;
+smalltalk.send(self,"_val_",[""]);
+return self},
+args: [],
+source: "clear\x0a      self val: ''",
+messageSends: ["val:"],
+referencedClasses: []
+}),
+smalltalk.HLCodeWidget);
+
+smalltalk.addMethod(
+"_currentLine",
+smalltalk.method({
+selector: "currentLine",
+category: 'accessing',
+fn: function (){
+var self=this;
+var $1;
+$1=smalltalk.send(self["@editor"],"_getLine_",[smalltalk.send(smalltalk.send(self["@editor"],"_getCursor",[]),"_line",[])]);
+return $1;
+},
+args: [],
+source: "currentLine\x0a    ^editor getLine: (editor getCursor line)",
+messageSends: ["getLine:", "line", "getCursor"],
+referencedClasses: []
+}),
+smalltalk.HLCodeWidget);
+
+smalltalk.addMethod(
+"_currentLineOrSelection",
+smalltalk.method({
+selector: "currentLineOrSelection",
+category: 'accessing',
+fn: function (){
+var self=this;
+var $2,$1;
+$2=smalltalk.send(self["@editor"],"_somethingSelected",[]);
+if(smalltalk.assert($2)){
+$1=smalltalk.send(self,"_selection",[]);
+} else {
+$1=smalltalk.send(self,"_currentLine",[]);
+};
+return $1;
+},
+args: [],
+source: "currentLineOrSelection\x0a    ^editor somethingSelected\x0a\x09\x09ifFalse: [self currentLine]\x0a\x09\x09ifTrue: [self selection]",
+messageSends: ["ifFalse:ifTrue:", "currentLine", "selection", "somethingSelected"],
+referencedClasses: []
+}),
+smalltalk.HLCodeWidget);
+
+smalltalk.addMethod(
+"_doIt",
+smalltalk.method({
+selector: "doIt",
+category: 'actions',
+fn: function (){
+var self=this;
+var result;
+smalltalk.send(smalltalk.send(self,"_announcer",[]),"_announce_",[smalltalk.send((smalltalk.HLDoItRequested || HLDoItRequested),"_on_",[self["@model"]])]);
+result=smalltalk.send(self["@model"],"_doIt_",[smalltalk.send(self,"_currentLineOrSelection",[])]);
+smalltalk.send(smalltalk.send(self,"_announcer",[]),"_announce_",[smalltalk.send((smalltalk.HLDoItExecuted || HLDoItExecuted),"_on_",[self["@model"]])]);
+return result;
+},
+args: [],
+source: "doIt\x0a\x09| result |\x0a\x0a\x09self announcer announce: (HLDoItRequested on: model).\x0a\x0a\x09result:=  model doIt: self currentLineOrSelection.\x0a\x0a\x09self announcer announce: (HLDoItExecuted on: model).\x0a\x0a\x09^ result        ",
+messageSends: ["announce:", "on:", "announcer", "doIt:", "currentLineOrSelection"],
+referencedClasses: ["HLDoItRequested", "HLDoItExecuted"]
+}),
+smalltalk.HLCodeWidget);
+
+smalltalk.addMethod(
+"_editor",
+smalltalk.method({
+selector: "editor",
+category: 'actions',
+fn: function (){
+var self=this;
+return self["@editor"];
+},
+args: [],
+source: "editor\x0a\x09^editor",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLCodeWidget);
+
+smalltalk.addMethod(
+"_focus",
+smalltalk.method({
+selector: "focus",
+category: 'actions',
+fn: function (){
+var self=this;
+smalltalk.send(smalltalk.send(self,"_editor",[]),"_focus",[]);
+return self},
+args: [],
+source: "focus\x0a      self editor focus",
+messageSends: ["focus", "editor"],
+referencedClasses: []
+}),
+smalltalk.HLCodeWidget);
+
+smalltalk.addMethod(
+"_inspectIt",
+smalltalk.method({
+selector: "inspectIt",
+category: 'actions',
+fn: function (){
+var self=this;
+var newInspector;
+smalltalk.send(smalltalk.send(self,"_announcer",[]),"_announce_",[smalltalk.send((smalltalk.HLInspectItRequested || HLInspectItRequested),"_on_",[self["@model"]])]);
+newInspector=smalltalk.send(self,"_makeInspectorOn_",[smalltalk.send(self,"_doIt",[])]);
+smalltalk.send(newInspector,"_open",[]);
+return self},
+args: [],
+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);
+
+smalltalk.addMethod(
+"_makeInspectorOn_",
+smalltalk.method({
+selector: "makeInspectorOn:",
+category: 'actions',
+fn: function (anObject){
+var self=this;
+var $2,$3,$1;
+$2=smalltalk.send((smalltalk.HLInspector || HLInspector),"_new",[]);
+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: anObject;\x0a\x09\x09yourself",
+messageSends: ["inspect:", "new", "yourself"],
+referencedClasses: ["HLInspector"]
+}),
+smalltalk.HLCodeWidget);
+
+smalltalk.addMethod(
+"_model",
+smalltalk.method({
+selector: "model",
+category: 'accessing',
+fn: function (){
+var self=this;
+return self["@model"];
+},
+args: [],
+source: "model\x0a\x0a\x09^ model ",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLCodeWidget);
+
+smalltalk.addMethod(
+"_model_",
+smalltalk.method({
+selector: "model:",
+category: 'accessing',
+fn: function (aModel){
+var self=this;
+self["@model"]=aModel;
+return self},
+args: ["aModel"],
+source: "model: aModel\x0a\x0a\x09model := aModel",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLCodeWidget);
+
+smalltalk.addMethod(
+"_observeWrapper",
+smalltalk.method({
+selector: "observeWrapper",
+category: 'actions',
+fn: function (){
+var self=this;
+smalltalk.send(self["@wrapper"],"_onKeyDown_",[(function(e){
+return smalltalk.send(self,"_onKeyDown_",[e]);
+})]);
+return self},
+args: [],
+source: "observeWrapper\x0a\x0a    wrapper onKeyDown: [:e | self onKeyDown: e]\x0a",
+messageSends: ["onKeyDown:"],
+referencedClasses: []
+}),
+smalltalk.HLCodeWidget);
+
+smalltalk.addMethod(
+"_onDoIt",
+smalltalk.method({
+selector: "onDoIt",
+category: 'reactions',
+fn: function (){
+var self=this;
+smalltalk.send(self,"_doIt",[]);
+return self},
+args: [],
+source: "onDoIt\x0a\x09\x0a    self doIt",
+messageSends: ["doIt"],
+referencedClasses: []
+}),
+smalltalk.HLCodeWidget);
+
+smalltalk.addMethod(
+"_onInspectIt",
+smalltalk.method({
+selector: "onInspectIt",
+category: 'reactions',
+fn: function (){
+var self=this;
+smalltalk.send(self,"_inspectIt",[]);
+return self},
+args: [],
+source: "onInspectIt\x0a\x0a\x09self inspectIt",
+messageSends: ["inspectIt"],
+referencedClasses: []
+}),
+smalltalk.HLCodeWidget);
+
+smalltalk.addMethod(
+"_onKeyDown_",
+smalltalk.method({
+selector: "onKeyDown:",
+category: 'reactions',
+fn: function (anEvent){
+var self=this;
+if(anEvent.ctrlKey) {
+		if(anEvent.keyCode === 80) { //ctrl+p
+			self._onPrintIt();
+			anEvent.preventDefault();
+			return false;
+		}
+		if(anEvent.keyCode === 68) { //ctrl+d
+			self._onDoIt();
+			anEvent.preventDefault();
+			return false;
+		}
+		if(anEvent.keyCode === 73) { //ctrl+i
+			self._onInspectIt();
+			anEvent.preventDefault();
+			return false;
+		}
+	};
+;
+return self},
+args: ["anEvent"],
+source: "onKeyDown: anEvent\x0a\x0a    <if(anEvent.ctrlKey) {\x0a\x09\x09if(anEvent.keyCode === 80) { //ctrl+p\x0a\x09\x09\x09self._onPrintIt();\x0a\x09\x09\x09anEvent.preventDefault();\x0a\x09\x09\x09return false;\x0a\x09\x09}\x0a\x09\x09if(anEvent.keyCode === 68) { //ctrl+d\x0a\x09\x09\x09self._onDoIt();\x0a\x09\x09\x09anEvent.preventDefault();\x0a\x09\x09\x09return false;\x0a\x09\x09}\x0a\x09\x09if(anEvent.keyCode === 73) { //ctrl+i\x0a\x09\x09\x09self._onInspectIt();\x0a\x09\x09\x09anEvent.preventDefault();\x0a\x09\x09\x09return false;\x0a\x09\x09}\x0a\x09}>\x09",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLCodeWidget);
+
+smalltalk.addMethod(
+"_onPrintIt",
+smalltalk.method({
+selector: "onPrintIt",
+category: 'reactions',
+fn: function (){
+var self=this;
+smalltalk.send(self,"_printIt",[]);
+return self},
+args: [],
+source: "onPrintIt\x0a\x0a\x09self printIt",
+messageSends: ["printIt"],
+referencedClasses: []
+}),
+smalltalk.HLCodeWidget);
+
+smalltalk.addMethod(
+"_print_",
+smalltalk.method({
+selector: "print:",
+category: 'actions',
+fn: function (aString){
+var self=this;
+var start;
+var stop;
+start=smalltalk.send((smalltalk.HashedCollection || HashedCollection),"_new",[]);
+stop=smalltalk.send((smalltalk.HashedCollection || HashedCollection),"_new",[]);
+smalltalk.send(start,"_at_put_",["line",smalltalk.send(smalltalk.send(self["@editor"],"_getCursor_",[false]),"_line",[])]);
+smalltalk.send(start,"_at_put_",["ch",smalltalk.send(smalltalk.send(self["@editor"],"_getCursor_",[false]),"_ch",[])]);
+smalltalk.send(stop,"_at_put_",["line",smalltalk.send(start,"_at_",["line"])]);
+smalltalk.send(stop,"_at_put_",["ch",smalltalk.send(smalltalk.send(smalltalk.send(start,"_at_",["ch"]),"__plus",[smalltalk.send(aString,"_size",[])]),"__plus",[(2)])]);
+smalltalk.send(self["@editor"],"_replaceSelection_",[smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self["@editor"],"_getSelection",[]),"__comma",[" "]),"__comma",[aString]),"__comma",[" "])]);
+smalltalk.send(self["@editor"],"_setCursor_",[smalltalk.send(self["@editor"],"_getCursor_",[true])]);
+smalltalk.send(self["@editor"],"_setSelection_end_",[stop,start]);
+return self},
+args: ["aString"],
+source: "print: aString\x0a\x09| start stop |\x0a\x09start := HashedCollection new.\x0a\x09stop := HashedCollection new.\x0a\x09start at: 'line' put: (editor getCursor: false) line.\x0a\x09start at: 'ch' put: (editor getCursor: false) ch.\x0a\x09stop at: 'line' put: (start at: 'line').\x0a\x09stop at: 'ch' put: ((start at: 'ch') + aString size + 2).\x0a\x09editor replaceSelection: (editor getSelection, ' ', aString, ' ').\x0a\x09editor setCursor: (editor getCursor: true).\x0a\x09editor setSelection: stop end: start",
+messageSends: ["new", "at:put:", "line", "getCursor:", "ch", "at:", "+", "size", "replaceSelection:", ",", "getSelection", "setCursor:", "setSelection:end:"],
+referencedClasses: ["HashedCollection"]
+}),
+smalltalk.HLCodeWidget);
+
+smalltalk.addMethod(
+"_printIt",
+smalltalk.method({
+selector: "printIt",
+category: 'actions',
+fn: function (){
+var self=this;
+var result;
+result=smalltalk.send(self,"_doIt",[]);
+smalltalk.send(smalltalk.send(self,"_announcer",[]),"_announce_",[smalltalk.send((smalltalk.HLPrintItRequested || HLPrintItRequested),"_on_",[self["@model"]])]);
+smalltalk.send(self,"_print_",[smalltalk.send(result,"_printString",[])]);
+smalltalk.send(self,"_focus",[]);
+return self},
+args: [],
+source: "printIt\x0a\x0a\x09| result |\x0a\x0a\x09result:=  self doIt.\x0a       \x0a\x09self announcer announce: (HLPrintItRequested on: model).\x0a\x0a    self print: result printString.\x0a\x09self focus.",
+messageSends: ["doIt", "announce:", "on:", "announcer", "print:", "printString", "focus"],
+referencedClasses: ["HLPrintItRequested"]
+}),
+smalltalk.HLCodeWidget);
+
+smalltalk.addMethod(
+"_receiver",
+smalltalk.method({
+selector: "receiver",
+category: 'accessing',
+fn: function (){
+var self=this;
+var $1;
+$1=smalltalk.send(smalltalk.send(self,"_model",[]),"_receiver",[]);
+return $1;
+},
+args: [],
+source: "receiver\x0a\x09^ self model receiver",
+messageSends: ["receiver", "model"],
+referencedClasses: []
+}),
+smalltalk.HLCodeWidget);
+
+smalltalk.addMethod(
+"_receiver_",
+smalltalk.method({
+selector: "receiver:",
+category: 'accessing',
+fn: function (anObject){
+var self=this;
+smalltalk.send(smalltalk.send(self,"_model",[]),"_receiver_",[anObject]);
+return self},
+args: ["anObject"],
+source: "receiver: anObject\x0a\x09self model receiver: anObject",
+messageSends: ["receiver:", "model"],
+referencedClasses: []
+}),
+smalltalk.HLCodeWidget);
+
+smalltalk.addMethod(
+"_renderOn_",
+smalltalk.method({
+selector: "renderOn:",
+category: 'rendering',
+fn: function (html){
+var self=this;
+self["@wrapper"]=smalltalk.send(smalltalk.send(html,"_div",[]),"_class_",["code"]);
+smalltalk.send(smalltalk.send(smalltalk.send(self,"_observeWrapper",[]),"_wrapper",[]),"_with_",[(function(){
+self["@code"]=smalltalk.send(html,"_textarea",[]);
+return self["@code"];
+})]);
+smalltalk.send(self,"_setEditorOn_",[smalltalk.send(self["@code"],"_element",[])]);
+return self},
+args: ["html"],
+source: "renderOn: html\x0a    wrapper := html div class: 'code'.\x0a    self observeWrapper\x0a    wrapper with: [code := html textarea].\x0a    self setEditorOn: code element.\x0a    \x0a",
+messageSends: ["class:", "div", "with:", "textarea", "wrapper", "observeWrapper", "setEditorOn:", "element"],
+referencedClasses: []
+}),
+smalltalk.HLCodeWidget);
+
+smalltalk.addMethod(
+"_selection",
+smalltalk.method({
+selector: "selection",
+category: 'accessing',
+fn: function (){
+var self=this;
+var $1;
+$1=smalltalk.send(self["@editor"],"_getSelection",[]);
+return $1;
+},
+args: [],
+source: "selection\x0a\x09^editor getSelection",
+messageSends: ["getSelection"],
+referencedClasses: []
+}),
+smalltalk.HLCodeWidget);
+
+smalltalk.addMethod(
+"_selectionEnd",
+smalltalk.method({
+selector: "selectionEnd",
+category: 'accessing',
+fn: function (){
+var self=this;
+var $1;
+$1=smalltalk.send(smalltalk.send(self["@code"],"_element",[]),"_selectionEnd",[]);
+return $1;
+},
+args: [],
+source: "selectionEnd\x0a   ^code element selectionEnd",
+messageSends: ["selectionEnd", "element"],
+referencedClasses: []
+}),
+smalltalk.HLCodeWidget);
+
+smalltalk.addMethod(
+"_selectionEnd_",
+smalltalk.method({
+selector: "selectionEnd:",
+category: 'accessing',
+fn: function (anInteger){
+var self=this;
+smalltalk.send(smalltalk.send(self["@code"],"_element",[]),"_selectionEnd_",[anInteger]);
+return self},
+args: ["anInteger"],
+source: "selectionEnd: anInteger\x0a   code element selectionEnd: anInteger",
+messageSends: ["selectionEnd:", "element"],
+referencedClasses: []
+}),
+smalltalk.HLCodeWidget);
+
+smalltalk.addMethod(
+"_selectionStart",
+smalltalk.method({
+selector: "selectionStart",
+category: 'accessing',
+fn: function (){
+var self=this;
+var $1;
+$1=smalltalk.send(smalltalk.send(self["@code"],"_element",[]),"_selectionStart",[]);
+return $1;
+},
+args: [],
+source: "selectionStart\x0a   ^code element selectionStart",
+messageSends: ["selectionStart", "element"],
+referencedClasses: []
+}),
+smalltalk.HLCodeWidget);
+
+smalltalk.addMethod(
+"_selectionStart_",
+smalltalk.method({
+selector: "selectionStart:",
+category: 'accessing',
+fn: function (anInteger){
+var self=this;
+smalltalk.send(smalltalk.send(self["@code"],"_element",[]),"_selectionStart_",[anInteger]);
+return self},
+args: ["anInteger"],
+source: "selectionStart: anInteger\x0a   code element selectionStart: anInteger",
+messageSends: ["selectionStart:", "element"],
+referencedClasses: []
+}),
+smalltalk.HLCodeWidget);
+
+smalltalk.addMethod(
+"_setEditorOn_",
+smalltalk.method({
+selector: "setEditorOn:",
+category: 'actions',
+fn: function (aTextarea){
+var self=this;
+self['@editor'] = CodeMirror.fromTextArea(aTextarea, {
+		theme: 'amber',
+                lineNumbers: true,
+                enterMode: 'flat',
+                matchBrackets: true,
+                electricChars: false
+	});
+;
+return self},
+args: ["aTextarea"],
+source: "setEditorOn: aTextarea\x0a\x09<self['@editor'] = CodeMirror.fromTextArea(aTextarea, {\x0a\x09\x09theme: 'amber',\x0a                lineNumbers: true,\x0a                enterMode: 'flat',\x0a                matchBrackets: true,\x0a                electricChars: false\x0a\x09})>",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLCodeWidget);
+
+smalltalk.addMethod(
+"_val",
+smalltalk.method({
+selector: "val",
+category: 'accessing',
+fn: function (){
+var self=this;
+var $1;
+$1=smalltalk.send(self["@code"],"_getValue",[]);
+return $1;
+},
+args: [],
+source: "val\x0a\x09^ code getValue",
+messageSends: ["getValue"],
+referencedClasses: []
+}),
+smalltalk.HLCodeWidget);
+
+smalltalk.addMethod(
+"_val_",
+smalltalk.method({
+selector: "val:",
+category: 'accessing',
+fn: function (aString){
+var self=this;
+smalltalk.send(self["@code"],"_setValue_",[aString]);
+return self},
+args: ["aString"],
+source: "val: aString\x0a    code setValue: aString",
+messageSends: ["setValue:"],
+referencedClasses: []
+}),
+smalltalk.HLCodeWidget);
+
+smalltalk.addMethod(
+"_wrapper",
+smalltalk.method({
+selector: "wrapper",
+category: 'accessing',
+fn: function (){
+var self=this;
+return self["@wrapper"];
+},
+args: [],
+source: "wrapper\x0a\x0a\x09^ wrapper",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLCodeWidget);
+
+
+
+smalltalk.addClass('HLWorkspace', smalltalk.HLWidget, ['model', 'code'], 'Helios-Workspace');
+smalltalk.addMethod(
+"_code",
+smalltalk.method({
+selector: "code",
+category: 'accessing',
+fn: function (){
+var self=this;
+var $1;
+if(($receiver = self["@code"]) == nil || $receiver == undefined){
+$1=smalltalk.send(self,"_initializeCode",[]);
+} else {
+$1=self["@code"];
+};
+return $1;
+},
+args: [],
+source: "code\x0a\x0a\x09^ code ifNil:[self initializeCode]",
+messageSends: ["ifNil:", "initializeCode"],
+referencedClasses: []
+}),
+smalltalk.HLWorkspace);
+
+smalltalk.addMethod(
+"_ensureModel",
+smalltalk.method({
+selector: "ensureModel",
+category: 'actions',
+fn: function (){
+var self=this;
+if(($receiver = self["@model"]) == nil || $receiver == undefined){
+smalltalk.send(self,"_model_",[smalltalk.send(self,"_model",[])]);
+} 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"],
+referencedClasses: []
+}),
+smalltalk.HLWorkspace);
+
+smalltalk.addMethod(
+"_initializeCode",
+smalltalk.method({
+selector: "initializeCode",
+category: 'initialization',
+fn: function (){
+var self=this;
+var $1;
+self["@code"]=smalltalk.send(self,"_makeCode",[]);
+$1=self["@code"];
+return $1;
+},
+args: [],
+source: "initializeCode\x0a\x0a\x09^ code := self makeCode.",
+messageSends: ["makeCode"],
+referencedClasses: []
+}),
+smalltalk.HLWorkspace);
+
+smalltalk.addMethod(
+"_initializeModel",
+smalltalk.method({
+selector: "initializeModel",
+category: 'initialization',
+fn: function (){
+var self=this;
+var $1;
+self["@model"]=smalltalk.send((smalltalk.HLWorkspaceModel || HLWorkspaceModel),"_new",[]);
+$1=self["@model"];
+return $1;
+},
+args: [],
+source: "initializeModel\x0a\x0a\x09^ model := HLWorkspaceModel new",
+messageSends: ["new"],
+referencedClasses: ["HLWorkspaceModel"]
+}),
+smalltalk.HLWorkspace);
+
+smalltalk.addMethod(
+"_makeCode",
+smalltalk.method({
+selector: "makeCode",
+category: 'actions',
+fn: function (){
+var self=this;
+var $2,$3,$1;
+$2=smalltalk.send((smalltalk.HLCodeWidget || HLCodeWidget),"_new",[]);
+smalltalk.send($2,"_model_",[smalltalk.send(self["@model"],"_code",[])]);
+$3=smalltalk.send($2,"_yourself",[]);
+$1=$3;
+return $1;
+},
+args: [],
+source: "makeCode\x0a\x0a\x09^ HLCodeWidget new\x0a    \x09model: model code;\x0a        yourself",
+messageSends: ["model:", "code", "new", "yourself"],
+referencedClasses: ["HLCodeWidget"]
+}),
+smalltalk.HLWorkspace);
+
+smalltalk.addMethod(
+"_model",
+smalltalk.method({
+selector: "model",
+category: 'accessing',
+fn: function (){
+var self=this;
+var $1;
+if(($receiver = self["@model"]) == nil || $receiver == undefined){
+$1=smalltalk.send(self,"_initializeModel",[]);
+} else {
+$1=self["@model"];
+};
+return $1;
+},
+args: [],
+source: "model\x0a\x0a\x09^ model ifNil:[self initializeModel]",
+messageSends: ["ifNil:", "initializeModel"],
+referencedClasses: []
+}),
+smalltalk.HLWorkspace);
+
+smalltalk.addMethod(
+"_model_",
+smalltalk.method({
+selector: "model:",
+category: 'accessing',
+fn: function (aModel){
+var self=this;
+self["@model"]=aModel;
+smalltalk.send(smalltalk.send(self,"_code",[]),"_model_",[smalltalk.send(aModel,"_code",[])]);
+smalltalk.send(self,"_observeCode",[]);
+return self},
+args: ["aModel"],
+source: "model: aModel\x0a\x0a\x09model := aModel.\x0a     \x0a    self code model: aModel code.\x0a    self observeCode.\x0a    ",
+messageSends: ["model:", "code", "observeCode"],
+referencedClasses: []
+}),
+smalltalk.HLWorkspace);
+
+smalltalk.addMethod(
+"_observeCode",
+smalltalk.method({
+selector: "observeCode",
+category: 'actions',
+fn: function (){
+var self=this;
+return self},
+args: [],
+source: "observeCode\x0a\x0a",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLWorkspace);
+
+smalltalk.addMethod(
+"_onDoIt",
+smalltalk.method({
+selector: "onDoIt",
+category: 'reactions',
+fn: function (){
+var self=this;
+return self},
+args: [],
+source: "onDoIt",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLWorkspace);
+
+smalltalk.addMethod(
+"_onInspectIt",
+smalltalk.method({
+selector: "onInspectIt",
+category: 'reactions',
+fn: function (){
+var self=this;
+return self},
+args: [],
+source: "onInspectIt",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLWorkspace);
+
+smalltalk.addMethod(
+"_onPrintIt",
+smalltalk.method({
+selector: "onPrintIt",
+category: 'reactions',
+fn: function (){
+var self=this;
+return self},
+args: [],
+source: "onPrintIt",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLWorkspace);
+
+smalltalk.addMethod(
+"_renderContentOn_",
+smalltalk.method({
+selector: "renderContentOn:",
+category: 'rendering',
+fn: function (html){
+var self=this;
+smalltalk.send(self,"_ensureModel",[]);
+smalltalk.send(html,"_with_",[smalltalk.send(self,"_code",[])]);
+return self},
+args: ["html"],
+source: "renderContentOn: html\x0a\x0a\x09self ensureModel.\x0a    \x0a\x09html with: self code\x0a    ",
+messageSends: ["ensureModel", "with:", "code"],
+referencedClasses: []
+}),
+smalltalk.HLWorkspace);
+
+
+smalltalk.addMethod(
+"_canBeOpenAsTab",
+smalltalk.method({
+selector: "canBeOpenAsTab",
+category: 'testing',
+fn: function (){
+var self=this;
+return true;
+},
+args: [],
+source: "canBeOpenAsTab\x0a\x09^ true",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLWorkspace.klass);
+
+smalltalk.addMethod(
+"_tabLabel",
+smalltalk.method({
+selector: "tabLabel",
+category: 'accessing',
+fn: function (){
+var self=this;
+return "Workspace";
+},
+args: [],
+source: "tabLabel\x0a\x09^ 'Workspace'",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLWorkspace.klass);
+
+smalltalk.addMethod(
+"_tabPriority",
+smalltalk.method({
+selector: "tabPriority",
+category: 'accessing',
+fn: function (){
+var self=this;
+return (10);
+},
+args: [],
+source: "tabPriority\x0a\x09^ 10",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLWorkspace.klass);
+
+
+smalltalk.addClass('HLWorkspaceModel', smalltalk.Object, ['announcer', 'environment', 'code'], 'Helios-Workspace');
+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\x09^ announcer ifNil: [ self initializeAnnouncer ]",
+messageSends: ["ifNil:", "initializeAnnouncer"],
+referencedClasses: []
+}),
+smalltalk.HLWorkspaceModel);
+
+smalltalk.addMethod(
+"_beLocal",
+smalltalk.method({
+selector: "beLocal",
+category: 'actions',
+fn: function (){
+var self=this;
+smalltalk.send(self,"_initializeEnvironment",[]);
+return self},
+args: [],
+source: "beLocal\x0a\x0a\x09self initializeEnvironment\x0a",
+messageSends: ["initializeEnvironment"],
+referencedClasses: []
+}),
+smalltalk.HLWorkspaceModel);
+
+smalltalk.addMethod(
+"_beRemoteOn_port_",
+smalltalk.method({
+selector: "beRemoteOn:port:",
+category: 'actions',
+fn: function (anIPAddress,aPort){
+var self=this;
+return self},
+args: ["anIPAddress", "aPort"],
+source: "beRemoteOn: anIPAddress port: aPort\x0a\x0a\x09\x22to-do\x22\x0a    \x0a    \x22environment := HLRemoteEnvironment on: anIPAddress port: aPort\x0a    \x0a    ...kind of stuff\x22\x0a    \x0a",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLWorkspaceModel);
+
+smalltalk.addMethod(
+"_code",
+smalltalk.method({
+selector: "code",
+category: 'accessing',
+fn: function (){
+var self=this;
+var $1;
+if(($receiver = self["@code"]) == nil || $receiver == undefined){
+$1=smalltalk.send(self,"_initializeCode",[]);
+} else {
+$1=self["@code"];
+};
+return $1;
+},
+args: [],
+source: "code\x0a\x09\x22Answers the code model working for this workspace model\x22\x0a\x09^ code ifNil:[self initializeCode]",
+messageSends: ["ifNil:", "initializeCode"],
+referencedClasses: []
+}),
+smalltalk.HLWorkspaceModel);
+
+smalltalk.addMethod(
+"_environment",
+smalltalk.method({
+selector: "environment",
+category: 'accessing',
+fn: function (){
+var self=this;
+var $1;
+if(($receiver = self["@environment"]) == nil || $receiver == undefined){
+$1=smalltalk.send(self,"_initializeEnvironment",[]);
+} else {
+$1=self["@environment"];
+};
+return $1;
+},
+args: [],
+source: "environment\x0a\x09^ environment ifNil: [ self initializeEnvironment]",
+messageSends: ["ifNil:", "initializeEnvironment"],
+referencedClasses: []
+}),
+smalltalk.HLWorkspaceModel);
+
+smalltalk.addMethod(
+"_environment_",
+smalltalk.method({
+selector: "environment:",
+category: 'accessing',
+fn: function (anEnvironment){
+var self=this;
+self["@environment"]=anEnvironment;
+return self},
+args: ["anEnvironment"],
+source: "environment: anEnvironment\x0a\x09environment := anEnvironment",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLWorkspaceModel);
+
+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\x09^ announcer := Announcer new",
+messageSends: ["new"],
+referencedClasses: ["Announcer"]
+}),
+smalltalk.HLWorkspaceModel);
+
+smalltalk.addMethod(
+"_initializeCode",
+smalltalk.method({
+selector: "initializeCode",
+category: 'initialization',
+fn: function (){
+var self=this;
+var $1;
+self["@code"]=smalltalk.send((smalltalk.HLCodeModel || HLCodeModel),"_on_",[smalltalk.send(self,"_environment",[])]);
+$1=self["@code"];
+return $1;
+},
+args: [],
+source: "initializeCode\x0a\x0a\x09^ code := HLCodeModel on: self environment",
+messageSends: ["on:", "environment"],
+referencedClasses: ["HLCodeModel"]
+}),
+smalltalk.HLWorkspaceModel);
+
+smalltalk.addMethod(
+"_initializeEnvironment",
+smalltalk.method({
+selector: "initializeEnvironment",
+category: 'initialization',
+fn: function (){
+var self=this;
+var $1;
+self["@environment"]=smalltalk.send((smalltalk.HLLocalEnvironment || HLLocalEnvironment),"_new",[]);
+$1=self["@environment"];
+return $1;
+},
+args: [],
+source: "initializeEnvironment\x0a\x09^ environment := HLLocalEnvironment new",
+messageSends: ["new"],
+referencedClasses: ["HLLocalEnvironment"]
+}),
+smalltalk.HLWorkspaceModel);
+
+smalltalk.addMethod(
+"_onKeyDown_",
+smalltalk.method({
+selector: "onKeyDown:",
+category: 'reactions',
+fn: function (anEvent){
+var self=this;
+if(anEvent.ctrlKey) {
+		if(anEvent.keyCode === 80) { //ctrl+p
+			self._printIt();
+			anEvent.preventDefault();
+			return false;
+		}
+		if(anEvent.keyCode === 68) { //ctrl+d
+			self._doIt();
+			anEvent.preventDefault();
+			return false;
+		}
+		if(anEvent.keyCode === 73) { //ctrl+i
+			self._inspectIt();
+			anEvent.preventDefault();
+			return false;
+		}
+	};
+;
+return self},
+args: ["anEvent"],
+source: "onKeyDown: anEvent\x0a\x0a\x09<if(anEvent.ctrlKey) {\x0a\x09\x09if(anEvent.keyCode === 80) { //ctrl+p\x0a\x09\x09\x09self._printIt();\x0a\x09\x09\x09anEvent.preventDefault();\x0a\x09\x09\x09return false;\x0a\x09\x09}\x0a\x09\x09if(anEvent.keyCode === 68) { //ctrl+d\x0a\x09\x09\x09self._doIt();\x0a\x09\x09\x09anEvent.preventDefault();\x0a\x09\x09\x09return false;\x0a\x09\x09}\x0a\x09\x09if(anEvent.keyCode === 73) { //ctrl+i\x0a\x09\x09\x09self._inspectIt();\x0a\x09\x09\x09anEvent.preventDefault();\x0a\x09\x09\x09return false;\x0a\x09\x09}\x0a\x09}>",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLWorkspaceModel);
+
+smalltalk.addMethod(
+"_subscribe_",
+smalltalk.method({
+selector: "subscribe:",
+category: 'actions',
+fn: function (aWidget){
+var self=this;
+smalltalk.send(aWidget,"_subscribeTo_",[smalltalk.send(self,"_announcer",[])]);
+return self},
+args: ["aWidget"],
+source: "subscribe: aWidget\x0a\x09aWidget subscribeTo: self announcer",
+messageSends: ["subscribeTo:", "announcer"],
+referencedClasses: []
+}),
+smalltalk.HLWorkspaceModel);
+
+
+smalltalk.addMethod(
+"_on_",
+smalltalk.method({
+selector: "on:",
+category: 'actions',
+fn: function (anEnvironment){
+var self=this;
+var $2,$3,$1;
+$2=smalltalk.send(self,"_new",[]);
+smalltalk.send($2,"_environment_",[anEnvironment]);
+$3=smalltalk.send($2,"_yourself",[]);
+$1=$3;
+return $1;
+},
+args: ["anEnvironment"],
+source: "on: anEnvironment\x0a\x0a\x09^ self new\x0a    \x09environment: anEnvironment;\x0a        yourself",
+messageSends: ["environment:", "new", "yourself"],
+referencedClasses: []
+}),
+smalltalk.HLWorkspaceModel.klass);
+
+

+ 30 - 0
js/Kernel-Collections.deploy.js

@@ -1314,6 +1314,23 @@ return self}
 }),
 smalltalk.Dictionary);
 
+smalltalk.addMethod(
+"_keyAtValue_",
+smalltalk.method({
+selector: "keyAtValue:",
+fn: function (anObject){
+var self=this;
+var $1;
+$1=smalltalk.send(smalltalk.send(smalltalk.send(self,"_associations",[]),"_detect_ifNone_",[(function(k,v){
+return smalltalk.send(v,"__eq_eq",[anObject]);
+}),(function(){
+return smalltalk.send(self,"_error_",["Not found"]);
+})]),"_key",[]);
+return $1;
+}
+}),
+smalltalk.Dictionary);
+
 smalltalk.addMethod(
 "_keys",
 smalltalk.method({
@@ -1349,6 +1366,19 @@ return self}
 }),
 smalltalk.Dictionary);
 
+smalltalk.addMethod(
+"_valueAt_",
+smalltalk.method({
+selector: "valueAt:",
+fn: function (anObject){
+var self=this;
+var $1;
+$1=smalltalk.send(self,"_associationsDo_",[(2)]);
+return $1;
+}
+}),
+smalltalk.Dictionary);
+
 smalltalk.addMethod(
 "_values",
 smalltalk.method({

+ 40 - 0
js/Kernel-Collections.js

@@ -1750,6 +1750,28 @@ referencedClasses: []
 }),
 smalltalk.Dictionary);
 
+smalltalk.addMethod(
+"_keyAtValue_",
+smalltalk.method({
+selector: "keyAtValue:",
+category: 'accessing',
+fn: function (anObject){
+var self=this;
+var $1;
+$1=smalltalk.send(smalltalk.send(smalltalk.send(self,"_associations",[]),"_detect_ifNone_",[(function(k,v){
+return smalltalk.send(v,"__eq_eq",[anObject]);
+}),(function(){
+return smalltalk.send(self,"_error_",["Not found"]);
+})]),"_key",[]);
+return $1;
+},
+args: ["anObject"],
+source: "keyAtValue: anObject\x0a\x0a\x09^ (self associations \x0a    \x09detect:[:k :v| v == anObject] \x0a    \x09ifNone:[self error: 'Not found']) key",
+messageSends: ["key", "detect:ifNone:", "==", "error:", "associations"],
+referencedClasses: []
+}),
+smalltalk.Dictionary);
+
 smalltalk.addMethod(
 "_keys",
 smalltalk.method({
@@ -1795,6 +1817,24 @@ referencedClasses: []
 }),
 smalltalk.Dictionary);
 
+smalltalk.addMethod(
+"_valueAt_",
+smalltalk.method({
+selector: "valueAt:",
+category: 'accessing',
+fn: function (anObject){
+var self=this;
+var $1;
+$1=smalltalk.send(self,"_associationsDo_",[(2)]);
+return $1;
+},
+args: ["anObject"],
+source: "valueAt: anObject\x0a\x0a\x09^ self associationsDo:2",
+messageSends: ["associationsDo:"],
+referencedClasses: []
+}),
+smalltalk.Dictionary);
+
 smalltalk.addMethod(
 "_values",
 smalltalk.method({

+ 53 - 0
st/Helios-Announcements.st

@@ -3,6 +3,51 @@ Object subclass: #HLAnnouncement
 	instanceVariableNames: ''
 	package: 'Helios-Announcements'!
 
+HLAnnouncement subclass: #HLCodeHandled
+	instanceVariableNames: 'code'
+	package: 'Helios-Announcements'!
+
+!HLCodeHandled methodsFor: 'accessing'!
+
+code
+
+	^ code
+!
+
+code: aModel
+
+	code := aModel
+! !
+
+!HLCodeHandled class methodsFor: 'actions'!
+
+on: aCodeModel
+
+	^ self new 
+    	code: aCodeModel;
+        yourself
+! !
+
+HLCodeHandled subclass: #HLDoItExecuted
+	instanceVariableNames: ''
+	package: 'Helios-Announcements'!
+
+HLCodeHandled subclass: #HLDoItRequested
+	instanceVariableNames: ''
+	package: 'Helios-Announcements'!
+
+HLCodeHandled subclass: #HLInspectItRequested
+	instanceVariableNames: ''
+	package: 'Helios-Announcements'!
+
+HLCodeHandled subclass: #HLPrintItRequested
+	instanceVariableNames: ''
+	package: 'Helios-Announcements'!
+
+HLAnnouncement subclass: #HLDiveRequested
+	instanceVariableNames: ''
+	package: 'Helios-Announcements'!
+
 HLAnnouncement subclass: #HLItemSelected
 	instanceVariableNames: 'item'
 	package: 'Helios-Announcements'!
@@ -29,6 +74,10 @@ HLItemSelected subclass: #HLClassSelected
 	instanceVariableNames: ''
 	package: 'Helios-Announcements'!
 
+HLItemSelected subclass: #HLInstanceVariableSelected
+	instanceVariableNames: ''
+	package: 'Helios-Announcements'!
+
 HLItemSelected subclass: #HLMethodSelected
 	instanceVariableNames: ''
 	package: 'Helios-Announcements'!
@@ -41,6 +90,10 @@ HLItemSelected subclass: #HLProtocolSelected
 	instanceVariableNames: ''
 	package: 'Helios-Announcements'!
 
+HLAnnouncement subclass: #HLRefreshRequested
+	instanceVariableNames: ''
+	package: 'Helios-Announcements'!
+
 HLAnnouncement subclass: #HLShowCommentToggled
 	instanceVariableNames: ''
 	package: 'Helios-Announcements'!

+ 32 - 1
st/Helios-Browser.st

@@ -507,7 +507,7 @@ allProtocol
 !
 
 environment
-	^ environment ifNil: [ environment := Smalltalk current ]
+	^ environment ifNil: [ self initializeEnvironment ]
 !
 
 environment: anEnvironment
@@ -598,6 +598,22 @@ showInstance: aBoolean
     self announcer announce: HLShowInstanceToggled new
 ! !
 
+!HLBrowserModel methodsFor: 'actions'!
+
+beLocal
+
+	self initializeEnvironment
+!
+
+beRemoteOn: anIPAddress port: aPort
+
+	"to-do"
+    
+    "environment := HLRemoteEnvironment on: anIPAddress port: aPort
+    
+    ...kind of stuff"
+! !
+
 !HLBrowserModel methodsFor: 'announcements'!
 
 announcer
@@ -608,6 +624,21 @@ subscribe: aWidget
 	aWidget subscribeTo: self announcer
 ! !
 
+!HLBrowserModel methodsFor: 'initialization'!
+
+initializeEnvironment
+	^ environment := HLLocalEnvironment new
+! !
+
+!HLBrowserModel class methodsFor: 'actions'!
+
+on: anEnvironment
+
+	^ self new
+    	environment: anEnvironment;
+        yourself
+! !
+
 HLWidget subclass: #HLBrowserSourceWidget
 	instanceVariableNames: 'model sourceArea'
 	package: 'Helios-Browser'!

+ 104 - 25
st/Helios-Core.st

@@ -1,4 +1,101 @@
 Smalltalk current createPackage: 'Helios-Core' properties: #{}!
+Object subclass: #HLEnvironment
+	instanceVariableNames: ''
+	package: 'Helios-Core'!
+!HLEnvironment commentStamp!
+Abstract class defining common behavior for local and remote environments!
+
+!HLEnvironment methodsFor: 'accessing'!
+
+packages
+
+	^ self subclassResponsibility
+! !
+
+!HLEnvironment methodsFor: 'actions'!
+
+eval: someCode on: aReceiver
+
+	^ self subclassResponsibility
+! !
+
+HLEnvironment subclass: #HLLocalEnvironment
+	instanceVariableNames: ''
+	package: 'Helios-Core'!
+
+!HLLocalEnvironment methodsFor: 'accessing'!
+
+packages
+
+	^ Smalltalk current packages
+! !
+
+!HLLocalEnvironment methodsFor: 'actions'!
+
+eval: someCode on: aReceiver
+	| compiler  |
+	compiler := Compiler new.
+	[compiler parseExpression: someCode] on: Error do: [:ex |
+		^window alert: ex messageText].
+	^(compiler eval: (compiler compile: 'doIt ^[', someCode, '] value' forClass: DoIt)) fn applyTo: aReceiver arguments: #()
+! !
+
+HLEnvironment subclass: #HLRemoteEnvironment
+	instanceVariableNames: ''
+	package: 'Helios-Core'!
+
+!HLRemoteEnvironment methodsFor: 'accessing'!
+
+packages
+	"Answer the remote environment's packages"
+  
+	"to-do"
+    
+    "Note for future self and friends:
+    the problem with remote stuff is that the answers shouldn't be expected to be
+    received in a syncrhonous fashion. Everything network is asyc, so you *are going to deal with callbacks* here"
+! !
+
+!HLRemoteEnvironment methodsFor: 'actions'!
+
+eval: someCode on: aReceiver
+
+	"Note for future self and friends:
+    whatever way this compilation happens on the other side, 
+    it should return a proxy to the remote resulting object"
+    
+    self notYetImplemented
+! !
+
+Object subclass: #HLRemoteObject
+	instanceVariableNames: ''
+	package: 'Helios-Core'!
+!HLRemoteObject commentStamp!
+This is a local proxy to a remote object.
+Tipically useful for evaluating and inspecting and interacting with instances of a remote VM.!
+
+!HLRemoteObject methodsFor: 'actions'!
+
+doesNotUnderstand: aMessage
+
+	"to-do
+
+	aham, blah blah
+
+	super doesNotUnderstand: aMessage"
+!
+
+inspectOn: anInspector
+
+	"to-do"
+
+	"this is a source of so much fun..."
+!
+
+printString
+	^ 'this is a remote object'
+! !
+
 Widget subclass: #HLSourceArea
 	instanceVariableNames: 'editor textarea div receiver onDoIt'
 	package: 'Helios-Core'!
@@ -348,7 +445,7 @@ iconForItem: anObject
 !
 
 items
-	^ items ifNil: [ #() ]
+	^ items ifNil: [ self initializeItems ]
 !
 
 items: aCollection
@@ -406,6 +503,12 @@ setupKeyBindings
 			self activateListItem: next ] ]
 ! !
 
+!HLListWidget methodsFor: 'initializing'!
+
+initializeItems
+	^ items := #()
+! !
+
 !HLListWidget methodsFor: 'rendering'!
 
 renderButtonsOn: html
@@ -492,10 +595,6 @@ setupKeyBindings
         	self previousFocus ] ]
 ! !
 
-HLWidget subclass: #HLInspector
-	instanceVariableNames: ''
-	package: 'Helios-Core'!
-
 HLWidget subclass: #HLManager
 	instanceVariableNames: 'tabs activeTab keyBinder'
 	package: 'Helios-Core'!
@@ -670,23 +769,3 @@ canBeOpenAsTab
 	^ true
 ! !
 
-HLWidget subclass: #HLWorkspace
-	instanceVariableNames: ''
-	package: 'Helios-Core'!
-
-!HLWorkspace class methodsFor: 'accessing'!
-
-tabLabel
-	^ 'Workspace'
-!
-
-tabPriority
-	^ 10
-! !
-
-!HLWorkspace class methodsFor: 'testing'!
-
-canBeOpenAsTab
-	^ true
-! !
-

+ 491 - 0
st/Helios-Inspector.st

@@ -0,0 +1,491 @@
+Smalltalk current createPackage: 'Helios-Inspector' properties: #{}!
+HLWidget subclass: #HLInspector
+	instanceVariableNames: 'model variables display code label'
+	package: 'Helios-Inspector'!
+
+!HLInspector methodsFor: 'accessing'!
+
+code
+
+	^ code ifNil:[self initializeCode]
+!
+
+display
+
+	^ display ifNil:[self initializeDisplay]
+!
+
+inspectee
+
+	^ self model inspectee
+!
+
+inspectee: anObject
+
+	self model inspectee: anObject
+!
+
+label
+	
+    ^ label ifNil:[self initializeLabel]
+!
+
+model
+
+	^ model ifNil:[self initializeModel]
+!
+
+model: aModel
+
+	model := aModel.
+     
+    self code model: aModel code.
+    self observeCode.
+!
+
+tabLabel
+	
+    ^ self label
+!
+
+variables
+
+	^ variables ifNil:[self initializeVariables]
+! !
+
+!HLInspector methodsFor: 'actions'!
+
+ensureModel
+	"Sends the #model: initialization message if needed."
+
+	self observeVariables.
+        
+	model ifNil:[
+		self model: self model]
+!
+
+inspect: anObject
+
+	self model inspect: anObject on: self.
+    
+	self 
+    	refreshVariables;
+		refreshDisplay;
+        yourself
+!
+
+makeCode
+
+	^ HLCodeWidget new
+    	model: model code;
+        receiver: model inspectee;
+        yourself.
+!
+
+makeDisplay
+
+	^ HLInspectorDisplay new
+    	model: self model;
+        yourself
+!
+
+makeVariables
+
+	^ HLInspectorVariables new
+    	model: self model;
+        yourself
+!
+
+observeCode
+
+	self code announcer 
+    	on: HLDoItExecuted 
+        do: [self onDoneIt]
+!
+
+observeVariables
+
+	self variables announcer 
+    	on: HLRefreshRequested do:[:ann| self onRefresh];
+        on: HLDiveRequested do:[self onDive];
+        yourself.
+
+	self model announcer
+        on: HLInstanceVariableSelected do:[:ann| self onInstanceVariableSelected];
+        yourself.
+!
+
+open
+
+	HLManager current addTab: (HLTab on: self labelled: self tabLabel)
+!
+
+refresh
+
+	self inspect: self inspectee
+!
+
+refreshDisplay
+
+	self display refresh
+!
+
+refreshVariables
+
+	self variables refresh
+!
+
+setLabel: aString
+	label := aString
+!
+
+setVariables: aDictionary
+
+	self model variables: aDictionary
+! !
+
+!HLInspector methodsFor: 'initialization'!
+
+initializeCode
+
+	^ code := self makeCode.
+!
+
+initializeDisplay
+	^ display := self makeDisplay
+!
+
+initializeLabel
+	^ label := model inspectee printString
+!
+
+initializeModel
+
+	^ model := HLInspectorModel new
+!
+
+initializeVariables
+	^ variables := self makeVariables
+! !
+
+!HLInspector methodsFor: 'reactions'!
+
+onDive
+
+	self inspect: self model selectedInstVarObject
+!
+
+onDoIt
+!
+
+onDoneIt
+
+	self refresh
+!
+
+onInspectIt
+!
+
+onInstanceVariableSelected
+
+	self code receiver: self model selectedInstVarObject.
+	self refreshDisplay
+!
+
+onPrintIt
+!
+
+onRefresh
+
+	self refresh
+! !
+
+!HLInspector methodsFor: 'rendering'!
+
+renderContentOn: html
+
+	self ensureModel.
+    
+   	html with: (HLContainer with: (HLHorizontalSplitter
+    	with: (HLVerticalSplitter 
+            		with: self variables
+            	    with: self display)
+        with: self code))
+! !
+
+!HLInspector class methodsFor: 'accessing'!
+
+tabLabel
+	^ 'Inspector'
+!
+
+tabPriority
+	^ 10
+! !
+
+!HLInspector class methodsFor: 'testing'!
+
+canBeOpenAsTab
+	^ false
+! !
+
+HLNavigationListWidget subclass: #HLInspectorDisplay
+	instanceVariableNames: 'model'
+	package: 'Helios-Inspector'!
+
+!HLInspectorDisplay methodsFor: 'accessing'!
+
+model
+
+	^ model
+!
+
+model: aModel
+
+	model := aModel
+! !
+
+!HLInspectorDisplay methodsFor: 'rendering'!
+
+renderContentOn: html
+	
+    html div with: self selectionDisplayString
+!
+
+selectionDisplayString
+	|selection|
+	selection := model selection.
+    ^ (model variables keys includes: selection)
+    	ifTrue:[(model instVarObjectAt: selection) printString]
+      	ifFalse:['']
+! !
+
+Object subclass: #HLInspectorModel
+	instanceVariableNames: 'announcer environment inspectee code variables selection'
+	package: 'Helios-Inspector'!
+
+!HLInspectorModel methodsFor: 'accessing'!
+
+announcer
+	^ announcer ifNil: [ self initializeAnnouncer ]
+!
+
+code
+	"Answers the code model working for this workspace model"
+	^ code ifNil:[self initializeCode]
+!
+
+environment
+	^ environment ifNil: [ self initializeEnvironment]
+!
+
+environment: anEnvironment
+	environment := anEnvironment
+!
+
+inspectee 
+
+	^ inspectee
+!
+
+inspectee: anObject 
+
+	inspectee := anObject
+!
+
+selectedInstVarObject
+
+	^ self instVarObjectAt: self selection
+!
+
+selection
+
+	^ selection ifNil:[self initializeSelection]
+!
+
+selection: anObject
+
+	selection := anObject.
+
+	self announcer announce: (HLInstanceVariableSelected on: selection)
+!
+
+variables
+
+	^ variables
+!
+
+variables: aCollection
+
+	variables := aCollection
+! !
+
+!HLInspectorModel methodsFor: 'actions'!
+
+beLocal
+
+	self initializeEnvironment
+!
+
+beRemoteOn: anIPAddress port: aPort
+
+	"to-do"
+    
+    "environment := HLRemoteEnvironment on: anIPAddress port: aPort
+    
+    ...kind of stuff"
+!
+
+inspect: anObject on: anInspector
+
+	inspectee := anObject.
+	variables := #().
+	inspectee inspectOn: anInspector
+!
+
+instVarObjectAt: anInstVarName
+
+	^ self variables at: anInstVarName
+!
+
+selectedInstVar: anInstVarName
+
+    self selection: anInstVarName
+!
+
+subscribe: aWidget
+	aWidget subscribeTo: self announcer
+! !
+
+!HLInspectorModel methodsFor: 'initialization'!
+
+initializeAnnouncer
+	^ announcer := Announcer new
+!
+
+initializeCode
+
+	^ code := HLCodeModel on: self environment
+!
+
+initializeEnvironment
+	^ environment := HLLocalEnvironment new
+!
+
+initializeSelection
+
+	^ selection := ''
+! !
+
+!HLInspectorModel methodsFor: 'reactions'!
+
+onKeyDown: anEvent
+
+	<if(anEvent.ctrlKey) {
+		if(anEvent.keyCode === 80) { //ctrl+p
+			self._printIt();
+			anEvent.preventDefault();
+			return false;
+		}
+		if(anEvent.keyCode === 68) { //ctrl+d
+			self._doIt();
+			anEvent.preventDefault();
+			return false;
+		}
+		if(anEvent.keyCode === 73) { //ctrl+i
+			self._inspectIt();
+			anEvent.preventDefault();
+			return false;
+		}
+	}>
+! !
+
+!HLInspectorModel class methodsFor: 'actions'!
+
+on: anEnvironment
+
+	^ self new
+    	environment: anEnvironment;
+        yourself
+! !
+
+HLNavigationListWidget subclass: #HLInspectorVariables
+	instanceVariableNames: 'announcer model list diveButton'
+	package: 'Helios-Inspector'!
+
+!HLInspectorVariables methodsFor: 'accessing'!
+
+announcer
+
+	^ announcer ifNil:[self initializeAnnouncer]
+!
+
+model
+	
+    ^ 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: 'reactions'!
+
+selectItem: anObject
+	   
+	super selectItem: anObject.
+    
+    self model selectedInstVar: anObject
+! !
+
+!HLInspectorVariables methodsFor: 'rendering'!
+
+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]
+! !
+

+ 442 - 0
st/Helios-Workspace.st

@@ -0,0 +1,442 @@
+Smalltalk current createPackage: 'Helios-Workspace' properties: #{}!
+Object subclass: #HLCodeModel
+	instanceVariableNames: 'announcer environment receiver'
+	package: 'Helios-Workspace'!
+
+!HLCodeModel methodsFor: 'accessing'!
+
+announcer
+	^ announcer ifNil: [ self initializeAnnouncer ]
+!
+
+environment
+	^ environment ifNil: [ self initializeEnvironment]
+!
+
+environment: anEnvironment
+	environment := anEnvironment
+!
+
+receiver
+	^ receiver
+!
+
+receiver: anObject
+	receiver := anObject
+! !
+
+!HLCodeModel methodsFor: 'actions'!
+
+doIt: someCode
+
+	^ self environment eval: someCode on: self receiver
+!
+
+subscribe: aWidget
+	aWidget subscribeTo: self announcer
+! !
+
+!HLCodeModel methodsFor: 'initialization'!
+
+initializeAnnouncer
+	^ announcer := Announcer new
+!
+
+initializeEnvironment
+	^ environment := Smalltalk current
+!
+
+initializeReceiver
+	^receiver := DoIt new
+! !
+
+!HLCodeModel class methodsFor: 'actions'!
+
+on: anEnvironment
+
+	^ self new
+    	environment: anEnvironment;
+        yourself
+! !
+
+HLWidget subclass: #HLCodeWidget
+	instanceVariableNames: 'model wrapper code editor'
+	package: 'Helios-Workspace'!
+
+!HLCodeWidget methodsFor: 'accessing'!
+
+announcer
+	^ self model announcer
+!
+
+currentLine
+    ^editor getLine: (editor getCursor line)
+!
+
+currentLineOrSelection
+    ^editor somethingSelected
+		ifFalse: [self currentLine]
+		ifTrue: [self selection]
+!
+
+model
+
+	^ model
+!
+
+model: aModel
+
+	model := aModel
+!
+
+receiver
+	^ self model receiver
+!
+
+receiver: anObject
+	self model receiver: anObject
+!
+
+selection
+	^editor getSelection
+!
+
+selectionEnd
+   ^code element selectionEnd
+!
+
+selectionEnd: anInteger
+   code element selectionEnd: anInteger
+!
+
+selectionStart
+   ^code element selectionStart
+!
+
+selectionStart: anInteger
+   code element selectionStart: anInteger
+!
+
+val
+	^ code getValue
+!
+
+val: aString
+    code setValue: aString
+!
+
+wrapper
+
+	^ wrapper
+! !
+
+!HLCodeWidget methodsFor: 'actions'!
+
+clear
+      self val: ''
+!
+
+doIt
+	| result |
+
+	self announcer announce: (HLDoItRequested on: model).
+
+	result:=  model doIt: self currentLineOrSelection.
+
+	self announcer announce: (HLDoItExecuted on: model).
+
+	^ result
+!
+
+editor
+	^editor
+!
+
+focus
+      self editor focus
+!
+
+inspectIt
+
+	| newInspector |
+       
+	self announcer announce: (HLInspectItRequested on: model).
+	newInspector := self makeInspectorOn: self doIt.
+	newInspector open
+!
+
+makeInspectorOn: anObject
+
+	^ HLInspector new 
+		inspect: anObject;
+		yourself
+!
+
+observeWrapper
+
+    wrapper onKeyDown: [:e | self onKeyDown: e]
+!
+
+print: aString
+	| start stop |
+	start := HashedCollection new.
+	stop := HashedCollection new.
+	start at: 'line' put: (editor getCursor: false) line.
+	start at: 'ch' put: (editor getCursor: false) ch.
+	stop at: 'line' put: (start at: 'line').
+	stop at: 'ch' put: ((start at: 'ch') + aString size + 2).
+	editor replaceSelection: (editor getSelection, ' ', aString, ' ').
+	editor setCursor: (editor getCursor: true).
+	editor setSelection: stop end: start
+!
+
+printIt
+
+	| result |
+
+	result:=  self doIt.
+       
+	self announcer announce: (HLPrintItRequested on: model).
+
+    self print: result printString.
+	self focus.
+!
+
+setEditorOn: aTextarea
+	<self['@editor'] = CodeMirror.fromTextArea(aTextarea, {
+		theme: 'amber',
+                lineNumbers: true,
+                enterMode: 'flat',
+                matchBrackets: true,
+                electricChars: false
+	})>
+! !
+
+!HLCodeWidget methodsFor: 'reactions'!
+
+onDoIt
+	
+    self doIt
+!
+
+onInspectIt
+
+	self inspectIt
+!
+
+onKeyDown: anEvent
+
+    <if(anEvent.ctrlKey) {
+		if(anEvent.keyCode === 80) { //ctrl+p
+			self._onPrintIt();
+			anEvent.preventDefault();
+			return false;
+		}
+		if(anEvent.keyCode === 68) { //ctrl+d
+			self._onDoIt();
+			anEvent.preventDefault();
+			return false;
+		}
+		if(anEvent.keyCode === 73) { //ctrl+i
+			self._onInspectIt();
+			anEvent.preventDefault();
+			return false;
+		}
+	}>
+!
+
+onPrintIt
+
+	self printIt
+! !
+
+!HLCodeWidget methodsFor: 'rendering'!
+
+renderOn: html
+    wrapper := html div class: 'code'.
+    self observeWrapper
+    wrapper with: [code := html textarea].
+    self setEditorOn: code element.
+! !
+
+HLWidget subclass: #HLWorkspace
+	instanceVariableNames: 'model code'
+	package: 'Helios-Workspace'!
+
+!HLWorkspace methodsFor: 'accessing'!
+
+code
+
+	^ code ifNil:[self initializeCode]
+!
+
+model
+
+	^ model ifNil:[self initializeModel]
+!
+
+model: aModel
+
+	model := aModel.
+     
+    self code model: aModel code.
+    self observeCode.
+! !
+
+!HLWorkspace methodsFor: 'actions'!
+
+ensureModel
+	"Sends the #model: initialization message if needed."
+
+	model ifNil:[
+		self model: self model]
+!
+
+makeCode
+
+	^ HLCodeWidget new
+    	model: model code;
+        yourself
+!
+
+observeCode
+! !
+
+!HLWorkspace methodsFor: 'initialization'!
+
+initializeCode
+
+	^ code := self makeCode.
+!
+
+initializeModel
+
+	^ model := HLWorkspaceModel new
+! !
+
+!HLWorkspace methodsFor: 'reactions'!
+
+onDoIt
+!
+
+onInspectIt
+!
+
+onPrintIt
+! !
+
+!HLWorkspace methodsFor: 'rendering'!
+
+renderContentOn: html
+
+	self ensureModel.
+    
+	html with: self code
+! !
+
+!HLWorkspace class methodsFor: 'accessing'!
+
+tabLabel
+	^ 'Workspace'
+!
+
+tabPriority
+	^ 10
+! !
+
+!HLWorkspace class methodsFor: 'testing'!
+
+canBeOpenAsTab
+	^ true
+! !
+
+Object subclass: #HLWorkspaceModel
+	instanceVariableNames: 'announcer environment code'
+	package: 'Helios-Workspace'!
+
+!HLWorkspaceModel methodsFor: 'accessing'!
+
+announcer
+	^ announcer ifNil: [ self initializeAnnouncer ]
+!
+
+code
+	"Answers the code model working for this workspace model"
+	^ code ifNil:[self initializeCode]
+!
+
+environment
+	^ environment ifNil: [ self initializeEnvironment]
+!
+
+environment: anEnvironment
+	environment := anEnvironment
+! !
+
+!HLWorkspaceModel methodsFor: 'actions'!
+
+beLocal
+
+	self initializeEnvironment
+!
+
+beRemoteOn: anIPAddress port: aPort
+
+	"to-do"
+    
+    "environment := HLRemoteEnvironment on: anIPAddress port: aPort
+    
+    ...kind of stuff"
+!
+
+subscribe: aWidget
+	aWidget subscribeTo: self announcer
+! !
+
+!HLWorkspaceModel methodsFor: 'initialization'!
+
+initializeAnnouncer
+	^ announcer := Announcer new
+!
+
+initializeCode
+
+	^ code := HLCodeModel on: self environment
+!
+
+initializeEnvironment
+	^ environment := HLLocalEnvironment new
+! !
+
+!HLWorkspaceModel methodsFor: 'reactions'!
+
+onKeyDown: anEvent
+
+	<if(anEvent.ctrlKey) {
+		if(anEvent.keyCode === 80) { //ctrl+p
+			self._printIt();
+			anEvent.preventDefault();
+			return false;
+		}
+		if(anEvent.keyCode === 68) { //ctrl+d
+			self._doIt();
+			anEvent.preventDefault();
+			return false;
+		}
+		if(anEvent.keyCode === 73) { //ctrl+i
+			self._inspectIt();
+			anEvent.preventDefault();
+			return false;
+		}
+	}>
+! !
+
+!HLWorkspaceModel class methodsFor: 'actions'!
+
+on: anEnvironment
+
+	^ self new
+    	environment: anEnvironment;
+        yourself
+! !
+

+ 12 - 0
st/Kernel-Collections.st

@@ -570,10 +570,22 @@ at: aKey put: aValue
 	>
 !
 
+keyAtValue: anObject
+
+	^ (self associations 
+    	detect:[:k :v| v == anObject] 
+    	ifNone:[self error: 'Not found']) key
+!
+
 keys
 	^keys copy
 !
 
+valueAt: anObject
+
+	^ self associationsDo:2
+!
+
 values
 	^values copy
 ! !