Browse Source

Helios changes:
- better documentation widget
- new HLMethodReference class to reference methods

Nicolas Petton 11 years ago
parent
commit
03425f8880
7 changed files with 1050 additions and 89 deletions
  1. 35 0
      css/helios.css
  2. 230 22
      js/Helios-Browser.deploy.js
  3. 301 33
      js/Helios-Browser.js
  4. 136 6
      js/Helios-References.deploy.js
  5. 184 9
      js/Helios-References.js
  6. 105 13
      st/Helios-Browser.st
  7. 59 6
      st/Helios-References.st

+ 35 - 0
css/helios.css

@@ -599,3 +599,38 @@ i {
 .button:focus {
     outline: 0;
 }
+
+.doc {
+    background: white;
+}
+
+.doc code, .doc pre {
+    font-size: 11px;
+}
+
+.doc code {
+    padding: 1px 4px;
+}
+
+.doc .head {
+    background: #08C;
+    padding: 10px;
+    font-size: 22px;
+    color: white;
+    border-top: 1px solid #eee;
+}
+
+.doc .markdown,
+.doc .inheritance {
+    padding: 10px;
+}
+
+.doc h1 {
+    font-size: 22px;
+    margin: 0 10px;
+    border-bottom: 1px solid #666;
+}
+
+.doc h2 {
+    font-size: 16px;
+}

+ 230 - 22
js/Helios-Browser.deploy.js

@@ -1460,11 +1460,22 @@ selector: "defaultDocumentation",
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-return "#No documentation available. \x0a##That's bad. Seriously.";
+return "No documentation available. \x0a**That's bad. Seriously.**";
 }, function($ctx1) {$ctx1.fill(self,"defaultDocumentation",{},smalltalk.HLDocumentationWidget)})},
 messageSends: []}),
 smalltalk.HLDocumentationWidget);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "defaultHead",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+return "No class selected";
+}, function($ctx1) {$ctx1.fill(self,"defaultHead",{},smalltalk.HLDocumentationWidget)})},
+messageSends: []}),
+smalltalk.HLDocumentationWidget);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "documentation",
@@ -1472,15 +1483,40 @@ fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $2,$1;
-$2=_st(_st(_st(_st(self)._model())._selectedClass())._theNonMetaClass())._comment();
+$2=_st(self)._selectedItem();
 if(($receiver = $2) == nil || $receiver == undefined){
-$1=_st(self)._defaultDocumentation();
+$1="";
 } else {
-$1=$2;
+var item;
+item=$receiver;
+$1=_st(_st(item)._comment())._ifEmpty_((function(){
+return smalltalk.withContext(function($ctx2) {
+return _st(self)._defaultDocumentation();
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
 };
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"documentation",{},smalltalk.HLDocumentationWidget)})},
-messageSends: ["ifNil:", "defaultDocumentation", "comment", "theNonMetaClass", "selectedClass", "model"]}),
+messageSends: ["ifNil:ifNotNil:", "ifEmpty:", "defaultDocumentation", "comment", "selectedItem"]}),
+smalltalk.HLDocumentationWidget);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "head",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $2,$1;
+$2=_st(self)._selectedItem();
+if(($receiver = $2) == nil || $receiver == undefined){
+$1=_st(self)._defaultHead();
+} else {
+var item;
+item=$receiver;
+$1=_st(item)._name();
+};
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"head",{},smalltalk.HLDocumentationWidget)})},
+messageSends: ["ifNil:ifNotNil:", "defaultHead", "name", "selectedItem"]}),
 smalltalk.HLDocumentationWidget);
 
 smalltalk.addMethod(
@@ -1503,8 +1539,32 @@ fn: function (aModel){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 self["@model"]=aModel;
+_st(self)._observeModel();
 return self}, function($ctx1) {$ctx1.fill(self,"model:",{aModel:aModel},smalltalk.HLDocumentationWidget)})},
-messageSends: []}),
+messageSends: ["observeModel"]}),
+smalltalk.HLDocumentationWidget);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "observeModel",
+fn: function (){
+var self=this;
+function $HLClassSelected(){return smalltalk.HLClassSelected||(typeof HLClassSelected=="undefined"?nil:HLClassSelected)}
+return smalltalk.withContext(function($ctx1) { 
+_st(_st(_st(self)._model())._announcer())._on_send_to_($HLClassSelected(),"onClassSelected:",self);
+return self}, function($ctx1) {$ctx1.fill(self,"observeModel",{},smalltalk.HLDocumentationWidget)})},
+messageSends: ["on:send:to:", "announcer", "model"]}),
+smalltalk.HLDocumentationWidget);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "onClassSelected:",
+fn: function (anAnnouncement){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+_st(self)._refresh();
+return self}, function($ctx1) {$ctx1.fill(self,"onClassSelected:",{anAnnouncement:anAnnouncement},smalltalk.HLDocumentationWidget)})},
+messageSends: ["refresh"]}),
 smalltalk.HLDocumentationWidget);
 
 smalltalk.addMethod(
@@ -1512,15 +1572,128 @@ smalltalk.method({
 selector: "renderContentOn:",
 fn: function (html){
 var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1,$3,$4,$2;
+$1=_st(html)._div();
+_st($1)._class_("doc");
+$2=_st($1)._with_((function(){
+return smalltalk.withContext(function($ctx2) {
+$3=self;
+_st($3)._renderHeadOn_(html);
+$4=_st($3)._renderDocOn_(html);
+return $4;
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
+return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLDocumentationWidget)})},
+messageSends: ["class:", "div", "with:", "renderHeadOn:", "renderDocOn:"]}),
+smalltalk.HLDocumentationWidget);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "renderDocOn:",
+fn: function (html){
+var self=this;
 function $Showdown(){return smalltalk.Showdown||(typeof Showdown=="undefined"?nil:Showdown)}
 return smalltalk.withContext(function($ctx1) { 
+var $1,$2,$3;
+$1=_st(self)._selectedItem();
+if(($receiver = $1) == nil || $receiver == undefined){
+$1;
+} else {
+_st(self)._renderInheritanceOn_(html);
+_st(_st(html)._h1())._with_("Overview");
+$2=_st(html)._div();
+_st($2)._class_("markdown");
+$3=_st($2)._asJQuery();
+_st($3)._html_(_st(_st(_st($Showdown())._at_("converter"))._new())._makeHtml_(_st(self)._documentation()));
+};
+return self}, function($ctx1) {$ctx1.fill(self,"renderDocOn:",{html:html},smalltalk.HLDocumentationWidget)})},
+messageSends: ["ifNotNil:", "renderInheritanceOn:", "with:", "h1", "html:", "makeHtml:", "documentation", "new", "at:", "class:", "div", "asJQuery", "selectedItem"]}),
+smalltalk.HLDocumentationWidget);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "renderHeadOn:",
+fn: function (html){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
 var $1,$2;
 $1=_st(html)._div();
-_st($1)._class_("markdown");
-$2=_st($1)._asJQuery();
-_st($2)._html_(_st(_st(_st($Showdown())._at_("converter"))._new())._makeHtml_(_st(self)._documentation()));
-return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLDocumentationWidget)})},
-messageSends: ["html:", "makeHtml:", "documentation", "new", "at:", "class:", "div", "asJQuery"]}),
+_st($1)._class_("head");
+$2=_st($1)._with_(_st(self)._head());
+return self}, function($ctx1) {$ctx1.fill(self,"renderHeadOn:",{html:html},smalltalk.HLDocumentationWidget)})},
+messageSends: ["class:", "div", "with:", "head"]}),
+smalltalk.HLDocumentationWidget);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "renderInheritanceOn:",
+fn: function (html){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1,$3,$4,$5,$2;
+$1=_st(html)._div();
+_st($1)._class_("inheritance");
+$2=_st($1)._with_((function(){
+return smalltalk.withContext(function($ctx2) {
+_st(html)._with_("Subclass of ");
+$3=_st(_st(self)._selectedItem())._superclass();
+if(($receiver = $3) == nil || $receiver == undefined){
+return _st(_st(html)._em())._with_("nil");
+} else {
+$4=_st(html)._a();
+_st($4)._with_(_st(_st(_st(self)._selectedItem())._superclass())._name());
+$5=_st($4)._onClick_((function(){
+return smalltalk.withContext(function($ctx3) {
+return _st(self)._selectClass_(_st(_st(self)._selectedItem())._superclass());
+}, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
+return $5;
+};
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
+return self}, function($ctx1) {$ctx1.fill(self,"renderInheritanceOn:",{html:html},smalltalk.HLDocumentationWidget)})},
+messageSends: ["class:", "div", "with:", "ifNil:ifNotNil:", "em", "name", "superclass", "selectedItem", "a", "onClick:", "selectClass:"]}),
+smalltalk.HLDocumentationWidget);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "selectClass:",
+fn: function (aClass){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+_st(_st(self)._model())._selectedClass_(aClass);
+return self}, function($ctx1) {$ctx1.fill(self,"selectClass:",{aClass:aClass},smalltalk.HLDocumentationWidget)})},
+messageSends: ["selectedClass:", "model"]}),
+smalltalk.HLDocumentationWidget);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "selectedItem",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $2,$1;
+$2=_st(_st(self)._model())._selectedClass();
+if(($receiver = $2) == nil || $receiver == undefined){
+$1=$2;
+} else {
+var class_;
+class_=$receiver;
+$1=_st(class_)._theNonMetaClass();
+};
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"selectedItem",{},smalltalk.HLDocumentationWidget)})},
+messageSends: ["ifNotNil:", "theNonMetaClass", "selectedClass", "model"]}),
+smalltalk.HLDocumentationWidget);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "unregister",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+smalltalk.HLFocusableWidget.fn.prototype._unregister.apply(_st(self), []);
+_st(_st(_st(self)._model())._announcer())._unregister_(self);
+return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},smalltalk.HLDocumentationWidget)})},
+messageSends: ["unregister", "unregister:", "announcer", "model"]}),
 smalltalk.HLDocumentationWidget);
 
 
@@ -1653,6 +1826,7 @@ fn: function (){
 var self=this;
 function $HLProtocolSelected(){return smalltalk.HLProtocolSelected||(typeof HLProtocolSelected=="undefined"?nil:HLProtocolSelected)}
 function $HLShowInstanceToggled(){return smalltalk.HLShowInstanceToggled||(typeof HLShowInstanceToggled=="undefined"?nil:HLShowInstanceToggled)}
+function $HLShowCommentToggled(){return smalltalk.HLShowCommentToggled||(typeof HLShowCommentToggled=="undefined"?nil:HLShowCommentToggled)}
 function $HLMethodSelected(){return smalltalk.HLMethodSelected||(typeof HLMethodSelected=="undefined"?nil:HLMethodSelected)}
 function $HLMethodsFocusRequested(){return smalltalk.HLMethodsFocusRequested||(typeof HLMethodsFocusRequested=="undefined"?nil:HLMethodsFocusRequested)}
 return smalltalk.withContext(function($ctx1) { 
@@ -1660,6 +1834,7 @@ var $1,$2;
 $1=_st(_st(self)._model())._announcer();
 _st($1)._on_send_to_($HLProtocolSelected(),"onProtocolSelected:",self);
 _st($1)._on_send_to_($HLShowInstanceToggled(),"onShowInstanceToggled",self);
+_st($1)._on_send_to_($HLShowCommentToggled(),"onShowCommentToggled",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)})},
@@ -1857,6 +2032,17 @@ return self}, function($ctx1) {$ctx1.fill(self,"onProtocolSelected:",{anAnnounce
 messageSends: ["selectedItem:", "setItemsForSelectedProtocol", "refresh"]}),
 smalltalk.HLMethodsListWidget);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "onShowCommentToggled",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+_st(self)._onProtocolSelected_(nil);
+return self}, function($ctx1) {$ctx1.fill(self,"onShowCommentToggled",{},smalltalk.HLMethodsListWidget)})},
+messageSends: ["onProtocolSelected:"]}),
+smalltalk.HLMethodsListWidget);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "onShowInstanceToggled",
@@ -2272,6 +2458,7 @@ fn: function (){
 var self=this;
 function $HLClassSelected(){return smalltalk.HLClassSelected||(typeof HLClassSelected=="undefined"?nil:HLClassSelected)}
 function $HLShowInstanceToggled(){return smalltalk.HLShowInstanceToggled||(typeof HLShowInstanceToggled=="undefined"?nil:HLShowInstanceToggled)}
+function $HLShowCommentToggled(){return smalltalk.HLShowCommentToggled||(typeof HLShowCommentToggled=="undefined"?nil:HLShowCommentToggled)}
 function $HLProtocolSelected(){return smalltalk.HLProtocolSelected||(typeof HLProtocolSelected=="undefined"?nil:HLProtocolSelected)}
 function $HLProtocolsFocusRequested(){return smalltalk.HLProtocolsFocusRequested||(typeof HLProtocolsFocusRequested=="undefined"?nil:HLProtocolsFocusRequested)}
 return smalltalk.withContext(function($ctx1) { 
@@ -2279,6 +2466,7 @@ var $1,$2;
 $1=_st(_st(self)._model())._announcer();
 _st($1)._on_send_to_($HLClassSelected(),"onClassSelected:",self);
 _st($1)._on_send_to_($HLShowInstanceToggled(),"onClassSelected:",self);
+_st($1)._on_send_to_($HLShowCommentToggled(),"onShowCommentToggled",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)})},
@@ -2401,6 +2589,21 @@ return self}, function($ctx1) {$ctx1.fill(self,"onProtocolsFocusRequested",{},sm
 messageSends: ["focus"]}),
 smalltalk.HLProtocolsListWidget);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "onShowCommentToggled",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2;
+$1=self;
+_st($1)._selectItem_(nil);
+_st($1)._setItemsForSelectedClass();
+$2=_st($1)._refresh();
+return self}, function($ctx1) {$ctx1.fill(self,"onShowCommentToggled",{},smalltalk.HLProtocolsListWidget)})},
+messageSends: ["selectItem:", "setItemsForSelectedClass", "refresh"]}),
+smalltalk.HLProtocolsListWidget);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "renderContentOn:",
@@ -2455,20 +2658,25 @@ fn: function (aClass){
 var self=this;
 function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
 return smalltalk.withContext(function($ctx1) { 
-var $1,$3,$4,$5,$2;
-$1=self;
-$3=aClass;
-if(($receiver = $3) == nil || $receiver == undefined){
-$2=_st($Array())._with_(_st(self)._allProtocol());
-} else {
+var $1,$2,$3,$5,$6,$7,$4;
+$1=_st(_st(self)._model())._showComment();
+if(smalltalk.assert($1)){
+$2=_st(self)._items_([]);
+return $2;
+};
+$3=self;
+$5=aClass;
+if(($receiver = $5) == nil || $receiver == undefined){
 $4=_st($Array())._with_(_st(self)._allProtocol());
-_st($4)._addAll_(_st(aClass)._protocols());
-$5=_st($4)._yourself();
-$2=$5;
+} else {
+$6=_st($Array())._with_(_st(self)._allProtocol());
+_st($6)._addAll_(_st(aClass)._protocols());
+$7=_st($6)._yourself();
+$4=$7;
 };
-_st($1)._items_($2);
+_st($3)._items_($4);
 return self}, function($ctx1) {$ctx1.fill(self,"setItemsForClass:",{aClass:aClass},smalltalk.HLProtocolsListWidget)})},
-messageSends: ["items:", "ifNil:ifNotNil:", "with:", "allProtocol", "addAll:", "protocols", "yourself"]}),
+messageSends: ["ifTrue:", "items:", "showComment", "model", "ifNil:ifNotNil:", "with:", "allProtocol", "addAll:", "protocols", "yourself"]}),
 smalltalk.HLProtocolsListWidget);
 
 smalltalk.addMethod(

+ 301 - 33
js/Helios-Browser.js

@@ -1896,10 +1896,26 @@ category: 'defaults',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-return "#No documentation available. \x0a##That's bad. Seriously.";
+return "No documentation available. \x0a**That's bad. Seriously.**";
 }, function($ctx1) {$ctx1.fill(self,"defaultDocumentation",{},smalltalk.HLDocumentationWidget)})},
 args: [],
-source: "defaultDocumentation\x0a\x09^ '#No documentation available. \x0a##That''s bad. Seriously.'",
+source: "defaultDocumentation\x0a\x09^ 'No documentation available. \x0a**That''s bad. Seriously.**'",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLDocumentationWidget);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "defaultHead",
+category: 'defaults',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+return "No class selected";
+}, function($ctx1) {$ctx1.fill(self,"defaultHead",{},smalltalk.HLDocumentationWidget)})},
+args: [],
+source: "defaultHead\x0a\x09^ 'No class selected'",
 messageSends: [],
 referencedClasses: []
 }),
@@ -1913,17 +1929,47 @@ fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $2,$1;
-$2=_st(_st(_st(_st(self)._model())._selectedClass())._theNonMetaClass())._comment();
+$2=_st(self)._selectedItem();
 if(($receiver = $2) == nil || $receiver == undefined){
-$1=_st(self)._defaultDocumentation();
+$1="";
 } else {
-$1=$2;
+var item;
+item=$receiver;
+$1=_st(_st(item)._comment())._ifEmpty_((function(){
+return smalltalk.withContext(function($ctx2) {
+return _st(self)._defaultDocumentation();
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
 };
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"documentation",{},smalltalk.HLDocumentationWidget)})},
 args: [],
-source: "documentation\x0a\x09^ self model selectedClass theNonMetaClass comment ifNil: [ self defaultDocumentation ]",
-messageSends: ["ifNil:", "defaultDocumentation", "comment", "theNonMetaClass", "selectedClass", "model"],
+source: "documentation\x0a\x09^ self selectedItem \x0a\x09\x09ifNil: [ '' ]\x0a\x09\x09ifNotNil: [ :item | item comment ifEmpty: [ self defaultDocumentation ] ]",
+messageSends: ["ifNil:ifNotNil:", "ifEmpty:", "defaultDocumentation", "comment", "selectedItem"],
+referencedClasses: []
+}),
+smalltalk.HLDocumentationWidget);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "head",
+category: 'accessing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $2,$1;
+$2=_st(self)._selectedItem();
+if(($receiver = $2) == nil || $receiver == undefined){
+$1=_st(self)._defaultHead();
+} else {
+var item;
+item=$receiver;
+$1=_st(item)._name();
+};
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"head",{},smalltalk.HLDocumentationWidget)})},
+args: [],
+source: "head\x0a\x09^ self selectedItem \x0a\x09\x09ifNil: [ self defaultHead ]\x0a\x09\x09ifNotNil: [ :item | item name ]",
+messageSends: ["ifNil:ifNotNil:", "defaultHead", "name", "selectedItem"],
 referencedClasses: []
 }),
 smalltalk.HLDocumentationWidget);
@@ -1954,10 +2000,44 @@ fn: function (aModel){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 self["@model"]=aModel;
+_st(self)._observeModel();
 return self}, function($ctx1) {$ctx1.fill(self,"model:",{aModel:aModel},smalltalk.HLDocumentationWidget)})},
 args: ["aModel"],
-source: "model: aModel\x0a\x09model := aModel",
-messageSends: [],
+source: "model: aModel\x0a\x09model := aModel.\x0a\x09self observeModel",
+messageSends: ["observeModel"],
+referencedClasses: []
+}),
+smalltalk.HLDocumentationWidget);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "observeModel",
+category: 'actions',
+fn: function (){
+var self=this;
+function $HLClassSelected(){return smalltalk.HLClassSelected||(typeof HLClassSelected=="undefined"?nil:HLClassSelected)}
+return smalltalk.withContext(function($ctx1) { 
+_st(_st(_st(self)._model())._announcer())._on_send_to_($HLClassSelected(),"onClassSelected:",self);
+return self}, function($ctx1) {$ctx1.fill(self,"observeModel",{},smalltalk.HLDocumentationWidget)})},
+args: [],
+source: "observeModel\x0a\x09self model announcer \x0a\x09\x09on: HLClassSelected\x0a\x09\x09send: #onClassSelected:\x0a\x09\x09to: self",
+messageSends: ["on:send:to:", "announcer", "model"],
+referencedClasses: ["HLClassSelected"]
+}),
+smalltalk.HLDocumentationWidget);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "onClassSelected:",
+category: 'reactions',
+fn: function (anAnnouncement){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+_st(self)._refresh();
+return self}, function($ctx1) {$ctx1.fill(self,"onClassSelected:",{anAnnouncement:anAnnouncement},smalltalk.HLDocumentationWidget)})},
+args: ["anAnnouncement"],
+source: "onClassSelected: anAnnouncement\x0a\x09self refresh",
+messageSends: ["refresh"],
 referencedClasses: []
 }),
 smalltalk.HLDocumentationWidget);
@@ -1968,21 +2048,164 @@ selector: "renderContentOn:",
 category: 'rendering',
 fn: function (html){
 var self=this;
-function $Showdown(){return smalltalk.Showdown||(typeof Showdown=="undefined"?nil:Showdown)}
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2;
+var $1,$3,$4,$2;
 $1=_st(html)._div();
-_st($1)._class_("markdown");
-$2=_st($1)._asJQuery();
-_st($2)._html_(_st(_st(_st($Showdown())._at_("converter"))._new())._makeHtml_(_st(self)._documentation()));
+_st($1)._class_("doc");
+$2=_st($1)._with_((function(){
+return smalltalk.withContext(function($ctx2) {
+$3=self;
+_st($3)._renderHeadOn_(html);
+$4=_st($3)._renderDocOn_(html);
+return $4;
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
 return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLDocumentationWidget)})},
 args: ["html"],
-source: "renderContentOn: html\x0a\x09(html div \x0a\x09\x09class: 'markdown';\x0a\x09\x09asJQuery) html: ((Showdown at: 'converter') new makeHtml: self documentation)",
-messageSends: ["html:", "makeHtml:", "documentation", "new", "at:", "class:", "div", "asJQuery"],
+source: "renderContentOn: html\x0a\x09html div \x0a\x09\x09class: 'doc';\x0a\x09\x09with: [\x0a\x09\x09\x09self \x0a\x09\x09\x09\x09renderHeadOn: html;\x0a\x09\x09\x09\x09renderDocOn: html ]",
+messageSends: ["class:", "div", "with:", "renderHeadOn:", "renderDocOn:"],
+referencedClasses: []
+}),
+smalltalk.HLDocumentationWidget);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "renderDocOn:",
+category: 'rendering',
+fn: function (html){
+var self=this;
+function $Showdown(){return smalltalk.Showdown||(typeof Showdown=="undefined"?nil:Showdown)}
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2,$3;
+$1=_st(self)._selectedItem();
+if(($receiver = $1) == nil || $receiver == undefined){
+$1;
+} else {
+_st(self)._renderInheritanceOn_(html);
+_st(_st(html)._h1())._with_("Overview");
+$2=_st(html)._div();
+_st($2)._class_("markdown");
+$3=_st($2)._asJQuery();
+_st($3)._html_(_st(_st(_st($Showdown())._at_("converter"))._new())._makeHtml_(_st(self)._documentation()));
+};
+return self}, function($ctx1) {$ctx1.fill(self,"renderDocOn:",{html:html},smalltalk.HLDocumentationWidget)})},
+args: ["html"],
+source: "renderDocOn: html\x0a\x09self selectedItem ifNotNil: [\x0a\x09\x09self renderInheritanceOn: html.\x0a\x09\x09html h1 with: 'Overview'.\x0a\x09\x09(html div \x0a\x09\x09\x09class: 'markdown';\x0a\x09\x09\x09asJQuery) html: ((Showdown at: 'converter') new makeHtml: self documentation) ]",
+messageSends: ["ifNotNil:", "renderInheritanceOn:", "with:", "h1", "html:", "makeHtml:", "documentation", "new", "at:", "class:", "div", "asJQuery", "selectedItem"],
 referencedClasses: ["Showdown"]
 }),
 smalltalk.HLDocumentationWidget);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "renderHeadOn:",
+category: 'rendering',
+fn: function (html){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2;
+$1=_st(html)._div();
+_st($1)._class_("head");
+$2=_st($1)._with_(_st(self)._head());
+return self}, function($ctx1) {$ctx1.fill(self,"renderHeadOn:",{html:html},smalltalk.HLDocumentationWidget)})},
+args: ["html"],
+source: "renderHeadOn: html\x0a\x09html div \x0a\x09\x09class: 'head';\x0a\x09\x09with: self head",
+messageSends: ["class:", "div", "with:", "head"],
+referencedClasses: []
+}),
+smalltalk.HLDocumentationWidget);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "renderInheritanceOn:",
+category: 'rendering',
+fn: function (html){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1,$3,$4,$5,$2;
+$1=_st(html)._div();
+_st($1)._class_("inheritance");
+$2=_st($1)._with_((function(){
+return smalltalk.withContext(function($ctx2) {
+_st(html)._with_("Subclass of ");
+$3=_st(_st(self)._selectedItem())._superclass();
+if(($receiver = $3) == nil || $receiver == undefined){
+return _st(_st(html)._em())._with_("nil");
+} else {
+$4=_st(html)._a();
+_st($4)._with_(_st(_st(_st(self)._selectedItem())._superclass())._name());
+$5=_st($4)._onClick_((function(){
+return smalltalk.withContext(function($ctx3) {
+return _st(self)._selectClass_(_st(_st(self)._selectedItem())._superclass());
+}, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
+return $5;
+};
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
+return self}, function($ctx1) {$ctx1.fill(self,"renderInheritanceOn:",{html:html},smalltalk.HLDocumentationWidget)})},
+args: ["html"],
+source: "renderInheritanceOn: html\x0a\x09html div \x09\x0a\x09\x09class: 'inheritance';\x0a\x09\x09with: [\x0a\x09\x09\x09html with: 'Subclass of '.\x0a\x09\x09\x09self selectedItem superclass \x0a\x09\x09\x09\x09ifNil: [ html em with: 'nil' ]\x0a\x09\x09\x09\x09ifNotNil: [\x0a\x09\x09\x09\x09\x09html a \x0a\x09\x09\x09\x09\x09\x09with: self selectedItem superclass name;\x0a\x09\x09\x09\x09\x09\x09onClick: [ self selectClass: self selectedItem superclass ] ] ]",
+messageSends: ["class:", "div", "with:", "ifNil:ifNotNil:", "em", "name", "superclass", "selectedItem", "a", "onClick:", "selectClass:"],
+referencedClasses: []
+}),
+smalltalk.HLDocumentationWidget);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "selectClass:",
+category: 'actions',
+fn: function (aClass){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+_st(_st(self)._model())._selectedClass_(aClass);
+return self}, function($ctx1) {$ctx1.fill(self,"selectClass:",{aClass:aClass},smalltalk.HLDocumentationWidget)})},
+args: ["aClass"],
+source: "selectClass: aClass\x0a\x09self model selectedClass: aClass",
+messageSends: ["selectedClass:", "model"],
+referencedClasses: []
+}),
+smalltalk.HLDocumentationWidget);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "selectedItem",
+category: 'accessing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $2,$1;
+$2=_st(_st(self)._model())._selectedClass();
+if(($receiver = $2) == nil || $receiver == undefined){
+$1=$2;
+} else {
+var class_;
+class_=$receiver;
+$1=_st(class_)._theNonMetaClass();
+};
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"selectedItem",{},smalltalk.HLDocumentationWidget)})},
+args: [],
+source: "selectedItem\x0a\x09^ self model selectedClass ifNotNil: [ :class | class theNonMetaClass ]",
+messageSends: ["ifNotNil:", "theNonMetaClass", "selectedClass", "model"],
+referencedClasses: []
+}),
+smalltalk.HLDocumentationWidget);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "unregister",
+category: 'actions',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+smalltalk.HLFocusableWidget.fn.prototype._unregister.apply(_st(self), []);
+_st(_st(_st(self)._model())._announcer())._unregister_(self);
+return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},smalltalk.HLDocumentationWidget)})},
+args: [],
+source: "unregister\x0a\x09super unregister.\x0a\x09self model announcer unregister: self",
+messageSends: ["unregister", "unregister:", "announcer", "model"],
+referencedClasses: []
+}),
+smalltalk.HLDocumentationWidget);
+
 
 
 smalltalk.addClass('HLMethodsListWidget', smalltalk.HLToolListWidget, ['selectorsCache'], 'Helios-Browser');
@@ -2149,6 +2372,7 @@ fn: function (){
 var self=this;
 function $HLProtocolSelected(){return smalltalk.HLProtocolSelected||(typeof HLProtocolSelected=="undefined"?nil:HLProtocolSelected)}
 function $HLShowInstanceToggled(){return smalltalk.HLShowInstanceToggled||(typeof HLShowInstanceToggled=="undefined"?nil:HLShowInstanceToggled)}
+function $HLShowCommentToggled(){return smalltalk.HLShowCommentToggled||(typeof HLShowCommentToggled=="undefined"?nil:HLShowCommentToggled)}
 function $HLMethodSelected(){return smalltalk.HLMethodSelected||(typeof HLMethodSelected=="undefined"?nil:HLMethodSelected)}
 function $HLMethodsFocusRequested(){return smalltalk.HLMethodsFocusRequested||(typeof HLMethodsFocusRequested=="undefined"?nil:HLMethodsFocusRequested)}
 return smalltalk.withContext(function($ctx1) { 
@@ -2156,13 +2380,14 @@ var $1,$2;
 $1=_st(_st(self)._model())._announcer();
 _st($1)._on_send_to_($HLProtocolSelected(),"onProtocolSelected:",self);
 _st($1)._on_send_to_($HLShowInstanceToggled(),"onShowInstanceToggled",self);
+_st($1)._on_send_to_($HLShowCommentToggled(),"onShowCommentToggled",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)})},
 args: [],
-source: "observeModel\x0a\x09self model announcer \x0a\x09\x09on: HLProtocolSelected \x0a\x09\x09send: #onProtocolSelected: \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: HLMethodSelected \x0a\x09\x09send: #onMethodSelected:\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLMethodsFocusRequested \x0a\x09\x09send: #onMethodsFocusRequested\x0a\x09\x09to: self",
+source: "observeModel\x0a\x09self model announcer \x0a\x09\x09on: HLProtocolSelected \x0a\x09\x09send: #onProtocolSelected: \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: HLShowCommentToggled \x0a\x09\x09send: #onShowCommentToggled\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLMethodSelected \x0a\x09\x09send: #onMethodSelected:\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLMethodsFocusRequested \x0a\x09\x09send: #onMethodsFocusRequested\x0a\x09\x09to: self",
 messageSends: ["on:send:to:", "announcer", "model"],
-referencedClasses: ["HLProtocolSelected", "HLShowInstanceToggled", "HLMethodSelected", "HLMethodsFocusRequested"]
+referencedClasses: ["HLProtocolSelected", "HLShowInstanceToggled", "HLShowCommentToggled", "HLMethodSelected", "HLMethodsFocusRequested"]
 }),
 smalltalk.HLMethodsListWidget);
 
@@ -2402,6 +2627,22 @@ referencedClasses: []
 }),
 smalltalk.HLMethodsListWidget);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "onShowCommentToggled",
+category: 'reactions',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+_st(self)._onProtocolSelected_(nil);
+return self}, function($ctx1) {$ctx1.fill(self,"onShowCommentToggled",{},smalltalk.HLMethodsListWidget)})},
+args: [],
+source: "onShowCommentToggled\x0a\x09self onProtocolSelected: nil",
+messageSends: ["onProtocolSelected:"],
+referencedClasses: []
+}),
+smalltalk.HLMethodsListWidget);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "onShowInstanceToggled",
@@ -2909,7 +3150,7 @@ smalltalk.addClass('HLProtocolsListWidget', smalltalk.HLToolListWidget, [], 'Hel
 smalltalk.addMethod(
 smalltalk.method({
 selector: "allProtocol",
-category: 'foo',
+category: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -2948,6 +3189,7 @@ fn: function (){
 var self=this;
 function $HLClassSelected(){return smalltalk.HLClassSelected||(typeof HLClassSelected=="undefined"?nil:HLClassSelected)}
 function $HLShowInstanceToggled(){return smalltalk.HLShowInstanceToggled||(typeof HLShowInstanceToggled=="undefined"?nil:HLShowInstanceToggled)}
+function $HLShowCommentToggled(){return smalltalk.HLShowCommentToggled||(typeof HLShowCommentToggled=="undefined"?nil:HLShowCommentToggled)}
 function $HLProtocolSelected(){return smalltalk.HLProtocolSelected||(typeof HLProtocolSelected=="undefined"?nil:HLProtocolSelected)}
 function $HLProtocolsFocusRequested(){return smalltalk.HLProtocolsFocusRequested||(typeof HLProtocolsFocusRequested=="undefined"?nil:HLProtocolsFocusRequested)}
 return smalltalk.withContext(function($ctx1) { 
@@ -2955,13 +3197,14 @@ var $1,$2;
 $1=_st(_st(self)._model())._announcer();
 _st($1)._on_send_to_($HLClassSelected(),"onClassSelected:",self);
 _st($1)._on_send_to_($HLShowInstanceToggled(),"onClassSelected:",self);
+_st($1)._on_send_to_($HLShowCommentToggled(),"onShowCommentToggled",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)})},
 args: [],
-source: "observeModel\x0a    self model announcer \x0a\x09\x09on: HLClassSelected\x0a\x09\x09send: #onClassSelected:\x0a\x09\x09to: self;\x0a\x09\x09\x0a    \x09on: HLShowInstanceToggled \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: HLProtocolsFocusRequested \x0a\x09\x09send: #onProtocolsFocusRequested\x0a\x09\x09to: self",
+source: "observeModel\x0a    self model announcer \x0a\x09\x09on: HLClassSelected\x0a\x09\x09send: #onClassSelected:\x0a\x09\x09to: self;\x0a\x09\x09\x0a    \x09on: HLShowInstanceToggled \x0a\x09\x09send: #onClassSelected:\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLShowCommentToggled \x0a\x09\x09send: #onShowCommentToggled\x0a\x09\x09to: self;\x0a\x09\x09\x0a    \x09on: HLProtocolSelected\x0a\x09\x09send: #onProtocolSelected:\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLProtocolsFocusRequested \x0a\x09\x09send: #onProtocolsFocusRequested\x0a\x09\x09to: self",
 messageSends: ["on:send:to:", "announcer", "model"],
-referencedClasses: ["HLClassSelected", "HLShowInstanceToggled", "HLProtocolSelected", "HLProtocolsFocusRequested"]
+referencedClasses: ["HLClassSelected", "HLShowInstanceToggled", "HLShowCommentToggled", "HLProtocolSelected", "HLProtocolsFocusRequested"]
 }),
 smalltalk.HLProtocolsListWidget);
 
@@ -3111,6 +3354,26 @@ referencedClasses: []
 }),
 smalltalk.HLProtocolsListWidget);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "onShowCommentToggled",
+category: 'reactions',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2;
+$1=self;
+_st($1)._selectItem_(nil);
+_st($1)._setItemsForSelectedClass();
+$2=_st($1)._refresh();
+return self}, function($ctx1) {$ctx1.fill(self,"onShowCommentToggled",{},smalltalk.HLProtocolsListWidget)})},
+args: [],
+source: "onShowCommentToggled\x0a\x09self \x0a\x09\x09selectItem: nil;\x0a\x09\x09setItemsForSelectedClass;\x0a    \x09refresh",
+messageSends: ["selectItem:", "setItemsForSelectedClass", "refresh"],
+referencedClasses: []
+}),
+smalltalk.HLProtocolsListWidget);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "renderContentOn:",
@@ -3181,22 +3444,27 @@ fn: function (aClass){
 var self=this;
 function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
 return smalltalk.withContext(function($ctx1) { 
-var $1,$3,$4,$5,$2;
-$1=self;
-$3=aClass;
-if(($receiver = $3) == nil || $receiver == undefined){
-$2=_st($Array())._with_(_st(self)._allProtocol());
-} else {
+var $1,$2,$3,$5,$6,$7,$4;
+$1=_st(_st(self)._model())._showComment();
+if(smalltalk.assert($1)){
+$2=_st(self)._items_([]);
+return $2;
+};
+$3=self;
+$5=aClass;
+if(($receiver = $5) == nil || $receiver == undefined){
 $4=_st($Array())._with_(_st(self)._allProtocol());
-_st($4)._addAll_(_st(aClass)._protocols());
-$5=_st($4)._yourself();
-$2=$5;
+} else {
+$6=_st($Array())._with_(_st(self)._allProtocol());
+_st($6)._addAll_(_st(aClass)._protocols());
+$7=_st($6)._yourself();
+$4=$7;
 };
-_st($1)._items_($2);
+_st($3)._items_($4);
 return self}, function($ctx1) {$ctx1.fill(self,"setItemsForClass:",{aClass:aClass},smalltalk.HLProtocolsListWidget)})},
 args: ["aClass"],
-source: "setItemsForClass: aClass\x0a\x09self items: (aClass\x0a    \x09ifNil: [ Array with: self allProtocol ]\x0a      \x09ifNotNil: [ \x0a        \x09(Array with: self allProtocol) \x0a            \x09addAll: aClass protocols; \x0a                yourself ])",
-messageSends: ["items:", "ifNil:ifNotNil:", "with:", "allProtocol", "addAll:", "protocols", "yourself"],
+source: "setItemsForClass: aClass\x0a\x09self model showComment ifTrue: [\x0a\x09\x09^ self items: #() ].\x0a\x09\x09\x0a\x09self items: (aClass\x0a    \x09ifNil: [ Array with: self allProtocol ]\x0a      \x09ifNotNil: [ \x0a        \x09(Array with: self allProtocol) \x0a            \x09addAll: aClass protocols; \x0a                yourself ])",
+messageSends: ["ifTrue:", "items:", "showComment", "model", "ifNil:ifNotNil:", "with:", "allProtocol", "addAll:", "protocols", "yourself"],
 referencedClasses: ["Array"]
 }),
 smalltalk.HLProtocolsListWidget);

+ 136 - 6
js/Helios-References.deploy.js

@@ -1,4 +1,111 @@
 smalltalk.addPackage('Helios-References');
+smalltalk.addClass('HLMethodReference', smalltalk.Object, ['selector', 'methodClass'], 'Helios-References');
+smalltalk.addMethod(
+smalltalk.method({
+selector: "initializeFromMethod:",
+fn: function (aCompiledMethod){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2;
+$1=self;
+_st($1)._selector_(_st(aCompiledMethod)._selector());
+$2=_st($1)._methodClass_(_st(aCompiledMethod)._methodClass());
+return self}, function($ctx1) {$ctx1.fill(self,"initializeFromMethod:",{aCompiledMethod:aCompiledMethod},smalltalk.HLMethodReference)})},
+messageSends: ["selector:", "selector", "methodClass:", "methodClass"]}),
+smalltalk.HLMethodReference);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "method",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+$1=_st(_st(self)._methodClass())._methodAt_(_st(self)._selector());
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"method",{},smalltalk.HLMethodReference)})},
+messageSends: ["methodAt:", "selector", "methodClass"]}),
+smalltalk.HLMethodReference);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "methodClass",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+$1=self["@methodClass"];
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"methodClass",{},smalltalk.HLMethodReference)})},
+messageSends: []}),
+smalltalk.HLMethodReference);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "methodClass:",
+fn: function (aClass){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+self["@methodClass"]=aClass;
+return self}, function($ctx1) {$ctx1.fill(self,"methodClass:",{aClass:aClass},smalltalk.HLMethodReference)})},
+messageSends: []}),
+smalltalk.HLMethodReference);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "selector",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+$1=self["@selector"];
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"selector",{},smalltalk.HLMethodReference)})},
+messageSends: []}),
+smalltalk.HLMethodReference);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "selector:",
+fn: function (aString){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+self["@selector"]=aString;
+return self}, function($ctx1) {$ctx1.fill(self,"selector:",{aString:aString},smalltalk.HLMethodReference)})},
+messageSends: []}),
+smalltalk.HLMethodReference);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "source",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+$1=_st(_st(self)._method())._source();
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"source",{},smalltalk.HLMethodReference)})},
+messageSends: ["source", "method"]}),
+smalltalk.HLMethodReference);
+
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "on:",
+fn: function (aCompiledMethod){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $2,$3,$1;
+$2=_st(self)._new();
+_st($2)._initializeFromMethod_(aCompiledMethod);
+$3=_st($2)._yourself();
+$1=$3;
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"on:",{aCompiledMethod:aCompiledMethod},smalltalk.HLMethodReference.klass)})},
+messageSends: ["initializeFromMethod:", "new", "yourself"]}),
+smalltalk.HLMethodReference.klass);
+
+
 smalltalk.addClass('HLReferences', smalltalk.HLWidget, ['model', 'sendersListWidget', 'implementorsListWidget', 'classReferencesListWidget', 'regexpListWidget', 'sourceCodeWidget'], 'Helios-References');
 smalltalk.addMethod(
 smalltalk.method({
@@ -575,13 +682,16 @@ fn: function (aString){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
-$1=_st(_st(self)._allMethods())._select_((function(each){
+$1=_st(_st(_st(self)._allMethods())._select_((function(each){
 return smalltalk.withContext(function($ctx2) {
 return _st(_st(each)._selector()).__eq(aString);
+}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._collect_((function(each){
+return smalltalk.withContext(function($ctx2) {
+return _st(self)._methodReferenceOn_(each);
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"implementorsOf:",{aString:aString},smalltalk.HLReferencesModel)})},
-messageSends: ["select:", "=", "selector", "allMethods"]}),
+messageSends: ["collect:", "methodReferenceOn:", "select:", "=", "selector", "allMethods"]}),
 smalltalk.HLReferencesModel);
 
 smalltalk.addMethod(
@@ -595,6 +705,20 @@ return true;
 messageSends: []}),
 smalltalk.HLReferencesModel);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "methodReferenceOn:",
+fn: function (aCompiledMethod){
+var self=this;
+function $HLMethodReference(){return smalltalk.HLMethodReference||(typeof HLMethodReference=="undefined"?nil:HLMethodReference)}
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+$1=_st($HLMethodReference())._on_(aCompiledMethod);
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"methodReferenceOn:",{aCompiledMethod:aCompiledMethod},smalltalk.HLReferencesModel)})},
+messageSends: ["on:"]}),
+smalltalk.HLReferencesModel);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "methodsCache",
@@ -621,13 +745,16 @@ fn: function (aString){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
-$1=_st(_st(self)._allMethods())._select_((function(each){
+$1=_st(_st(_st(self)._allMethods())._select_((function(each){
 return smalltalk.withContext(function($ctx2) {
 return _st(_st(each)._source())._match_(aString);
+}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._collect_((function(each){
+return smalltalk.withContext(function($ctx2) {
+return _st(self)._methodReferenceOn_(each);
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"regexpReferencesOf:",{aString:aString},smalltalk.HLReferencesModel)})},
-messageSends: ["select:", "match:", "source", "allMethods"]}),
+messageSends: ["collect:", "methodReferenceOn:", "select:", "match:", "source", "allMethods"]}),
 smalltalk.HLReferencesModel);
 
 smalltalk.addMethod(
@@ -654,13 +781,16 @@ fn: function (aString){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
-$1=_st(_st(self)._allMethods())._select_((function(each){
+$1=_st(_st(_st(self)._allMethods())._select_((function(each){
 return smalltalk.withContext(function($ctx2) {
 return _st(_st(each)._messageSends())._includes_(aString);
+}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._collect_((function(each){
+return smalltalk.withContext(function($ctx2) {
+return _st(self)._methodReferenceOn_(each);
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"sendersOf:",{aString:aString},smalltalk.HLReferencesModel)})},
-messageSends: ["select:", "includes:", "messageSends", "allMethods"]}),
+messageSends: ["collect:", "methodReferenceOn:", "select:", "includes:", "messageSends", "allMethods"]}),
 smalltalk.HLReferencesModel);
 
 smalltalk.addMethod(

+ 184 - 9
js/Helios-References.js

@@ -1,4 +1,151 @@
 smalltalk.addPackage('Helios-References');
+smalltalk.addClass('HLMethodReference', smalltalk.Object, ['selector', 'methodClass'], 'Helios-References');
+smalltalk.addMethod(
+smalltalk.method({
+selector: "initializeFromMethod:",
+category: 'initialization',
+fn: function (aCompiledMethod){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2;
+$1=self;
+_st($1)._selector_(_st(aCompiledMethod)._selector());
+$2=_st($1)._methodClass_(_st(aCompiledMethod)._methodClass());
+return self}, function($ctx1) {$ctx1.fill(self,"initializeFromMethod:",{aCompiledMethod:aCompiledMethod},smalltalk.HLMethodReference)})},
+args: ["aCompiledMethod"],
+source: "initializeFromMethod: aCompiledMethod\x0a\x09self\x0a\x09\x09selector: aCompiledMethod selector;\x0a\x09\x09methodClass: aCompiledMethod methodClass",
+messageSends: ["selector:", "selector", "methodClass:", "methodClass"],
+referencedClasses: []
+}),
+smalltalk.HLMethodReference);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "method",
+category: 'accessing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+$1=_st(_st(self)._methodClass())._methodAt_(_st(self)._selector());
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"method",{},smalltalk.HLMethodReference)})},
+args: [],
+source: "method\x0a\x09^ self methodClass methodAt: self selector",
+messageSends: ["methodAt:", "selector", "methodClass"],
+referencedClasses: []
+}),
+smalltalk.HLMethodReference);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "methodClass",
+category: 'accessing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+$1=self["@methodClass"];
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"methodClass",{},smalltalk.HLMethodReference)})},
+args: [],
+source: "methodClass\x0a\x09^ methodClass",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLMethodReference);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "methodClass:",
+category: 'accessing',
+fn: function (aClass){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+self["@methodClass"]=aClass;
+return self}, function($ctx1) {$ctx1.fill(self,"methodClass:",{aClass:aClass},smalltalk.HLMethodReference)})},
+args: ["aClass"],
+source: "methodClass: aClass\x0a\x09methodClass := aClass",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLMethodReference);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "selector",
+category: 'accessing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+$1=self["@selector"];
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"selector",{},smalltalk.HLMethodReference)})},
+args: [],
+source: "selector\x0a\x09^ selector",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLMethodReference);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "selector:",
+category: 'accessing',
+fn: function (aString){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+self["@selector"]=aString;
+return self}, function($ctx1) {$ctx1.fill(self,"selector:",{aString:aString},smalltalk.HLMethodReference)})},
+args: ["aString"],
+source: "selector: aString\x0a\x09selector := aString",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLMethodReference);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "source",
+category: 'accessing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+$1=_st(_st(self)._method())._source();
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"source",{},smalltalk.HLMethodReference)})},
+args: [],
+source: "source\x0a\x09^ self method source",
+messageSends: ["source", "method"],
+referencedClasses: []
+}),
+smalltalk.HLMethodReference);
+
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "on:",
+category: 'instance creation',
+fn: function (aCompiledMethod){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $2,$3,$1;
+$2=_st(self)._new();
+_st($2)._initializeFromMethod_(aCompiledMethod);
+$3=_st($2)._yourself();
+$1=$3;
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"on:",{aCompiledMethod:aCompiledMethod},smalltalk.HLMethodReference.klass)})},
+args: ["aCompiledMethod"],
+source: "on: aCompiledMethod\x0a\x09^ self new\x0a\x09\x09initializeFromMethod: aCompiledMethod;\x0a\x09\x09yourself",
+messageSends: ["initializeFromMethod:", "new", "yourself"],
+referencedClasses: []
+}),
+smalltalk.HLMethodReference.klass);
+
+
 smalltalk.addClass('HLReferences', smalltalk.HLWidget, ['model', 'sendersListWidget', 'implementorsListWidget', 'classReferencesListWidget', 'regexpListWidget', 'sourceCodeWidget'], 'Helios-References');
 smalltalk.addMethod(
 smalltalk.method({
@@ -756,15 +903,18 @@ fn: function (aString){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
-$1=_st(_st(self)._allMethods())._select_((function(each){
+$1=_st(_st(_st(self)._allMethods())._select_((function(each){
 return smalltalk.withContext(function($ctx2) {
 return _st(_st(each)._selector()).__eq(aString);
+}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._collect_((function(each){
+return smalltalk.withContext(function($ctx2) {
+return _st(self)._methodReferenceOn_(each);
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"implementorsOf:",{aString:aString},smalltalk.HLReferencesModel)})},
 args: ["aString"],
-source: "implementorsOf: aString\x0a\x09^ self allMethods select: [ :each |\x0a\x09\x09each selector = aString ]",
-messageSends: ["select:", "=", "selector", "allMethods"],
+source: "implementorsOf: aString\x0a\x09^ (self allMethods select: [ :each |\x0a\x09\x09each selector = aString ])\x0a\x09\x09\x09collect: [ :each | self methodReferenceOn: each ]",
+messageSends: ["collect:", "methodReferenceOn:", "select:", "=", "selector", "allMethods"],
 referencedClasses: []
 }),
 smalltalk.HLReferencesModel);
@@ -785,6 +935,25 @@ referencedClasses: []
 }),
 smalltalk.HLReferencesModel);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "methodReferenceOn:",
+category: 'accessing',
+fn: function (aCompiledMethod){
+var self=this;
+function $HLMethodReference(){return smalltalk.HLMethodReference||(typeof HLMethodReference=="undefined"?nil:HLMethodReference)}
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+$1=_st($HLMethodReference())._on_(aCompiledMethod);
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"methodReferenceOn:",{aCompiledMethod:aCompiledMethod},smalltalk.HLReferencesModel)})},
+args: ["aCompiledMethod"],
+source: "methodReferenceOn: aCompiledMethod\x0a\x09^ HLMethodReference on: aCompiledMethod",
+messageSends: ["on:"],
+referencedClasses: ["HLMethodReference"]
+}),
+smalltalk.HLReferencesModel);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "methodsCache",
@@ -817,15 +986,18 @@ fn: function (aString){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
-$1=_st(_st(self)._allMethods())._select_((function(each){
+$1=_st(_st(_st(self)._allMethods())._select_((function(each){
 return smalltalk.withContext(function($ctx2) {
 return _st(_st(each)._source())._match_(aString);
+}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._collect_((function(each){
+return smalltalk.withContext(function($ctx2) {
+return _st(self)._methodReferenceOn_(each);
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"regexpReferencesOf:",{aString:aString},smalltalk.HLReferencesModel)})},
 args: ["aString"],
-source: "regexpReferencesOf: aString\x0a\x09^ self allMethods select: [ :each |\x0a\x09\x09each source match: aString ]",
-messageSends: ["select:", "match:", "source", "allMethods"],
+source: "regexpReferencesOf: aString\x0a\x09^ (self allMethods select: [ :each |\x0a\x09\x09each source match: aString ])\x0a\x09\x09\x09collect: [ :each | self methodReferenceOn: each ]",
+messageSends: ["collect:", "methodReferenceOn:", "select:", "match:", "source", "allMethods"],
 referencedClasses: []
 }),
 smalltalk.HLReferencesModel);
@@ -860,15 +1032,18 @@ fn: function (aString){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
-$1=_st(_st(self)._allMethods())._select_((function(each){
+$1=_st(_st(_st(self)._allMethods())._select_((function(each){
 return smalltalk.withContext(function($ctx2) {
 return _st(_st(each)._messageSends())._includes_(aString);
+}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._collect_((function(each){
+return smalltalk.withContext(function($ctx2) {
+return _st(self)._methodReferenceOn_(each);
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"sendersOf:",{aString:aString},smalltalk.HLReferencesModel)})},
 args: ["aString"],
-source: "sendersOf: aString\x0a\x09^ self allMethods select: [ :each |\x0a\x09\x09each messageSends includes: aString ]",
-messageSends: ["select:", "includes:", "messageSends", "allMethods"],
+source: "sendersOf: aString\x0a\x09^ (self allMethods select: [ :each |\x0a\x09\x09each messageSends includes: aString ])\x0a\x09\x09\x09collect: [ :each | self methodReferenceOn: each ]",
+messageSends: ["collect:", "methodReferenceOn:", "select:", "includes:", "messageSends", "allMethods"],
 referencedClasses: []
 }),
 smalltalk.HLReferencesModel);

+ 105 - 13
st/Helios-Browser.st

@@ -661,7 +661,15 @@ HLFocusableWidget subclass: #HLDocumentationWidget
 !HLDocumentationWidget methodsFor: 'accessing'!
 
 documentation
-	^ self model selectedClass theNonMetaClass comment ifNil: [ self defaultDocumentation ]
+	^ self selectedItem 
+		ifNil: [ '' ]
+		ifNotNil: [ :item | item comment ifEmpty: [ self defaultDocumentation ] ]
+!
+
+head
+	^ self selectedItem 
+		ifNil: [ self defaultHead ]
+		ifNotNil: [ :item | item name ]
 !
 
 model
@@ -669,22 +677,86 @@ model
 !
 
 model: aModel
-	model := aModel
+	model := aModel.
+	self observeModel
+!
+
+selectedItem
+	^ self model selectedClass ifNotNil: [ :class | class theNonMetaClass ]
+! !
+
+!HLDocumentationWidget methodsFor: 'actions'!
+
+observeModel
+	self model announcer 
+		on: HLClassSelected
+		send: #onClassSelected:
+		to: self
+!
+
+selectClass: aClass
+	self model selectedClass: aClass
+!
+
+unregister
+	super unregister.
+	self model announcer unregister: self
 ! !
 
 !HLDocumentationWidget methodsFor: 'defaults'!
 
 defaultDocumentation
-	^ '#No documentation available. 
-##That''s bad. Seriously.'
+	^ 'No documentation available. 
+**That''s bad. Seriously.**'
+!
+
+defaultHead
+	^ 'No class selected'
+! !
+
+!HLDocumentationWidget methodsFor: 'reactions'!
+
+onClassSelected: anAnnouncement
+	self refresh
 ! !
 
 !HLDocumentationWidget methodsFor: 'rendering'!
 
 renderContentOn: html
-	(html div 
-		class: 'markdown';
-		asJQuery) html: ((Showdown at: 'converter') new makeHtml: self documentation)
+	html div 
+		class: 'doc';
+		with: [
+			self 
+				renderHeadOn: html;
+				renderDocOn: html ]
+!
+
+renderDocOn: html
+	self selectedItem ifNotNil: [
+		self renderInheritanceOn: html.
+		html h1 with: 'Overview'.
+		(html div 
+			class: 'markdown';
+			asJQuery) html: ((Showdown at: 'converter') new makeHtml: self documentation) ]
+!
+
+renderHeadOn: html
+	html div 
+		class: 'head';
+		with: self head
+!
+
+renderInheritanceOn: html
+	html div 	
+		class: 'inheritance';
+		with: [
+			html with: 'Subclass of '.
+			self selectedItem superclass 
+				ifNil: [ html em with: 'nil' ]
+				ifNotNil: [
+					html a 
+						with: self selectedItem superclass name;
+						onClick: [ self selectClass: self selectedItem superclass ] ] ]
 ! !
 
 HLToolListWidget subclass: #HLMethodsListWidget
@@ -768,6 +840,10 @@ observeModel
 		send: #onShowInstanceToggled
 		to: self;
 		
+		on: HLShowCommentToggled 
+		send: #onShowCommentToggled
+		to: self;
+		
 		on: HLMethodSelected 
 		send: #onMethodSelected:
 		to: self;
@@ -896,6 +972,10 @@ onProtocolSelected: anAnnouncement
     self refresh
 !
 
+onShowCommentToggled
+	self onProtocolSelected: nil
+!
+
 onShowInstanceToggled
 	self onProtocolSelected: nil
 ! !
@@ -1034,6 +1114,10 @@ HLToolListWidget subclass: #HLProtocolsListWidget
 
 !HLProtocolsListWidget methodsFor: 'accessing'!
 
+allProtocol
+	^ self model allProtocol
+!
+
 label
 	^ 'Protocols'
 !
@@ -1054,6 +1138,10 @@ observeModel
 		send: #onClassSelected:
 		to: self;
 		
+		on: HLShowCommentToggled 
+		send: #onShowCommentToggled
+		to: self;
+		
     	on: HLProtocolSelected
 		send: #onProtocolSelected:
 		to: self;
@@ -1078,15 +1166,12 @@ selectItem: aString
     self model selectedProtocol: aString
 ! !
 
-!HLProtocolsListWidget methodsFor: 'foo'!
-
-allProtocol
-	^ self model allProtocol
-! !
-
 !HLProtocolsListWidget methodsFor: 'private'!
 
 setItemsForClass: aClass
+	self model showComment ifTrue: [
+		^ self items: #() ].
+		
 	self items: (aClass
     	ifNil: [ Array with: self allProtocol ]
       	ifNotNil: [ 
@@ -1153,6 +1238,13 @@ onProtocolSelected: anAnnouncement
 
 onProtocolsFocusRequested
 	self focus
+!
+
+onShowCommentToggled
+	self 
+		selectItem: nil;
+		setItemsForSelectedClass;
+    	refresh
 ! !
 
 !HLProtocolsListWidget methodsFor: 'rendering'!

+ 59 - 6
st/Helios-References.st

@@ -1,4 +1,50 @@
 Smalltalk current createPackage: 'Helios-References'!
+Object subclass: #HLMethodReference
+	instanceVariableNames: 'selector methodClass'
+	package: 'Helios-References'!
+
+!HLMethodReference methodsFor: 'accessing'!
+
+method
+	^ self methodClass methodAt: self selector
+!
+
+methodClass
+	^ methodClass
+!
+
+methodClass: aClass
+	methodClass := aClass
+!
+
+selector
+	^ selector
+!
+
+selector: aString
+	selector := aString
+!
+
+source
+	^ self method source
+! !
+
+!HLMethodReference methodsFor: 'initialization'!
+
+initializeFromMethod: aCompiledMethod
+	self
+		selector: aCompiledMethod selector;
+		methodClass: aCompiledMethod methodClass
+! !
+
+!HLMethodReference class methodsFor: 'instance creation'!
+
+on: aCompiledMethod
+	^ self new
+		initializeFromMethod: aCompiledMethod;
+		yourself
+! !
+
 HLWidget subclass: #HLReferences
 	instanceVariableNames: 'model sendersListWidget implementorsListWidget classReferencesListWidget regexpListWidget sourceCodeWidget'
 	package: 'Helios-References'!
@@ -264,18 +310,25 @@ classesAndMetaclasses
 !
 
 implementorsOf: aString
-	^ self allMethods select: [ :each |
-		each selector = aString ]
+	^ (self allMethods select: [ :each |
+		each selector = aString ])
+			collect: [ :each | self methodReferenceOn: each ]
+!
+
+methodReferenceOn: aCompiledMethod
+	^ HLMethodReference on: aCompiledMethod
 !
 
 regexpReferencesOf: aString
-	^ self allMethods select: [ :each |
-		each source match: aString ]
+	^ (self allMethods select: [ :each |
+		each source match: aString ])
+			collect: [ :each | self methodReferenceOn: each ]
 !
 
 sendersOf: aString
-	^ self allMethods select: [ :each |
-		each messageSends includes: aString ]
+	^ (self allMethods select: [ :each |
+		each messageSends includes: aString ])
+			collect: [ :each | self methodReferenceOn: each ]
 ! !
 
 !HLReferencesModel methodsFor: 'actions'!