Explorar o código

- Improve commands registration algorithm
- Modifiy command registration to take activateBlock into account
- Test it on MoveToMethod* commands

Benjamin Van Ryseghem %!s(int64=11) %!d(string=hai) anos
pai
achega
7d46031fc4

+ 15 - 0
js/Helios-Commands-Browser.deploy.js

@@ -249,6 +249,21 @@ smalltalk.HLMoveToCommand.klass);
 
 
 smalltalk.addClass('HLMoveMethodToCommand', smalltalk.HLMoveToCommand, [], 'Helios-Commands-Browser');
+smalltalk.addMethod(
+"_activeBlock",
+smalltalk.method({
+selector: "activeBlock",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
var $1;
+$1=(function(){
+return smalltalk.withContext(function($ctx2) {
return _st(_st(_st(self)._model())._selectedMethod())._notNil();
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"activeBlock",{},smalltalk.HLMoveMethodToCommand)})},
+messageSends: ["notNil", "selectedMethod", "model"]}),
+smalltalk.HLMoveMethodToCommand);
+
 
 smalltalk.addMethod(
 "_key",

+ 20 - 0
js/Helios-Commands-Browser.js

@@ -349,6 +349,26 @@ smalltalk.HLMoveToCommand.klass);
 
 
 smalltalk.addClass('HLMoveMethodToCommand', smalltalk.HLMoveToCommand, [], 'Helios-Commands-Browser');
+smalltalk.addMethod(
+"_activeBlock",
+smalltalk.method({
+selector: "activeBlock",
+category: 'accessing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
var $1;
+$1=(function(){
+return smalltalk.withContext(function($ctx2) {
return _st(_st(_st(self)._model())._selectedMethod())._notNil();
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"activeBlock",{},smalltalk.HLMoveMethodToCommand)})},
+args: [],
+source: "activeBlock\x0a\x09^ [ self model selectedMethod notNil ]",
+messageSends: ["notNil", "selectedMethod", "model"],
+referencedClasses: []
+}),
+smalltalk.HLMoveMethodToCommand);
+
 
 smalltalk.addMethod(
 "_key",

+ 45 - 452
js/Helios-Commands-Core.deploy.js

@@ -1,5 +1,20 @@
 smalltalk.addPackage('Helios-Commands-Core');
 smalltalk.addClass('HLCommand', smalltalk.Object, [], 'Helios-Commands-Core');
+smalltalk.addMethod(
+"_activeBlock",
+smalltalk.method({
+selector: "activeBlock",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
var $1;
+$1=(function(){
+return smalltalk.withContext(function($ctx2) {
return true;
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"activeBlock",{},smalltalk.HLCommand)})},
+messageSends: []}),
+smalltalk.HLCommand);
+
 smalltalk.addMethod(
 "_asActionBinding",
 smalltalk.method({
@@ -7,12 +22,12 @@ selector: "asActionBinding",
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1;
-$1=_st(_st((smalltalk.HLBindingAction || HLBindingAction))._on_labelled_(_st(self)._key(),_st(self)._label()))._callback_((function(){
+$1=_st(_st((smalltalk.HLBindingAction || HLBindingAction))._on_labelled_activeBlock_(_st(self)._key(),_st(self)._label(),_st(self)._activeBlock()))._callback_((function(){
 return smalltalk.withContext(function($ctx2) {
return _st(self)._execute();
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"asActionBinding",{},smalltalk.HLCommand)})},
-messageSends: ["callback:", "execute", "on:labelled:", "key", "label"]}),
+messageSends: ["callback:", "execute", "on:labelled:activeBlock:", "key", "label", "activeBlock"]}),
 smalltalk.HLCommand);
 
 smalltalk.addMethod(
@@ -122,6 +137,22 @@ messageSends: ["add:", "asBinding"]}),
 smalltalk.HLCommand);
 
 
+smalltalk.addMethod(
+"_asBindingOn_",
+smalltalk.method({
+selector: "asBindingOn:",
+fn: function (aBinding){
+var self=this;
+var instance;
+return smalltalk.withContext(function($ctx1) { 
var $1;
+instance=_st(_st(self)._new())._asBinding();
+_st(aBinding)._add_(instance);
+$1=instance;
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"asBindingOn:",{aBinding:aBinding,instance:instance},smalltalk.HLCommand.klass)})},
+messageSends: ["asBinding", "new", "add:"]}),
+smalltalk.HLCommand.klass);
+
 smalltalk.addMethod(
 "_concreteSubclasses",
 smalltalk.method({
@@ -189,18 +220,21 @@ smalltalk.method({
 selector: "registerConcreteClassesOn:",
 fn: function (aBinding){
 var self=this;
+var newBinding;
 return smalltalk.withContext(function($ctx1) { 
var $1;
-_st(_st(self)._concreteSubclasses())._do_((function(each){
-var binding;
-return smalltalk.withContext(function($ctx2) {
binding=_st(each)._registerOn_(aBinding);
-binding;
-$1=_st(binding)._isBindingGroup();
+$1=_st(self)._isConcrete();
 if(smalltalk.assert($1)){
-return _st(each)._registerConcreteClassesOn_(binding);
+newBinding=_st(self)._asBindingOn_(aBinding);
+newBinding;
+} else {
+newBinding=aBinding;
+newBinding;
 };
-}, function($ctx2) {$ctx2.fillBlock({each:each,binding:binding},$ctx1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"registerConcreteClassesOn:",{aBinding:aBinding},smalltalk.HLCommand.klass)})},
-messageSends: ["do:", "registerOn:", "ifTrue:", "registerConcreteClassesOn:", "isBindingGroup", "concreteSubclasses"]}),
+_st(_st(self)._subclasses())._do_((function(each){
+return smalltalk.withContext(function($ctx2) {
return _st(each)._registerConcreteClassesOn_(newBinding);
+}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
+return self}, function($ctx1) {$ctx1.fill(self,"registerConcreteClassesOn:",{aBinding:aBinding,newBinding:newBinding},smalltalk.HLCommand.klass)})},
+messageSends: ["ifTrue:ifFalse:", "asBindingOn:", "isConcrete", "do:", "registerConcreteClassesOn:", "subclasses"]}),
 smalltalk.HLCommand.klass);
 
 smalltalk.addMethod(
@@ -326,447 +360,6 @@ messageSends: ["registerOn:", "for:"]}),
 smalltalk.HLModelCommand.klass);
 
 
-smalltalk.addClass('HLBrowserCommand', smalltalk.HLModelCommand, [], 'Helios-Commands-Browser');
-
-smalltalk.addMethod(
-"_for_",
-smalltalk.method({
-selector: "for:",
-fn: function (aBrowserModel){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $2,$3,$1;
-$2=_st(self)._new();
-_st($2)._model_(aBrowserModel);
-$3=_st($2)._yourself();
-$1=$3;
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"for:",{aBrowserModel:aBrowserModel},smalltalk.HLBrowserCommand.klass)})},
-messageSends: ["model:", "new", "yourself"]}),
-smalltalk.HLBrowserCommand.klass);
-
-
-smalltalk.addClass('HLBrowserGoToCommand', smalltalk.HLBrowserCommand, [], 'Helios-Commands-Browser');
-
-smalltalk.addMethod(
-"_key",
-smalltalk.method({
-selector: "key",
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (71);
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLGoToCommand.klass)})},
-messageSends: []}),
-smalltalk.HLBrowserGoToCommand.klass);
-
-smalltalk.addMethod(
-"_label",
-smalltalk.method({
-selector: "label",
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "Go to";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLGoToCommand.klass)})},
-messageSends: []}),
-smalltalk.HLBrowserGoToCommand.klass);
-
-
-smalltalk.addClass('HLGoToClassesCommand', smalltalk.HLBrowserGoToCommand, [], 'Helios-Commands-Browser');
-smalltalk.addMethod(
-"_execute",
-smalltalk.method({
-selector: "execute",
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._model())._focusOnClasses();
-return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLGoToClassesCommand)})},
-messageSends: ["focusOnClasses", "model"]}),
-smalltalk.HLGoToClassesCommand);
-
-
-smalltalk.addMethod(
-"_key",
-smalltalk.method({
-selector: "key",
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (67);
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLGoToClassesCommand.klass)})},
-messageSends: []}),
-smalltalk.HLGoToClassesCommand.klass);
-
-smalltalk.addMethod(
-"_label",
-smalltalk.method({
-selector: "label",
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "Classes";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLGoToClassesCommand.klass)})},
-messageSends: []}),
-smalltalk.HLGoToClassesCommand.klass);
-
-
-smalltalk.addClass('HLGoToMethodsCommand', smalltalk.HLBrowserGoToCommand, [], 'Helios-Commands-Browser');
-smalltalk.addMethod(
-"_execute",
-smalltalk.method({
-selector: "execute",
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._model())._focusOnMethods();
-return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLGoToMethodsCommand)})},
-messageSends: ["focusOnMethods", "model"]}),
-smalltalk.HLGoToMethodsCommand);
-
-
-smalltalk.addMethod(
-"_key",
-smalltalk.method({
-selector: "key",
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (77);
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLGoToMethodsCommand.klass)})},
-messageSends: []}),
-smalltalk.HLGoToMethodsCommand.klass);
-
-smalltalk.addMethod(
-"_label",
-smalltalk.method({
-selector: "label",
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "Methods";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLGoToMethodsCommand.klass)})},
-messageSends: []}),
-smalltalk.HLGoToMethodsCommand.klass);
-
-
-smalltalk.addClass('HLGoToPackagesCommand', smalltalk.HLBrowserGoToCommand, [], 'Helios-Commands-Browser');
-smalltalk.addMethod(
-"_execute",
-smalltalk.method({
-selector: "execute",
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._model())._focusOnPackages();
-return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLGoToPackagesCommand)})},
-messageSends: ["focusOnPackages", "model"]}),
-smalltalk.HLGoToPackagesCommand);
-
-
-smalltalk.addMethod(
-"_key",
-smalltalk.method({
-selector: "key",
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (80);
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLGoToPackagesCommand.klass)})},
-messageSends: []}),
-smalltalk.HLGoToPackagesCommand.klass);
-
-smalltalk.addMethod(
-"_label",
-smalltalk.method({
-selector: "label",
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "Packages";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLGoToPackagesCommand.klass)})},
-messageSends: []}),
-smalltalk.HLGoToPackagesCommand.klass);
-
-
-smalltalk.addClass('HLGoToProtocolsCommand', smalltalk.HLBrowserGoToCommand, [], 'Helios-Commands-Browser');
-smalltalk.addMethod(
-"_execute",
-smalltalk.method({
-selector: "execute",
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._model())._focusOnProtocols();
-return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLGoToProtocolsCommand)})},
-messageSends: ["focusOnProtocols", "model"]}),
-smalltalk.HLGoToProtocolsCommand);
-
-
-smalltalk.addMethod(
-"_key",
-smalltalk.method({
-selector: "key",
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (84);
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLGoToProtocolsCommand.klass)})},
-messageSends: []}),
-smalltalk.HLGoToProtocolsCommand.klass);
-
-smalltalk.addMethod(
-"_label",
-smalltalk.method({
-selector: "label",
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "Protocols";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLGoToProtocolsCommand.klass)})},
-messageSends: []}),
-smalltalk.HLGoToProtocolsCommand.klass);
-
-
-smalltalk.addClass('HLGoToSourceCodeCommand', smalltalk.HLBrowserGoToCommand, [], 'Helios-Commands-Browser');
-smalltalk.addMethod(
-"_execute",
-smalltalk.method({
-selector: "execute",
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._model())._focusOnSourceCode();
-return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLGoToSourceCodeCommand)})},
-messageSends: ["focusOnSourceCode", "model"]}),
-smalltalk.HLGoToSourceCodeCommand);
-
-
-smalltalk.addMethod(
-"_key",
-smalltalk.method({
-selector: "key",
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (83);
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLGoToSourceCodeCommand.klass)})},
-messageSends: []}),
-smalltalk.HLGoToSourceCodeCommand.klass);
-
-smalltalk.addMethod(
-"_label",
-smalltalk.method({
-selector: "label",
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "Source code";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLGoToSourceCodeCommand.klass)})},
-messageSends: []}),
-smalltalk.HLGoToSourceCodeCommand.klass);
-
-
-smalltalk.addClass('HLMoveToCommand', smalltalk.HLBrowserCommand, [], 'Helios-Commands-Browser');
-
-smalltalk.addMethod(
-"_key",
-smalltalk.method({
-selector: "key",
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (77);
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLMoveToCommand.klass)})},
-messageSends: []}),
-smalltalk.HLMoveToCommand.klass);
-
-smalltalk.addMethod(
-"_label",
-smalltalk.method({
-selector: "label",
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "Move";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLMoveToCommand.klass)})},
-messageSends: []}),
-smalltalk.HLMoveToCommand.klass);
-
-
-smalltalk.addClass('HLMoveMethodToCommand', smalltalk.HLMoveToCommand, [], 'Helios-Commands-Browser');
-
-smalltalk.addMethod(
-"_key",
-smalltalk.method({
-selector: "key",
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (77);
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLMoveMethodToCommand.klass)})},
-messageSends: []}),
-smalltalk.HLMoveMethodToCommand.klass);
-
-smalltalk.addMethod(
-"_label",
-smalltalk.method({
-selector: "label",
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "Method";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLMoveMethodToCommand.klass)})},
-messageSends: []}),
-smalltalk.HLMoveMethodToCommand.klass);
-
-
-smalltalk.addClass('HLMoveMethodToClassCommand', smalltalk.HLMoveMethodToCommand, [], 'Helios-Commands-Browser');
-smalltalk.addMethod(
-"_execute",
-smalltalk.method({
-selector: "execute",
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLMoveMethodToClassCommand)})},
-messageSends: []}),
-smalltalk.HLMoveMethodToClassCommand);
-
-
-smalltalk.addMethod(
-"_key",
-smalltalk.method({
-selector: "key",
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (67);
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLMoveMethodToClassCommand.klass)})},
-messageSends: []}),
-smalltalk.HLMoveMethodToClassCommand.klass);
-
-smalltalk.addMethod(
-"_label",
-smalltalk.method({
-selector: "label",
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "to class";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLMoveMethodToClassCommand.klass)})},
-messageSends: []}),
-smalltalk.HLMoveMethodToClassCommand.klass);
-
-
-smalltalk.addClass('HLMoveMethodToProtocolCommand', smalltalk.HLMoveMethodToCommand, [], 'Helios-Commands-Browser');
-smalltalk.addMethod(
-"_execute",
-smalltalk.method({
-selector: "execute",
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLMoveMethodToProtocolCommand)})},
-messageSends: []}),
-smalltalk.HLMoveMethodToProtocolCommand);
-
-
-smalltalk.addMethod(
-"_key",
-smalltalk.method({
-selector: "key",
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (84);
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLMoveMethodToProtocolCommand.klass)})},
-messageSends: []}),
-smalltalk.HLMoveMethodToProtocolCommand.klass);
-
-smalltalk.addMethod(
-"_label",
-smalltalk.method({
-selector: "label",
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "to protocol";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLMoveMethodToProtocolCommand.klass)})},
-messageSends: []}),
-smalltalk.HLMoveMethodToProtocolCommand.klass);
-
-
-smalltalk.addClass('HLToggleCommand', smalltalk.HLBrowserCommand, [], 'Helios-Commands-Browser');
-
-smalltalk.addMethod(
-"_key",
-smalltalk.method({
-selector: "key",
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (84);
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLToggleCommand.klass)})},
-messageSends: []}),
-smalltalk.HLToggleCommand.klass);
-
-smalltalk.addMethod(
-"_label",
-smalltalk.method({
-selector: "label",
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "Toggle";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLToggleCommand.klass)})},
-messageSends: []}),
-smalltalk.HLToggleCommand.klass);
-
-
-smalltalk.addClass('HLToggleClassSideCommand', smalltalk.HLToggleCommand, [], 'Helios-Commands-Browser');
-smalltalk.addMethod(
-"_execute",
-smalltalk.method({
-selector: "execute",
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._model())._showInstance_(false);
-return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLToggleClassSideCommand)})},
-messageSends: ["showInstance:", "model"]}),
-smalltalk.HLToggleClassSideCommand);
-
-
-smalltalk.addMethod(
-"_key",
-smalltalk.method({
-selector: "key",
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (67);
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLToggleClassSideCommand.klass)})},
-messageSends: []}),
-smalltalk.HLToggleClassSideCommand.klass);
-
-smalltalk.addMethod(
-"_label",
-smalltalk.method({
-selector: "label",
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "Class side";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLToggleClassSideCommand.klass)})},
-messageSends: []}),
-smalltalk.HLToggleClassSideCommand.klass);
-
-
-smalltalk.addClass('HLToggleInstanceSideCommand', smalltalk.HLToggleCommand, [], 'Helios-Commands-Browser');
-smalltalk.addMethod(
-"_execute",
-smalltalk.method({
-selector: "execute",
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._model())._showInstance_(true);
-return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLToggleInstanceSideCommand)})},
-messageSends: ["showInstance:", "model"]}),
-smalltalk.HLToggleInstanceSideCommand);
-
-
-smalltalk.addMethod(
-"_key",
-smalltalk.method({
-selector: "key",
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (73);
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLToggleInstanceSideCommand.klass)})},
-messageSends: []}),
-smalltalk.HLToggleInstanceSideCommand.klass);
-
-smalltalk.addMethod(
-"_label",
-smalltalk.method({
-selector: "label",
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "Instance side";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLToggleInstanceSideCommand.klass)})},
-messageSends: []}),
-smalltalk.HLToggleInstanceSideCommand.klass);
-
-
 smalltalk.addClass('HLOpenCommand', smalltalk.HLCommand, [], 'Helios-Commands-Core');
 
 smalltalk.addMethod(

+ 57 - 634
js/Helios-Commands-Core.js

@@ -1,5 +1,25 @@
 smalltalk.addPackage('Helios-Commands-Core');
 smalltalk.addClass('HLCommand', smalltalk.Object, [], 'Helios-Commands-Core');
+smalltalk.addMethod(
+"_activeBlock",
+smalltalk.method({
+selector: "activeBlock",
+category: 'accessing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
var $1;
+$1=(function(){
+return smalltalk.withContext(function($ctx2) {
return true;
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"activeBlock",{},smalltalk.HLCommand)})},
+args: [],
+source: "activeBlock\x0a\x09^ [ true ]",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLCommand);
+
 smalltalk.addMethod(
 "_asActionBinding",
 smalltalk.method({
@@ -8,14 +28,14 @@ category: 'converting',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1;
-$1=_st(_st((smalltalk.HLBindingAction || HLBindingAction))._on_labelled_(_st(self)._key(),_st(self)._label()))._callback_((function(){
+$1=_st(_st((smalltalk.HLBindingAction || HLBindingAction))._on_labelled_activeBlock_(_st(self)._key(),_st(self)._label(),_st(self)._activeBlock()))._callback_((function(){
 return smalltalk.withContext(function($ctx2) {
return _st(self)._execute();
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"asActionBinding",{},smalltalk.HLCommand)})},
 args: [],
-source: "asActionBinding\x0a\x09^ (HLBindingAction on: self key labelled: self label)\x0a    \x09callback: [ self execute ]",
-messageSends: ["callback:", "execute", "on:labelled:", "key", "label"],
+source: "asActionBinding\x0a\x09^ (HLBindingAction on: self key labelled: self label activeBlock: self activeBlock)\x0a    \x09callback: [ self execute ]",
+messageSends: ["callback:", "execute", "on:labelled:activeBlock:", "key", "label", "activeBlock"],
 referencedClasses: ["HLBindingAction"]
 }),
 smalltalk.HLCommand);
@@ -167,6 +187,27 @@ referencedClasses: []
 smalltalk.HLCommand);
 
 
+smalltalk.addMethod(
+"_asBindingOn_",
+smalltalk.method({
+selector: "asBindingOn:",
+category: 'converting',
+fn: function (aBinding){
+var self=this;
+var instance;
+return smalltalk.withContext(function($ctx1) { 
var $1;
+instance=_st(_st(self)._new())._asBinding();
+_st(aBinding)._add_(instance);
+$1=instance;
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"asBindingOn:",{aBinding:aBinding,instance:instance},smalltalk.HLCommand.klass)})},
+args: ["aBinding"],
+source: "asBindingOn: aBinding\x0a\x09| instance |\x0a\x09\x0a\x09instance := self new asBinding.\x0a\x09aBinding add: instance.\x0a\x09^ instance",
+messageSends: ["asBinding", "new", "add:"],
+referencedClasses: []
+}),
+smalltalk.HLCommand.klass);
+
 smalltalk.addMethod(
 "_concreteSubclasses",
 smalltalk.method({
@@ -260,20 +301,23 @@ selector: "registerConcreteClassesOn:",
 category: 'registration',
 fn: function (aBinding){
 var self=this;
+var newBinding;
 return smalltalk.withContext(function($ctx1) { 
var $1;
-_st(_st(self)._concreteSubclasses())._do_((function(each){
-var binding;
-return smalltalk.withContext(function($ctx2) {
binding=_st(each)._registerOn_(aBinding);
-binding;
-$1=_st(binding)._isBindingGroup();
+$1=_st(self)._isConcrete();
 if(smalltalk.assert($1)){
-return _st(each)._registerConcreteClassesOn_(binding);
+newBinding=_st(self)._asBindingOn_(aBinding);
+newBinding;
+} else {
+newBinding=aBinding;
+newBinding;
 };
-}, function($ctx2) {$ctx2.fillBlock({each:each,binding:binding},$ctx1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"registerConcreteClassesOn:",{aBinding:aBinding},smalltalk.HLCommand.klass)})},
+_st(_st(self)._subclasses())._do_((function(each){
+return smalltalk.withContext(function($ctx2) {
return _st(each)._registerConcreteClassesOn_(newBinding);
+}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
+return self}, function($ctx1) {$ctx1.fill(self,"registerConcreteClassesOn:",{aBinding:aBinding,newBinding:newBinding},smalltalk.HLCommand.klass)})},
 args: ["aBinding"],
-source: "registerConcreteClassesOn: aBinding\x0a\x09self concreteSubclasses do: [ :each | | binding |\x0a\x09\x09binding := each registerOn: aBinding.\x0a\x09\x09binding isBindingGroup ifTrue: [\x0a\x09\x09\x09each registerConcreteClassesOn: binding ] ]",
-messageSends: ["do:", "registerOn:", "ifTrue:", "registerConcreteClassesOn:", "isBindingGroup", "concreteSubclasses"],
+source: "registerConcreteClassesOn: aBinding\x0a\x09| newBinding |\x0a\x09\x0a\x09self isConcrete\x0a\x09\x09ifTrue: [ newBinding := self asBindingOn: aBinding ]\x0a\x09\x09ifFalse: [ newBinding := aBinding ].\x0a\x09\x09\x0a\x09self subclasses do: [ :each | each registerConcreteClassesOn: newBinding ]",
+messageSends: ["ifTrue:ifFalse:", "asBindingOn:", "isConcrete", "do:", "registerConcreteClassesOn:", "subclasses"],
 referencedClasses: []
 }),
 smalltalk.HLCommand.klass);
@@ -446,627 +490,6 @@ referencedClasses: []
 smalltalk.HLModelCommand.klass);
 
 
-smalltalk.addClass('HLBrowserCommand', smalltalk.HLModelCommand, [], 'Helios-Commands-Browser');
-
-smalltalk.addMethod(
-"_for_",
-smalltalk.method({
-selector: "for:",
-category: 'instance creation',
-fn: function (aBrowserModel){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $2,$3,$1;
-$2=_st(self)._new();
-_st($2)._model_(aBrowserModel);
-$3=_st($2)._yourself();
-$1=$3;
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"for:",{aBrowserModel:aBrowserModel},smalltalk.HLBrowserCommand.klass)})},
-args: ["aBrowserModel"],
-source: "for: aBrowserModel\x0a\x09^ self new\x0a    \x09model: aBrowserModel;\x0a        yourself",
-messageSends: ["model:", "new", "yourself"],
-referencedClasses: []
-}),
-smalltalk.HLBrowserCommand.klass);
-
-
-smalltalk.addClass('HLBrowserGoToCommand', smalltalk.HLBrowserCommand, [], 'Helios-Commands-Browser');
-
-smalltalk.addMethod(
-"_key",
-smalltalk.method({
-selector: "key",
-category: 'accessing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (71);
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLGoToCommand.klass)})},
-args: [],
-source: "key\x0a\x09^ 71",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.HLBrowserGoToCommand.klass);
-
-smalltalk.addMethod(
-"_label",
-smalltalk.method({
-selector: "label",
-category: 'accessing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "Go to";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLGoToCommand.klass)})},
-args: [],
-source: "label\x0a\x09^ 'Go to'",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.HLBrowserGoToCommand.klass);
-
-
-smalltalk.addClass('HLGoToClassesCommand', smalltalk.HLBrowserGoToCommand, [], 'Helios-Commands-Browser');
-smalltalk.addMethod(
-"_execute",
-smalltalk.method({
-selector: "execute",
-category: 'executing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._model())._focusOnClasses();
-return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLGoToClassesCommand)})},
-args: [],
-source: "execute\x0a\x09self model focusOnClasses",
-messageSends: ["focusOnClasses", "model"],
-referencedClasses: []
-}),
-smalltalk.HLGoToClassesCommand);
-
-
-smalltalk.addMethod(
-"_key",
-smalltalk.method({
-selector: "key",
-category: 'accessing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (67);
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLGoToClassesCommand.klass)})},
-args: [],
-source: "key\x0a\x09\x22c\x22\x0a    \x0a\x09^ 67",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.HLGoToClassesCommand.klass);
-
-smalltalk.addMethod(
-"_label",
-smalltalk.method({
-selector: "label",
-category: 'accessing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "Classes";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLGoToClassesCommand.klass)})},
-args: [],
-source: "label\x0a\x09^ 'Classes'",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.HLGoToClassesCommand.klass);
-
-
-smalltalk.addClass('HLGoToMethodsCommand', smalltalk.HLBrowserGoToCommand, [], 'Helios-Commands-Browser');
-smalltalk.addMethod(
-"_execute",
-smalltalk.method({
-selector: "execute",
-category: 'executing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._model())._focusOnMethods();
-return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLGoToMethodsCommand)})},
-args: [],
-source: "execute\x0a\x09self model focusOnMethods",
-messageSends: ["focusOnMethods", "model"],
-referencedClasses: []
-}),
-smalltalk.HLGoToMethodsCommand);
-
-
-smalltalk.addMethod(
-"_key",
-smalltalk.method({
-selector: "key",
-category: 'accessing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (77);
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLGoToMethodsCommand.klass)})},
-args: [],
-source: "key\x0a\x09\x22m\x22\x0a    \x0a\x09^ 77",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.HLGoToMethodsCommand.klass);
-
-smalltalk.addMethod(
-"_label",
-smalltalk.method({
-selector: "label",
-category: 'accessing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "Methods";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLGoToMethodsCommand.klass)})},
-args: [],
-source: "label\x0a\x09^ 'Methods'",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.HLGoToMethodsCommand.klass);
-
-
-smalltalk.addClass('HLGoToPackagesCommand', smalltalk.HLBrowserGoToCommand, [], 'Helios-Commands-Browser');
-smalltalk.addMethod(
-"_execute",
-smalltalk.method({
-selector: "execute",
-category: 'executing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._model())._focusOnPackages();
-return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLGoToPackagesCommand)})},
-args: [],
-source: "execute\x0a\x09self model focusOnPackages",
-messageSends: ["focusOnPackages", "model"],
-referencedClasses: []
-}),
-smalltalk.HLGoToPackagesCommand);
-
-
-smalltalk.addMethod(
-"_key",
-smalltalk.method({
-selector: "key",
-category: 'accessing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (80);
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLGoToPackagesCommand.klass)})},
-args: [],
-source: "key\x0a\x09\x22p\x22\x0a    \x0a\x09^ 80",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.HLGoToPackagesCommand.klass);
-
-smalltalk.addMethod(
-"_label",
-smalltalk.method({
-selector: "label",
-category: 'accessing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "Packages";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLGoToPackagesCommand.klass)})},
-args: [],
-source: "label\x0a\x09^ 'Packages'",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.HLGoToPackagesCommand.klass);
-
-
-smalltalk.addClass('HLGoToProtocolsCommand', smalltalk.HLBrowserGoToCommand, [], 'Helios-Commands-Browser');
-smalltalk.addMethod(
-"_execute",
-smalltalk.method({
-selector: "execute",
-category: 'executing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._model())._focusOnProtocols();
-return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLGoToProtocolsCommand)})},
-args: [],
-source: "execute\x0a\x09self model focusOnProtocols",
-messageSends: ["focusOnProtocols", "model"],
-referencedClasses: []
-}),
-smalltalk.HLGoToProtocolsCommand);
-
-
-smalltalk.addMethod(
-"_key",
-smalltalk.method({
-selector: "key",
-category: 'accessing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (84);
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLGoToProtocolsCommand.klass)})},
-args: [],
-source: "key\x0a\x09\x22p\x22\x0a    \x0a\x09^ 84",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.HLGoToProtocolsCommand.klass);
-
-smalltalk.addMethod(
-"_label",
-smalltalk.method({
-selector: "label",
-category: 'accessing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "Protocols";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLGoToProtocolsCommand.klass)})},
-args: [],
-source: "label\x0a\x09^ 'Protocols'",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.HLGoToProtocolsCommand.klass);
-
-
-smalltalk.addClass('HLGoToSourceCodeCommand', smalltalk.HLBrowserGoToCommand, [], 'Helios-Commands-Browser');
-smalltalk.addMethod(
-"_execute",
-smalltalk.method({
-selector: "execute",
-category: 'executing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._model())._focusOnSourceCode();
-return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLGoToSourceCodeCommand)})},
-args: [],
-source: "execute\x0a\x09self model focusOnSourceCode",
-messageSends: ["focusOnSourceCode", "model"],
-referencedClasses: []
-}),
-smalltalk.HLGoToSourceCodeCommand);
-
-
-smalltalk.addMethod(
-"_key",
-smalltalk.method({
-selector: "key",
-category: 'accessing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (83);
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLGoToSourceCodeCommand.klass)})},
-args: [],
-source: "key\x0a\x09\x22s\x22\x0a    \x0a\x09^ 83",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.HLGoToSourceCodeCommand.klass);
-
-smalltalk.addMethod(
-"_label",
-smalltalk.method({
-selector: "label",
-category: 'accessing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "Source code";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLGoToSourceCodeCommand.klass)})},
-args: [],
-source: "label\x0a\x09^ 'Source code'",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.HLGoToSourceCodeCommand.klass);
-
-
-smalltalk.addClass('HLMoveToCommand', smalltalk.HLBrowserCommand, [], 'Helios-Commands-Browser');
-
-smalltalk.addMethod(
-"_key",
-smalltalk.method({
-selector: "key",
-category: 'accessing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (77);
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLMoveToCommand.klass)})},
-args: [],
-source: "key\x0a\x09^ 77",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.HLMoveToCommand.klass);
-
-smalltalk.addMethod(
-"_label",
-smalltalk.method({
-selector: "label",
-category: 'accessing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "Move";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLMoveToCommand.klass)})},
-args: [],
-source: "label\x0a\x09^ 'Move'",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.HLMoveToCommand.klass);
-
-
-smalltalk.addClass('HLMoveMethodToCommand', smalltalk.HLMoveToCommand, [], 'Helios-Commands-Browser');
-
-smalltalk.addMethod(
-"_key",
-smalltalk.method({
-selector: "key",
-category: 'accessing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (77);
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLMoveMethodToCommand.klass)})},
-args: [],
-source: "key\x0a\x09^ 77",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.HLMoveMethodToCommand.klass);
-
-smalltalk.addMethod(
-"_label",
-smalltalk.method({
-selector: "label",
-category: 'accessing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "Method";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLMoveMethodToCommand.klass)})},
-args: [],
-source: "label\x0a\x09^ 'Method'",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.HLMoveMethodToCommand.klass);
-
-
-smalltalk.addClass('HLMoveMethodToClassCommand', smalltalk.HLMoveMethodToCommand, [], 'Helios-Commands-Browser');
-smalltalk.addMethod(
-"_execute",
-smalltalk.method({
-selector: "execute",
-category: 'executing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLMoveMethodToClassCommand)})},
-args: [],
-source: "execute",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.HLMoveMethodToClassCommand);
-
-
-smalltalk.addMethod(
-"_key",
-smalltalk.method({
-selector: "key",
-category: 'accessing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (67);
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLMoveMethodToClassCommand.klass)})},
-args: [],
-source: "key\x0a\x09^ 67",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.HLMoveMethodToClassCommand.klass);
-
-smalltalk.addMethod(
-"_label",
-smalltalk.method({
-selector: "label",
-category: 'accessing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "to class";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLMoveMethodToClassCommand.klass)})},
-args: [],
-source: "label\x09\x0a\x09^ 'to class'",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.HLMoveMethodToClassCommand.klass);
-
-
-smalltalk.addClass('HLMoveMethodToProtocolCommand', smalltalk.HLMoveMethodToCommand, [], 'Helios-Commands-Browser');
-smalltalk.addMethod(
-"_execute",
-smalltalk.method({
-selector: "execute",
-category: 'executing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLMoveMethodToProtocolCommand)})},
-args: [],
-source: "execute",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.HLMoveMethodToProtocolCommand);
-
-
-smalltalk.addMethod(
-"_key",
-smalltalk.method({
-selector: "key",
-category: 'accessing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (84);
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLMoveMethodToProtocolCommand.klass)})},
-args: [],
-source: "key\x0a\x09^ 84",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.HLMoveMethodToProtocolCommand.klass);
-
-smalltalk.addMethod(
-"_label",
-smalltalk.method({
-selector: "label",
-category: 'accessing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "to protocol";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLMoveMethodToProtocolCommand.klass)})},
-args: [],
-source: "label\x0a\x09^ 'to protocol'",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.HLMoveMethodToProtocolCommand.klass);
-
-
-smalltalk.addClass('HLToggleCommand', smalltalk.HLBrowserCommand, [], 'Helios-Commands-Browser');
-
-smalltalk.addMethod(
-"_key",
-smalltalk.method({
-selector: "key",
-category: 'accessing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (84);
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLToggleCommand.klass)})},
-args: [],
-source: "key\x0a\x09^ 84",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.HLToggleCommand.klass);
-
-smalltalk.addMethod(
-"_label",
-smalltalk.method({
-selector: "label",
-category: 'accessing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "Toggle";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLToggleCommand.klass)})},
-args: [],
-source: "label\x0a\x09^ 'Toggle'",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.HLToggleCommand.klass);
-
-
-smalltalk.addClass('HLToggleClassSideCommand', smalltalk.HLToggleCommand, [], 'Helios-Commands-Browser');
-smalltalk.addMethod(
-"_execute",
-smalltalk.method({
-selector: "execute",
-category: 'executing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._model())._showInstance_(false);
-return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLToggleClassSideCommand)})},
-args: [],
-source: "execute\x0a\x09self model showInstance: false",
-messageSends: ["showInstance:", "model"],
-referencedClasses: []
-}),
-smalltalk.HLToggleClassSideCommand);
-
-
-smalltalk.addMethod(
-"_key",
-smalltalk.method({
-selector: "key",
-category: 'accessing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (67);
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLToggleClassSideCommand.klass)})},
-args: [],
-source: "key\x0a\x09\x22c\x22\x0a    \x0a\x09^ 67",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.HLToggleClassSideCommand.klass);
-
-smalltalk.addMethod(
-"_label",
-smalltalk.method({
-selector: "label",
-category: 'accessing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "Class side";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLToggleClassSideCommand.klass)})},
-args: [],
-source: "label\x0a\x09^ 'Class side'",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.HLToggleClassSideCommand.klass);
-
-
-smalltalk.addClass('HLToggleInstanceSideCommand', smalltalk.HLToggleCommand, [], 'Helios-Commands-Browser');
-smalltalk.addMethod(
-"_execute",
-smalltalk.method({
-selector: "execute",
-category: 'executing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._model())._showInstance_(true);
-return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLToggleInstanceSideCommand)})},
-args: [],
-source: "execute\x0a\x09self model showInstance: true",
-messageSends: ["showInstance:", "model"],
-referencedClasses: []
-}),
-smalltalk.HLToggleInstanceSideCommand);
-
-
-smalltalk.addMethod(
-"_key",
-smalltalk.method({
-selector: "key",
-category: 'accessing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (73);
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLToggleInstanceSideCommand.klass)})},
-args: [],
-source: "key\x0a\x09\x22i\x22\x0a    \x0a\x09^ 73",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.HLToggleInstanceSideCommand.klass);
-
-smalltalk.addMethod(
-"_label",
-smalltalk.method({
-selector: "label",
-category: 'accessing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "Instance side";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLToggleInstanceSideCommand.klass)})},
-args: [],
-source: "label\x0a\x09^ 'Instance side'",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.HLToggleInstanceSideCommand.klass);
-
-
 smalltalk.addClass('HLOpenCommand', smalltalk.HLCommand, [], 'Helios-Commands-Core');
 
 smalltalk.addMethod(

+ 20 - 3
js/Helios-KeyBindings.deploy.js

@@ -248,6 +248,24 @@ messageSends: []}),
 smalltalk.HLBindingAction);
 
 
+smalltalk.addMethod(
+"_on_labelled_activeBlock_",
+smalltalk.method({
+selector: "on:labelled:activeBlock:",
+fn: function (anInteger,aString,aBlock){
+var self=this;
+var instance;
+return smalltalk.withContext(function($ctx1) { 
var $2,$3,$1;
+instance=smalltalk.HLBinding.klass.fn.prototype._on_labelled_.apply(_st(self), [anInteger,aString]);
+$2=instance;
+_st($2)._activeBlock_(aBlock);
+$3=_st($2)._yourself();
+$1=$3;
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"on:labelled:activeBlock:",{anInteger:anInteger,aString:aString,aBlock:aBlock,instance:instance},smalltalk.HLBindingAction.klass)})},
+messageSends: ["on:labelled:", "activeBlock:", "yourself"]}),
+smalltalk.HLBindingAction.klass);
+
 
 smalltalk.addClass('HLBindingGroup', smalltalk.HLBinding, ['bindings'], 'Helios-KeyBindings');
 smalltalk.addMethod(
@@ -573,16 +591,15 @@ var self=this;
 var group;
 return smalltalk.withContext(function($ctx1) { 
var $1,$2,$3;
 $1=_st((smalltalk.HLBindingGroup || HLBindingGroup))._new();
-_st($1)._addGroupKey_labelled_((79),"Open");
 _st($1)._addGroupKey_labelled_((86),"View");
 _st($1)._add_(_st(_st((smalltalk.HLCloseTabCommand || HLCloseTabCommand))._new())._asBinding());
 $2=_st($1)._yourself();
 group=$2;
-_st((smalltalk.HLOpenCommand || HLOpenCommand))._registerConcreteClassesOn_(_st(group)._at_("Open"));
+_st((smalltalk.HLOpenCommand || HLOpenCommand))._registerConcreteClassesOn_(group);
 $3=group;
 return $3;
 }, function($ctx1) {$ctx1.fill(self,"defaultBindings",{group:group},smalltalk.HLKeyBinder)})},
-messageSends: ["addGroupKey:labelled:", "new", "add:", "asBinding", "yourself", "registerConcreteClassesOn:", "at:"]}),
+messageSends: ["addGroupKey:labelled:", "new", "add:", "asBinding", "yourself", "registerConcreteClassesOn:"]}),
 smalltalk.HLKeyBinder);
 
 smalltalk.addMethod(

+ 26 - 4
js/Helios-KeyBindings.js

@@ -343,6 +343,29 @@ referencedClasses: []
 smalltalk.HLBindingAction);
 
 
+smalltalk.addMethod(
+"_on_labelled_activeBlock_",
+smalltalk.method({
+selector: "on:labelled:activeBlock:",
+category: 'instance creation',
+fn: function (anInteger,aString,aBlock){
+var self=this;
+var instance;
+return smalltalk.withContext(function($ctx1) { 
var $2,$3,$1;
+instance=smalltalk.HLBinding.klass.fn.prototype._on_labelled_.apply(_st(self), [anInteger,aString]);
+$2=instance;
+_st($2)._activeBlock_(aBlock);
+$3=_st($2)._yourself();
+$1=$3;
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"on:labelled:activeBlock:",{anInteger:anInteger,aString:aString,aBlock:aBlock,instance:instance},smalltalk.HLBindingAction.klass)})},
+args: ["anInteger", "aString", "aBlock"],
+source: "on: anInteger labelled: aString activeBlock: aBlock\x0a\x09| instance |\x0a\x09\x0a\x09instance := super on: anInteger labelled: aString.\x0a\x09^ instance \x0a\x09\x09activeBlock: aBlock;\x0a\x09\x09yourself",
+messageSends: ["on:labelled:", "activeBlock:", "yourself"],
+referencedClasses: []
+}),
+smalltalk.HLBindingAction.klass);
+
 
 smalltalk.addClass('HLBindingGroup', smalltalk.HLBinding, ['bindings'], 'Helios-KeyBindings');
 smalltalk.addMethod(
@@ -779,18 +802,17 @@ var self=this;
 var group;
 return smalltalk.withContext(function($ctx1) { 
var $1,$2,$3;
 $1=_st((smalltalk.HLBindingGroup || HLBindingGroup))._new();
-_st($1)._addGroupKey_labelled_((79),"Open");
 _st($1)._addGroupKey_labelled_((86),"View");
 _st($1)._add_(_st(_st((smalltalk.HLCloseTabCommand || HLCloseTabCommand))._new())._asBinding());
 $2=_st($1)._yourself();
 group=$2;
-_st((smalltalk.HLOpenCommand || HLOpenCommand))._registerConcreteClassesOn_(_st(group)._at_("Open"));
+_st((smalltalk.HLOpenCommand || HLOpenCommand))._registerConcreteClassesOn_(group);
 $3=group;
 return $3;
 }, function($ctx1) {$ctx1.fill(self,"defaultBindings",{group:group},smalltalk.HLKeyBinder)})},
 args: [],
-source: "defaultBindings\x0a\x09| group |\x0a\x09\x0a\x09group := HLBindingGroup new\x0a\x09\x09addGroupKey: 79 labelled: 'Open';\x0a\x09\x09addGroupKey: 86 labelled: 'View';\x0a\x09\x09add: HLCloseTabCommand new asBinding;\x0a\x09\x09yourself.\x0a\x09\x09\x0a\x09HLOpenCommand registerConcreteClassesOn: (group at: 'Open').\x0a\x09\x09\x09\x09\x0a\x09^ group",
-messageSends: ["addGroupKey:labelled:", "new", "add:", "asBinding", "yourself", "registerConcreteClassesOn:", "at:"],
+source: "defaultBindings\x0a\x09| group |\x0a\x09\x0a\x09group := HLBindingGroup new\x0a\x09\x09addGroupKey: 86 labelled: 'View';\x0a\x09\x09add: HLCloseTabCommand new asBinding;\x0a\x09\x09yourself.\x0a\x09\x09\x0a\x09HLOpenCommand registerConcreteClassesOn: group.\x0a\x09\x09\x09\x09\x0a\x09^ group",
+messageSends: ["addGroupKey:labelled:", "new", "add:", "asBinding", "yourself", "registerConcreteClassesOn:"],
 referencedClasses: ["HLBindingGroup", "HLCloseTabCommand", "HLOpenCommand"]
 }),
 smalltalk.HLKeyBinder);

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

@@ -153,6 +153,12 @@ HLMoveToCommand subclass: #HLMoveMethodToCommand
  instanceVariableNames: ''
  package: 'Helios-Commands-Browser'!
 
+!HLMoveMethodToCommand methodsFor: 'accessing'!
+
+activeBlock
+	^ [ self model selectedMethod notNil ]
+! !
+
 !HLMoveMethodToCommand class methodsFor: 'accessing'!
 
 key

+ 22 - 265
st/Helios-Commands-Core.st

@@ -5,6 +5,10 @@ Object subclass: #HLCommand
 
 !HLCommand methodsFor: 'accessing'!
 
+activeBlock
+	^ [ true ]
+!
+
 documentation
 	^ self class documentation
 !
@@ -20,7 +24,7 @@ label
 !HLCommand methodsFor: 'converting'!
 
 asActionBinding
-	^ (HLBindingAction on: self key labelled: self label)
+	^ (HLBindingAction on: self key labelled: self label activeBlock: self activeBlock)
     	callback: [ self execute ]
 !
 
@@ -72,13 +76,26 @@ label
 	^ ''
 ! !
 
+!HLCommand class methodsFor: 'converting'!
+
+asBindingOn: aBinding
+	| instance |
+	
+	instance := self new asBinding.
+	aBinding add: instance.
+	^ instance
+! !
+
 !HLCommand class methodsFor: 'registration'!
 
 registerConcreteClassesOn: aBinding
-	self concreteSubclasses do: [ :each | | binding |
-		binding := each registerOn: aBinding.
-		binding isBindingGroup ifTrue: [
-			each registerConcreteClassesOn: binding ] ]
+	| newBinding |
+	
+	self isConcrete
+		ifTrue: [ newBinding := self asBindingOn: aBinding ]
+		ifFalse: [ newBinding := aBinding ].
+		
+	self subclasses do: [ :each | each registerConcreteClassesOn: newBinding ]
 !
 
 registerOn: aBinding
@@ -144,266 +161,6 @@ registerOn: aBinding for: aModel
 	^ (self for: aModel) registerOn: aBinding
 ! !
 
-HLModelCommand subclass: #HLBrowserCommand
- instanceVariableNames: ''
- package: 'Helios-Commands-Browser'!
-
-!HLBrowserCommand class methodsFor: 'instance creation'!
-
-for: aBrowserModel
-	^ self new
-    	model: aBrowserModel;
-        yourself
-! !
-
-HLBrowserCommand subclass: #HLBrowserGoToCommand
- instanceVariableNames: ''
- package: 'Helios-Commands-Browser'!
-
-!HLBrowserGoToCommand class methodsFor: 'accessing'!
-
-key
-	^ 71
-!
-
-label
-	^ 'Go to'
-! !
-
-HLBrowserGoToCommand subclass: #HLGoToClassesCommand
- instanceVariableNames: ''
- package: 'Helios-Commands-Browser'!
-
-!HLGoToClassesCommand methodsFor: 'executing'!
-
-execute
-	self model focusOnClasses
-! !
-
-!HLGoToClassesCommand class methodsFor: 'accessing'!
-
-key
-	"c"
-    
-	^ 67
-!
-
-label
-	^ 'Classes'
-! !
-
-HLBrowserGoToCommand subclass: #HLGoToMethodsCommand
- instanceVariableNames: ''
- package: 'Helios-Commands-Browser'!
-
-!HLGoToMethodsCommand methodsFor: 'executing'!
-
-execute
-	self model focusOnMethods
-! !
-
-!HLGoToMethodsCommand class methodsFor: 'accessing'!
-
-key
-	"m"
-    
-	^ 77
-!
-
-label
-	^ 'Methods'
-! !
-
-HLBrowserGoToCommand subclass: #HLGoToPackagesCommand
- instanceVariableNames: ''
- package: 'Helios-Commands-Browser'!
-
-!HLGoToPackagesCommand methodsFor: 'executing'!
-
-execute
-	self model focusOnPackages
-! !
-
-!HLGoToPackagesCommand class methodsFor: 'accessing'!
-
-key
-	"p"
-    
-	^ 80
-!
-
-label
-	^ 'Packages'
-! !
-
-HLBrowserGoToCommand subclass: #HLGoToProtocolsCommand
- instanceVariableNames: ''
- package: 'Helios-Commands-Browser'!
-
-!HLGoToProtocolsCommand methodsFor: 'executing'!
-
-execute
-	self model focusOnProtocols
-! !
-
-!HLGoToProtocolsCommand class methodsFor: 'accessing'!
-
-key
-	"p"
-    
-	^ 84
-!
-
-label
-	^ 'Protocols'
-! !
-
-HLBrowserGoToCommand subclass: #HLGoToSourceCodeCommand
- instanceVariableNames: ''
- package: 'Helios-Commands-Browser'!
-
-!HLGoToSourceCodeCommand methodsFor: 'executing'!
-
-execute
-	self model focusOnSourceCode
-! !
-
-!HLGoToSourceCodeCommand class methodsFor: 'accessing'!
-
-key
-	"s"
-    
-	^ 83
-!
-
-label
-	^ 'Source code'
-! !
-
-HLBrowserCommand subclass: #HLMoveToCommand
- instanceVariableNames: ''
- package: 'Helios-Commands-Browser'!
-
-!HLMoveToCommand class methodsFor: 'accessing'!
-
-key
-	^ 77
-!
-
-label
-	^ 'Move'
-! !
-
-HLMoveToCommand subclass: #HLMoveMethodToCommand
- instanceVariableNames: ''
- package: 'Helios-Commands-Browser'!
-
-!HLMoveMethodToCommand class methodsFor: 'accessing'!
-
-key
-	^ 77
-!
-
-label
-	^ 'Method'
-! !
-
-HLMoveMethodToCommand subclass: #HLMoveMethodToClassCommand
- instanceVariableNames: ''
- package: 'Helios-Commands-Browser'!
-
-!HLMoveMethodToClassCommand methodsFor: 'executing'!
-
-execute
-! !
-
-!HLMoveMethodToClassCommand class methodsFor: 'accessing'!
-
-key
-	^ 67
-!
-
-label	
-	^ 'to class'
-! !
-
-HLMoveMethodToCommand subclass: #HLMoveMethodToProtocolCommand
- instanceVariableNames: ''
- package: 'Helios-Commands-Browser'!
-
-!HLMoveMethodToProtocolCommand methodsFor: 'executing'!
-
-execute
-! !
-
-!HLMoveMethodToProtocolCommand class methodsFor: 'accessing'!
-
-key
-	^ 84
-!
-
-label
-	^ 'to protocol'
-! !
-
-HLBrowserCommand subclass: #HLToggleCommand
- instanceVariableNames: ''
- package: 'Helios-Commands-Browser'!
-
-!HLToggleCommand class methodsFor: 'accessing'!
-
-key
-	^ 84
-!
-
-label
-	^ 'Toggle'
-! !
-
-HLToggleCommand subclass: #HLToggleClassSideCommand
- instanceVariableNames: ''
- package: 'Helios-Commands-Browser'!
-
-!HLToggleClassSideCommand methodsFor: 'executing'!
-
-execute
-	self model showInstance: false
-! !
-
-!HLToggleClassSideCommand class methodsFor: 'accessing'!
-
-key
-	"c"
-    
-	^ 67
-!
-
-label
-	^ 'Class side'
-! !
-
-HLToggleCommand subclass: #HLToggleInstanceSideCommand
- instanceVariableNames: ''
- package: 'Helios-Commands-Browser'!
-
-!HLToggleInstanceSideCommand methodsFor: 'executing'!
-
-execute
-	self model showInstance: true
-! !
-
-!HLToggleInstanceSideCommand class methodsFor: 'accessing'!
-
-key
-	"i"
-    
-	^ 73
-!
-
-label
-	^ 'Instance side'
-! !
-
 HLCommand subclass: #HLOpenCommand
  instanceVariableNames: ''
  package: 'Helios-Commands-Core'!

+ 12 - 2
st/Helios-KeyBindings.st

@@ -103,6 +103,17 @@ isBindingAction
 	^ true
 ! !
 
+!HLBindingAction class methodsFor: 'instance creation'!
+
+on: anInteger labelled: aString activeBlock: aBlock
+	| instance |
+	
+	instance := super on: anInteger labelled: aString.
+	^ instance 
+		activeBlock: aBlock;
+		yourself
+! !
+
 HLBinding subclass: #HLBindingGroup
  instanceVariableNames: 'bindings'
  package: 'Helios-KeyBindings'!
@@ -254,12 +265,11 @@ defaultBindings
 	| group |
 	
 	group := HLBindingGroup new
-		addGroupKey: 79 labelled: 'Open';
 		addGroupKey: 86 labelled: 'View';
 		add: HLCloseTabCommand new asBinding;
 		yourself.
 		
-	HLOpenCommand registerConcreteClassesOn: (group at: 'Open').
+	HLOpenCommand registerConcreteClassesOn: group.
 				
 	^ group
 ! !