Browse Source

Helios: Announcement refactorings: use #on:send:to:

Helios: Announcement refactorings: use #on:send:to: #2

Helios: Announcement refactorings: use #on:send:to: #3

Helios: Announcement refactorings: use #on:send:to: #3

Helios: Announcement refactorings: use #on:send:to: #4

Helios: Announcement refactorings: use #on:send:to: #5

Helios: Announcement refactorings: use #on:send:to: #6

Helios: Announcement refactorings: use #on:send:to:
Nicolas Petton 11 years ago
parent
commit
18f6016ac1

+ 189 - 237
js/Helios-Browser.deploy.js

@@ -202,6 +202,21 @@ return $1;
 messageSends: ["ifNil:", "model:", "model", "new", "yourself"]}),
 smalltalk.HLBrowser);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "unregister",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+smalltalk.HLWidget.fn.prototype._unregister.apply(_st(self), []);
+_st([_st(self)._packagesListWidget(),_st(self)._classesListWidget(),_st(self)._protocolsListWidget(),_st(self)._methodsListWidget(),_st(self)._sourceWidget()])._do_((function(each){
+return smalltalk.withContext(function($ctx2) {
+return _st(each)._unregister();
+}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
+return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},smalltalk.HLBrowser)})},
+messageSends: ["unregister", "do:", "packagesListWidget", "classesListWidget", "protocolsListWidget", "methodsListWidget", "sourceWidget"]}),
+smalltalk.HLBrowser);
+
 
 smalltalk.HLBrowser.klass.iVarNames = ['nextId'];
 smalltalk.addMethod(
@@ -364,16 +379,10 @@ function $HLShowCommentToggled(){return smalltalk.HLShowCommentToggled||(typeof
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2;
 $1=_st(_st(self)._model())._announcer();
-_st($1)._on_do_($HLShowInstanceToggled(),(function(){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onShowInstanceToggled();
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
-$2=_st($1)._on_do_($HLShowCommentToggled(),(function(){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onShowCommentToggled();
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
+_st($1)._on_send_to_($HLShowInstanceToggled(),"onShowInstanceToggled",self);
+$2=_st($1)._on_send_to_($HLShowCommentToggled(),"onShowCommentToggled",self);
 return self}, function($ctx1) {$ctx1.fill(self,"observeModel",{},smalltalk.HLBrowserBottomWidget)})},
-messageSends: ["on:do:", "onShowInstanceToggled", "announcer", "model", "onShowCommentToggled"]}),
+messageSends: ["on:send:to:", "announcer", "model"]}),
 smalltalk.HLBrowserBottomWidget);
 
 smalltalk.addMethod(
@@ -946,28 +955,13 @@ function $HLClassesFocusRequested(){return smalltalk.HLClassesFocusRequested||(t
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2;
 $1=_st(_st(self)._model())._announcer();
-_st($1)._on_do_($HLPackageSelected(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onPackageSelected_(_st(ann)._item());
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
-_st($1)._on_do_($HLShowInstanceToggled(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onShowInstanceToggled();
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
-_st($1)._on_do_($HLShowCommentToggled(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onShowCommentToggled();
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
-_st($1)._on_do_($HLClassSelected(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onClassSelected_(_st(ann)._item());
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
-$2=_st($1)._on_do_($HLClassesFocusRequested(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onClassesFocusRequested();
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
+_st($1)._on_send_to_($HLPackageSelected(),"onPackageSelected:",self);
+_st($1)._on_send_to_($HLShowInstanceToggled(),"onShowInstanceToggled",self);
+_st($1)._on_send_to_($HLShowCommentToggled(),"onShowCommentToggled",self);
+_st($1)._on_send_to_($HLClassSelected(),"onClassSelected:",self);
+$2=_st($1)._on_send_to_($HLClassesFocusRequested(),"onClassesFocusRequested",self);
 return self}, function($ctx1) {$ctx1.fill(self,"observeModel",{},smalltalk.HLClassesListWidget)})},
-messageSends: ["on:do:", "onPackageSelected:", "item", "announcer", "model", "onShowInstanceToggled", "onShowCommentToggled", "onClassSelected:", "onClassesFocusRequested"]}),
+messageSends: ["on:send:to:", "announcer", "model"]}),
 smalltalk.HLClassesListWidget);
 
 smalltalk.addMethod(
@@ -983,40 +977,27 @@ function $ClassMigrated(){return smalltalk.ClassMigrated||(typeof ClassMigrated=
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2;
 $1=_st(_st(self)._model())._systemAnnouncer();
-_st($1)._on_do_($ClassAdded(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onClassAdded_(_st(ann)._theClass());
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
-_st($1)._on_do_($ClassRemoved(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onClassRemoved_(_st(ann)._theClass());
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
-_st($1)._on_do_($ClassMoved(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onClassMoved_from_(_st(ann)._theClass(),_st(ann)._oldPackage());
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
-_st($1)._on_do_($ClassRenamed(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onClassRenamed_(_st(ann)._theClass());
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
-$2=_st($1)._on_do_($ClassMigrated(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onClassMigrated_from_(_st(ann)._theClass(),_st(ann)._oldClass());
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
+_st($1)._on_send_to_($ClassAdded(),"onClassAdded:",self);
+_st($1)._on_send_to_($ClassRemoved(),"onClassRemoved:",self);
+_st($1)._on_send_to_($ClassMoved(),"onClassMoved:",self);
+_st($1)._on_send_to_($ClassRenamed(),"onClassRenamed:",self);
+$2=_st($1)._on_send_to_($ClassMigrated(),"onClassMigrated:",self);
 return self}, function($ctx1) {$ctx1.fill(self,"observeSystem",{},smalltalk.HLClassesListWidget)})},
-messageSends: ["on:do:", "onClassAdded:", "theClass", "systemAnnouncer", "model", "onClassRemoved:", "onClassMoved:from:", "oldPackage", "onClassRenamed:", "onClassMigrated:from:", "oldClass"]}),
+messageSends: ["on:send:to:", "systemAnnouncer", "model"]}),
 smalltalk.HLClassesListWidget);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "onClassAdded:",
-fn: function (aClass){
+fn: function (anAnnouncement){
 var self=this;
+var class_;
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2;
-$1=_st(_st(_st(aClass)._package()).__eq(_st(_st(self)._model())._selectedPackage()))._or_((function(){
+class_=_st(anAnnouncement)._theClass();
+$1=_st(_st(_st(class_)._package()).__eq(_st(_st(self)._model())._selectedPackage()))._or_((function(){
 return smalltalk.withContext(function($ctx2) {
-return _st(_st(self)._items())._includes_(aClass);
+return _st(_st(self)._items())._includes_(class_);
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
 if(! smalltalk.assert($1)){
 $2=self;
@@ -1024,17 +1005,20 @@ return $2;
 };
 _st(self)._setItemsForSelectedPackage();
 _st(self)._refresh();
-return self}, function($ctx1) {$ctx1.fill(self,"onClassAdded:",{aClass:aClass},smalltalk.HLClassesListWidget)})},
-messageSends: ["ifFalse:", "or:", "includes:", "items", "=", "selectedPackage", "model", "package", "setItemsForSelectedPackage", "refresh"]}),
+return self}, function($ctx1) {$ctx1.fill(self,"onClassAdded:",{anAnnouncement:anAnnouncement,class_:class_},smalltalk.HLClassesListWidget)})},
+messageSends: ["theClass", "ifFalse:", "or:", "includes:", "items", "=", "selectedPackage", "model", "package", "setItemsForSelectedPackage", "refresh"]}),
 smalltalk.HLClassesListWidget);
 
 smalltalk.addMethod(
 smalltalk.method({
-selector: "onClassMigrated:from:",
-fn: function (aClass,oldClass){
+selector: "onClassMigrated:",
+fn: function (anAnnouncement){
 var self=this;
+var class_,oldClass;
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2,$3;
+class_=_st(anAnnouncement)._theClass();
+oldClass=_st(anAnnouncement)._oldClass();
 $1=_st(_st(self)._items())._includes_(oldClass);
 if(! smalltalk.assert($1)){
 $2=self;
@@ -1042,30 +1026,33 @@ return $2;
 };
 $3=_st(_st(_st(self)._model())._selectedClass()).__eq(oldClass);
 if(smalltalk.assert($3)){
-_st(_st(self)._model())._selectedClass_(aClass);
+_st(_st(self)._model())._selectedClass_(class_);
 };
 _st(self)._setItemsForSelectedPackage();
 _st(self)._refresh();
-return self}, function($ctx1) {$ctx1.fill(self,"onClassMigrated:from:",{aClass:aClass,oldClass:oldClass},smalltalk.HLClassesListWidget)})},
-messageSends: ["ifFalse:", "includes:", "items", "ifTrue:", "selectedClass:", "model", "=", "selectedClass", "setItemsForSelectedPackage", "refresh"]}),
+return self}, function($ctx1) {$ctx1.fill(self,"onClassMigrated:",{anAnnouncement:anAnnouncement,class_:class_,oldClass:oldClass},smalltalk.HLClassesListWidget)})},
+messageSends: ["theClass", "oldClass", "ifFalse:", "includes:", "items", "ifTrue:", "selectedClass:", "model", "=", "selectedClass", "setItemsForSelectedPackage", "refresh"]}),
 smalltalk.HLClassesListWidget);
 
 smalltalk.addMethod(
 smalltalk.method({
-selector: "onClassMoved:from:",
-fn: function (aClass,aPackage){
+selector: "onClassMoved:",
+fn: function (anAnnouncement){
 var self=this;
+var class_,oldPackage;
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2,$3,$4,$5;
-$1=_st(_st(aPackage).__eq(_st(_st(self)._model())._selectedPackage()))._or_((function(){
+class_=_st(anAnnouncement)._theClass();
+oldPackage=_st(anAnnouncement)._oldPackage();
+$1=_st(_st(oldPackage).__eq(_st(_st(self)._model())._selectedPackage()))._or_((function(){
 return smalltalk.withContext(function($ctx2) {
-return _st(_st(aClass)._package()).__eq(_st(_st(self)._model())._selectedPackage());
+return _st(_st(class_)._package()).__eq(_st(_st(self)._model())._selectedPackage());
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
 if(! smalltalk.assert($1)){
 $2=self;
 return $2;
 };
-$3=_st(aPackage).__eq(_st(_st(self)._model())._selectedPackage());
+$3=_st(oldPackage).__eq(_st(_st(self)._model())._selectedPackage());
 if(smalltalk.assert($3)){
 $4=self;
 _st($4)._selectedItem_(nil);
@@ -1074,66 +1061,68 @@ $5;
 };
 _st(self)._setItemsForSelectedPackage();
 _st(self)._refresh();
-return self}, function($ctx1) {$ctx1.fill(self,"onClassMoved:from:",{aClass:aClass,aPackage:aPackage},smalltalk.HLClassesListWidget)})},
-messageSends: ["ifFalse:", "or:", "=", "selectedPackage", "model", "package", "ifTrue:", "selectedItem:", "selectItem:", "setItemsForSelectedPackage", "refresh"]}),
+return self}, function($ctx1) {$ctx1.fill(self,"onClassMoved:",{anAnnouncement:anAnnouncement,class_:class_,oldPackage:oldPackage},smalltalk.HLClassesListWidget)})},
+messageSends: ["theClass", "oldPackage", "ifFalse:", "or:", "=", "selectedPackage", "model", "package", "ifTrue:", "selectedItem:", "selectItem:", "setItemsForSelectedPackage", "refresh"]}),
 smalltalk.HLClassesListWidget);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "onClassRemoved:",
-fn: function (aClass){
+fn: function (anAnnouncement){
 var self=this;
+var class_;
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2,$3;
-$1=_st(_st(aClass)._package()).__eq(_st(_st(self)._model())._selectedPackage());
+class_=_st(anAnnouncement)._theClass();
+$1=_st(_st(class_)._package()).__eq(_st(_st(self)._model())._selectedPackage());
 if(! smalltalk.assert($1)){
 $2=self;
 return $2;
 };
-$3=_st(aClass).__eq(_st(_st(self)._model())._selectedClass());
+$3=_st(class_).__eq(_st(_st(self)._model())._selectedClass());
 if(smalltalk.assert($3)){
 _st(self)._selectItem_(nil);
 };
 _st(self)._setItemsForSelectedPackage();
 _st(self)._refresh();
-return self}, function($ctx1) {$ctx1.fill(self,"onClassRemoved:",{aClass:aClass},smalltalk.HLClassesListWidget)})},
-messageSends: ["ifFalse:", "=", "selectedPackage", "model", "package", "ifTrue:", "selectItem:", "selectedClass", "setItemsForSelectedPackage", "refresh"]}),
+return self}, function($ctx1) {$ctx1.fill(self,"onClassRemoved:",{anAnnouncement:anAnnouncement,class_:class_},smalltalk.HLClassesListWidget)})},
+messageSends: ["theClass", "ifFalse:", "=", "selectedPackage", "model", "package", "ifTrue:", "selectItem:", "selectedClass", "setItemsForSelectedPackage", "refresh"]}),
 smalltalk.HLClassesListWidget);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "onClassRenamed:",
-fn: function (aClass){
+fn: function (anAnnouncement){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2;
-$1=_st(_st(aClass)._package()).__eq(_st(_st(self)._model())._selectedPackage());
+$1=_st(_st(_st(anAnnouncement)._theClass())._package()).__eq(_st(_st(self)._model())._selectedPackage());
 if(! smalltalk.assert($1)){
 $2=self;
 return $2;
 };
 _st(self)._setItemsForSelectedPackage();
 _st(self)._refresh();
-return self}, function($ctx1) {$ctx1.fill(self,"onClassRenamed:",{aClass:aClass},smalltalk.HLClassesListWidget)})},
-messageSends: ["ifFalse:", "=", "selectedPackage", "model", "package", "setItemsForSelectedPackage", "refresh"]}),
+return self}, function($ctx1) {$ctx1.fill(self,"onClassRenamed:",{anAnnouncement:anAnnouncement},smalltalk.HLClassesListWidget)})},
+messageSends: ["ifFalse:", "=", "selectedPackage", "model", "package", "theClass", "setItemsForSelectedPackage", "refresh"]}),
 smalltalk.HLClassesListWidget);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "onClassSelected:",
-fn: function (aClass){
+fn: function (anAnnouncement){
 var self=this;
 var selectedClass;
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2,$3,$4,$5;
-$1=aClass;
+$1=_st(anAnnouncement)._item();
 if(($receiver = $1) == nil || $receiver == undefined){
 $2=self;
 return $2;
 } else {
 $1;
 };
-selectedClass=_st(aClass)._theNonMetaClass();
+selectedClass=_st(_st(anAnnouncement)._item())._theNonMetaClass();
 _st(self)._selectedItem_(selectedClass);
 $3=_st(self)._hasFocus();
 if(! smalltalk.assert($3)){
@@ -1142,8 +1131,8 @@ _st($4)._activateItem_(selectedClass);
 $5=_st($4)._focus();
 $5;
 };
-return self}, function($ctx1) {$ctx1.fill(self,"onClassSelected:",{aClass:aClass,selectedClass:selectedClass},smalltalk.HLClassesListWidget)})},
-messageSends: ["ifNil:", "theNonMetaClass", "selectedItem:", "ifFalse:", "activateItem:", "focus", "hasFocus"]}),
+return self}, function($ctx1) {$ctx1.fill(self,"onClassSelected:",{anAnnouncement:anAnnouncement,selectedClass:selectedClass},smalltalk.HLClassesListWidget)})},
+messageSends: ["ifNil:", "item", "theNonMetaClass", "selectedItem:", "ifFalse:", "activateItem:", "focus", "hasFocus"]}),
 smalltalk.HLClassesListWidget);
 
 smalltalk.addMethod(
@@ -1160,13 +1149,13 @@ smalltalk.HLClassesListWidget);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "onPackageSelected:",
-fn: function (aPackage){
+fn: function (anAnnouncement){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 _st(self)._selectedItem_(nil);
 _st(self)._setItemsForSelectedPackage();
 _st(self)._refresh();
-return self}, function($ctx1) {$ctx1.fill(self,"onPackageSelected:",{aPackage:aPackage},smalltalk.HLClassesListWidget)})},
+return self}, function($ctx1) {$ctx1.fill(self,"onPackageSelected:",{anAnnouncement:anAnnouncement},smalltalk.HLClassesListWidget)})},
 messageSends: ["selectedItem:", "setItemsForSelectedPackage", "refresh"]}),
 smalltalk.HLClassesListWidget);
 
@@ -1669,24 +1658,12 @@ function $HLMethodsFocusRequested(){return smalltalk.HLMethodsFocusRequested||(t
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2;
 $1=_st(_st(self)._model())._announcer();
-_st($1)._on_do_($HLProtocolSelected(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onProtocolSelected_(_st(ann)._item());
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
-_st($1)._on_do_($HLShowInstanceToggled(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onProtocolSelected_(nil);
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
-_st($1)._on_do_($HLMethodSelected(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onMethodSelected_(_st(ann)._item());
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
-$2=_st($1)._on_do_($HLMethodsFocusRequested(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onMethodsFocusRequested();
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
+_st($1)._on_send_to_($HLProtocolSelected(),"onProtocolSelected:",self);
+_st($1)._on_send_to_($HLShowInstanceToggled(),"onShowInstanceToggled",self);
+_st($1)._on_send_to_($HLMethodSelected(),"onMethodSelected:",self);
+$2=_st($1)._on_send_to_($HLMethodsFocusRequested(),"onMethodsFocusRequested",self);
 return self}, function($ctx1) {$ctx1.fill(self,"observeModel",{},smalltalk.HLMethodsListWidget)})},
-messageSends: ["on:do:", "onProtocolSelected:", "item", "announcer", "model", "onMethodSelected:", "onMethodsFocusRequested"]}),
+messageSends: ["on:send:to:", "announcer", "model"]}),
 smalltalk.HLMethodsListWidget);
 
 smalltalk.addMethod(
@@ -1702,56 +1679,41 @@ function $MethodMoved(){return smalltalk.MethodMoved||(typeof MethodMoved=="unde
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2;
 $1=_st(_st(self)._model())._systemAnnouncer();
-_st($1)._on_do_($ProtocolAdded(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onProtocolAdded_(_st(ann)._theClass());
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
-_st($1)._on_do_($ProtocolRemoved(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onProtocolRemoved_(_st(ann)._theClass());
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
-_st($1)._on_do_($MethodAdded(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onMethodAdded_(_st(ann)._method());
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
-_st($1)._on_do_($MethodRemoved(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onMethodRemoved_(_st(ann)._method());
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
-$2=_st($1)._on_do_($MethodMoved(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onMethodMoved_(_st(ann)._method());
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
+_st($1)._on_send_to_($ProtocolAdded(),"onProtocolAdded:",self);
+_st($1)._on_send_to_($ProtocolRemoved(),"onProtocolRemoved:",self);
+_st($1)._on_send_to_($MethodAdded(),"onMethodAdded:",self);
+_st($1)._on_send_to_($MethodRemoved(),"onMethodRemoved:",self);
+$2=_st($1)._on_send_to_($MethodMoved(),"onMethodMoved:",self);
 return self}, function($ctx1) {$ctx1.fill(self,"observeSystem",{},smalltalk.HLMethodsListWidget)})},
-messageSends: ["on:do:", "onProtocolAdded:", "theClass", "systemAnnouncer", "model", "onProtocolRemoved:", "onMethodAdded:", "method", "onMethodRemoved:", "onMethodMoved:"]}),
+messageSends: ["on:send:to:", "systemAnnouncer", "model"]}),
 smalltalk.HLMethodsListWidget);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "onMethodAdded:",
-fn: function (aMethod){
+fn: function (anAnnouncement){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2;
-$1=_st(_st(_st(self)._model())._selectedClass()).__eq(_st(aMethod)._methodClass());
+$1=_st(_st(_st(self)._model())._selectedClass()).__eq(_st(_st(anAnnouncement)._method())._methodClass());
 if(! smalltalk.assert($1)){
 $2=self;
 return $2;
 };
 _st(self)._setItemsForSelectedProtocol();
 _st(self)._refresh();
-return self}, function($ctx1) {$ctx1.fill(self,"onMethodAdded:",{aMethod:aMethod},smalltalk.HLMethodsListWidget)})},
-messageSends: ["ifFalse:", "=", "methodClass", "selectedClass", "model", "setItemsForSelectedProtocol", "refresh"]}),
+return self}, function($ctx1) {$ctx1.fill(self,"onMethodAdded:",{anAnnouncement:anAnnouncement},smalltalk.HLMethodsListWidget)})},
+messageSends: ["ifFalse:", "=", "methodClass", "method", "selectedClass", "model", "setItemsForSelectedProtocol", "refresh"]}),
 smalltalk.HLMethodsListWidget);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "onMethodMoved:",
-fn: function (aMethod){
+fn: function (anAnnouncement){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2,$3,$4,$5;
-$1=_st(_st(_st(self)._model())._selectedMethod()).__eq(aMethod);
+$1=_st(_st(_st(self)._model())._selectedMethod()).__eq(_st(anAnnouncement)._method());
 if(! smalltalk.assert($1)){
 $2=self;
 return $2;
@@ -1765,22 +1727,24 @@ _st($4)._setItemsForSelectedProtocol();
 $5=_st($4)._refresh();
 $5;
 };
-return self}, function($ctx1) {$ctx1.fill(self,"onMethodMoved:",{aMethod:aMethod},smalltalk.HLMethodsListWidget)})},
-messageSends: ["ifFalse:", "=", "selectedMethod", "model", "selectedItem:", "selectItem:", "setItemsForSelectedProtocol", "refresh", "allProtocol", "selectedProtocol"]}),
+return self}, function($ctx1) {$ctx1.fill(self,"onMethodMoved:",{anAnnouncement:anAnnouncement},smalltalk.HLMethodsListWidget)})},
+messageSends: ["ifFalse:", "=", "method", "selectedMethod", "model", "selectedItem:", "selectItem:", "setItemsForSelectedProtocol", "refresh", "allProtocol", "selectedProtocol"]}),
 smalltalk.HLMethodsListWidget);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "onMethodRemoved:",
-fn: function (aMethod){
+fn: function (anAnnouncement){
 var self=this;
+var method;
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2,$3,$4,$5;
 var $early={};
 try {
+method=_st(anAnnouncement)._method();
 _st(_st(self)._items())._detect_ifNone_((function(each){
 return smalltalk.withContext(function($ctx2) {
-return _st(each).__eq(_st(aMethod)._selector());
+return _st(each).__eq(_st(method)._selector());
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
 return smalltalk.withContext(function($ctx2) {
 $1=self;
@@ -1790,9 +1754,9 @@ $2=_st(self)._selectedItem();
 if(($receiver = $2) == nil || $receiver == undefined){
 $2;
 } else {
-$3=_st(_st(_st(aMethod)._methodClass()).__eq(_st(_st(self)._model())._selectedClass()))._and_((function(){
+$3=_st(_st(_st(method)._methodClass()).__eq(_st(_st(self)._model())._selectedClass()))._and_((function(){
 return smalltalk.withContext(function($ctx2) {
-return _st(_st(aMethod)._selector()).__eq(_st(self)._selectedItem());
+return _st(_st(method)._selector()).__eq(_st(self)._selectedItem());
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
 if(smalltalk.assert($3)){
 $4=self;
@@ -1805,29 +1769,30 @@ _st(self)._setItemsForSelectedProtocol();
 _st(self)._refresh();
 return self}
 catch(e) {if(e===$early)return e[0]; throw e}
-}, function($ctx1) {$ctx1.fill(self,"onMethodRemoved:",{aMethod:aMethod},smalltalk.HLMethodsListWidget)})},
-messageSends: ["detect:ifNone:", "=", "selector", "items", "ifNotNil:", "ifTrue:", "selectedItem:", "selectItem:", "and:", "selectedItem", "selectedClass", "model", "methodClass", "setItemsForSelectedProtocol", "refresh"]}),
+}, function($ctx1) {$ctx1.fill(self,"onMethodRemoved:",{anAnnouncement:anAnnouncement,method:method},smalltalk.HLMethodsListWidget)})},
+messageSends: ["method", "detect:ifNone:", "=", "selector", "items", "ifNotNil:", "ifTrue:", "selectedItem:", "selectItem:", "and:", "selectedItem", "selectedClass", "model", "methodClass", "setItemsForSelectedProtocol", "refresh"]}),
 smalltalk.HLMethodsListWidget);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "onMethodSelected:",
-fn: function (aMethod){
+fn: function (anAnnouncement){
 var self=this;
-var selector;
+var selector,method;
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2,$3;
-$1=_st(aMethod)._isCompiledMethod();
+method=_st(anAnnouncement)._item();
+$1=_st(method)._isCompiledMethod();
 if(smalltalk.assert($1)){
-selector=_st(aMethod)._selector();
+selector=_st(method)._selector();
 } else {
 selector=nil;
 };
 $2=self;
 _st($2)._selectedItem_(selector);
 $3=_st($2)._activateItem_(selector);
-return self}, function($ctx1) {$ctx1.fill(self,"onMethodSelected:",{aMethod:aMethod,selector:selector},smalltalk.HLMethodsListWidget)})},
-messageSends: ["ifTrue:ifFalse:", "selector", "isCompiledMethod", "selectedItem:", "activateItem:"]}),
+return self}, function($ctx1) {$ctx1.fill(self,"onMethodSelected:",{anAnnouncement:anAnnouncement,selector:selector,method:method},smalltalk.HLMethodsListWidget)})},
+messageSends: ["item", "ifTrue:ifFalse:", "selector", "isCompiledMethod", "selectedItem:", "activateItem:"]}),
 smalltalk.HLMethodsListWidget);
 
 smalltalk.addMethod(
@@ -1844,11 +1809,11 @@ smalltalk.HLMethodsListWidget);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "onProtocolAdded:",
-fn: function (aClass){
+fn: function (anAnnouncement){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2;
-$1=_st(_st(_st(self)._model())._selectedClass()).__eq(aClass);
+$1=_st(_st(_st(self)._model())._selectedClass()).__eq(_st(anAnnouncement)._theClass());
 if(! smalltalk.assert($1)){
 $2=self;
 return $2;
@@ -1856,18 +1821,18 @@ return $2;
 _st(self)._setItemsForSelectedProtocol();
 _st(self)._refresh();
 _st(self)._focus();
-return self}, function($ctx1) {$ctx1.fill(self,"onProtocolAdded:",{aClass:aClass},smalltalk.HLMethodsListWidget)})},
-messageSends: ["ifFalse:", "=", "selectedClass", "model", "setItemsForSelectedProtocol", "refresh", "focus"]}),
+return self}, function($ctx1) {$ctx1.fill(self,"onProtocolAdded:",{anAnnouncement:anAnnouncement},smalltalk.HLMethodsListWidget)})},
+messageSends: ["ifFalse:", "=", "theClass", "selectedClass", "model", "setItemsForSelectedProtocol", "refresh", "focus"]}),
 smalltalk.HLMethodsListWidget);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "onProtocolRemoved:",
-fn: function (aClass){
+fn: function (anAnnouncement){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2;
-$1=_st(_st(_st(self)._model())._selectedClass()).__eq(aClass);
+$1=_st(_st(_st(self)._model())._selectedClass()).__eq(_st(anAnnouncement)._theClass());
 if(! smalltalk.assert($1)){
 $2=self;
 return $2;
@@ -1875,23 +1840,34 @@ return $2;
 _st(self)._setItemsForSelectedProtocol();
 _st(self)._refresh();
 _st(self)._focus();
-return self}, function($ctx1) {$ctx1.fill(self,"onProtocolRemoved:",{aClass:aClass},smalltalk.HLMethodsListWidget)})},
-messageSends: ["ifFalse:", "=", "selectedClass", "model", "setItemsForSelectedProtocol", "refresh", "focus"]}),
+return self}, function($ctx1) {$ctx1.fill(self,"onProtocolRemoved:",{anAnnouncement:anAnnouncement},smalltalk.HLMethodsListWidget)})},
+messageSends: ["ifFalse:", "=", "theClass", "selectedClass", "model", "setItemsForSelectedProtocol", "refresh", "focus"]}),
 smalltalk.HLMethodsListWidget);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "onProtocolSelected:",
-fn: function (aString){
+fn: function (anAnnouncement){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 _st(self)._selectedItem_(nil);
 _st(self)._setItemsForSelectedProtocol();
 _st(self)._refresh();
-return self}, function($ctx1) {$ctx1.fill(self,"onProtocolSelected:",{aString:aString},smalltalk.HLMethodsListWidget)})},
+return self}, function($ctx1) {$ctx1.fill(self,"onProtocolSelected:",{anAnnouncement:anAnnouncement},smalltalk.HLMethodsListWidget)})},
 messageSends: ["selectedItem:", "setItemsForSelectedProtocol", "refresh"]}),
 smalltalk.HLMethodsListWidget);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "onShowInstanceToggled",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+_st(self)._onProtocolSelected_(nil);
+return self}, function($ctx1) {$ctx1.fill(self,"onShowInstanceToggled",{},smalltalk.HLMethodsListWidget)})},
+messageSends: ["onProtocolSelected:"]}),
+smalltalk.HLMethodsListWidget);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "overrideSelectors",
@@ -2148,16 +2124,10 @@ function $HLPackagesFocusRequested(){return smalltalk.HLPackagesFocusRequested||
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2;
 $1=_st(_st(self)._model())._announcer();
-_st($1)._on_do_($HLPackageSelected(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onPackageSelected_(_st(ann)._item());
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
-$2=_st($1)._on_do_($HLPackagesFocusRequested(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onPackagesFocusRequested();
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
+_st($1)._on_send_to_($HLPackageSelected(),"onPackageSelected:",self);
+$2=_st($1)._on_send_to_($HLPackagesFocusRequested(),"onPackagesFocusRequested",self);
 return self}, function($ctx1) {$ctx1.fill(self,"observeModel",{},smalltalk.HLPackagesListWidget)})},
-messageSends: ["on:do:", "onPackageSelected:", "item", "announcer", "model", "onPackagesFocusRequested"]}),
+messageSends: ["on:send:to:", "announcer", "model"]}),
 smalltalk.HLPackagesListWidget);
 
 smalltalk.addMethod(
@@ -2167,49 +2137,48 @@ fn: function (){
 var self=this;
 function $ClassAdded(){return smalltalk.ClassAdded||(typeof ClassAdded=="undefined"?nil:ClassAdded)}
 return smalltalk.withContext(function($ctx1) { 
-_st(_st(_st(self)._model())._systemAnnouncer())._on_do_($ClassAdded(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onClassAdded_(_st(ann)._theClass());
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
+_st(_st(_st(self)._model())._systemAnnouncer())._on_send_to_($ClassAdded(),"onClassAdded:",self);
 return self}, function($ctx1) {$ctx1.fill(self,"observeSystem",{},smalltalk.HLPackagesListWidget)})},
-messageSends: ["on:do:", "onClassAdded:", "theClass", "systemAnnouncer", "model"]}),
+messageSends: ["on:send:to:", "systemAnnouncer", "model"]}),
 smalltalk.HLPackagesListWidget);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "onClassAdded:",
-fn: function (aClass){
+fn: function (anAnnouncement){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2,$3;
-$1=_st(_st(self)._items())._includes_(_st(aClass)._package());
+$1=_st(_st(self)._items())._includes_(_st(_st(anAnnouncement)._theClass())._package());
 if(! smalltalk.assert($1)){
 $2=self;
 _st($2)._initializeItems();
 $3=_st($2)._refresh();
 $3;
 };
-return self}, function($ctx1) {$ctx1.fill(self,"onClassAdded:",{aClass:aClass},smalltalk.HLPackagesListWidget)})},
-messageSends: ["ifFalse:", "initializeItems", "refresh", "includes:", "package", "items"]}),
+return self}, function($ctx1) {$ctx1.fill(self,"onClassAdded:",{anAnnouncement:anAnnouncement},smalltalk.HLPackagesListWidget)})},
+messageSends: ["ifFalse:", "initializeItems", "refresh", "includes:", "package", "theClass", "items"]}),
 smalltalk.HLPackagesListWidget);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "onPackageSelected:",
-fn: function (aPackage){
+fn: function (anAnnouncement){
 var self=this;
+var package_;
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2,$3;
-_st(self)._selectedItem_(aPackage);
+package_=_st(anAnnouncement)._item();
+_st(self)._selectedItem_(package_);
 $1=_st(self)._hasFocus();
 if(! smalltalk.assert($1)){
 $2=self;
-_st($2)._activateItem_(aPackage);
+_st($2)._activateItem_(package_);
 $3=_st($2)._focus();
 $3;
 };
-return self}, function($ctx1) {$ctx1.fill(self,"onPackageSelected:",{aPackage:aPackage},smalltalk.HLPackagesListWidget)})},
-messageSends: ["selectedItem:", "ifFalse:", "activateItem:", "focus", "hasFocus"]}),
+return self}, function($ctx1) {$ctx1.fill(self,"onPackageSelected:",{anAnnouncement:anAnnouncement,package_:package_},smalltalk.HLPackagesListWidget)})},
+messageSends: ["item", "selectedItem:", "ifFalse:", "activateItem:", "focus", "hasFocus"]}),
 smalltalk.HLPackagesListWidget);
 
 smalltalk.addMethod(
@@ -2308,24 +2277,12 @@ function $HLProtocolsFocusRequested(){return smalltalk.HLProtocolsFocusRequested
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2;
 $1=_st(_st(self)._model())._announcer();
-_st($1)._on_do_($HLClassSelected(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onClassSelected_(_st(ann)._item());
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
-_st($1)._on_do_($HLShowInstanceToggled(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onClassSelected_(_st(_st(self)._model())._selectedClass());
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
-_st($1)._on_do_($HLProtocolSelected(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onProtocolSelected_(_st(ann)._item());
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
-$2=_st($1)._on_do_($HLProtocolsFocusRequested(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onProtocolsFocusRequested();
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
+_st($1)._on_send_to_($HLClassSelected(),"onClassSelected:",self);
+_st($1)._on_send_to_($HLShowInstanceToggled(),"onClassSelected:",self);
+_st($1)._on_send_to_($HLProtocolSelected(),"onProtocolSelected:",self);
+$2=_st($1)._on_send_to_($HLProtocolsFocusRequested(),"onProtocolsFocusRequested",self);
 return self}, function($ctx1) {$ctx1.fill(self,"observeModel",{},smalltalk.HLProtocolsListWidget)})},
-messageSends: ["on:do:", "onClassSelected:", "item", "announcer", "model", "selectedClass", "onProtocolSelected:", "onProtocolsFocusRequested"]}),
+messageSends: ["on:send:to:", "announcer", "model"]}),
 smalltalk.HLProtocolsListWidget);
 
 smalltalk.addMethod(
@@ -2338,62 +2295,61 @@ function $ProtocolRemoved(){return smalltalk.ProtocolRemoved||(typeof ProtocolRe
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2;
 $1=_st(_st(self)._model())._systemAnnouncer();
-_st($1)._on_do_($ProtocolAdded(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onProtocolAdded_to_(_st(ann)._protocol(),_st(ann)._theClass());
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
-$2=_st($1)._on_do_($ProtocolRemoved(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onProtocolRemoved_from_(_st(ann)._protocol(),_st(ann)._theClass());
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
+_st($1)._on_send_to_($ProtocolAdded(),"onProtocolAdded:",self);
+$2=_st($1)._on_send_to_($ProtocolRemoved(),"onProtocolRemoved:",self);
 return self}, function($ctx1) {$ctx1.fill(self,"observeSystem",{},smalltalk.HLProtocolsListWidget)})},
-messageSends: ["on:do:", "onProtocolAdded:to:", "protocol", "theClass", "systemAnnouncer", "model", "onProtocolRemoved:from:"]}),
+messageSends: ["on:send:to:", "systemAnnouncer", "model"]}),
 smalltalk.HLProtocolsListWidget);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "onClassSelected:",
-fn: function (aClass){
+fn: function (anAnnouncement){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 _st(self)._selectedItem_(nil);
 _st(self)._setItemsForSelectedClass();
 _st(self)._refresh();
-return self}, function($ctx1) {$ctx1.fill(self,"onClassSelected:",{aClass:aClass},smalltalk.HLProtocolsListWidget)})},
+return self}, function($ctx1) {$ctx1.fill(self,"onClassSelected:",{anAnnouncement:anAnnouncement},smalltalk.HLProtocolsListWidget)})},
 messageSends: ["selectedItem:", "setItemsForSelectedClass", "refresh"]}),
 smalltalk.HLProtocolsListWidget);
 
 smalltalk.addMethod(
 smalltalk.method({
-selector: "onProtocolAdded:to:",
-fn: function (aString,aClass){
+selector: "onProtocolAdded:",
+fn: function (anAnnouncement){
 var self=this;
+var class_;
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2;
-$1=_st(aClass).__eq(_st(_st(self)._model())._selectedClass());
+class_=_st(anAnnouncement)._theClass();
+$1=_st(class_).__eq(_st(_st(self)._model())._selectedClass());
 if(! smalltalk.assert($1)){
 $2=self;
 return $2;
 };
 _st(self)._setItemsForSelectedClass();
 _st(self)._refresh();
-return self}, function($ctx1) {$ctx1.fill(self,"onProtocolAdded:to:",{aString:aString,aClass:aClass},smalltalk.HLProtocolsListWidget)})},
-messageSends: ["ifFalse:", "=", "selectedClass", "model", "setItemsForSelectedClass", "refresh"]}),
+return self}, function($ctx1) {$ctx1.fill(self,"onProtocolAdded:",{anAnnouncement:anAnnouncement,class_:class_},smalltalk.HLProtocolsListWidget)})},
+messageSends: ["theClass", "ifFalse:", "=", "selectedClass", "model", "setItemsForSelectedClass", "refresh"]}),
 smalltalk.HLProtocolsListWidget);
 
 smalltalk.addMethod(
 smalltalk.method({
-selector: "onProtocolRemoved:from:",
-fn: function (aString,aClass){
+selector: "onProtocolRemoved:",
+fn: function (anAnnouncement){
 var self=this;
+var class_,protocol;
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2,$3,$4,$5;
-$1=_st(aClass).__eq(_st(_st(self)._model())._selectedClass());
+class_=_st(anAnnouncement)._theClass();
+protocol=_st(anAnnouncement)._protocol();
+$1=_st(class_).__eq(_st(_st(self)._model())._selectedClass());
 if(! smalltalk.assert($1)){
 $2=self;
 return $2;
 };
-$3=_st(_st(_st(self)._model())._selectedProtocol()).__eq(aString);
+$3=_st(_st(_st(self)._model())._selectedProtocol()).__eq(protocol);
 if(smalltalk.assert($3)){
 $4=self;
 _st($4)._selectedItem_(nil);
@@ -2402,19 +2358,21 @@ $5;
 };
 _st(self)._setItemsForSelectedClass();
 _st(self)._refresh();
-return self}, function($ctx1) {$ctx1.fill(self,"onProtocolRemoved:from:",{aString:aString,aClass:aClass},smalltalk.HLProtocolsListWidget)})},
-messageSends: ["ifFalse:", "=", "selectedClass", "model", "ifTrue:", "selectedItem:", "selectItem:", "selectedProtocol", "setItemsForSelectedClass", "refresh"]}),
+return self}, function($ctx1) {$ctx1.fill(self,"onProtocolRemoved:",{anAnnouncement:anAnnouncement,class_:class_,protocol:protocol},smalltalk.HLProtocolsListWidget)})},
+messageSends: ["theClass", "protocol", "ifFalse:", "=", "selectedClass", "model", "ifTrue:", "selectedItem:", "selectItem:", "selectedProtocol", "setItemsForSelectedClass", "refresh"]}),
 smalltalk.HLProtocolsListWidget);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "onProtocolSelected:",
-fn: function (aString){
+fn: function (anAnnouncement){
 var self=this;
+var protocol;
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2,$3,$4,$5;
-_st(self)._selectedItem_(aString);
-$1=aString;
+protocol=_st(anAnnouncement)._item();
+_st(self)._selectedItem_(protocol);
+$1=protocol;
 if(($receiver = $1) == nil || $receiver == undefined){
 $2=self;
 return $2;
@@ -2424,12 +2382,12 @@ $1;
 $3=_st(self)._hasFocus();
 if(! smalltalk.assert($3)){
 $4=self;
-_st($4)._activateItem_(aString);
+_st($4)._activateItem_(protocol);
 $5=_st($4)._focus();
 $5;
 };
-return self}, function($ctx1) {$ctx1.fill(self,"onProtocolSelected:",{aString:aString},smalltalk.HLProtocolsListWidget)})},
-messageSends: ["selectedItem:", "ifNil:", "ifFalse:", "activateItem:", "focus", "hasFocus"]}),
+return self}, function($ctx1) {$ctx1.fill(self,"onProtocolSelected:",{anAnnouncement:anAnnouncement,protocol:protocol},smalltalk.HLProtocolsListWidget)})},
+messageSends: ["item", "selectedItem:", "ifNil:", "ifFalse:", "activateItem:", "focus", "hasFocus"]}),
 smalltalk.HLProtocolsListWidget);
 
 smalltalk.addMethod(
@@ -2643,38 +2601,32 @@ function $MethodRemoved(){return smalltalk.MethodRemoved||(typeof MethodRemoved=
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2;
 $1=_st($SystemAnnouncer())._current();
-_st($1)._on_do_($MethodAdded(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onMethodAdded_(_st(ann)._method());
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
-$2=_st($1)._on_do_($MethodRemoved(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onMethodRemoved_(_st(ann)._method());
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
+_st($1)._on_send_to_($MethodAdded(),"onMethodAdded:",self);
+$2=_st($1)._on_send_to_($MethodRemoved(),"onMethodRemoved:",self);
 return self}, function($ctx1) {$ctx1.fill(self,"observeSystem",{},smalltalk.HLSelectorsCache)})},
-messageSends: ["on:do:", "onMethodAdded:", "method", "current", "onMethodRemoved:"]}),
+messageSends: ["on:send:to:", "current"]}),
 smalltalk.HLSelectorsCache);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "onMethodAdded:",
-fn: function (aMethod){
+fn: function (anAnnouncement){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-_st(self)._invalidateCacheFor_(aMethod);
-return self}, function($ctx1) {$ctx1.fill(self,"onMethodAdded:",{aMethod:aMethod},smalltalk.HLSelectorsCache)})},
-messageSends: ["invalidateCacheFor:"]}),
+_st(self)._invalidateCacheFor_(_st(anAnnouncement)._method());
+return self}, function($ctx1) {$ctx1.fill(self,"onMethodAdded:",{anAnnouncement:anAnnouncement},smalltalk.HLSelectorsCache)})},
+messageSends: ["invalidateCacheFor:", "method"]}),
 smalltalk.HLSelectorsCache);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "onMethodRemoved:",
-fn: function (aMethod){
+fn: function (anAnnouncement){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-_st(self)._invalidateCacheFor_(aMethod);
-return self}, function($ctx1) {$ctx1.fill(self,"onMethodRemoved:",{aMethod:aMethod},smalltalk.HLSelectorsCache)})},
-messageSends: ["invalidateCacheFor:"]}),
+_st(self)._invalidateCacheFor_(_st(anAnnouncement)._method());
+return self}, function($ctx1) {$ctx1.fill(self,"onMethodRemoved:",{anAnnouncement:anAnnouncement},smalltalk.HLSelectorsCache)})},
+messageSends: ["invalidateCacheFor:", "method"]}),
 smalltalk.HLSelectorsCache);
 
 

File diff suppressed because it is too large
+ 248 - 286
js/Helios-Browser.js


+ 13 - 0
js/Helios-Commands-Tools.deploy.js

@@ -315,6 +315,19 @@ messageSends: []}),
 smalltalk.HLFindClassCommand);
 
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "isValidFor:",
+fn: function (aModel){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+$1=_st(aModel)._isBrowserModel();
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"isValidFor:",{aModel:aModel},smalltalk.HLFindClassCommand.klass)})},
+messageSends: ["isBrowserModel"]}),
+smalltalk.HLFindClassCommand.klass);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "key",

+ 18 - 0
js/Helios-Commands-Tools.js

@@ -445,6 +445,24 @@ referencedClasses: []
 smalltalk.HLFindClassCommand);
 
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "isValidFor:",
+category: 'testing',
+fn: function (aModel){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+$1=_st(aModel)._isBrowserModel();
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"isValidFor:",{aModel:aModel},smalltalk.HLFindClassCommand.klass)})},
+args: ["aModel"],
+source: "isValidFor: aModel\x0a\x09^ aModel isBrowserModel",
+messageSends: ["isBrowserModel"],
+referencedClasses: []
+}),
+smalltalk.HLFindClassCommand.klass);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "key",

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

@@ -1006,6 +1006,7 @@ fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
+_st(_st(self)._widget())._unregister();
 $1=self["@root"];
 if(($receiver = $1) == nil || $receiver == undefined){
 $1;
@@ -1013,7 +1014,7 @@ $1;
 _st(_st(self["@root"])._asJQuery())._remove();
 };
 return self}, function($ctx1) {$ctx1.fill(self,"remove",{},smalltalk.HLTab)})},
-messageSends: ["ifNotNil:", "remove", "asJQuery"]}),
+messageSends: ["unregister", "widget", "ifNotNil:", "remove", "asJQuery"]}),
 smalltalk.HLTab);
 
 smalltalk.addMethod(
@@ -1245,6 +1246,16 @@ return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},smalltalk
 messageSends: ["div", "appendToJQuery:", "asJQuery", "renderContentOn:"]}),
 smalltalk.HLWidget);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "unregister",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},smalltalk.HLWidget)})},
+messageSends: []}),
+smalltalk.HLWidget);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "wrapper",
@@ -2468,6 +2479,19 @@ return self}, function($ctx1) {$ctx1.fill(self,"selectedItem:",{anItem:anItem},s
 messageSends: ["selectedItem:", "updateMenu"]}),
 smalltalk.HLToolListWidget);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "unregister",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+smalltalk.HLNavigationListWidget.fn.prototype._unregister.apply(_st(self), []);
+_st(_st(_st(self)._model())._announcer())._unsubscribe_(self);
+_st(_st(_st(self)._model())._systemAnnouncer())._unsubscribe_(self);
+return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},smalltalk.HLToolListWidget)})},
+messageSends: ["unregister", "unsubscribe:", "announcer", "model", "systemAnnouncer"]}),
+smalltalk.HLToolListWidget);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "updateMenu",

+ 36 - 2
js/Helios-Core.js

@@ -1312,6 +1312,7 @@ fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
+_st(_st(self)._widget())._unregister();
 $1=self["@root"];
 if(($receiver = $1) == nil || $receiver == undefined){
 $1;
@@ -1320,8 +1321,8 @@ _st(_st(self["@root"])._asJQuery())._remove();
 };
 return self}, function($ctx1) {$ctx1.fill(self,"remove",{},smalltalk.HLTab)})},
 args: [],
-source: "remove\x0a\x09root ifNotNil: [ root asJQuery remove ]",
-messageSends: ["ifNotNil:", "remove", "asJQuery"],
+source: "remove\x0a\x09self widget unregister.\x0a\x09root ifNotNil: [ root asJQuery remove ]",
+messageSends: ["unregister", "widget", "ifNotNil:", "remove", "asJQuery"],
 referencedClasses: []
 }),
 smalltalk.HLTab);
@@ -1635,6 +1636,21 @@ referencedClasses: []
 }),
 smalltalk.HLWidget);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "unregister",
+category: 'actions',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},smalltalk.HLWidget)})},
+args: [],
+source: "unregister\x0a\x09\x22This method is called whenever the receiver is closed (as a tab).\x0a\x09Widgets subscribing to announcements should unregister there\x22",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLWidget);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "wrapper",
@@ -3203,6 +3219,24 @@ referencedClasses: []
 }),
 smalltalk.HLToolListWidget);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "unregister",
+category: 'actions',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+smalltalk.HLNavigationListWidget.fn.prototype._unregister.apply(_st(self), []);
+_st(_st(_st(self)._model())._announcer())._unsubscribe_(self);
+_st(_st(_st(self)._model())._systemAnnouncer())._unsubscribe_(self);
+return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},smalltalk.HLToolListWidget)})},
+args: [],
+source: "unregister\x0a\x09super unregister.\x0a\x09\x0a\x09self model announcer unsubscribe: self.\x0a\x09self model systemAnnouncer unsubscribe: self",
+messageSends: ["unregister", "unsubscribe:", "announcer", "model", "systemAnnouncer"],
+referencedClasses: []
+}),
+smalltalk.HLToolListWidget);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "updateMenu",

+ 2 - 5
js/Helios-Inspector.deploy.js

@@ -163,12 +163,9 @@ fn: function (){
 var self=this;
 function $HLInstanceVariableSelected(){return smalltalk.HLInstanceVariableSelected||(typeof HLInstanceVariableSelected=="undefined"?nil:HLInstanceVariableSelected)}
 return smalltalk.withContext(function($ctx1) { 
-_st(_st(_st(self)._model())._announcer())._on_do_($HLInstanceVariableSelected(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onInstanceVariableSelected();
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
+_st(_st(_st(self)._model())._announcer())._on_send_to_($HLInstanceVariableSelected(),"onInstanceVariableSelected",self);
 return self}, function($ctx1) {$ctx1.fill(self,"observeModel",{},smalltalk.HLInspector)})},
-messageSends: ["on:do:", "onInstanceVariableSelected", "announcer", "model"]}),
+messageSends: ["on:send:to:", "announcer", "model"]}),
 smalltalk.HLInspector);
 
 smalltalk.addMethod(

+ 3 - 6
js/Helios-Inspector.js

@@ -209,14 +209,11 @@ fn: function (){
 var self=this;
 function $HLInstanceVariableSelected(){return smalltalk.HLInstanceVariableSelected||(typeof HLInstanceVariableSelected=="undefined"?nil:HLInstanceVariableSelected)}
 return smalltalk.withContext(function($ctx1) { 
-_st(_st(_st(self)._model())._announcer())._on_do_($HLInstanceVariableSelected(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onInstanceVariableSelected();
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
+_st(_st(_st(self)._model())._announcer())._on_send_to_($HLInstanceVariableSelected(),"onInstanceVariableSelected",self);
 return self}, function($ctx1) {$ctx1.fill(self,"observeModel",{},smalltalk.HLInspector)})},
 args: [],
-source: "observeModel\x0a\x09self model announcer\x0a        on: HLInstanceVariableSelected do: [ :ann | self onInstanceVariableSelected ]",
-messageSends: ["on:do:", "onInstanceVariableSelected", "announcer", "model"],
+source: "observeModel\x0a\x09self model announcer\x0a        on: HLInstanceVariableSelected\x0a\x09\x09send: #onInstanceVariableSelected\x0a\x09\x09to: self",
+messageSends: ["on:send:to:", "announcer", "model"],
 referencedClasses: ["HLInstanceVariableSelected"]
 }),
 smalltalk.HLInspector);

+ 69 - 127
js/Helios-Workspace.deploy.js

@@ -991,56 +991,20 @@ function $HLSourceCodeFocusRequested(){return smalltalk.HLSourceCodeFocusRequest
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2;
 $1=_st(_st(self)._browserModel())._announcer();
-_st($1)._on_do_($HLSaveSourceCode(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onSaveIt();
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
-_st($1)._on_do_($HLShowInstanceToggled(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onShowInstanceToggled();
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
-_st($1)._on_do_($HLSourceCodeSaved(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onSourceCodeSaved();
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
-_st($1)._on_do_($HLAboutToChange(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onBrowserAboutToChange_(_st(ann)._actionBlock());
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
-_st($1)._on_do_($HLParseErrorRaised(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onParseError_(ann);
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
-_st($1)._on_do_($HLCompileErrorRaised(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onCompileError_(_st(ann)._error());
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
-_st($1)._on_do_($HLUnknownVariableErrorRaised(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onUnknownVariableError_(_st(ann)._error());
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
-_st($1)._on_do_($HLInstVarAdded(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onInstVarAdded();
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
-_st($1)._on_do_($HLMethodSelected(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onMethodSelected_(_st(ann)._item());
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
-_st($1)._on_do_($HLClassSelected(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onClassSelected_(_st(ann)._item());
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
-_st($1)._on_do_($HLProtocolSelected(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onProtocolSelected_(_st(ann)._item());
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
-$2=_st($1)._on_do_($HLSourceCodeFocusRequested(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onSourceCodeFocusRequested();
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
+_st($1)._on_send_to_($HLSaveSourceCode(),"onSaveIt",self);
+_st($1)._on_send_to_($HLShowInstanceToggled(),"onShowInstanceToggled",self);
+_st($1)._on_send_to_($HLSourceCodeSaved(),"onSourceCodeSaved",self);
+_st($1)._on_send_to_($HLAboutToChange(),"onBrowserAboutToChange:",self);
+_st($1)._on_send_to_($HLParseErrorRaised(),"onParseError:",self);
+_st($1)._on_send_to_($HLCompileErrorRaised(),"onCompileError:",self);
+_st($1)._on_send_to_($HLUnknownVariableErrorRaised(),"onUnknownVariableError:",self);
+_st($1)._on_send_to_($HLInstVarAdded(),"onInstVarAdded",self);
+_st($1)._on_send_to_($HLMethodSelected(),"onMethodSelected:",self);
+_st($1)._on_send_to_($HLClassSelected(),"onClassSelected:",self);
+_st($1)._on_send_to_($HLProtocolSelected(),"onProtocolSelected:",self);
+$2=_st($1)._on_send_to_($HLSourceCodeFocusRequested(),"onSourceCodeFocusRequested",self);
 return self}, function($ctx1) {$ctx1.fill(self,"observeBrowserModel",{},smalltalk.HLBrowserCodeWidget)})},
-messageSends: ["on:do:", "onSaveIt", "announcer", "browserModel", "onShowInstanceToggled", "onSourceCodeSaved", "onBrowserAboutToChange:", "actionBlock", "onParseError:", "onCompileError:", "error", "onUnknownVariableError:", "onInstVarAdded", "onMethodSelected:", "item", "onClassSelected:", "onProtocolSelected:", "onSourceCodeFocusRequested"]}),
+messageSends: ["on:send:to:", "announcer", "browserModel"]}),
 smalltalk.HLBrowserCodeWidget);
 
 smalltalk.addMethod(
@@ -1049,106 +1013,65 @@ selector: "observeSystem",
 fn: function (){
 var self=this;
 function $MethodModified(){return smalltalk.MethodModified||(typeof MethodModified=="undefined"?nil:MethodModified)}
-function $HLMethodSelected(){return smalltalk.HLMethodSelected||(typeof HLMethodSelected=="undefined"?nil:HLMethodSelected)}
-function $HLClassSelected(){return smalltalk.HLClassSelected||(typeof HLClassSelected=="undefined"?nil:HLClassSelected)}
-function $HLProtocolSelected(){return smalltalk.HLProtocolSelected||(typeof HLProtocolSelected=="undefined"?nil:HLProtocolSelected)}
-function $HLSourceCodeFocusRequested(){return smalltalk.HLSourceCodeFocusRequested||(typeof HLSourceCodeFocusRequested=="undefined"?nil:HLSourceCodeFocusRequested)}
-return smalltalk.withContext(function($ctx1) { 
-var $1,$2;
-$1=_st(_st(self)._browserModel())._systemAnnouncer();
-_st($1)._on_do_($MethodModified(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onMethodModified_(_st(ann)._method());
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
-_st($1)._on_do_($HLMethodSelected(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onMethodSelected_(_st(ann)._item());
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
-_st($1)._on_do_($HLClassSelected(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onClassSelected_(_st(ann)._item());
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
-_st($1)._on_do_($HLProtocolSelected(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onProtocolSelected_(_st(ann)._item());
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
-$2=_st($1)._on_do_($HLSourceCodeFocusRequested(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onSourceCodeFocusRequested();
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"observeSystem",{},smalltalk.HLSourceCodeWidget)})},
-messageSends: ["on:do:", "onMethodModified:", "method", "systemAnnouncer", "browserModel", "onMethodSelected:", "item", "onClassSelected:", "onProtocolSelected:", "onSourceCodeFocusRequested"]}),
-smalltalk.HLBrowserCodeWidget);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "onBrowserAboutToChange",
-fn: function (){
-var self=this;
-function $HLChangeForbidden(){return smalltalk.HLChangeForbidden||(typeof HLChangeForbidden=="undefined"?nil:HLChangeForbidden)}
 return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st(self)._hasModification();
-if(smalltalk.assert($1)){
-_st(self)._confirm_ifFalse_("Do you want to cancel changes?",(function(){
-return smalltalk.withContext(function($ctx2) {
-return _st($HLChangeForbidden())._signal();
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
-_st(self)._methodContents_(_st(self)._contents());
-};
-return self}, function($ctx1) {$ctx1.fill(self,"onBrowserAboutToChange",{},smalltalk.HLBrowserCodeWidget)})},
-messageSends: ["ifTrue:", "confirm:ifFalse:", "signal", "methodContents:", "contents", "hasModification"]}),
+_st(_st(_st(self)._browserModel())._systemAnnouncer())._on_send_to_($MethodModified(),"onMethodModified:",self);
+return self}, function($ctx1) {$ctx1.fill(self,"observeSystem",{},smalltalk.HLBrowserCodeWidget)})},
+messageSends: ["on:send:to:", "systemAnnouncer", "browserModel"]}),
 smalltalk.HLBrowserCodeWidget);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "onBrowserAboutToChange:",
-fn: function (aBlock){
+fn: function (anAnnouncement){
 var self=this;
+var block;
 function $HLChangeForbidden(){return smalltalk.HLChangeForbidden||(typeof HLChangeForbidden=="undefined"?nil:HLChangeForbidden)}
 return smalltalk.withContext(function($ctx1) { 
 var $1;
+block=_st(anAnnouncement)._actionBlock();
 $1=_st(self)._hasModification();
 if(smalltalk.assert($1)){
 _st(self)._confirm_ifTrue_("Do you want to cancel changes?",(function(){
 return smalltalk.withContext(function($ctx2) {
 _st(self)._methodContents_(_st(self)._contents());
-return _st(aBlock)._value();
+return _st(block)._value();
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
 _st($HLChangeForbidden())._signal();
 };
-return self}, function($ctx1) {$ctx1.fill(self,"onBrowserAboutToChange:",{aBlock:aBlock},smalltalk.HLBrowserCodeWidget)})},
-messageSends: ["ifTrue:", "confirm:ifTrue:", "methodContents:", "contents", "value", "signal", "hasModification"]}),
+return self}, function($ctx1) {$ctx1.fill(self,"onBrowserAboutToChange:",{anAnnouncement:anAnnouncement,block:block},smalltalk.HLBrowserCodeWidget)})},
+messageSends: ["actionBlock", "ifTrue:", "confirm:ifTrue:", "methodContents:", "contents", "value", "signal", "hasModification"]}),
 smalltalk.HLBrowserCodeWidget);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "onClassSelected:",
-fn: function (aClass){
+fn: function (anAnnouncement){
 var self=this;
+var class_;
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2;
-$1=aClass;
+class_=_st(anAnnouncement)._item();
+$1=class_;
 if(($receiver = $1) == nil || $receiver == undefined){
 $2=_st(self)._contents_("");
 return $2;
 } else {
 $1;
 };
-_st(self)._contents_(_st(aClass)._definition());
-return self}, function($ctx1) {$ctx1.fill(self,"onClassSelected:",{aClass:aClass},smalltalk.HLSourceCodeWidget)})},
-messageSends: ["ifNil:", "contents:", "definition"]}),
+_st(self)._contents_(_st(class_)._definition());
+return self}, function($ctx1) {$ctx1.fill(self,"onClassSelected:",{anAnnouncement:anAnnouncement,class_:class_},smalltalk.HLBrowserCodeWidget)})},
+messageSends: ["item", "ifNil:", "contents:", "definition"]}),
 smalltalk.HLBrowserCodeWidget);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "onCompileError:",
-fn: function (anError){
+fn: function (anAnnouncement){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-_st(self)._alert_(_st(anError)._messageText());
-return self}, function($ctx1) {$ctx1.fill(self,"onCompileError:",{anError:anError},smalltalk.HLSourceCodeWidget)})},
-messageSends: ["alert:", "messageText"]}),
+_st(self)._alert_(_st(_st(anAnnouncement)._error())._messageText());
+return self}, function($ctx1) {$ctx1.fill(self,"onCompileError:",{anAnnouncement:anAnnouncement},smalltalk.HLBrowserCodeWidget)})},
+messageSends: ["alert:", "messageText", "error"]}),
 smalltalk.HLBrowserCodeWidget);
 
 smalltalk.addMethod(
@@ -1165,11 +1088,13 @@ smalltalk.HLBrowserCodeWidget);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "onMethodModified:",
-fn: function (aMethod){
+fn: function (anAnnouncement){
 var self=this;
+var method;
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2,$3,$4,$5,$6;
-$1=_st(_st(_st(self)._browserModel())._selectedClass()).__eq(_st(aMethod)._methodClass());
+method=_st(anAnnouncement)._method();
+$1=_st(_st(_st(self)._browserModel())._selectedClass()).__eq(_st(method)._methodClass());
 if(! smalltalk.assert($1)){
 $2=self;
 return $2;
@@ -1181,33 +1106,35 @@ return $4;
 } else {
 $3;
 };
-$5=_st(_st(_st(_st(self)._browserModel())._selectedMethod())._selector()).__eq(_st(aMethod)._selector());
+$5=_st(_st(_st(_st(self)._browserModel())._selectedMethod())._selector()).__eq(_st(method)._selector());
 if(! smalltalk.assert($5)){
 $6=self;
 return $6;
 };
 _st(self)._refresh();
-return self}, function($ctx1) {$ctx1.fill(self,"onMethodModified:",{aMethod:aMethod},smalltalk.HLBrowserCodeWidget)})},
-messageSends: ["ifFalse:", "=", "methodClass", "selectedClass", "browserModel", "ifNil:", "selectedMethod", "selector", "refresh"]}),
+return self}, function($ctx1) {$ctx1.fill(self,"onMethodModified:",{anAnnouncement:anAnnouncement,method:method},smalltalk.HLBrowserCodeWidget)})},
+messageSends: ["method", "ifFalse:", "=", "methodClass", "selectedClass", "browserModel", "ifNil:", "selectedMethod", "selector", "refresh"]}),
 smalltalk.HLBrowserCodeWidget);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "onMethodSelected:",
-fn: function (aCompiledMethod){
+fn: function (anAnnouncement){
 var self=this;
+var method;
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2;
-$1=aCompiledMethod;
+method=_st(anAnnouncement)._item();
+$1=method;
 if(($receiver = $1) == nil || $receiver == undefined){
 $2=_st(self)._contents_("");
 return $2;
 } else {
 $1;
 };
-_st(self)._contents_(_st(aCompiledMethod)._source());
-return self}, function($ctx1) {$ctx1.fill(self,"onMethodSelected:",{aCompiledMethod:aCompiledMethod},smalltalk.HLSourceCodeWidget)})},
-messageSends: ["ifNil:", "contents:", "source"]}),
+_st(self)._contents_(_st(method)._source());
+return self}, function($ctx1) {$ctx1.fill(self,"onMethodSelected:",{anAnnouncement:anAnnouncement,method:method},smalltalk.HLBrowserCodeWidget)})},
+messageSends: ["item", "ifNil:", "contents:", "source"]}),
 smalltalk.HLBrowserCodeWidget);
 
 smalltalk.addMethod(
@@ -1248,7 +1175,7 @@ smalltalk.HLBrowserCodeWidget);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "onProtocolSelected:",
-fn: function (aString){
+fn: function (anAnnouncement){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2;
@@ -1260,7 +1187,7 @@ return $2;
 $1;
 };
 _st(self)._contents_(_st(_st(_st(self)._browserModel())._selectedClass())._definition());
-return self}, function($ctx1) {$ctx1.fill(self,"onProtocolSelected:",{aString:aString},smalltalk.HLSourceCodeWidget)})},
+return self}, function($ctx1) {$ctx1.fill(self,"onProtocolSelected:",{anAnnouncement:anAnnouncement},smalltalk.HLBrowserCodeWidget)})},
 messageSends: ["ifNil:", "contents:", "selectedClass", "browserModel", "definition"]}),
 smalltalk.HLBrowserCodeWidget);
 
@@ -1320,24 +1247,26 @@ smalltalk.HLBrowserCodeWidget);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "onUnknownVariableError:",
-fn: function (anError){
+fn: function (anAnnouncement){
 var self=this;
+var error;
 function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2;
+error=_st(anAnnouncement)._error();
 _st(self)._confirm_ifTrue_(_st($String())._streamContents_((function(stream){
 return smalltalk.withContext(function($ctx2) {
 $1=stream;
-_st($1)._nextPutAll_(_st(anError)._messageText());
+_st($1)._nextPutAll_(_st(error)._messageText());
 _st($1)._nextPutAll_(_st($String())._cr());
 $2=_st($1)._nextPutAll_("Would you like to define an instance variable?");
 return $2;
 }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})})),(function(){
 return smalltalk.withContext(function($ctx2) {
-return _st(_st(self)._browserModel())._addInstVarNamed_(_st(anError)._variableName());
+return _st(_st(self)._browserModel())._addInstVarNamed_(_st(error)._variableName());
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"onUnknownVariableError:",{anError:anError},smalltalk.HLBrowserCodeWidget)})},
-messageSends: ["confirm:ifTrue:", "streamContents:", "nextPutAll:", "messageText", "cr", "addInstVarNamed:", "variableName", "browserModel"]}),
+return self}, function($ctx1) {$ctx1.fill(self,"onUnknownVariableError:",{anAnnouncement:anAnnouncement,error:error},smalltalk.HLBrowserCodeWidget)})},
+messageSends: ["error", "confirm:ifTrue:", "streamContents:", "nextPutAll:", "messageText", "cr", "addInstVarNamed:", "variableName", "browserModel"]}),
 smalltalk.HLBrowserCodeWidget);
 
 smalltalk.addMethod(
@@ -1373,6 +1302,19 @@ return self}, function($ctx1) {$ctx1.fill(self,"saveIt",{},smalltalk.HLSourceCod
 messageSends: ["saveSourceCode", "browserModel"]}),
 smalltalk.HLBrowserCodeWidget);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "unregister",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+smalltalk.HLNavigationCodeWidget.fn.prototype._unregsiter.apply(_st(self), []);
+_st(_st(_st(self)._browserModel())._announcer())._unsubscribe_(self);
+_st(_st(_st(self)._browserModel())._systemAnnouncer())._unsubscribe_(self);
+return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},smalltalk.HLBrowserCodeWidget)})},
+messageSends: ["unregsiter", "unsubscribe:", "announcer", "browserModel", "systemAnnouncer"]}),
+smalltalk.HLBrowserCodeWidget);
+
 
 smalltalk.addMethod(
 smalltalk.method({

+ 91 - 149
js/Helios-Workspace.js

@@ -1317,58 +1317,22 @@ function $HLSourceCodeFocusRequested(){return smalltalk.HLSourceCodeFocusRequest
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2;
 $1=_st(_st(self)._browserModel())._announcer();
-_st($1)._on_do_($HLSaveSourceCode(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onSaveIt();
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
-_st($1)._on_do_($HLShowInstanceToggled(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onShowInstanceToggled();
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
-_st($1)._on_do_($HLSourceCodeSaved(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onSourceCodeSaved();
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
-_st($1)._on_do_($HLAboutToChange(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onBrowserAboutToChange_(_st(ann)._actionBlock());
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
-_st($1)._on_do_($HLParseErrorRaised(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onParseError_(ann);
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
-_st($1)._on_do_($HLCompileErrorRaised(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onCompileError_(_st(ann)._error());
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
-_st($1)._on_do_($HLUnknownVariableErrorRaised(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onUnknownVariableError_(_st(ann)._error());
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
-_st($1)._on_do_($HLInstVarAdded(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onInstVarAdded();
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
-_st($1)._on_do_($HLMethodSelected(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onMethodSelected_(_st(ann)._item());
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
-_st($1)._on_do_($HLClassSelected(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onClassSelected_(_st(ann)._item());
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
-_st($1)._on_do_($HLProtocolSelected(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onProtocolSelected_(_st(ann)._item());
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
-$2=_st($1)._on_do_($HLSourceCodeFocusRequested(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onSourceCodeFocusRequested();
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
+_st($1)._on_send_to_($HLSaveSourceCode(),"onSaveIt",self);
+_st($1)._on_send_to_($HLShowInstanceToggled(),"onShowInstanceToggled",self);
+_st($1)._on_send_to_($HLSourceCodeSaved(),"onSourceCodeSaved",self);
+_st($1)._on_send_to_($HLAboutToChange(),"onBrowserAboutToChange:",self);
+_st($1)._on_send_to_($HLParseErrorRaised(),"onParseError:",self);
+_st($1)._on_send_to_($HLCompileErrorRaised(),"onCompileError:",self);
+_st($1)._on_send_to_($HLUnknownVariableErrorRaised(),"onUnknownVariableError:",self);
+_st($1)._on_send_to_($HLInstVarAdded(),"onInstVarAdded",self);
+_st($1)._on_send_to_($HLMethodSelected(),"onMethodSelected:",self);
+_st($1)._on_send_to_($HLClassSelected(),"onClassSelected:",self);
+_st($1)._on_send_to_($HLProtocolSelected(),"onProtocolSelected:",self);
+$2=_st($1)._on_send_to_($HLSourceCodeFocusRequested(),"onSourceCodeFocusRequested",self);
 return self}, function($ctx1) {$ctx1.fill(self,"observeBrowserModel",{},smalltalk.HLBrowserCodeWidget)})},
 args: [],
-source: "observeBrowserModel\x0a\x09self browserModel announcer\x0a\x09\x09on: HLSaveSourceCode\x0a\x09\x09do: [ :ann | self onSaveIt ];\x0a\x09\x09on: HLShowInstanceToggled\x0a\x09\x09do: [ :ann | self onShowInstanceToggled ];\x0a\x09\x09on: HLSourceCodeSaved\x0a\x09\x09do: [ :ann | self onSourceCodeSaved ];\x0a\x09\x09on: HLAboutToChange\x0a\x09\x09do: [ :ann | self onBrowserAboutToChange: ann actionBlock ];\x0a\x09\x09on: HLParseErrorRaised\x0a\x09\x09do: [ :ann | self onParseError: ann ];\x0a\x09\x09on: HLCompileErrorRaised\x0a\x09\x09do: [ :ann | self onCompileError: ann error ];\x0a\x09\x09on: HLUnknownVariableErrorRaised\x0a\x09\x09do: [ :ann | self onUnknownVariableError: ann error ];\x0a\x09\x09on: HLInstVarAdded \x0a\x09\x09do: [ :ann | self onInstVarAdded ];\x0a\x09\x09on: HLMethodSelected \x0a\x09\x09do: [ :ann | self onMethodSelected: ann item ];\x0a    \x09on: HLClassSelected \x0a\x09\x09do: [ :ann | self onClassSelected: ann item ];\x0a    \x09on: HLProtocolSelected \x0a\x09\x09do: [ :ann | self onProtocolSelected: ann item ];\x0a\x09\x09on: HLSourceCodeFocusRequested \x0a\x09\x09do: [ :ann | self onSourceCodeFocusRequested ]",
-messageSends: ["on:do:", "onSaveIt", "announcer", "browserModel", "onShowInstanceToggled", "onSourceCodeSaved", "onBrowserAboutToChange:", "actionBlock", "onParseError:", "onCompileError:", "error", "onUnknownVariableError:", "onInstVarAdded", "onMethodSelected:", "item", "onClassSelected:", "onProtocolSelected:", "onSourceCodeFocusRequested"],
+source: "observeBrowserModel\x0a\x09self browserModel announcer\x0a\x09\x09on: HLSaveSourceCode\x0a\x09\x09send: #onSaveIt\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLShowInstanceToggled\x0a\x09\x09send: #onShowInstanceToggled\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLSourceCodeSaved\x0a\x09\x09send: #onSourceCodeSaved\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLAboutToChange\x0a\x09\x09send: #onBrowserAboutToChange:\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLParseErrorRaised\x0a\x09\x09send: #onParseError:\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLCompileErrorRaised\x0a\x09\x09send: #onCompileError:\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLUnknownVariableErrorRaised\x0a\x09\x09send: #onUnknownVariableError:\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLInstVarAdded \x0a\x09\x09send: #onInstVarAdded\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLMethodSelected \x0a\x09\x09send: #onMethodSelected:\x0a\x09\x09to: self;\x0a\x09\x09\x0a    \x09on: HLClassSelected \x0a\x09\x09send: #onClassSelected:\x0a\x09\x09to: self;\x0a\x09\x09\x0a    \x09on: HLProtocolSelected \x0a\x09\x09send: #onProtocolSelected: \x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLSourceCodeFocusRequested \x0a\x09\x09send: #onSourceCodeFocusRequested\x0a\x09\x09to: self",
+messageSends: ["on:send:to:", "announcer", "browserModel"],
 referencedClasses: ["HLSaveSourceCode", "HLShowInstanceToggled", "HLSourceCodeSaved", "HLAboutToChange", "HLParseErrorRaised", "HLCompileErrorRaised", "HLUnknownVariableErrorRaised", "HLInstVarAdded", "HLMethodSelected", "HLClassSelected", "HLProtocolSelected", "HLSourceCodeFocusRequested"]
 }),
 smalltalk.HLBrowserCodeWidget);
@@ -1380,63 +1344,13 @@ category: 'actions',
 fn: function (){
 var self=this;
 function $MethodModified(){return smalltalk.MethodModified||(typeof MethodModified=="undefined"?nil:MethodModified)}
-function $HLMethodSelected(){return smalltalk.HLMethodSelected||(typeof HLMethodSelected=="undefined"?nil:HLMethodSelected)}
-function $HLClassSelected(){return smalltalk.HLClassSelected||(typeof HLClassSelected=="undefined"?nil:HLClassSelected)}
-function $HLProtocolSelected(){return smalltalk.HLProtocolSelected||(typeof HLProtocolSelected=="undefined"?nil:HLProtocolSelected)}
-function $HLSourceCodeFocusRequested(){return smalltalk.HLSourceCodeFocusRequested||(typeof HLSourceCodeFocusRequested=="undefined"?nil:HLSourceCodeFocusRequested)}
-return smalltalk.withContext(function($ctx1) { 
-var $1,$2;
-$1=_st(_st(self)._browserModel())._systemAnnouncer();
-_st($1)._on_do_($MethodModified(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onMethodModified_(_st(ann)._method());
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
-_st($1)._on_do_($HLMethodSelected(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onMethodSelected_(_st(ann)._item());
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
-_st($1)._on_do_($HLClassSelected(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onClassSelected_(_st(ann)._item());
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
-_st($1)._on_do_($HLProtocolSelected(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onProtocolSelected_(_st(ann)._item());
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
-$2=_st($1)._on_do_($HLSourceCodeFocusRequested(),(function(ann){
-return smalltalk.withContext(function($ctx2) {
-return _st(self)._onSourceCodeFocusRequested();
-}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"observeSystem",{},smalltalk.HLSourceCodeWidget)})},
-args: [],
-source: "observeSystem\x0a\x09self browserModel systemAnnouncer\x0a    \x09on: MethodModified\x0a        do: [ :ann | self onMethodModified: ann method ];\x0a\x09\x09on: HLMethodSelected \x0a\x09\x09do: [ :ann | self onMethodSelected: ann item ];\x0a    \x09on: HLClassSelected \x0a\x09\x09do: [ :ann | self onClassSelected: ann item ];\x0a    \x09on: HLProtocolSelected \x0a\x09\x09do: [ :ann | self onProtocolSelected: ann item ];\x0a\x09\x09on: HLSourceCodeFocusRequested \x0a\x09\x09do: [ :ann | self onSourceCodeFocusRequested ]",
-messageSends: ["on:do:", "onMethodModified:", "method", "systemAnnouncer", "browserModel", "onMethodSelected:", "item", "onClassSelected:", "onProtocolSelected:", "onSourceCodeFocusRequested"],
-referencedClasses: ["MethodModified", "HLMethodSelected", "HLClassSelected", "HLProtocolSelected", "HLSourceCodeFocusRequested"]
-}),
-smalltalk.HLBrowserCodeWidget);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "onBrowserAboutToChange",
-category: 'reactions',
-fn: function (){
-var self=this;
-function $HLChangeForbidden(){return smalltalk.HLChangeForbidden||(typeof HLChangeForbidden=="undefined"?nil:HLChangeForbidden)}
 return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st(self)._hasModification();
-if(smalltalk.assert($1)){
-_st(self)._confirm_ifFalse_("Do you want to cancel changes?",(function(){
-return smalltalk.withContext(function($ctx2) {
-return _st($HLChangeForbidden())._signal();
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
-_st(self)._methodContents_(_st(self)._contents());
-};
-return self}, function($ctx1) {$ctx1.fill(self,"onBrowserAboutToChange",{},smalltalk.HLBrowserCodeWidget)})},
+_st(_st(_st(self)._browserModel())._systemAnnouncer())._on_send_to_($MethodModified(),"onMethodModified:",self);
+return self}, function($ctx1) {$ctx1.fill(self,"observeSystem",{},smalltalk.HLBrowserCodeWidget)})},
 args: [],
-source: "onBrowserAboutToChange\x0a\x09self hasModification\x0a\x09\x09ifTrue: [ \x0a\x09\x09\x09self \x0a\x09\x09\x09\x09confirm: 'Do you want to cancel changes?' \x0a\x09\x09\x09\x09ifFalse: [ HLChangeForbidden signal ].\x0a\x09\x09\x09\x0a\x09\x09\x09\x22Don't ask twice\x22\x0a\x09\x09\x09self methodContents: self contents ]",
-messageSends: ["ifTrue:", "confirm:ifFalse:", "signal", "methodContents:", "contents", "hasModification"],
-referencedClasses: ["HLChangeForbidden"]
+source: "observeSystem\x0a\x09self browserModel systemAnnouncer\x0a    \x09on: MethodModified\x0a        send: #onMethodModified:\x0a\x09\x09to: self",
+messageSends: ["on:send:to:", "systemAnnouncer", "browserModel"],
+referencedClasses: ["MethodModified"]
 }),
 smalltalk.HLBrowserCodeWidget);
 
@@ -1444,24 +1358,26 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "onBrowserAboutToChange:",
 category: 'reactions',
-fn: function (aBlock){
+fn: function (anAnnouncement){
 var self=this;
+var block;
 function $HLChangeForbidden(){return smalltalk.HLChangeForbidden||(typeof HLChangeForbidden=="undefined"?nil:HLChangeForbidden)}
 return smalltalk.withContext(function($ctx1) { 
 var $1;
+block=_st(anAnnouncement)._actionBlock();
 $1=_st(self)._hasModification();
 if(smalltalk.assert($1)){
 _st(self)._confirm_ifTrue_("Do you want to cancel changes?",(function(){
 return smalltalk.withContext(function($ctx2) {
 _st(self)._methodContents_(_st(self)._contents());
-return _st(aBlock)._value();
+return _st(block)._value();
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
 _st($HLChangeForbidden())._signal();
 };
-return self}, function($ctx1) {$ctx1.fill(self,"onBrowserAboutToChange:",{aBlock:aBlock},smalltalk.HLBrowserCodeWidget)})},
-args: ["aBlock"],
-source: "onBrowserAboutToChange: aBlock\x0a\x09self hasModification\x0a\x09\x09ifTrue: [\x0a\x09\x09\x09self \x0a\x09\x09\x09\x09confirm: 'Do you want to cancel changes?' \x0a\x09\x09\x09\x09ifTrue: [\x0a\x09\x09\x09\x09\x09\x22Don't ask twice\x22\x0a\x09\x09\x09\x09\x09self methodContents: self contents.\x0a\x09\x09\x09\x09\x09aBlock value ].\x0a\x09\x09\x09\x0a\x09\x09\x09\x0a\x09\x09\x09HLChangeForbidden signal ]",
-messageSends: ["ifTrue:", "confirm:ifTrue:", "methodContents:", "contents", "value", "signal", "hasModification"],
+return self}, function($ctx1) {$ctx1.fill(self,"onBrowserAboutToChange:",{anAnnouncement:anAnnouncement,block:block},smalltalk.HLBrowserCodeWidget)})},
+args: ["anAnnouncement"],
+source: "onBrowserAboutToChange: anAnnouncement\x0a\x09| block |\x0a\x09\x0a\x09block := anAnnouncement actionBlock.\x0a\x09\x0a\x09self hasModification\x0a\x09\x09ifTrue: [\x0a\x09\x09\x09self \x0a\x09\x09\x09\x09confirm: 'Do you want to cancel changes?' \x0a\x09\x09\x09\x09ifTrue: [\x0a\x09\x09\x09\x09\x09\x22Don't ask twice\x22\x0a\x09\x09\x09\x09\x09self methodContents: self contents.\x0a\x09\x09\x09\x09\x09block value ].\x0a\x09\x09\x09\x0a\x09\x09\x09\x0a\x09\x09\x09HLChangeForbidden signal ]",
+messageSends: ["actionBlock", "ifTrue:", "confirm:ifTrue:", "methodContents:", "contents", "value", "signal", "hasModification"],
 referencedClasses: ["HLChangeForbidden"]
 }),
 smalltalk.HLBrowserCodeWidget);
@@ -1470,22 +1386,24 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "onClassSelected:",
 category: 'reactions',
-fn: function (aClass){
+fn: function (anAnnouncement){
 var self=this;
+var class_;
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2;
-$1=aClass;
+class_=_st(anAnnouncement)._item();
+$1=class_;
 if(($receiver = $1) == nil || $receiver == undefined){
 $2=_st(self)._contents_("");
 return $2;
 } else {
 $1;
 };
-_st(self)._contents_(_st(aClass)._definition());
-return self}, function($ctx1) {$ctx1.fill(self,"onClassSelected:",{aClass:aClass},smalltalk.HLSourceCodeWidget)})},
-args: ["aClass"],
-source: "onClassSelected: aClass\x0a\x09aClass ifNil: [ ^ self contents: '' ].\x0a    \x0a    self contents: aClass definition",
-messageSends: ["ifNil:", "contents:", "definition"],
+_st(self)._contents_(_st(class_)._definition());
+return self}, function($ctx1) {$ctx1.fill(self,"onClassSelected:",{anAnnouncement:anAnnouncement,class_:class_},smalltalk.HLBrowserCodeWidget)})},
+args: ["anAnnouncement"],
+source: "onClassSelected: anAnnouncement\x0a\x09| class |\x0a\x09\x0a\x09class:= anAnnouncement item.\x0a\x09\x0a\x09class ifNil: [ ^ self contents: '' ].\x0a    self contents: class definition",
+messageSends: ["item", "ifNil:", "contents:", "definition"],
 referencedClasses: []
 }),
 smalltalk.HLBrowserCodeWidget);
@@ -1494,14 +1412,14 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "onCompileError:",
 category: 'reactions',
-fn: function (anError){
+fn: function (anAnnouncement){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-_st(self)._alert_(_st(anError)._messageText());
-return self}, function($ctx1) {$ctx1.fill(self,"onCompileError:",{anError:anError},smalltalk.HLSourceCodeWidget)})},
-args: ["anError"],
-source: "onCompileError: anError\x0a\x09self alert: anError messageText",
-messageSends: ["alert:", "messageText"],
+_st(self)._alert_(_st(_st(anAnnouncement)._error())._messageText());
+return self}, function($ctx1) {$ctx1.fill(self,"onCompileError:",{anAnnouncement:anAnnouncement},smalltalk.HLBrowserCodeWidget)})},
+args: ["anAnnouncement"],
+source: "onCompileError: anAnnouncement\x0a\x09self alert: anAnnouncement error messageText",
+messageSends: ["alert:", "messageText", "error"],
 referencedClasses: []
 }),
 smalltalk.HLBrowserCodeWidget);
@@ -1526,11 +1444,13 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "onMethodModified:",
 category: 'reactions',
-fn: function (aMethod){
+fn: function (anAnnouncement){
 var self=this;
+var method;
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2,$3,$4,$5,$6;
-$1=_st(_st(_st(self)._browserModel())._selectedClass()).__eq(_st(aMethod)._methodClass());
+method=_st(anAnnouncement)._method();
+$1=_st(_st(_st(self)._browserModel())._selectedClass()).__eq(_st(method)._methodClass());
 if(! smalltalk.assert($1)){
 $2=self;
 return $2;
@@ -1542,16 +1462,16 @@ return $4;
 } else {
 $3;
 };
-$5=_st(_st(_st(_st(self)._browserModel())._selectedMethod())._selector()).__eq(_st(aMethod)._selector());
+$5=_st(_st(_st(_st(self)._browserModel())._selectedMethod())._selector()).__eq(_st(method)._selector());
 if(! smalltalk.assert($5)){
 $6=self;
 return $6;
 };
 _st(self)._refresh();
-return self}, function($ctx1) {$ctx1.fill(self,"onMethodModified:",{aMethod:aMethod},smalltalk.HLBrowserCodeWidget)})},
-args: ["aMethod"],
-source: "onMethodModified: aMethod\x0a\x09self browserModel selectedClass = aMethod methodClass ifFalse: [ ^ self ].\x0a\x09self browserModel selectedMethod ifNil: [ ^ self ].\x0a    self browserModel selectedMethod selector = aMethod selector ifFalse: [ ^ self ].\x0a\x0a\x09self refresh",
-messageSends: ["ifFalse:", "=", "methodClass", "selectedClass", "browserModel", "ifNil:", "selectedMethod", "selector", "refresh"],
+return self}, function($ctx1) {$ctx1.fill(self,"onMethodModified:",{anAnnouncement:anAnnouncement,method:method},smalltalk.HLBrowserCodeWidget)})},
+args: ["anAnnouncement"],
+source: "onMethodModified: anAnnouncement\x0a\x09| method |\x0a\x09\x0a\x09method := anAnnouncement method.\x0a\x09\x0a\x09self browserModel selectedClass = method methodClass ifFalse: [ ^ self ].\x0a\x09self browserModel selectedMethod ifNil: [ ^ self ].\x0a    self browserModel selectedMethod selector = method selector ifFalse: [ ^ self ].\x0a\x0a\x09self refresh",
+messageSends: ["method", "ifFalse:", "=", "methodClass", "selectedClass", "browserModel", "ifNil:", "selectedMethod", "selector", "refresh"],
 referencedClasses: []
 }),
 smalltalk.HLBrowserCodeWidget);
@@ -1560,22 +1480,24 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "onMethodSelected:",
 category: 'reactions',
-fn: function (aCompiledMethod){
+fn: function (anAnnouncement){
 var self=this;
+var method;
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2;
-$1=aCompiledMethod;
+method=_st(anAnnouncement)._item();
+$1=method;
 if(($receiver = $1) == nil || $receiver == undefined){
 $2=_st(self)._contents_("");
 return $2;
 } else {
 $1;
 };
-_st(self)._contents_(_st(aCompiledMethod)._source());
-return self}, function($ctx1) {$ctx1.fill(self,"onMethodSelected:",{aCompiledMethod:aCompiledMethod},smalltalk.HLSourceCodeWidget)})},
-args: ["aCompiledMethod"],
-source: "onMethodSelected: aCompiledMethod\x0a\x09aCompiledMethod ifNil: [ ^ self contents: '' ].\x0a    \x0a    self contents: aCompiledMethod source",
-messageSends: ["ifNil:", "contents:", "source"],
+_st(self)._contents_(_st(method)._source());
+return self}, function($ctx1) {$ctx1.fill(self,"onMethodSelected:",{anAnnouncement:anAnnouncement,method:method},smalltalk.HLBrowserCodeWidget)})},
+args: ["anAnnouncement"],
+source: "onMethodSelected: anAnnouncement\x0a\x09| method |\x0a\x09\x0a\x09method := anAnnouncement item.\x0a\x09\x0a\x09method ifNil: [ ^ self contents: '' ].\x0a    self contents: method source",
+messageSends: ["item", "ifNil:", "contents:", "source"],
 referencedClasses: []
 }),
 smalltalk.HLBrowserCodeWidget);
@@ -1624,7 +1546,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "onProtocolSelected:",
 category: 'reactions',
-fn: function (aString){
+fn: function (anAnnouncement){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2;
@@ -1636,9 +1558,9 @@ return $2;
 $1;
 };
 _st(self)._contents_(_st(_st(_st(self)._browserModel())._selectedClass())._definition());
-return self}, function($ctx1) {$ctx1.fill(self,"onProtocolSelected:",{aString:aString},smalltalk.HLSourceCodeWidget)})},
-args: ["aString"],
-source: "onProtocolSelected: aString\x0a\x09self browserModel selectedClass ifNil: [ ^ self contents: '' ].\x0a    \x0a    self contents: self browserModel selectedClass definition",
+return self}, function($ctx1) {$ctx1.fill(self,"onProtocolSelected:",{anAnnouncement:anAnnouncement},smalltalk.HLBrowserCodeWidget)})},
+args: ["anAnnouncement"],
+source: "onProtocolSelected: anAnnouncement\x0a\x09self browserModel selectedClass ifNil: [ ^ self contents: '' ].\x0a    self contents: self browserModel selectedClass definition",
 messageSends: ["ifNil:", "contents:", "selectedClass", "browserModel", "definition"],
 referencedClasses: []
 }),
@@ -1721,26 +1643,28 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "onUnknownVariableError:",
 category: 'reactions',
-fn: function (anError){
+fn: function (anAnnouncement){
 var self=this;
+var error;
 function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2;
+error=_st(anAnnouncement)._error();
 _st(self)._confirm_ifTrue_(_st($String())._streamContents_((function(stream){
 return smalltalk.withContext(function($ctx2) {
 $1=stream;
-_st($1)._nextPutAll_(_st(anError)._messageText());
+_st($1)._nextPutAll_(_st(error)._messageText());
 _st($1)._nextPutAll_(_st($String())._cr());
 $2=_st($1)._nextPutAll_("Would you like to define an instance variable?");
 return $2;
 }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})})),(function(){
 return smalltalk.withContext(function($ctx2) {
-return _st(_st(self)._browserModel())._addInstVarNamed_(_st(anError)._variableName());
+return _st(_st(self)._browserModel())._addInstVarNamed_(_st(error)._variableName());
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"onUnknownVariableError:",{anError:anError},smalltalk.HLBrowserCodeWidget)})},
-args: ["anError"],
-source: "onUnknownVariableError: anError\x0a\x09self \x0a\x09\x09confirm: (String streamContents: [ :stream |\x0a\x09\x09\x09stream \x0a\x09\x09\x09\x09nextPutAll: anError messageText;\x0a\x09\x09\x09\x09nextPutAll: String cr;\x0a\x09\x09\x09\x09nextPutAll: 'Would you like to define an instance variable?' ])\x0a\x09\x09ifTrue: [\x0a\x09\x09\x09self browserModel addInstVarNamed: anError variableName ]",
-messageSends: ["confirm:ifTrue:", "streamContents:", "nextPutAll:", "messageText", "cr", "addInstVarNamed:", "variableName", "browserModel"],
+return self}, function($ctx1) {$ctx1.fill(self,"onUnknownVariableError:",{anAnnouncement:anAnnouncement,error:error},smalltalk.HLBrowserCodeWidget)})},
+args: ["anAnnouncement"],
+source: "onUnknownVariableError: anAnnouncement\x0a\x09| error |\x0a\x09\x0a\x09error := anAnnouncement error.\x0a\x09\x0a\x09self \x0a\x09\x09confirm: (String streamContents: [ :stream |\x0a\x09\x09\x09stream \x0a\x09\x09\x09\x09nextPutAll: error messageText;\x0a\x09\x09\x09\x09nextPutAll: String cr;\x0a\x09\x09\x09\x09nextPutAll: 'Would you like to define an instance variable?' ])\x0a\x09\x09ifTrue: [\x0a\x09\x09\x09self browserModel addInstVarNamed: error variableName ]",
+messageSends: ["error", "confirm:ifTrue:", "streamContents:", "nextPutAll:", "messageText", "cr", "addInstVarNamed:", "variableName", "browserModel"],
 referencedClasses: ["String"]
 }),
 smalltalk.HLBrowserCodeWidget);
@@ -1788,6 +1712,24 @@ referencedClasses: []
 }),
 smalltalk.HLBrowserCodeWidget);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "unregister",
+category: 'actions',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+smalltalk.HLNavigationCodeWidget.fn.prototype._unregsiter.apply(_st(self), []);
+_st(_st(_st(self)._browserModel())._announcer())._unsubscribe_(self);
+_st(_st(_st(self)._browserModel())._systemAnnouncer())._unsubscribe_(self);
+return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},smalltalk.HLBrowserCodeWidget)})},
+args: [],
+source: "unregister\x0a\x09super unregsiter.\x0a\x09\x0a\x09self browserModel announcer unsubscribe: self.\x0a\x09self browserModel systemAnnouncer unsubscribe: self",
+messageSends: ["unregsiter", "unsubscribe:", "announcer", "browserModel", "systemAnnouncer"],
+referencedClasses: []
+}),
+smalltalk.HLBrowserCodeWidget);
+
 
 smalltalk.addMethod(
 smalltalk.method({

+ 212 - 94
st/Helios-Browser.st

@@ -21,6 +21,19 @@ model: aModel
 
 focus
 	^ self packagesListWidget focus
+!
+
+unregister
+	super unregister.
+
+	{ 
+		self packagesListWidget.
+		self classesListWidget.
+		self protocolsListWidget.
+		self methodsListWidget.
+		self sourceWidget
+	} 
+		do: [ :each | each unregister ]
 ! !
 
 !HLBrowser methodsFor: 'keybindings'!
@@ -157,9 +170,11 @@ focus
 observeModel
 	self model announcer 
 		on: HLShowInstanceToggled
-		do: [ self onShowInstanceToggled ];
+		send: #onShowInstanceToggled
+		to: self;
 		on: HLShowCommentToggled
-		do: [ self onShowCommentToggled ]
+		send: #onShowCommentToggled
+		to: self
 !
 
 selectWidget: aWidget
@@ -398,25 +413,48 @@ focusProtocolsListWidget
 
 observeModel
 	self model announcer 
-    	on: HLPackageSelected do: [ :ann | self onPackageSelected: ann item ];
-    	on: HLShowInstanceToggled do: [ :ann | self onShowInstanceToggled ];
-		on: HLShowCommentToggled do: [ :ann | self onShowCommentToggled ];
-		on: HLClassSelected do: [ :ann | self onClassSelected: ann item ];
-		on: HLClassesFocusRequested do: [ :ann | self onClassesFocusRequested ]
+    	on: HLPackageSelected
+		send: #onPackageSelected:
+		to: self;
+		
+    	on: HLShowInstanceToggled 
+		send: #onShowInstanceToggled
+		to: self;
+		
+		on: HLShowCommentToggled
+		send: #onShowCommentToggled
+		to: self;
+		
+		on: HLClassSelected
+		send: #onClassSelected:
+		to: self;
+		
+		on: HLClassesFocusRequested
+		send: #onClassesFocusRequested
+		to: self
 !
 
 observeSystem
 	self model systemAnnouncer
     	on: ClassAdded
-        do: [ :ann | self onClassAdded: ann theClass ];
+		send: #onClassAdded:
+		to: self;
+		
         on: ClassRemoved
-        do: [ :ann | self onClassRemoved: ann theClass ];
+        send: #onClassRemoved:
+		to: self;
+		
 		on: ClassMoved
-        do: [ :ann | self onClassMoved: ann theClass from: ann oldPackage ];
+		send: #onClassMoved:
+		to: self;
+		
 		on: ClassRenamed
-        do: [ :ann | self onClassRenamed: ann theClass ];
+		send: #onClassRenamed:
+		to: self;
+		
 		on: ClassMigrated
-		do: [ :ann | self onClassMigrated: ann theClass from: ann oldClass ]
+		send: #onClassMigrated:
+		to: self
 !
 
 selectItem: aClass
@@ -447,30 +485,44 @@ setItemsForSelectedPackage
 
 !HLClassesListWidget methodsFor: 'reactions'!
 
-onClassAdded: aClass
-	(aClass package = self model selectedPackage or: [
-		self items includes: aClass ]) ifFalse: [ ^ self ].
+onClassAdded: anAnnouncement
+	| class |
+	
+	class := anAnnouncement theClass.
+	
+	(class package = self model selectedPackage or: [
+		self items includes: class ]) ifFalse: [ ^ self ].
     
     self setItemsForSelectedPackage.
     self refresh
 !
 
-onClassMigrated: aClass from: oldClass
+onClassMigrated: anAnnouncement
+	| class oldClass |
+	
+	class := anAnnouncement theClass.
+	oldClass := anAnnouncement oldClass.
+
 	(self items includes: oldClass) ifFalse: [ ^ self ].
 
 	self model selectedClass = oldClass ifTrue: [
-		self model selectedClass: aClass ].
+		self model selectedClass: class ].
     
     self setItemsForSelectedPackage.
     self refresh
 !
 
-onClassMoved: aClass from: aPackage
-	(aPackage = self model selectedPackage or: [
-		aClass package = self model selectedPackage ])
+onClassMoved: anAnnouncement
+	| class oldPackage |
+	
+	class := anAnnouncement theClass.
+	oldPackage := anAnnouncement oldPackage.
+	
+	(oldPackage = self model selectedPackage or: [
+		class package = self model selectedPackage ])
 			ifFalse: [ ^ self ].
 	
-	aPackage = self model selectedPackage ifTrue: [ 
+	oldPackage = self model selectedPackage ifTrue: [ 
 		self 
 			selectedItem: nil;
 			selectItem: nil ].
@@ -479,27 +531,30 @@ onClassMoved: aClass from: aPackage
     self refresh
 !
 
-onClassRemoved: aClass
-	aClass package = self model selectedPackage ifFalse: [ ^ self ].
-    aClass = self model selectedClass ifTrue: [ self selectItem: nil ].
+onClassRemoved: anAnnouncement
+	| class |
+	class := anAnnouncement theClass.
+
+	class package = self model selectedPackage ifFalse: [ ^ self ].
+    class = self model selectedClass ifTrue: [ self selectItem: nil ].
     
     self setItemsForSelectedPackage.
     self refresh
 !
 
-onClassRenamed: aClass
-	aClass package = self model selectedPackage ifFalse: [ ^ self ].
+onClassRenamed: anAnnouncement
+	anAnnouncement theClass package = self model selectedPackage ifFalse: [ ^ self ].
     
     self setItemsForSelectedPackage.
     self refresh
 !
 
-onClassSelected: aClass
+onClassSelected: anAnnouncement
 	| selectedClass |
 	
-	aClass ifNil: [ ^ self ].
+	anAnnouncement item ifNil: [ ^ self ].
 	
-	selectedClass := aClass theNonMetaClass.
+	selectedClass := anAnnouncement item theNonMetaClass.
 	self selectedItem: selectedClass.
 
 	self hasFocus ifFalse: [
@@ -512,7 +567,7 @@ onClassesFocusRequested
 	self focus
 !
 
-onPackageSelected: aPackage
+onPackageSelected: anAnnouncement
     self selectedItem: nil.
     
     self setItemsForSelectedPackage.
@@ -706,27 +761,43 @@ selectorsInProtocol: aString
 observeModel
 	self model announcer 
 		on: HLProtocolSelected 
-		do: [ :ann | self onProtocolSelected: ann item ];
+		send: #onProtocolSelected: 
+		to: self;
+		
 		on: HLShowInstanceToggled 
-		do: [ :ann | self onProtocolSelected: nil ];
+		send: #onShowInstanceToggled
+		to: self;
+		
 		on: HLMethodSelected 
-		do: [ :ann | self onMethodSelected: ann item ];
+		send: #onMethodSelected:
+		to: self;
+		
 		on: HLMethodsFocusRequested 
-		do: [ :ann | self onMethodsFocusRequested ]
+		send: #onMethodsFocusRequested
+		to: self
 !
 
 observeSystem
 	self model systemAnnouncer 
     	on: ProtocolAdded
-        do: [ :ann | self onProtocolAdded: ann theClass ];
-    	on: ProtocolRemoved
-        do: [ :ann | self onProtocolRemoved: ann theClass ];
+        send: #onProtocolAdded:
+		to: self;
+    	
+		on: ProtocolRemoved
+        send: #onProtocolRemoved:
+		to: self;
+		
     	on: MethodAdded 
-        do: [ :ann | self onMethodAdded: ann method ];
+        send: #onMethodAdded:
+		to: self;
+		
         on: MethodRemoved 
-        do: [ :ann | self onMethodRemoved: ann method ];
+        send: #onMethodRemoved:
+		to: self;
+		
 		on: MethodMoved 
-        do: [ :ann | self onMethodMoved: ann method ]
+        send: #onMethodMoved:
+		to: self
 !
 
 selectItem: aSelector
@@ -749,15 +820,15 @@ setItemsForSelectedProtocol
 
 !HLMethodsListWidget methodsFor: 'reactions'!
 
-onMethodAdded: aMethod
-	self model selectedClass = aMethod methodClass ifFalse: [ ^ self ].
+onMethodAdded: anAnnouncement
+	self model selectedClass = anAnnouncement method methodClass ifFalse: [ ^ self ].
     
     self setItemsForSelectedProtocol.
     self refresh
 !
 
-onMethodMoved: aMethod
-	self model selectedMethod = aMethod ifFalse: [ ^ self ].
+onMethodMoved: anAnnouncement
+	self model selectedMethod = anAnnouncement method ifFalse: [ ^ self ].
     
 	self model selectedProtocol = self model allProtocol ifFalse: [
 		self 
@@ -767,11 +838,15 @@ onMethodMoved: aMethod
     		refresh ]
 !
 
-onMethodRemoved: aMethod
-	self items detect: [ :each | each = aMethod selector ] ifNone: [ ^ self ].
+onMethodRemoved: anAnnouncement
+	| method |
+	
+	method := anAnnouncement method.
+	
+	self items detect: [ :each | each = method selector ] ifNone: [ ^ self ].
 
     self selectedItem ifNotNil: [
-      	(aMethod methodClass = self model selectedClass and: [ aMethod selector = self selectedItem ])
+      	(method methodClass = self model selectedClass and: [ method selector = self selectedItem ])
   			ifTrue: [ 
 				self selectedItem: nil; 
 				selectItem: nil ] ].
@@ -780,10 +855,13 @@ onMethodRemoved: aMethod
 	self refresh
 !
 
-onMethodSelected: aMethod
-	| selector |
-	selector := aMethod isCompiledMethod 
-		ifTrue: [ aMethod selector ]
+onMethodSelected: anAnnouncement
+	| selector method |
+	
+	method := anAnnouncement item.
+	
+	selector := method isCompiledMethod 
+		ifTrue: [ method selector ]
 		ifFalse: [ nil ].
 		
 	self 
@@ -795,27 +873,31 @@ onMethodsFocusRequested
 	self focus
 !
 
-onProtocolAdded: aClass
-	self model selectedClass = aClass ifFalse: [ ^ self ].
+onProtocolAdded: anAnnouncement
+	self model selectedClass = anAnnouncement theClass ifFalse: [ ^ self ].
 	
 	self setItemsForSelectedProtocol.
     self refresh.
 	self focus
 !
 
-onProtocolRemoved: aClass
-	self model selectedClass = aClass ifFalse: [ ^ self ].
+onProtocolRemoved: anAnnouncement
+	self model selectedClass = anAnnouncement theClass ifFalse: [ ^ self ].
 	
 	self setItemsForSelectedProtocol.
     self refresh.
 	self focus
 !
 
-onProtocolSelected: aString
+onProtocolSelected: anAnnouncement
     self selectedItem: nil.
     
 	self setItemsForSelectedProtocol.
     self refresh
+!
+
+onShowInstanceToggled
+	self onProtocolSelected: nil
 ! !
 
 !HLMethodsListWidget methodsFor: 'rendering'!
@@ -876,16 +958,20 @@ focusClassesListWidget
 
 observeModel
     self model announcer 
-		on: HLPackageSelected 
-		do: [ :ann | self onPackageSelected: ann item ];
+		on: HLPackageSelected
+		send: #onPackageSelected:
+		to: self;
+		
 		on: HLPackagesFocusRequested 
-		do: [ :ann | self onPackagesFocusRequested ]
+		send: #onPackagesFocusRequested
+		to: self
 !
 
 observeSystem
     self model systemAnnouncer 
 		on: ClassAdded 
-		do: [ :ann | self onClassAdded: ann theClass ]
+		send: #onClassAdded:
+		to: self
 !
 
 selectItem: aPackage
@@ -901,20 +987,24 @@ initializeItems
 
 !HLPackagesListWidget methodsFor: 'reactions'!
 
-onClassAdded: aClass
+onClassAdded: anAnnouncement
 	"Amber doesn't have yet a global organizer for packages"
 	
-	(self items includes: aClass package) ifFalse: [ 
+	(self items includes: anAnnouncement theClass package) ifFalse: [ 
 		self 
 			initializeItems;
 			refresh ]
 !
 
-onPackageSelected: aPackage
-	self selectedItem: aPackage.
+onPackageSelected: anAnnouncement
+	| package |
+	
+	package := anAnnouncement item.
+	
+	self selectedItem: package.
 	self hasFocus ifFalse: [
 		self
-			activateItem: aPackage;
+			activateItem: package;
 			focus ]
 !
 
@@ -944,10 +1034,6 @@ HLToolListWidget subclass: #HLProtocolsListWidget
 
 !HLProtocolsListWidget methodsFor: 'accessing'!
 
-allProtocol
-	^ self model allProtocol
-!
-
 label
 	^ 'Protocols'
 !
@@ -960,28 +1046,44 @@ selectedItem
 
 observeModel
     self model announcer 
-		on: HLClassSelected 
-		do: [ :ann | self onClassSelected: ann item ];
+		on: HLClassSelected
+		send: #onClassSelected:
+		to: self;
+		
     	on: HLShowInstanceToggled 
-		do: [ :ann | self onClassSelected: self model selectedClass ];
+		send: #onClassSelected:
+		to: self;
+		
     	on: HLProtocolSelected
-		do: [ :ann | self onProtocolSelected: ann item ];
+		send: #onProtocolSelected:
+		to: self;
+		
 		on: HLProtocolsFocusRequested 
-		do: [ :ann | self onProtocolsFocusRequested ]
+		send: #onProtocolsFocusRequested
+		to: self
 !
 
 observeSystem
 	self model systemAnnouncer
 		on: ProtocolAdded 
-	    do: [ :ann | self onProtocolAdded: ann protocol to: ann theClass ];
-	    on: ProtocolRemoved
-	    do: [ :ann | self onProtocolRemoved: ann protocol from: ann theClass ]
+		send: #onProtocolAdded:
+		to: self;
+		
+		on: ProtocolRemoved
+		send: #onProtocolRemoved:
+		to: self
 !
 
 selectItem: aString
     self model selectedProtocol: aString
 ! !
 
+!HLProtocolsListWidget methodsFor: 'foo'!
+
+allProtocol
+	^ self model allProtocol
+! !
+
 !HLProtocolsListWidget methodsFor: 'private'!
 
 setItemsForClass: aClass
@@ -999,24 +1101,33 @@ setItemsForSelectedClass
 
 !HLProtocolsListWidget methodsFor: 'reactions'!
 
-onClassSelected: aClass
+onClassSelected: anAnnouncement
     self selectedItem: nil.
     
     self setItemsForSelectedClass.
     self refresh
 !
 
-onProtocolAdded: aString to: aClass
-	aClass = self model selectedClass ifFalse: [ ^ self ].
+onProtocolAdded: anAnnouncement
+	| class |
+	
+	class := anAnnouncement theClass.
+	
+	class = self model selectedClass ifFalse: [ ^ self ].
     
     self setItemsForSelectedClass.
     self refresh
 !
 
-onProtocolRemoved: aString from: aClass
-	aClass = self model selectedClass ifFalse: [ ^ self ].
+onProtocolRemoved: anAnnouncement
+	| class protocol |
+	
+	class := anAnnouncement theClass.
+	protocol := anAnnouncement protocol.
+	
+	class = self model selectedClass ifFalse: [ ^ self ].
     
-    self model selectedProtocol = aString 
+    self model selectedProtocol = protocol 
     	ifTrue: [ 
 			self 
 				selectedItem: nil;
@@ -1026,13 +1137,17 @@ onProtocolRemoved: aString from: aClass
     self refresh
 !
 
-onProtocolSelected: aString
-	self selectedItem: aString.
-	aString ifNil: [ ^ self ].
+onProtocolSelected: anAnnouncement
+	| protocol |
+	
+	protocol := anAnnouncement item.
+	
+	self selectedItem: protocol.
+	protocol ifNil: [ ^ self ].
     
 	self hasFocus ifFalse: [
 		self 
-			activateItem: aString;
+			activateItem: protocol;
 			focus ]
 !
 
@@ -1073,9 +1188,12 @@ classesCache
 observeSystem
 	SystemAnnouncer current
 		on: MethodAdded
-        do: [ :ann | self onMethodAdded: ann method ];
-        on: MethodRemoved
-        do: [ :ann | self onMethodRemoved: ann method ]
+		send: #onMethodAdded:
+		to: self;
+		
+		on: MethodRemoved
+        send: #onMethodRemoved:
+		to: self
 ! !
 
 !HLSelectorsCache methodsFor: 'factory'!
@@ -1102,12 +1220,12 @@ invalidateCacheFor: aMethod
 
 !HLSelectorsCache methodsFor: 'reactions'!
 
-onMethodAdded: aMethod
-	self invalidateCacheFor: aMethod
+onMethodAdded: anAnnouncement
+	self invalidateCacheFor: anAnnouncement method
 !
 
-onMethodRemoved: aMethod
-	self invalidateCacheFor: aMethod
+onMethodRemoved: anAnnouncement
+	self invalidateCacheFor: anAnnouncement method
 ! !
 
 !HLSelectorsCache methodsFor: 'testing'!

+ 6 - 0
st/Helios-Commands-Tools.st

@@ -174,6 +174,12 @@ label
 	^ 'Class'
 ! !
 
+!HLFindClassCommand class methodsFor: 'testing'!
+
+isValidFor: aModel
+	^ aModel isBrowserModel
+! !
+
 HLFindCommand subclass: #HLFindReferencesCommand
 	instanceVariableNames: ''
 	package: 'Helios-Commands-Tools'!

+ 13 - 0
st/Helios-Core.st

@@ -445,6 +445,7 @@ registerBindings
 !
 
 remove
+	self widget unregister.
 	root ifNotNil: [ root asJQuery remove ]
 !
 
@@ -513,6 +514,11 @@ execute: aCommand
 	HLManager current keyBinder
 		activate;
 		applyBinding: aCommand asBinding
+!
+
+unregister
+	"This method is called whenever the receiver is closed (as a tab).
+	Widgets subscribing to announcements should unregister there"
 ! !
 
 !HLWidget methodsFor: 'keybindings'!
@@ -1037,6 +1043,13 @@ observeModel
 !
 
 observeSystem
+!
+
+unregister
+	super unregister.
+	
+	self model announcer unsubscribe: self.
+	self model systemAnnouncer unsubscribe: self
 ! !
 
 !HLToolListWidget methodsFor: 'rendering'!

+ 3 - 1
st/Helios-Inspector.st

@@ -77,7 +77,9 @@ observeCodeWidget
 
 observeModel
 	self model announcer
-        on: HLInstanceVariableSelected do: [ :ann | self onInstanceVariableSelected ]
+        on: HLInstanceVariableSelected
+		send: #onInstanceVariableSelected
+		to: self
 !
 
 observeVariablesWidget

+ 81 - 52
st/Helios-Workspace.st

@@ -485,43 +485,59 @@ browserModel: aBrowserModel
 observeBrowserModel
 	self browserModel announcer
 		on: HLSaveSourceCode
-		do: [ :ann | self onSaveIt ];
+		send: #onSaveIt
+		to: self;
+		
 		on: HLShowInstanceToggled
-		do: [ :ann | self onShowInstanceToggled ];
+		send: #onShowInstanceToggled
+		to: self;
+		
 		on: HLSourceCodeSaved
-		do: [ :ann | self onSourceCodeSaved ];
+		send: #onSourceCodeSaved
+		to: self;
+		
 		on: HLAboutToChange
-		do: [ :ann | self onBrowserAboutToChange: ann actionBlock ];
+		send: #onBrowserAboutToChange:
+		to: self;
+		
 		on: HLParseErrorRaised
-		do: [ :ann | self onParseError: ann ];
+		send: #onParseError:
+		to: self;
+		
 		on: HLCompileErrorRaised
-		do: [ :ann | self onCompileError: ann error ];
+		send: #onCompileError:
+		to: self;
+		
 		on: HLUnknownVariableErrorRaised
-		do: [ :ann | self onUnknownVariableError: ann error ];
+		send: #onUnknownVariableError:
+		to: self;
+		
 		on: HLInstVarAdded 
-		do: [ :ann | self onInstVarAdded ];
+		send: #onInstVarAdded
+		to: self;
+		
 		on: HLMethodSelected 
-		do: [ :ann | self onMethodSelected: ann item ];
+		send: #onMethodSelected:
+		to: self;
+		
     	on: HLClassSelected 
-		do: [ :ann | self onClassSelected: ann item ];
+		send: #onClassSelected:
+		to: self;
+		
     	on: HLProtocolSelected 
-		do: [ :ann | self onProtocolSelected: ann item ];
+		send: #onProtocolSelected: 
+		to: self;
+		
 		on: HLSourceCodeFocusRequested 
-		do: [ :ann | self onSourceCodeFocusRequested ]
+		send: #onSourceCodeFocusRequested
+		to: self
 !
 
 observeSystem
 	self browserModel systemAnnouncer
     	on: MethodModified
-        do: [ :ann | self onMethodModified: ann method ];
-		on: HLMethodSelected 
-		do: [ :ann | self onMethodSelected: ann item ];
-    	on: HLClassSelected 
-		do: [ :ann | self onClassSelected: ann item ];
-    	on: HLProtocolSelected 
-		do: [ :ann | self onProtocolSelected: ann item ];
-		on: HLSourceCodeFocusRequested 
-		do: [ :ann | self onSourceCodeFocusRequested ]
+        send: #onMethodModified:
+		to: self
 !
 
 refresh
@@ -533,22 +549,22 @@ refresh
 
 saveIt
 	self browserModel saveSourceCode
+!
+
+unregister
+	super unregsiter.
+	
+	self browserModel announcer unsubscribe: self.
+	self browserModel systemAnnouncer unsubscribe: self
 ! !
 
 !HLBrowserCodeWidget methodsFor: 'reactions'!
 
-onBrowserAboutToChange
-	self hasModification
-		ifTrue: [ 
-			self 
-				confirm: 'Do you want to cancel changes?' 
-				ifFalse: [ HLChangeForbidden signal ].
-			
-			"Don't ask twice"
-			self methodContents: self contents ]
-!
-
-onBrowserAboutToChange: aBlock
+onBrowserAboutToChange: anAnnouncement
+	| block |
+	
+	block := anAnnouncement actionBlock.
+	
 	self hasModification
 		ifTrue: [
 			self 
@@ -556,38 +572,48 @@ onBrowserAboutToChange: aBlock
 				ifTrue: [
 					"Don't ask twice"
 					self methodContents: self contents.
-					aBlock value ].
+					block value ].
 			
 			
 			HLChangeForbidden signal ]
 !
 
-onClassSelected: aClass
-	aClass ifNil: [ ^ self contents: '' ].
-    
-    self contents: aClass definition
+onClassSelected: anAnnouncement
+	| class |
+	
+	class:= anAnnouncement item.
+	
+	class ifNil: [ ^ self contents: '' ].
+    self contents: class definition
 !
 
-onCompileError: anError
-	self alert: anError messageText
+onCompileError: anAnnouncement
+	self alert: anAnnouncement error messageText
 !
 
 onInstVarAdded
 	self browserModel save: self contents
 !
 
-onMethodModified: aMethod
-	self browserModel selectedClass = aMethod methodClass ifFalse: [ ^ self ].
+onMethodModified: anAnnouncement
+	| method |
+	
+	method := anAnnouncement method.
+	
+	self browserModel selectedClass = method methodClass ifFalse: [ ^ self ].
 	self browserModel selectedMethod ifNil: [ ^ self ].
-    self browserModel selectedMethod selector = aMethod selector ifFalse: [ ^ self ].
+    self browserModel selectedMethod selector = method selector ifFalse: [ ^ self ].
 
 	self refresh
 !
 
-onMethodSelected: aCompiledMethod
-	aCompiledMethod ifNil: [ ^ self contents: '' ].
-    
-    self contents: aCompiledMethod source
+onMethodSelected: anAnnouncement
+	| method |
+	
+	method := anAnnouncement item.
+	
+	method ifNil: [ ^ self contents: '' ].
+    self contents: method source
 !
 
 onParseError: anAnnouncement
@@ -610,9 +636,8 @@ onParseError: anAnnouncement
 			lineIndex := lineIndex + 1 ] ])
 !
 
-onProtocolSelected: aString
+onProtocolSelected: anAnnouncement
 	self browserModel selectedClass ifNil: [ ^ self contents: '' ].
-    
     self contents: self browserModel selectedClass definition
 !
 
@@ -635,15 +660,19 @@ onSourceCodeSaved
 	self updateState
 !
 
-onUnknownVariableError: anError
+onUnknownVariableError: anAnnouncement
+	| error |
+	
+	error := anAnnouncement error.
+	
 	self 
 		confirm: (String streamContents: [ :stream |
 			stream 
-				nextPutAll: anError messageText;
+				nextPutAll: error messageText;
 				nextPutAll: String cr;
 				nextPutAll: 'Would you like to define an instance variable?' ])
 		ifTrue: [
-			self browserModel addInstVarNamed: anError variableName ]
+			self browserModel addInstVarNamed: error variableName ]
 ! !
 
 !HLBrowserCodeWidget class methodsFor: 'instance creation'!

Some files were not shown because too many files changed in this diff