Browse Source

Helios: Source code widget refactorings

Nicolas Petton 11 years ago
parent
commit
337fff6f6f

+ 1 - 1
css/helios.css

@@ -402,7 +402,7 @@ i {
 }
 
 .key_helper .command {
-    padding: 0 10px;
+    padding: 0 2px;
 }
 
 .key_helper .label {

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

@@ -197,12 +197,12 @@ smalltalk.method({
 selector: "sourceWidget",
 fn: function (){
 var self=this;
-function $HLSourceCodeWidget(){return smalltalk.HLSourceCodeWidget||(typeof HLSourceCodeWidget=="undefined"?nil:HLSourceCodeWidget)}
+function $HLBrowserCodeWidget(){return smalltalk.HLBrowserCodeWidget||(typeof HLBrowserCodeWidget=="undefined"?nil:HLBrowserCodeWidget)}
 return smalltalk.withContext(function($ctx1) { 
 var $2,$3,$4,$1;
 $2=self["@sourceWidget"];
 if(($receiver = $2) == nil || $receiver == undefined){
-$3=_st($HLSourceCodeWidget())._new();
+$3=_st($HLBrowserCodeWidget())._new();
 _st($3)._browserModel_(_st(self)._model());
 $4=_st($3)._yourself();
 self["@sourceWidget"]=$4;
@@ -3080,6 +3080,64 @@ messageSends: ["theClass:", "new", "selectorsCache:", "yourself"]}),
 smalltalk.HLClassCache.klass);
 
 
+smalltalk.addClass('HLDocumentationWidget', smalltalk.HLFocusableWidget, ['documentation'], 'Helios-Browser');
+smalltalk.addMethod(
+smalltalk.method({
+selector: "defaultDocumentation",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+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: "documentation",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $2,$1;
+$2=self["@documentation"];
+if(($receiver = $2) == nil || $receiver == undefined){
+$1=_st(self)._defaultDocumentation();
+} else {
+$1=$2;
+};
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"documentation",{},smalltalk.HLDocumentationWidget)})},
+messageSends: ["ifNil:", "defaultDocumentation"]}),
+smalltalk.HLDocumentationWidget);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "documentation:",
+fn: function (aString){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+self["@documentation"]=aString;
+return self}, function($ctx1) {$ctx1.fill(self,"documentation:",{aString:aString},smalltalk.HLDocumentationWidget)})},
+messageSends: []}),
+smalltalk.HLDocumentationWidget);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "renderContentOn:",
+fn: function (html){
+var self=this;
+function $Showdown(){return smalltalk.Showdown||(typeof Showdown=="undefined"?nil:Showdown)}
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2;
+$1=_st(html)._div();
+_st($1)._class_("markdown");
+$2=_st($1)._with_(_st($Showdown())._makeHtml_(_st(self)._documentation()));
+return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLDocumentationWidget)})},
+messageSends: ["class:", "div", "with:", "makeHtml:", "documentation"]}),
+smalltalk.HLDocumentationWidget);
+
+
+
 smalltalk.addClass('HLSelectorsCache', smalltalk.Object, ['classesCache'], 'Helios-Browser');
 smalltalk.addMethod(
 smalltalk.method({

+ 82 - 4
js/Helios-Browser.js

@@ -258,12 +258,12 @@ selector: "sourceWidget",
 category: 'widgets',
 fn: function (){
 var self=this;
-function $HLSourceCodeWidget(){return smalltalk.HLSourceCodeWidget||(typeof HLSourceCodeWidget=="undefined"?nil:HLSourceCodeWidget)}
+function $HLBrowserCodeWidget(){return smalltalk.HLBrowserCodeWidget||(typeof HLBrowserCodeWidget=="undefined"?nil:HLBrowserCodeWidget)}
 return smalltalk.withContext(function($ctx1) { 
 var $2,$3,$4,$1;
 $2=self["@sourceWidget"];
 if(($receiver = $2) == nil || $receiver == undefined){
-$3=_st($HLSourceCodeWidget())._new();
+$3=_st($HLBrowserCodeWidget())._new();
 _st($3)._browserModel_(_st(self)._model());
 $4=_st($3)._yourself();
 self["@sourceWidget"]=$4;
@@ -274,9 +274,9 @@ $1=$2;
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"sourceWidget",{},smalltalk.HLBrowser)})},
 args: [],
-source: "sourceWidget\x0a\x09^ sourceWidget ifNil: [\x0a      \x09sourceWidget := HLSourceCodeWidget new\x0a\x09\x09\x09browserModel: self model;\x0a\x09\x09\x09yourself ]",
+source: "sourceWidget\x0a\x09^ sourceWidget ifNil: [\x0a      \x09sourceWidget := HLBrowserCodeWidget new\x0a\x09\x09\x09browserModel: self model;\x0a\x09\x09\x09yourself ]",
 messageSends: ["ifNil:", "browserModel:", "model", "new", "yourself"],
-referencedClasses: ["HLSourceCodeWidget"]
+referencedClasses: ["HLBrowserCodeWidget"]
 }),
 smalltalk.HLBrowser);
 
@@ -3965,6 +3965,84 @@ referencedClasses: []
 smalltalk.HLClassCache.klass);
 
 
+smalltalk.addClass('HLDocumentationWidget', smalltalk.HLFocusableWidget, ['documentation'], 'Helios-Browser');
+smalltalk.addMethod(
+smalltalk.method({
+selector: "defaultDocumentation",
+category: 'defaults',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+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.'",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLDocumentationWidget);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "documentation",
+category: 'accessing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $2,$1;
+$2=self["@documentation"];
+if(($receiver = $2) == nil || $receiver == undefined){
+$1=_st(self)._defaultDocumentation();
+} else {
+$1=$2;
+};
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"documentation",{},smalltalk.HLDocumentationWidget)})},
+args: [],
+source: "documentation\x0a\x09^ documentation ifNil: [ self defaultDocumentation ]",
+messageSends: ["ifNil:", "defaultDocumentation"],
+referencedClasses: []
+}),
+smalltalk.HLDocumentationWidget);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "documentation:",
+category: 'accessing',
+fn: function (aString){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+self["@documentation"]=aString;
+return self}, function($ctx1) {$ctx1.fill(self,"documentation:",{aString:aString},smalltalk.HLDocumentationWidget)})},
+args: ["aString"],
+source: "documentation: aString\x0a\x09documentation := aString",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLDocumentationWidget);
+
+smalltalk.addMethod(
+smalltalk.method({
+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;
+$1=_st(html)._div();
+_st($1)._class_("markdown");
+$2=_st($1)._with_(_st($Showdown())._makeHtml_(_st(self)._documentation()));
+return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLDocumentationWidget)})},
+args: ["html"],
+source: "renderContentOn: html\x0a\x09html div \x0a\x09\x09class: 'markdown';\x0a\x09\x09with: (Showdown makeHtml: self documentation)",
+messageSends: ["class:", "div", "with:", "makeHtml:", "documentation"],
+referencedClasses: ["Showdown"]
+}),
+smalltalk.HLDocumentationWidget);
+
+
+
 smalltalk.addClass('HLSelectorsCache', smalltalk.Object, ['classesCache'], 'Helios-Browser');
 smalltalk.addMethod(
 smalltalk.method({

+ 3 - 3
js/Helios-References.deploy.js

@@ -162,19 +162,19 @@ smalltalk.method({
 selector: "sourceCodeWidget",
 fn: function (){
 var self=this;
-function $HLSourceCodeWidget(){return smalltalk.HLSourceCodeWidget||(typeof HLSourceCodeWidget=="undefined"?nil:HLSourceCodeWidget)}
+function $HLNavigationCodeWidget(){return smalltalk.HLNavigationCodeWidget||(typeof HLNavigationCodeWidget=="undefined"?nil:HLNavigationCodeWidget)}
 return smalltalk.withContext(function($ctx1) { 
 var $2,$1;
 $2=self["@sourceCodeWidget"];
 if(($receiver = $2) == nil || $receiver == undefined){
-self["@sourceCodeWidget"]=_st($HLSourceCodeWidget())._on_(_st(self)._model());
+self["@sourceCodeWidget"]=_st($HLNavigationCodeWidget())._new();
 $1=self["@sourceCodeWidget"];
 } else {
 $1=$2;
 };
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"sourceCodeWidget",{},smalltalk.HLReferences)})},
-messageSends: ["ifNil:", "on:", "model"]}),
+messageSends: ["ifNil:", "new"]}),
 smalltalk.HLReferences);
 
 

+ 5 - 5
js/Helios-References.js

@@ -208,12 +208,12 @@ selector: "sourceCodeWidget",
 category: 'accessing',
 fn: function (){
 var self=this;
-function $HLSourceCodeWidget(){return smalltalk.HLSourceCodeWidget||(typeof HLSourceCodeWidget=="undefined"?nil:HLSourceCodeWidget)}
+function $HLNavigationCodeWidget(){return smalltalk.HLNavigationCodeWidget||(typeof HLNavigationCodeWidget=="undefined"?nil:HLNavigationCodeWidget)}
 return smalltalk.withContext(function($ctx1) { 
 var $2,$1;
 $2=self["@sourceCodeWidget"];
 if(($receiver = $2) == nil || $receiver == undefined){
-self["@sourceCodeWidget"]=_st($HLSourceCodeWidget())._on_(_st(self)._model());
+self["@sourceCodeWidget"]=_st($HLNavigationCodeWidget())._new();
 $1=self["@sourceCodeWidget"];
 } else {
 $1=$2;
@@ -221,9 +221,9 @@ $1=$2;
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"sourceCodeWidget",{},smalltalk.HLReferences)})},
 args: [],
-source: "sourceCodeWidget\x0a\x09^ sourceCodeWidget ifNil: [\x0a      \x09sourceCodeWidget := HLSourceCodeWidget on: self model ]",
-messageSends: ["ifNil:", "on:", "model"],
-referencedClasses: ["HLSourceCodeWidget"]
+source: "sourceCodeWidget\x0a\x09^ sourceCodeWidget ifNil: [\x0a      \x09sourceCodeWidget := HLNavigationCodeWidget new ]",
+messageSends: ["ifNil:", "new"],
+referencedClasses: ["HLNavigationCodeWidget"]
 }),
 smalltalk.HLReferences);
 

+ 19 - 19
js/Helios-Workspace.deploy.js

@@ -882,7 +882,7 @@ messageSends: ["browserModel:", "new", "yourself"]}),
 smalltalk.HLNavigationCodeWidget.klass);
 
 
-smalltalk.addClass('HLSourceCodeWidget', smalltalk.HLNavigationCodeWidget, ['browserModel'], 'Helios-Workspace');
+smalltalk.addClass('HLBrowserCodeWidget', smalltalk.HLNavigationCodeWidget, ['browserModel'], 'Helios-Workspace');
 smalltalk.addMethod(
 smalltalk.method({
 selector: "browserModel",
@@ -894,7 +894,7 @@ $1=self["@browserModel"];
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"browserModel",{},smalltalk.HLSourceCodeWidget)})},
 messageSends: []}),
-smalltalk.HLSourceCodeWidget);
+smalltalk.HLBrowserCodeWidget);
 
 smalltalk.addMethod(
 smalltalk.method({
@@ -909,7 +909,7 @@ _st($1)._observeSystem();
 $2=_st($1)._observeBrowserModel();
 return self}, function($ctx1) {$ctx1.fill(self,"browserModel:",{aBrowserModel:aBrowserModel},smalltalk.HLSourceCodeWidget)})},
 messageSends: ["observeSystem", "observeBrowserModel"]}),
-smalltalk.HLSourceCodeWidget);
+smalltalk.HLBrowserCodeWidget);
 
 smalltalk.addMethod(
 smalltalk.method({
@@ -966,7 +966,7 @@ return _st(self)._onSourceCodeFocusRequested();
 }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
 return self}, function($ctx1) {$ctx1.fill(self,"observeBrowserModel",{},smalltalk.HLSourceCodeWidget)})},
 messageSends: ["on:do:", "onSaveIt", "announcer", "browserModel", "onParseError:", "onCompileError:", "error", "onUnknownVariableError:", "onInstVarAdded", "onMethodSelected:", "item", "onClassSelected:", "onProtocolSelected:", "onSourceCodeFocusRequested"]}),
-smalltalk.HLSourceCodeWidget);
+smalltalk.HLBrowserCodeWidget);
 
 smalltalk.addMethod(
 smalltalk.method({
@@ -1003,7 +1003,7 @@ 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.HLSourceCodeWidget);
+smalltalk.HLBrowserCodeWidget);
 
 smalltalk.addMethod(
 smalltalk.method({
@@ -1022,7 +1022,7 @@ $1;
 _st(self)._contents_(_st(aClass)._definition());
 return self}, function($ctx1) {$ctx1.fill(self,"onClassSelected:",{aClass:aClass},smalltalk.HLSourceCodeWidget)})},
 messageSends: ["ifNil:", "contents:", "definition"]}),
-smalltalk.HLSourceCodeWidget);
+smalltalk.HLBrowserCodeWidget);
 
 smalltalk.addMethod(
 smalltalk.method({
@@ -1033,7 +1033,7 @@ 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"]}),
-smalltalk.HLSourceCodeWidget);
+smalltalk.HLBrowserCodeWidget);
 
 smalltalk.addMethod(
 smalltalk.method({
@@ -1044,7 +1044,7 @@ return smalltalk.withContext(function($ctx1) {
 _st(_st(self)._browserModel())._save_(_st(self)._contents());
 return self}, function($ctx1) {$ctx1.fill(self,"onInstVarAdded",{},smalltalk.HLSourceCodeWidget)})},
 messageSends: ["save:", "contents", "browserModel"]}),
-smalltalk.HLSourceCodeWidget);
+smalltalk.HLBrowserCodeWidget);
 
 smalltalk.addMethod(
 smalltalk.method({
@@ -1073,7 +1073,7 @@ return $6;
 _st(self)._refresh();
 return self}, function($ctx1) {$ctx1.fill(self,"onMethodModified:",{aMethod:aMethod},smalltalk.HLSourceCodeWidget)})},
 messageSends: ["ifFalse:", "=", "methodClass", "selectedClass", "browserModel", "ifNil:", "selectedMethod", "selector", "refresh"]}),
-smalltalk.HLSourceCodeWidget);
+smalltalk.HLBrowserCodeWidget);
 
 smalltalk.addMethod(
 smalltalk.method({
@@ -1092,7 +1092,7 @@ $1;
 _st(self)._contents_(_st(aCompiledMethod)._source());
 return self}, function($ctx1) {$ctx1.fill(self,"onMethodSelected:",{aCompiledMethod:aCompiledMethod},smalltalk.HLSourceCodeWidget)})},
 messageSends: ["ifNil:", "contents:", "source"]}),
-smalltalk.HLSourceCodeWidget);
+smalltalk.HLBrowserCodeWidget);
 
 smalltalk.addMethod(
 smalltalk.method({
@@ -1127,7 +1127,7 @@ return lineIndex;
 }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})})));
 return self}, function($ctx1) {$ctx1.fill(self,"onParseError:",{anAnnouncement:anAnnouncement,lineIndex:lineIndex,newContents:newContents},smalltalk.HLSourceCodeWidget)})},
 messageSends: ["contents:", "streamContents:", "linesDo:", "ifTrue:ifFalse:", "nextPutAll:", "copyFrom:to:", "column", "message", "+", "size", "=", "line", "cr", "contents"]}),
-smalltalk.HLSourceCodeWidget);
+smalltalk.HLBrowserCodeWidget);
 
 smalltalk.addMethod(
 smalltalk.method({
@@ -1146,7 +1146,7 @@ $1;
 _st(self)._contents_(_st(_st(_st(self)._browserModel())._selectedClass())._definition());
 return self}, function($ctx1) {$ctx1.fill(self,"onProtocolSelected:",{aString:aString},smalltalk.HLSourceCodeWidget)})},
 messageSends: ["ifNil:", "contents:", "selectedClass", "browserModel", "definition"]}),
-smalltalk.HLSourceCodeWidget);
+smalltalk.HLBrowserCodeWidget);
 
 smalltalk.addMethod(
 smalltalk.method({
@@ -1157,7 +1157,7 @@ return smalltalk.withContext(function($ctx1) {
 _st(_st(self)._browserModel())._save_(_st(self)._contents());
 return self}, function($ctx1) {$ctx1.fill(self,"onSaveIt",{},smalltalk.HLSourceCodeWidget)})},
 messageSends: ["save:", "contents", "browserModel"]}),
-smalltalk.HLSourceCodeWidget);
+smalltalk.HLBrowserCodeWidget);
 
 smalltalk.addMethod(
 smalltalk.method({
@@ -1168,7 +1168,7 @@ return smalltalk.withContext(function($ctx1) {
 _st(self)._focus();
 return self}, function($ctx1) {$ctx1.fill(self,"onSourceCodeFocusRequested",{},smalltalk.HLSourceCodeWidget)})},
 messageSends: ["focus"]}),
-smalltalk.HLSourceCodeWidget);
+smalltalk.HLBrowserCodeWidget);
 
 smalltalk.addMethod(
 smalltalk.method({
@@ -1195,7 +1195,7 @@ return $4;
 _st(_st(self)._browserModel())._addInstVarNamed_(_st(anError)._variableName());
 return self}, function($ctx1) {$ctx1.fill(self,"onUnknownVariableError:",{anError:anError,confirm:confirm},smalltalk.HLSourceCodeWidget)})},
 messageSends: ["confirm:", "streamContents:", "nextPutAll:", "messageText", "cr", "ifFalse:", "addInstVarNamed:", "variableName", "browserModel"]}),
-smalltalk.HLSourceCodeWidget);
+smalltalk.HLBrowserCodeWidget);
 
 smalltalk.addMethod(
 smalltalk.method({
@@ -1217,7 +1217,7 @@ return $4;
 _st(self)._contents_(_st(_st(_st(self)._model())._selectedMethod())._source());
 return self}, function($ctx1) {$ctx1.fill(self,"refresh",{},smalltalk.HLSourceCodeWidget)})},
 messageSends: ["ifTrue:", "hasModification", "hasFocus", "contents:", "source", "selectedMethod", "model"]}),
-smalltalk.HLSourceCodeWidget);
+smalltalk.HLBrowserCodeWidget);
 
 smalltalk.addMethod(
 smalltalk.method({
@@ -1228,7 +1228,7 @@ return smalltalk.withContext(function($ctx1) {
 _st(_st(self)._browserModel())._saveSourceCode();
 return self}, function($ctx1) {$ctx1.fill(self,"saveIt",{},smalltalk.HLSourceCodeWidget)})},
 messageSends: ["saveSourceCode", "browserModel"]}),
-smalltalk.HLSourceCodeWidget);
+smalltalk.HLBrowserCodeWidget);
 
 
 smalltalk.addMethod(
@@ -1240,7 +1240,7 @@ return smalltalk.withContext(function($ctx1) {
 return false;
 }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLSourceCodeWidget.klass)})},
 messageSends: []}),
-smalltalk.HLSourceCodeWidget.klass);
+smalltalk.HLBrowserCodeWidget.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
@@ -1256,7 +1256,7 @@ $1=$3;
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"on:",{aBrowserModel:aBrowserModel},smalltalk.HLSourceCodeWidget.klass)})},
 messageSends: ["browserModel:", "new", "yourself"]}),
-smalltalk.HLSourceCodeWidget.klass);
+smalltalk.HLBrowserCodeWidget.klass);
 
 
 smalltalk.addClass('HLWorkspace', smalltalk.HLWidget, ['codeWidget'], 'Helios-Workspace');

+ 19 - 19
js/Helios-Workspace.js

@@ -1182,7 +1182,7 @@ referencedClasses: []
 smalltalk.HLNavigationCodeWidget.klass);
 
 
-smalltalk.addClass('HLSourceCodeWidget', smalltalk.HLNavigationCodeWidget, ['browserModel'], 'Helios-Workspace');
+smalltalk.addClass('HLBrowserCodeWidget', smalltalk.HLNavigationCodeWidget, ['browserModel'], 'Helios-Workspace');
 smalltalk.addMethod(
 smalltalk.method({
 selector: "browserModel",
@@ -1199,7 +1199,7 @@ source: "browserModel\x0a\x09^ browserModel",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLSourceCodeWidget);
+smalltalk.HLBrowserCodeWidget);
 
 smalltalk.addMethod(
 smalltalk.method({
@@ -1219,7 +1219,7 @@ source: "browserModel: aBrowserModel\x0a\x09browserModel := aBrowserModel.\x0a\x
 messageSends: ["observeSystem", "observeBrowserModel"],
 referencedClasses: []
 }),
-smalltalk.HLSourceCodeWidget);
+smalltalk.HLBrowserCodeWidget);
 
 smalltalk.addMethod(
 smalltalk.method({
@@ -1281,7 +1281,7 @@ source: "observeBrowserModel\x0a\x09self browserModel announcer\x0a\x09\x09on: H
 messageSends: ["on:do:", "onSaveIt", "announcer", "browserModel", "onParseError:", "onCompileError:", "error", "onUnknownVariableError:", "onInstVarAdded", "onMethodSelected:", "item", "onClassSelected:", "onProtocolSelected:", "onSourceCodeFocusRequested"],
 referencedClasses: ["HLSaveSourceCode", "HLParseErrorRaised", "HLCompileErrorRaised", "HLUnknownVariableErrorRaised", "HLInstVarAdded", "HLMethodSelected", "HLClassSelected", "HLProtocolSelected", "HLSourceCodeFocusRequested"]
 }),
-smalltalk.HLSourceCodeWidget);
+smalltalk.HLBrowserCodeWidget);
 
 smalltalk.addMethod(
 smalltalk.method({
@@ -1323,7 +1323,7 @@ source: "observeSystem\x0a\x09self browserModel systemAnnouncer\x0a    \x09on: M
 messageSends: ["on:do:", "onMethodModified:", "method", "systemAnnouncer", "browserModel", "onMethodSelected:", "item", "onClassSelected:", "onProtocolSelected:", "onSourceCodeFocusRequested"],
 referencedClasses: ["MethodModified", "HLMethodSelected", "HLClassSelected", "HLProtocolSelected", "HLSourceCodeFocusRequested"]
 }),
-smalltalk.HLSourceCodeWidget);
+smalltalk.HLBrowserCodeWidget);
 
 smalltalk.addMethod(
 smalltalk.method({
@@ -1347,7 +1347,7 @@ source: "onClassSelected: aClass\x0a\x09aClass ifNil: [ ^ self contents: '' ].\x
 messageSends: ["ifNil:", "contents:", "definition"],
 referencedClasses: []
 }),
-smalltalk.HLSourceCodeWidget);
+smalltalk.HLBrowserCodeWidget);
 
 smalltalk.addMethod(
 smalltalk.method({
@@ -1363,7 +1363,7 @@ source: "onCompileError: anError\x0a\x09self alert: anError messageText",
 messageSends: ["alert:", "messageText"],
 referencedClasses: []
 }),
-smalltalk.HLSourceCodeWidget);
+smalltalk.HLBrowserCodeWidget);
 
 smalltalk.addMethod(
 smalltalk.method({
@@ -1379,7 +1379,7 @@ source: "onInstVarAdded\x0a\x09self  browserModel save: self contents",
 messageSends: ["save:", "contents", "browserModel"],
 referencedClasses: []
 }),
-smalltalk.HLSourceCodeWidget);
+smalltalk.HLBrowserCodeWidget);
 
 smalltalk.addMethod(
 smalltalk.method({
@@ -1413,7 +1413,7 @@ source: "onMethodModified: aMethod\x0a\x09self browserModel selectedClass = aMet
 messageSends: ["ifFalse:", "=", "methodClass", "selectedClass", "browserModel", "ifNil:", "selectedMethod", "selector", "refresh"],
 referencedClasses: []
 }),
-smalltalk.HLSourceCodeWidget);
+smalltalk.HLBrowserCodeWidget);
 
 smalltalk.addMethod(
 smalltalk.method({
@@ -1437,7 +1437,7 @@ source: "onMethodSelected: aCompiledMethod\x0a\x09aCompiledMethod ifNil: [ ^ sel
 messageSends: ["ifNil:", "contents:", "source"],
 referencedClasses: []
 }),
-smalltalk.HLSourceCodeWidget);
+smalltalk.HLBrowserCodeWidget);
 
 smalltalk.addMethod(
 smalltalk.method({
@@ -1477,7 +1477,7 @@ source: "onParseError: anAnnouncement\x0a\x09| lineIndex newContents |\x0a\x09\x
 messageSends: ["contents:", "streamContents:", "linesDo:", "ifTrue:ifFalse:", "nextPutAll:", "copyFrom:to:", "column", "message", "+", "size", "=", "line", "cr", "contents"],
 referencedClasses: ["String"]
 }),
-smalltalk.HLSourceCodeWidget);
+smalltalk.HLBrowserCodeWidget);
 
 smalltalk.addMethod(
 smalltalk.method({
@@ -1501,7 +1501,7 @@ source: "onProtocolSelected: aString\x0a\x09self browserModel selectedClass ifNi
 messageSends: ["ifNil:", "contents:", "selectedClass", "browserModel", "definition"],
 referencedClasses: []
 }),
-smalltalk.HLSourceCodeWidget);
+smalltalk.HLBrowserCodeWidget);
 
 smalltalk.addMethod(
 smalltalk.method({
@@ -1517,7 +1517,7 @@ source: "onSaveIt\x0a\x09self browserModel save: self contents",
 messageSends: ["save:", "contents", "browserModel"],
 referencedClasses: []
 }),
-smalltalk.HLSourceCodeWidget);
+smalltalk.HLBrowserCodeWidget);
 
 smalltalk.addMethod(
 smalltalk.method({
@@ -1533,7 +1533,7 @@ source: "onSourceCodeFocusRequested\x0a\x09self focus",
 messageSends: ["focus"],
 referencedClasses: []
 }),
-smalltalk.HLSourceCodeWidget);
+smalltalk.HLBrowserCodeWidget);
 
 smalltalk.addMethod(
 smalltalk.method({
@@ -1565,7 +1565,7 @@ source: "onUnknownVariableError: anError\x0a\x09| confirm |\x0a\x0a\x09confirm :
 messageSends: ["confirm:", "streamContents:", "nextPutAll:", "messageText", "cr", "ifFalse:", "addInstVarNamed:", "variableName", "browserModel"],
 referencedClasses: ["String"]
 }),
-smalltalk.HLSourceCodeWidget);
+smalltalk.HLBrowserCodeWidget);
 
 smalltalk.addMethod(
 smalltalk.method({
@@ -1592,7 +1592,7 @@ source: "refresh\x0a\x09self hasModification ifTrue: [ ^ self ].\x0a    self has
 messageSends: ["ifTrue:", "hasModification", "hasFocus", "contents:", "source", "selectedMethod", "model"],
 referencedClasses: []
 }),
-smalltalk.HLSourceCodeWidget);
+smalltalk.HLBrowserCodeWidget);
 
 smalltalk.addMethod(
 smalltalk.method({
@@ -1608,7 +1608,7 @@ source: "saveIt\x0a\x09self browserModel saveSourceCode",
 messageSends: ["saveSourceCode", "browserModel"],
 referencedClasses: []
 }),
-smalltalk.HLSourceCodeWidget);
+smalltalk.HLBrowserCodeWidget);
 
 
 smalltalk.addMethod(
@@ -1625,7 +1625,7 @@ source: "canBeOpenAsTab\x0a\x09^ false",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLSourceCodeWidget.klass);
+smalltalk.HLBrowserCodeWidget.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
@@ -1646,7 +1646,7 @@ source: "on: aBrowserModel\x0a\x09^ self new\x0a\x09\x09browserModel: aBrowserMo
 messageSends: ["browserModel:", "new", "yourself"],
 referencedClasses: []
 }),
-smalltalk.HLSourceCodeWidget.klass);
+smalltalk.HLBrowserCodeWidget.klass);
 
 
 smalltalk.addClass('HLWorkspace', smalltalk.HLWidget, ['codeWidget'], 'Helios-Workspace');

+ 30 - 1
st/Helios-Browser.st

@@ -85,7 +85,7 @@ protocolsListWidget
 
 sourceWidget
 	^ sourceWidget ifNil: [
-      	sourceWidget := HLSourceCodeWidget new
+      	sourceWidget := HLBrowserCodeWidget new
 			browserModel: self model;
 			yourself ]
 ! !
@@ -1314,6 +1314,35 @@ on: aClass selectorsCache: aSelectorsCache
         yourself
 ! !
 
+HLFocusableWidget subclass: #HLDocumentationWidget
+	instanceVariableNames: 'documentation'
+	package: 'Helios-Browser'!
+
+!HLDocumentationWidget methodsFor: 'accessing'!
+
+documentation
+	^ documentation ifNil: [ self defaultDocumentation ]
+!
+
+documentation: aString
+	documentation := aString
+! !
+
+!HLDocumentationWidget methodsFor: 'defaults'!
+
+defaultDocumentation
+	^ '#No documentation available. 
+##That''s bad. Seriously.'
+! !
+
+!HLDocumentationWidget methodsFor: 'rendering'!
+
+renderContentOn: html
+	html div 
+		class: 'markdown';
+		with: (Showdown makeHtml: self documentation)
+! !
+
 Object subclass: #HLSelectorsCache
 	instanceVariableNames: 'classesCache'
 	package: 'Helios-Browser'!

+ 1 - 1
st/Helios-References.st

@@ -42,7 +42,7 @@ sendersListWidget
 
 sourceCodeWidget
 	^ sourceCodeWidget ifNil: [
-      	sourceCodeWidget := HLSourceCodeWidget on: self model ]
+      	sourceCodeWidget := HLNavigationCodeWidget new ]
 ! !
 
 !HLReferences methodsFor: 'actions'!

+ 6 - 6
st/Helios-Workspace.st

@@ -444,11 +444,11 @@ canBeOpenAsTab
 	^ false
 ! !
 
-HLNavigationCodeWidget subclass: #HLSourceCodeWidget
+HLNavigationCodeWidget subclass: #HLBrowserCodeWidget
 	instanceVariableNames: 'browserModel'
 	package: 'Helios-Workspace'!
 
-!HLSourceCodeWidget methodsFor: 'accessing'!
+!HLBrowserCodeWidget methodsFor: 'accessing'!
 
 browserModel
 	^ browserModel
@@ -461,7 +461,7 @@ browserModel: aBrowserModel
 		observeBrowserModel
 ! !
 
-!HLSourceCodeWidget methodsFor: 'actions'!
+!HLBrowserCodeWidget methodsFor: 'actions'!
 
 observeBrowserModel
 	self browserModel announcer
@@ -510,7 +510,7 @@ saveIt
 	self browserModel saveSourceCode
 ! !
 
-!HLSourceCodeWidget methodsFor: 'reactions'!
+!HLBrowserCodeWidget methodsFor: 'reactions'!
 
 onClassSelected: aClass
 	aClass ifNil: [ ^ self contents: '' ].
@@ -588,7 +588,7 @@ onUnknownVariableError: anError
 	self browserModel addInstVarNamed: anError variableName
 ! !
 
-!HLSourceCodeWidget class methodsFor: 'instance creation'!
+!HLBrowserCodeWidget class methodsFor: 'instance creation'!
 
 on: aBrowserModel
 	^ self new
@@ -596,7 +596,7 @@ on: aBrowserModel
 		yourself
 ! !
 
-!HLSourceCodeWidget class methodsFor: 'testing'!
+!HLBrowserCodeWidget class methodsFor: 'testing'!
 
 canBeOpenAsTab
 	^ false