Browse Source

- Helios keybindings refactorings
- Helios modal widgets refactorings

Nicolas Petton 10 years ago
parent
commit
c6396502b3
6 changed files with 174 additions and 106 deletions
  1. 31 19
      js/Helios-Core.deploy.js
  2. 45 27
      js/Helios-Core.js
  3. 11 10
      js/Helios-KeyBindings.deploy.js
  4. 24 20
      js/Helios-KeyBindings.js
  5. 22 12
      st/Helios-Core.st
  6. 41 18
      st/Helios-KeyBindings.st

+ 31 - 19
js/Helios-Core.deploy.js

@@ -2400,10 +2400,9 @@ var $1,$2;
 $1=_st($HLConfirmationWidget())._new();
 _st($1)._confirmationString_(aString);
 _st($1)._cancelBlock_(aBlock);
-$2=_st($1)._yourself();
-_st($2)._appendToJQuery_("body"._asJQuery());
+$2=_st($1)._show();
 return self}, function($ctx1) {$ctx1.fill(self,"confirm:ifFalse:",{aString:aString,aBlock:aBlock},smalltalk.HLManager)})},
-messageSends: ["appendToJQuery:", "asJQuery", "confirmationString:", "new", "cancelBlock:", "yourself"]}),
+messageSends: ["confirmationString:", "new", "cancelBlock:", "show"]}),
 smalltalk.HLManager);
 
 smalltalk.addMethod(
@@ -2417,10 +2416,9 @@ var $1,$2;
 $1=_st($HLConfirmationWidget())._new();
 _st($1)._confirmationString_(aString);
 _st($1)._actionBlock_(aBlock);
-$2=_st($1)._yourself();
-_st($2)._appendToJQuery_("body"._asJQuery());
+$2=_st($1)._show();
 return self}, function($ctx1) {$ctx1.fill(self,"confirm:ifTrue:",{aString:aString,aBlock:aBlock},smalltalk.HLManager)})},
-messageSends: ["appendToJQuery:", "asJQuery", "confirmationString:", "new", "actionBlock:", "yourself"]}),
+messageSends: ["confirmationString:", "new", "actionBlock:", "show"]}),
 smalltalk.HLManager);
 
 smalltalk.addMethod(
@@ -2790,10 +2788,9 @@ $1=_st($HLRequestWidget())._new();
 _st($1)._confirmationString_(aString);
 _st($1)._actionBlock_(aBlock);
 _st($1)._value_(valueString);
-$2=_st($1)._yourself();
-_st($2)._appendToJQuery_("body"._asJQuery());
+$2=_st($1)._show();
 return self}, function($ctx1) {$ctx1.fill(self,"request:value:do:",{aString:aString,valueString:valueString,aBlock:aBlock},smalltalk.HLManager)})},
-messageSends: ["appendToJQuery:", "asJQuery", "confirmationString:", "new", "actionBlock:", "value:", "yourself"]}),
+messageSends: ["confirmationString:", "new", "actionBlock:", "value:", "show"]}),
 smalltalk.HLManager);
 
 smalltalk.addMethod(
@@ -3001,6 +2998,17 @@ return self}, function($ctx1) {$ctx1.fill(self,"setupKeyBindings",{},smalltalk.H
 messageSends: ["keyup:", "ifTrue:", "cancel", "=", "keyCode", "asJQuery"]}),
 smalltalk.HLModalWidget);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "show",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+self._appendToJQuery_("body"._asJQuery());
+return self}, function($ctx1) {$ctx1.fill(self,"show",{},smalltalk.HLModalWidget)})},
+messageSends: ["appendToJQuery:", "asJQuery"]}),
+smalltalk.HLModalWidget);
+
 
 
 smalltalk.addClass('HLConfirmationWidget', smalltalk.HLModalWidget, ['confirmationString', 'actionBlock', 'cancelBlock'], 'Helios-Core');
@@ -3374,16 +3382,6 @@ return self}, function($ctx1) {$ctx1.fill(self,"removeProgressBar:",{aProgressBa
 messageSends: ["remove:ifAbsent:", "progressBars", "remove", "asJQuery", "wrapper", "ifEmpty:"]}),
 smalltalk.HLProgressWidget);
 
-smalltalk.addMethod(
-smalltalk.method({
-selector: "renderButtonsOn:",
-fn: function (html){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html},smalltalk.HLProgressWidget)})},
-messageSends: []}),
-smalltalk.HLProgressWidget);
-
 smalltalk.addMethod(
 smalltalk.method({
 selector: "renderMainOn:",
@@ -3437,6 +3435,20 @@ messageSends: ["ifNil:", "new"]}),
 smalltalk.HLProgressWidget.klass);
 
 
+smalltalk.addClass('HLTabSelectionWidget', smalltalk.HLModalWidget, [], 'Helios-Core');
+smalltalk.addMethod(
+smalltalk.method({
+selector: "renderMainOn:",
+fn: function (html){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+_st(html)._with_("hello");
+return self}, function($ctx1) {$ctx1.fill(self,"renderMainOn:",{html:html},smalltalk.HLTabSelectionWidget)})},
+messageSends: ["with:"]}),
+smalltalk.HLTabSelectionWidget);
+
+
+
 smalltalk.addClass('HLProgressBarWidget', smalltalk.HLWidget, ['label', 'parent', 'workBlock', 'collection', 'bar'], 'Helios-Core');
 smalltalk.addMethod(
 smalltalk.method({

+ 45 - 27
js/Helios-Core.js

@@ -3167,12 +3167,11 @@ var $1,$2;
 $1=_st($HLConfirmationWidget())._new();
 _st($1)._confirmationString_(aString);
 _st($1)._cancelBlock_(aBlock);
-$2=_st($1)._yourself();
-_st($2)._appendToJQuery_("body"._asJQuery());
+$2=_st($1)._show();
 return self}, function($ctx1) {$ctx1.fill(self,"confirm:ifFalse:",{aString:aString,aBlock:aBlock},smalltalk.HLManager)})},
 args: ["aString", "aBlock"],
-source: "confirm: aString ifFalse: aBlock\x0a\x09(HLConfirmationWidget new\x0a\x09\x09confirmationString: aString;\x0a\x09\x09cancelBlock: aBlock;\x0a\x09\x09yourself)\x0a\x09\x09\x09appendToJQuery: 'body' asJQuery",
-messageSends: ["appendToJQuery:", "asJQuery", "confirmationString:", "new", "cancelBlock:", "yourself"],
+source: "confirm: aString ifFalse: aBlock\x0a\x09HLConfirmationWidget new\x0a\x09\x09confirmationString: aString;\x0a\x09\x09cancelBlock: aBlock;\x0a\x09\x09show",
+messageSends: ["confirmationString:", "new", "cancelBlock:", "show"],
 referencedClasses: ["HLConfirmationWidget"]
 }),
 smalltalk.HLManager);
@@ -3189,12 +3188,11 @@ var $1,$2;
 $1=_st($HLConfirmationWidget())._new();
 _st($1)._confirmationString_(aString);
 _st($1)._actionBlock_(aBlock);
-$2=_st($1)._yourself();
-_st($2)._appendToJQuery_("body"._asJQuery());
+$2=_st($1)._show();
 return self}, function($ctx1) {$ctx1.fill(self,"confirm:ifTrue:",{aString:aString,aBlock:aBlock},smalltalk.HLManager)})},
 args: ["aString", "aBlock"],
-source: "confirm: aString ifTrue: aBlock\x0a\x09(HLConfirmationWidget new\x0a\x09\x09confirmationString: aString;\x0a\x09\x09actionBlock: aBlock;\x0a\x09\x09yourself)\x0a\x09\x09\x09appendToJQuery: 'body' asJQuery",
-messageSends: ["appendToJQuery:", "asJQuery", "confirmationString:", "new", "actionBlock:", "yourself"],
+source: "confirm: aString ifTrue: aBlock\x0a\x09HLConfirmationWidget new\x0a\x09\x09confirmationString: aString;\x0a\x09\x09actionBlock: aBlock;\x0a\x09\x09show",
+messageSends: ["confirmationString:", "new", "actionBlock:", "show"],
 referencedClasses: ["HLConfirmationWidget"]
 }),
 smalltalk.HLManager);
@@ -3657,12 +3655,11 @@ $1=_st($HLRequestWidget())._new();
 _st($1)._confirmationString_(aString);
 _st($1)._actionBlock_(aBlock);
 _st($1)._value_(valueString);
-$2=_st($1)._yourself();
-_st($2)._appendToJQuery_("body"._asJQuery());
+$2=_st($1)._show();
 return self}, function($ctx1) {$ctx1.fill(self,"request:value:do:",{aString:aString,valueString:valueString,aBlock:aBlock},smalltalk.HLManager)})},
 args: ["aString", "valueString", "aBlock"],
-source: "request: aString value: valueString do: aBlock\x0a\x09(HLRequestWidget new\x0a\x09\x09confirmationString: aString;\x0a\x09\x09actionBlock: aBlock;\x0a\x09\x09value: valueString;\x0a\x09\x09yourself)\x0a\x09\x09\x09appendToJQuery: 'body' asJQuery",
-messageSends: ["appendToJQuery:", "asJQuery", "confirmationString:", "new", "actionBlock:", "value:", "yourself"],
+source: "request: aString value: valueString do: aBlock\x0a\x09HLRequestWidget new\x0a\x09\x09confirmationString: aString;\x0a\x09\x09actionBlock: aBlock;\x0a\x09\x09value: valueString;\x0a\x09\x09show",
+messageSends: ["confirmationString:", "new", "actionBlock:", "value:", "show"],
 referencedClasses: ["HLRequestWidget"]
 }),
 smalltalk.HLManager);
@@ -3938,6 +3935,22 @@ referencedClasses: []
 }),
 smalltalk.HLModalWidget);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "show",
+category: 'actions',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+self._appendToJQuery_("body"._asJQuery());
+return self}, function($ctx1) {$ctx1.fill(self,"show",{},smalltalk.HLModalWidget)})},
+args: [],
+source: "show\x0a\x09self appendToJQuery: 'body' asJQuery",
+messageSends: ["appendToJQuery:", "asJQuery"],
+referencedClasses: []
+}),
+smalltalk.HLModalWidget);
+
 
 
 smalltalk.addClass('HLConfirmationWidget', smalltalk.HLModalWidget, ['confirmationString', 'actionBlock', 'cancelBlock'], 'Helios-Core');
@@ -4429,21 +4442,6 @@ referencedClasses: []
 }),
 smalltalk.HLProgressWidget);
 
-smalltalk.addMethod(
-smalltalk.method({
-selector: "renderButtonsOn:",
-category: 'rendering',
-fn: function (html){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html},smalltalk.HLProgressWidget)})},
-args: ["html"],
-source: "renderButtonsOn: html",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.HLProgressWidget);
-
 smalltalk.addMethod(
 smalltalk.method({
 selector: "renderMainOn:",
@@ -4512,6 +4510,26 @@ referencedClasses: []
 smalltalk.HLProgressWidget.klass);
 
 
+smalltalk.addClass('HLTabSelectionWidget', smalltalk.HLModalWidget, [], 'Helios-Core');
+smalltalk.HLTabSelectionWidget.comment="I am used to select or create tabs.";
+smalltalk.addMethod(
+smalltalk.method({
+selector: "renderMainOn:",
+category: 'rendering',
+fn: function (html){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+_st(html)._with_("hello");
+return self}, function($ctx1) {$ctx1.fill(self,"renderMainOn:",{html:html},smalltalk.HLTabSelectionWidget)})},
+args: ["html"],
+source: "renderMainOn: html\x0a\x09html with: 'hello'",
+messageSends: ["with:"],
+referencedClasses: []
+}),
+smalltalk.HLTabSelectionWidget);
+
+
+
 smalltalk.addClass('HLProgressBarWidget', smalltalk.HLWidget, ['label', 'parent', 'workBlock', 'collection', 'bar'], 'Helios-Core');
 smalltalk.HLProgressBarWidget.comment="I am a widget used to display a progress bar while iterating over a collection.";
 smalltalk.addMethod(

+ 11 - 10
js/Helios-KeyBindings.deploy.js

@@ -4,11 +4,11 @@ smalltalk.addPackage('Helios-KeyBindings');
 smalltalk.addClass('HLBinding', smalltalk.Object, ['key', 'label'], 'Helios-KeyBindings');
 smalltalk.addMethod(
 smalltalk.method({
-selector: "applyOn:",
-fn: function (aKeyBinder){
+selector: "apply",
+fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-return self}, function($ctx1) {$ctx1.fill(self,"applyOn:",{aKeyBinder:aKeyBinder},smalltalk.HLBinding)})},
+return self}, function($ctx1) {$ctx1.fill(self,"apply",{},smalltalk.HLBinding)})},
 messageSends: []}),
 smalltalk.HLBinding);
 
@@ -153,19 +153,20 @@ smalltalk.HLBinding.klass);
 smalltalk.addClass('HLBindingAction', smalltalk.HLBinding, ['command'], 'Helios-KeyBindings');
 smalltalk.addMethod(
 smalltalk.method({
-selector: "applyOn:",
-fn: function (aKeyBinder){
+selector: "apply",
+fn: function (){
 var self=this;
+function $HLKeyBinder(){return smalltalk.HLKeyBinder||(typeof HLKeyBinder=="undefined"?nil:HLKeyBinder)}
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=_st(self._command())._isInputRequired();
 if(smalltalk.assert($1)){
-_st(_st(aKeyBinder)._helper())._showWidget_(self._inputWidget());
+_st(_st(_st($HLKeyBinder())._current())._helper())._showWidget_(self._inputWidget());
 } else {
 self._executeCommand();
 };
-return self}, function($ctx1) {$ctx1.fill(self,"applyOn:",{aKeyBinder:aKeyBinder},smalltalk.HLBindingAction)})},
-messageSends: ["ifTrue:ifFalse:", "showWidget:", "inputWidget", "helper", "executeCommand", "isInputRequired", "command"]}),
+return self}, function($ctx1) {$ctx1.fill(self,"apply",{},smalltalk.HLBindingAction)})},
+messageSends: ["ifTrue:ifFalse:", "showWidget:", "inputWidget", "helper", "current", "executeCommand", "isInputRequired", "command"]}),
 smalltalk.HLBindingAction);
 
 smalltalk.addMethod(
@@ -829,9 +830,9 @@ $2=self;
 return $2;
 };
 self._selectBinding_(aBinding);
-_st(aBinding)._applyOn_(self);
+_st(aBinding)._apply();
 return self}, function($ctx1) {$ctx1.fill(self,"applyBinding:",{aBinding:aBinding},smalltalk.HLKeyBinder)})},
-messageSends: ["ifFalse:", "isActive", "selectBinding:", "applyOn:"]}),
+messageSends: ["ifFalse:", "isActive", "selectBinding:", "apply"]}),
 smalltalk.HLKeyBinder);
 
 smalltalk.addMethod(

+ 24 - 20
js/Helios-KeyBindings.js

@@ -2,16 +2,17 @@
 smalltalk.addPackage('Helios-KeyBindings');
 
 smalltalk.addClass('HLBinding', smalltalk.Object, ['key', 'label'], 'Helios-KeyBindings');
+smalltalk.HLBinding.comment="I am the abstract representation of a keybinding in Helios. My instances hold a key (integer value) and a label. \x0a\x0aBindings are built into a tree of keys, so pressing a key may result in more key choices (for example, to open a workspace, 'o' is pressed first then 'w' is pressed).\x0a\x0aBinding action handling and selection is handled by the `current` instance of `HLKeyBinder`.\x0a\x0aSubclasses implement specific behavior like evaluating actions or (sub-)grouping other bindings.";
 smalltalk.addMethod(
 smalltalk.method({
-selector: "applyOn:",
+selector: "apply",
 category: 'actions',
-fn: function (aKeyBinder){
+fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-return self}, function($ctx1) {$ctx1.fill(self,"applyOn:",{aKeyBinder:aKeyBinder},smalltalk.HLBinding)})},
-args: ["aKeyBinder"],
-source: "applyOn: aKeyBinder\x0a\x09",
+return self}, function($ctx1) {$ctx1.fill(self,"apply",{},smalltalk.HLBinding)})},
+args: [],
+source: "apply\x0a\x09",
 messageSends: [],
 referencedClasses: []
 }),
@@ -27,7 +28,7 @@ return smalltalk.withContext(function($ctx1) {
 return nil;
 }, function($ctx1) {$ctx1.fill(self,"atKey:",{aKey:aKey},smalltalk.HLBinding)})},
 args: ["aKey"],
-source: "atKey: aKey\x0a\x09^ nil",
+source: "atKey: aKey\x0a\x09\x22Answer the sub-binding at key aKey.\x0a\x09Always answer nil here. See HLBindingGroup for more.\x22\x0a\x09\x0a\x09^ nil",
 messageSends: [],
 referencedClasses: []
 }),
@@ -211,25 +212,27 @@ smalltalk.HLBinding.klass);
 
 
 smalltalk.addClass('HLBindingAction', smalltalk.HLBinding, ['command'], 'Helios-KeyBindings');
+smalltalk.HLBindingAction.comment="My instances are the leafs of the binding tree. They evaluate actions through commands, instances of concrete subclasses of `HLCommand`.\x0a\x0aThe `#apply` methods is used to evaluate the `command`. If the command requires user input, an `inputWidget` will be displayed to the user.";
 smalltalk.addMethod(
 smalltalk.method({
-selector: "applyOn:",
+selector: "apply",
 category: 'actions',
-fn: function (aKeyBinder){
+fn: function (){
 var self=this;
+function $HLKeyBinder(){return smalltalk.HLKeyBinder||(typeof HLKeyBinder=="undefined"?nil:HLKeyBinder)}
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=_st(self._command())._isInputRequired();
 if(smalltalk.assert($1)){
-_st(_st(aKeyBinder)._helper())._showWidget_(self._inputWidget());
+_st(_st(_st($HLKeyBinder())._current())._helper())._showWidget_(self._inputWidget());
 } else {
 self._executeCommand();
 };
-return self}, function($ctx1) {$ctx1.fill(self,"applyOn:",{aKeyBinder:aKeyBinder},smalltalk.HLBindingAction)})},
-args: ["aKeyBinder"],
-source: "applyOn: aKeyBinder\x0a\x09self command isInputRequired\x0a\x09\x09ifTrue: [ aKeyBinder helper showWidget: self inputWidget ]\x0a\x09\x09ifFalse: [ self executeCommand ]",
-messageSends: ["ifTrue:ifFalse:", "showWidget:", "inputWidget", "helper", "executeCommand", "isInputRequired", "command"],
-referencedClasses: []
+return self}, function($ctx1) {$ctx1.fill(self,"apply",{},smalltalk.HLBindingAction)})},
+args: [],
+source: "apply\x0a\x09self command isInputRequired\x0a\x09\x09ifTrue: [ HLKeyBinder current helper showWidget: self inputWidget ]\x0a\x09\x09ifFalse: [ self executeCommand ]",
+messageSends: ["ifTrue:ifFalse:", "showWidget:", "inputWidget", "helper", "current", "executeCommand", "isInputRequired", "command"],
+referencedClasses: ["HLKeyBinder"]
 }),
 smalltalk.HLBindingAction);
 
@@ -385,6 +388,7 @@ smalltalk.HLBindingAction);
 
 
 smalltalk.addClass('HLBindingGroup', smalltalk.HLBinding, ['bindings'], 'Helios-KeyBindings');
+smalltalk.HLBindingGroup.comment="My instances hold other bindings, either actions or groups, and do not have actions by themselves.\x0a\x0aChildren are accessed with `atKey:` and added with the `add*` methods.";
 smalltalk.addMethod(
 smalltalk.method({
 selector: "activeBindings",
@@ -409,7 +413,7 @@ smalltalk.HLBindingGroup);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "add:",
-category: 'accessing',
+category: 'adding',
 fn: function (aBinding){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -427,7 +431,7 @@ smalltalk.HLBindingGroup);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "addActionKey:labelled:callback:",
-category: 'accessing',
+category: 'adding',
 fn: function (anInteger,aString,aBlock){
 var self=this;
 function $HLBindingAction(){return smalltalk.HLBindingAction||(typeof HLBindingAction=="undefined"?nil:HLBindingAction)}
@@ -448,7 +452,7 @@ smalltalk.HLBindingGroup);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "addGroupKey:labelled:",
-category: 'accessing',
+category: 'add',
 fn: function (anInteger,aString){
 var self=this;
 function $HLBindingGroup(){return smalltalk.HLBindingGroup||(typeof HLBindingGroup=="undefined"?nil:HLBindingGroup)}
@@ -1097,11 +1101,11 @@ $2=self;
 return $2;
 };
 self._selectBinding_(aBinding);
-_st(aBinding)._applyOn_(self);
+_st(aBinding)._apply();
 return self}, function($ctx1) {$ctx1.fill(self,"applyBinding:",{aBinding:aBinding},smalltalk.HLKeyBinder)})},
 args: ["aBinding"],
-source: "applyBinding: aBinding\x0a\x09aBinding isActive ifFalse: [ ^ self ].\x0a\x09\x0a\x09self selectBinding: aBinding.\x0a    aBinding applyOn: self",
-messageSends: ["ifFalse:", "isActive", "selectBinding:", "applyOn:"],
+source: "applyBinding: aBinding\x0a\x09aBinding isActive ifFalse: [ ^ self ].\x0a\x09\x0a\x09self selectBinding: aBinding.\x0a    aBinding apply",
+messageSends: ["ifFalse:", "isActive", "selectBinding:", "apply"],
 referencedClasses: []
 }),
 smalltalk.HLKeyBinder);

+ 22 - 12
st/Helios-Core.st

@@ -1149,19 +1149,17 @@ addToHistory: aTab
 !
 
 confirm: aString ifFalse: aBlock
-	(HLConfirmationWidget new
+	HLConfirmationWidget new
 		confirmationString: aString;
 		cancelBlock: aBlock;
-		yourself)
-			appendToJQuery: 'body' asJQuery
+		show
 !
 
 confirm: aString ifTrue: aBlock
-	(HLConfirmationWidget new
+	HLConfirmationWidget new
 		confirmationString: aString;
 		actionBlock: aBlock;
-		yourself)
-			appendToJQuery: 'body' asJQuery
+		show
 !
 
 registerErrorHandler: anErrorHandler
@@ -1204,12 +1202,11 @@ request: aString do: aBlock
 !
 
 request: aString value: valueString do: aBlock
-	(HLRequestWidget new
+	HLRequestWidget new
 		confirmationString: aString;
 		actionBlock: aBlock;
 		value: valueString;
-		yourself)
-			appendToJQuery: 'body' asJQuery
+		show
 ! !
 
 !HLManager methodsFor: 'defaults'!
@@ -1360,6 +1357,10 @@ remove
 		'#overlay' asJQuery remove.
 		'.dialog' asJQuery remove
 	] valueWithTimeout: 300
+!
+
+show
+	self appendToJQuery: 'body' asJQuery
 ! !
 
 !HLModalWidget methodsFor: 'rendering'!
@@ -1569,9 +1570,6 @@ show
 
 !HLProgressWidget methodsFor: 'rendering'!
 
-renderButtonsOn: html
-!
-
 renderMainOn: html
 	self progressBars do: [ :each |
 		html with: each ]
@@ -1591,6 +1589,18 @@ default
 	^ default ifNil: [ default := self new ]
 ! !
 
+HLModalWidget subclass: #HLTabSelectionWidget
+	instanceVariableNames: ''
+	package: 'Helios-Core'!
+!HLTabSelectionWidget commentStamp!
+I am used to select or create tabs.!
+
+!HLTabSelectionWidget methodsFor: 'rendering'!
+
+renderMainOn: html
+	html with: 'hello'
+! !
+
 HLWidget subclass: #HLProgressBarWidget
 	instanceVariableNames: 'label parent workBlock collection bar'
 	package: 'Helios-Core'!

+ 41 - 18
st/Helios-KeyBindings.st

@@ -2,10 +2,21 @@ Smalltalk current createPackage: 'Helios-KeyBindings'!
 Object subclass: #HLBinding
 	instanceVariableNames: 'key label'
 	package: 'Helios-KeyBindings'!
+!HLBinding commentStamp!
+I am the abstract representation of a keybinding in Helios. My instances hold a key (integer value) and a label. 
+
+Bindings are built into a tree of keys, so pressing a key may result in more key choices (for example, to open a workspace, 'o' is pressed first then 'w' is pressed).
+
+Binding action handling and selection is handled by the `current` instance of `HLKeyBinder`.
+
+Subclasses implement specific behavior like evaluating actions or (sub-)grouping other bindings.!
 
 !HLBinding methodsFor: 'accessing'!
 
 atKey: aKey
+	"Answer the sub-binding at key aKey.
+	Always answer nil here. See HLBindingGroup for more."
+	
 	^ nil
 !
 
@@ -35,7 +46,7 @@ shortcut
 
 !HLBinding methodsFor: 'actions'!
 
-applyOn: aKeyBinder
+apply
 !
 
 release
@@ -64,6 +75,10 @@ on: anInteger labelled: aString
 HLBinding subclass: #HLBindingAction
 	instanceVariableNames: 'command'
 	package: 'Helios-KeyBindings'!
+!HLBindingAction commentStamp!
+My instances are the leafs of the binding tree. They evaluate actions through commands, instances of concrete subclasses of `HLCommand`.
+
+The `#apply` methods is used to evaluate the `command`. If the command requires user input, an `inputWidget` will be displayed to the user.!
 
 !HLBindingAction methodsFor: 'accessing'!
 
@@ -106,9 +121,9 @@ inputWidget
 
 !HLBindingAction methodsFor: 'actions'!
 
-applyOn: aKeyBinder
+apply
 	self command isInputRequired
-		ifTrue: [ aKeyBinder helper showWidget: self inputWidget ]
+		ifTrue: [ HLKeyBinder current helper showWidget: self inputWidget ]
 		ifFalse: [ self executeCommand ]
 !
 
@@ -126,6 +141,10 @@ isActive
 HLBinding subclass: #HLBindingGroup
 	instanceVariableNames: 'bindings'
 	package: 'Helios-KeyBindings'!
+!HLBindingGroup commentStamp!
+My instances hold other bindings, either actions or groups, and do not have actions by themselves.
+
+Children are accessed with `atKey:` and added with the `add*` methods.!
 
 !HLBindingGroup methodsFor: 'accessing'!
 
@@ -133,20 +152,6 @@ activeBindings
 	^ self bindings select: [ :each | each isActive ]
 !
 
-add: aBinding
-	^ self bindings add: aBinding
-!
-
-addActionKey: anInteger labelled: aString callback: aBlock
-	self add: ((HLBindingAction on: anInteger labelled: aString)
-    	callback: aBlock;
-        yourself)
-!
-
-addGroupKey: anInteger labelled: aString
-	self add: (HLBindingGroup on: anInteger labelled: aString)
-!
-
 at: aString
 	^ self bindings 
     	detect: [ :each | each label = aString ]
@@ -182,6 +187,24 @@ release
 	self bindings do: [ :each | each release ]
 ! !
 
+!HLBindingGroup methodsFor: 'add'!
+
+addGroupKey: anInteger labelled: aString
+	self add: (HLBindingGroup on: anInteger labelled: aString)
+! !
+
+!HLBindingGroup methodsFor: 'adding'!
+
+add: aBinding
+	^ self bindings add: aBinding
+!
+
+addActionKey: anInteger labelled: aString callback: aBlock
+	self add: ((HLBindingAction on: anInteger labelled: aString)
+    	callback: aBlock;
+        yourself)
+! !
+
 !HLBindingGroup methodsFor: 'rendering'!
 
 renderOn: aBindingHelper html: html
@@ -367,7 +390,7 @@ applyBinding: aBinding
 	aBinding isActive ifFalse: [ ^ self ].
 	
 	self selectBinding: aBinding.
-    aBinding applyOn: self
+    aBinding apply
 !
 
 deactivate