浏览代码

First draw of command inputs

Benjamin Van Ryseghem 11 年之前
父节点
当前提交
99cda92b73

+ 11 - 0
js/Helios-Browser.deploy.js

@@ -1766,6 +1766,17 @@ return self}, function($ctx1) {$ctx1.fill(self,"handleUnkownVariableError:",{anE
 messageSends: ["announce:", "error:", "new", "yourself", "announcer"]}),
 smalltalk.HLBrowserModel);
 
+smalltalk.addMethod(
+"_moveMethodToClass_",
+smalltalk.method({
+selector: "moveMethodToClass:",
+fn: function (aClassName){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
_st(console)._log_(_st("moveMethodToClass ").__comma(aClassName));
+return self}, function($ctx1) {$ctx1.fill(self,"moveMethodToClass:",{aClassName:aClassName},smalltalk.HLBrowserModel)})},
+messageSends: ["log:", ","]}),
+smalltalk.HLBrowserModel);
+
 smalltalk.addMethod(
 "_packages",
 smalltalk.method({

+ 16 - 0
js/Helios-Browser.js

@@ -2306,6 +2306,22 @@ referencedClasses: ["HLUnknownVariableErrorRaised"]
 }),
 smalltalk.HLBrowserModel);
 
+smalltalk.addMethod(
+"_moveMethodToClass_",
+smalltalk.method({
+selector: "moveMethodToClass:",
+category: 'commands actions',
+fn: function (aClassName){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
_st(console)._log_(_st("moveMethodToClass ").__comma(aClassName));
+return self}, function($ctx1) {$ctx1.fill(self,"moveMethodToClass:",{aClassName:aClassName},smalltalk.HLBrowserModel)})},
+args: ["aClassName"],
+source: "moveMethodToClass: aClassName\x0a\x09console log: 'moveMethodToClass ', aClassName",
+messageSends: ["log:", ","],
+referencedClasses: []
+}),
+smalltalk.HLBrowserModel);
+
 smalltalk.addMethod(
 "_packages",
 smalltalk.method({

+ 54 - 12
js/Helios-Commands-Browser.deploy.js

@@ -289,16 +289,6 @@ 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",
@@ -323,6 +313,57 @@ messageSends: []}),
 smalltalk.HLMoveMethodToClassCommand.klass);
 
 
+smalltalk.addClass('HLMethodMoveToClassSelectionCommand', smalltalk.HLMoveMethodToClassCommand, [], 'Helios-Commands-Browser');
+smalltalk.addMethod(
+"_asBinding",
+smalltalk.method({
+selector: "asBinding",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
var $1;
+$1=_st(_st((smalltalk.HLBindingInput || HLBindingInput))._on_labelled_activeBlock_(_st(self)._key(),_st(self)._label(),_st(self)._activeBlock()))._callback_((function(ex){
+return smalltalk.withContext(function($ctx2) {
return _st(self)._execute_(ex);
+}, function($ctx2) {$ctx2.fillBlock({ex:ex},$ctx1)})}));
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"asBinding",{},smalltalk.HLMethodMoveToClassSelectionCommand)})},
+messageSends: ["callback:", "execute:", "on:labelled:activeBlock:", "key", "label", "activeBlock"]}),
+smalltalk.HLMethodMoveToClassSelectionCommand);
+
+smalltalk.addMethod(
+"_execute_",
+smalltalk.method({
+selector: "execute:",
+fn: function (aClass){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._model())._moveMethodToClass_(aClass);
+return self}, function($ctx1) {$ctx1.fill(self,"execute:",{aClass:aClass},smalltalk.HLMethodMoveToClassSelectionCommand)})},
+messageSends: ["moveMethodToClass:", "model"]}),
+smalltalk.HLMethodMoveToClassSelectionCommand);
+
+
+smalltalk.addMethod(
+"_key",
+smalltalk.method({
+selector: "key",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
return (13);
+}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLMethodMoveToClassSelectionCommand.klass)})},
+messageSends: []}),
+smalltalk.HLMethodMoveToClassSelectionCommand.klass);
+
+smalltalk.addMethod(
+"_label",
+smalltalk.method({
+selector: "label",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
return "select a class";
+}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLMethodMoveToClassSelectionCommand.klass)})},
+messageSends: []}),
+smalltalk.HLMethodMoveToClassSelectionCommand.klass);
+
+
 smalltalk.addClass('HLMoveMethodToProtocolCommand', smalltalk.HLMoveMethodToCommand, [], 'Helios-Commands-Browser');
 smalltalk.addMethod(
 "_execute",
@@ -330,8 +371,9 @@ 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: []}),
+return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._model())._moveMethodToProtocol();
+return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLMoveMethodToProtocolCommand)})},
+messageSends: ["moveMethodToProtocol", "model"]}),
 smalltalk.HLMoveMethodToProtocolCommand);
 
 

+ 74 - 17
js/Helios-Commands-Browser.js

@@ -404,20 +404,76 @@ smalltalk.HLMoveMethodToCommand.klass);
 
 
 smalltalk.addClass('HLMoveMethodToClassCommand', smalltalk.HLMoveMethodToCommand, [], 'Helios-Commands-Browser');
+
 smalltalk.addMethod(
-"_execute",
+"_key",
 smalltalk.method({
-selector: "execute",
-category: 'executing',
+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 self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLMoveMethodToClassCommand)})},
+return smalltalk.withContext(function($ctx1) { 
return "to class";
+}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLMoveMethodToClassCommand.klass)})},
 args: [],
-source: "execute",
+source: "label\x09\x0a\x09^ 'to class'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLMoveMethodToClassCommand);
+smalltalk.HLMoveMethodToClassCommand.klass);
+
+
+smalltalk.addClass('HLMethodMoveToClassSelectionCommand', smalltalk.HLMoveMethodToClassCommand, [], 'Helios-Commands-Browser');
+smalltalk.addMethod(
+"_asBinding",
+smalltalk.method({
+selector: "asBinding",
+category: 'converting',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
var $1;
+$1=_st(_st((smalltalk.HLBindingInput || HLBindingInput))._on_labelled_activeBlock_(_st(self)._key(),_st(self)._label(),_st(self)._activeBlock()))._callback_((function(ex){
+return smalltalk.withContext(function($ctx2) {
return _st(self)._execute_(ex);
+}, function($ctx2) {$ctx2.fillBlock({ex:ex},$ctx1)})}));
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"asBinding",{},smalltalk.HLMethodMoveToClassSelectionCommand)})},
+args: [],
+source: "asBinding\x0a\x09^ (HLBindingInput on: self key labelled: self label activeBlock: self activeBlock)\x0a    \x09callback: [:ex | self execute: ex ]",
+messageSends: ["callback:", "execute:", "on:labelled:activeBlock:", "key", "label", "activeBlock"],
+referencedClasses: ["HLBindingInput"]
+}),
+smalltalk.HLMethodMoveToClassSelectionCommand);
+
+smalltalk.addMethod(
+"_execute_",
+smalltalk.method({
+selector: "execute:",
+category: 'actions',
+fn: function (aClass){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._model())._moveMethodToClass_(aClass);
+return self}, function($ctx1) {$ctx1.fill(self,"execute:",{aClass:aClass},smalltalk.HLMethodMoveToClassSelectionCommand)})},
+args: ["aClass"],
+source: "execute: aClass\x0a\x09self model moveMethodToClass: aClass",
+messageSends: ["moveMethodToClass:", "model"],
+referencedClasses: []
+}),
+smalltalk.HLMethodMoveToClassSelectionCommand);
 
 
 smalltalk.addMethod(
@@ -427,14 +483,14 @@ 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)})},
+return smalltalk.withContext(function($ctx1) { 
return (13);
+}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLMethodMoveToClassSelectionCommand.klass)})},
 args: [],
-source: "key\x0a\x09^ 67",
+source: "key\x0a\x09^ 13 \x22enter\x22",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLMoveMethodToClassCommand.klass);
+smalltalk.HLMethodMoveToClassSelectionCommand.klass);
 
 smalltalk.addMethod(
 "_label",
@@ -443,14 +499,14 @@ 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)})},
+return smalltalk.withContext(function($ctx1) { 
return "select a class";
+}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLMethodMoveToClassSelectionCommand.klass)})},
 args: [],
-source: "label\x09\x0a\x09^ 'to class'",
+source: "label\x0a\x09^ 'select a class'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLMoveMethodToClassCommand.klass);
+smalltalk.HLMethodMoveToClassSelectionCommand.klass);
 
 
 smalltalk.addClass('HLMoveMethodToProtocolCommand', smalltalk.HLMoveMethodToCommand, [], 'Helios-Commands-Browser');
@@ -461,10 +517,11 @@ selector: "execute",
 category: 'executing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLMoveMethodToProtocolCommand)})},
+return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._model())._moveMethodToProtocol();
+return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLMoveMethodToProtocolCommand)})},
 args: [],
-source: "execute",
-messageSends: [],
+source: "execute\x0a\x09self model moveMethodToProtocol",
+messageSends: ["moveMethodToProtocol", "model"],
 referencedClasses: []
 }),
 smalltalk.HLMoveMethodToProtocolCommand);

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

@@ -1,5 +1,5 @@
 smalltalk.addPackage('Helios-KeyBindings');
-smalltalk.addClass('HLBinding', smalltalk.Object, ['key', 'label'], 'Helios-KeyBindings');
+smalltalk.addClass('HLBinding', smalltalk.Object, ['key', 'label', 'each'], 'Helios-KeyBindings');
 smalltalk.addMethod(
 "_applyOn_",
 smalltalk.method({
@@ -107,6 +107,32 @@ return self}, function($ctx1) {$ctx1.fill(self,"label:",{aString:aString}, small
 messageSends: []}),
 smalltalk.HLBinding);
 
+smalltalk.addMethod(
+"_renderBindingOn_actionOn_",
+smalltalk.method({
+selector: "renderBindingOn:actionOn:",
+fn: function (html,aBinder){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
var $1,$3,$4,$5,$6,$2;
+$1=_st(html)._span();
+_st($1)._class_("command");
+$2=_st($1)._with_((function(){
+return smalltalk.withContext(function($ctx2) {
$3=_st(html)._span();
+_st($3)._class_("label");
+$4=_st($3)._with_(_st(_st(self)._shortcut())._asLowercase());
+$4;
+$5=_st(html)._a();
+_st($5)._class_("action");
+_st($5)._with_(_st(self)._displayLabel());
+$6=_st($5)._onClick_((function(){
+return smalltalk.withContext(function($ctx3) {
return _st(aBinder)._applyBinding_(self);
+}, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
+return $6;
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
+return self}, function($ctx1) {$ctx1.fill(self,"renderBindingOn:actionOn:",{html:html,aBinder:aBinder},smalltalk.HLBinding)})},
+messageSends: ["class:", "span", "with:", "asLowercase", "shortcut", "a", "displayLabel", "onClick:", "applyBinding:"]}),
+smalltalk.HLBinding);
+
 smalltalk.addMethod(
 "_renderOn_html_",
 smalltalk.method({
@@ -267,6 +293,60 @@ messageSends: ["on:labelled:", "activeBlock:", "yourself"]}),
 smalltalk.HLBindingAction.klass);
 
 
+smalltalk.addClass('HLBindingInput', smalltalk.HLBindingAction, ['input'], 'Helios-KeyBindings');
+smalltalk.addMethod(
+"_applyOn_",
+smalltalk.method({
+selector: "applyOn:",
+fn: function (aBinder){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
var $1,$2;
+$1=_st(self)._isActive();
+if(! smalltalk.assert($1)){
+$2=self;
+return $2;
+};
+_st(aBinder)._applyBindingInput_with_(self,_st(self)._input());
+return self}, function($ctx1) {$ctx1.fill(self,"applyOn:",{aBinder:aBinder},smalltalk.HLBindingInput)})},
+messageSends: ["ifFalse:", "isActive", "applyBindingInput:with:", "input"]}),
+smalltalk.HLBindingInput);
+
+smalltalk.addMethod(
+"_input",
+smalltalk.method({
+selector: "input",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
var $1;
+$1=_st(_st(self["@input"])._asJQuery())._val();
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"input",{},smalltalk.HLBindingInput)})},
+messageSends: ["val", "asJQuery"]}),
+smalltalk.HLBindingInput);
+
+smalltalk.addMethod(
+"_renderBindingOn_actionOn_",
+smalltalk.method({
+selector: "renderBindingOn:actionOn:",
+fn: function (html,aBinder){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
var $1,$3,$4,$2;
+$1=_st(html)._span();
+_st($1)._class_("command");
+$2=_st($1)._with_((function(){
+return smalltalk.withContext(function($ctx2) {
$3=_st(html)._input();
+_st($3)._class_("search-query");
+$4=_st($3)._placeholder_(_st(self)._displayLabel());
+self["@input"]=$4;
+return self["@input"];
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
+_st(_st(self["@input"])._asJQuery())._focus();
+return self}, function($ctx1) {$ctx1.fill(self,"renderBindingOn:actionOn:",{html:html,aBinder:aBinder},smalltalk.HLBindingInput)})},
+messageSends: ["class:", "span", "with:", "input", "placeholder:", "displayLabel", "focus", "asJQuery"]}),
+smalltalk.HLBindingInput);
+
+
+
 smalltalk.addClass('HLBindingGroup', smalltalk.HLBinding, ['bindings'], 'Helios-KeyBindings');
 smalltalk.addMethod(
 "_activeBindings",
@@ -551,6 +631,18 @@ return self}, function($ctx1) {$ctx1.fill(self,"applyBindingGroup:",{aBinding:aB
 messageSends: ["refresh", "helper"]}),
 smalltalk.HLKeyBinder);
 
+smalltalk.addMethod(
+"_applyBindingInput_with_",
+smalltalk.method({
+selector: "applyBindingInput:with:",
+fn: function (aBinding,value){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
_st(_st(aBinding)._callback())._value_(value);
+_st(self)._deactivate();
+return self}, function($ctx1) {$ctx1.fill(self,"applyBindingInput:with:",{aBinding:aBinding,value:value},smalltalk.HLKeyBinder)})},
+messageSends: ["value:", "callback", "deactivate"]}),
+smalltalk.HLKeyBinder);
+
 smalltalk.addMethod(
 "_bindings",
 smalltalk.method({
@@ -870,29 +962,13 @@ smalltalk.method({
 selector: "renderBindingGroup:on:",
 fn: function (aBindingGroup,html){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1,$3,$4,$5,$6,$2;
-_st(_st(_st(aBindingGroup)._activeBindings())._sorted_((function(a,b){
+return smalltalk.withContext(function($ctx1) { 
_st(_st(_st(aBindingGroup)._activeBindings())._sorted_((function(a,b){
 return smalltalk.withContext(function($ctx2) {
return _st(_st(a)._key()).__lt(_st(b)._key());
 }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1)})})))._do_((function(each){
-return smalltalk.withContext(function($ctx2) {
$1=_st(html)._span();
-_st($1)._class_("command");
-$2=_st($1)._with_((function(){
-return smalltalk.withContext(function($ctx3) {
$3=_st(html)._span();
-_st($3)._class_("label");
-$4=_st($3)._with_(_st(_st(each)._shortcut())._asLowercase());
-$4;
-$5=_st(html)._a();
-_st($5)._class_("action");
-_st($5)._with_(_st(each)._displayLabel());
-$6=_st($5)._onClick_((function(){
-return smalltalk.withContext(function($ctx4) {
return _st(_st(self)._keyBinder())._applyBinding_(each);
-}, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}));
-return $6;
-}, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
-return $2;
+return smalltalk.withContext(function($ctx2) {
return _st(each)._renderBindingOn_actionOn_(html,_st(self)._keyBinder());
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
 return self}, function($ctx1) {$ctx1.fill(self,"renderBindingGroup:on:",{aBindingGroup:aBindingGroup,html:html},smalltalk.HLKeyBinderHelper)})},
-messageSends: ["do:", "class:", "span", "with:", "asLowercase", "shortcut", "a", "displayLabel", "onClick:", "applyBinding:", "keyBinder", "sorted:", "<", "key", "activeBindings"]}),
+messageSends: ["do:", "renderBindingOn:actionOn:", "keyBinder", "sorted:", "<", "key", "activeBindings"]}),
 smalltalk.HLKeyBinderHelper);
 
 smalltalk.addMethod(

+ 122 - 21
js/Helios-KeyBindings.js

@@ -1,5 +1,5 @@
 smalltalk.addPackage('Helios-KeyBindings');
-smalltalk.addClass('HLBinding', smalltalk.Object, ['key', 'label'], 'Helios-KeyBindings');
+smalltalk.addClass('HLBinding', smalltalk.Object, ['key', 'label', 'each'], 'Helios-KeyBindings');
 smalltalk.addMethod(
 "_applyOn_",
 smalltalk.method({
@@ -152,6 +152,37 @@ referencedClasses: []
 }),
 smalltalk.HLBinding);
 
+smalltalk.addMethod(
+"_renderBindingOn_actionOn_",
+smalltalk.method({
+selector: "renderBindingOn:actionOn:",
+category: 'rendering',
+fn: function (html,aBinder){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
var $1,$3,$4,$5,$6,$2;
+$1=_st(html)._span();
+_st($1)._class_("command");
+$2=_st($1)._with_((function(){
+return smalltalk.withContext(function($ctx2) {
$3=_st(html)._span();
+_st($3)._class_("label");
+$4=_st($3)._with_(_st(_st(self)._shortcut())._asLowercase());
+$4;
+$5=_st(html)._a();
+_st($5)._class_("action");
+_st($5)._with_(_st(self)._displayLabel());
+$6=_st($5)._onClick_((function(){
+return smalltalk.withContext(function($ctx3) {
return _st(aBinder)._applyBinding_(self);
+}, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
+return $6;
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
+return self}, function($ctx1) {$ctx1.fill(self,"renderBindingOn:actionOn:",{html:html,aBinder:aBinder},smalltalk.HLBinding)})},
+args: ["html", "aBinder"],
+source: "renderBindingOn: html actionOn: aBinder\x0a\x0a\x09html span class: 'command'; with: [\x0a\x09\x09html span \x0a\x09\x09\x09class: 'label'; \x0a\x09\x09\x09with: self shortcut asLowercase.\x0a  \x09\x09html a \x0a        \x09class: 'action'; \x0a            with: self displayLabel;\x0a  \x09\x09\x09onClick: [ aBinder applyBinding: self ] ]",
+messageSends: ["class:", "span", "with:", "asLowercase", "shortcut", "a", "displayLabel", "onClick:", "applyBinding:"],
+referencedClasses: []
+}),
+smalltalk.HLBinding);
+
 smalltalk.addMethod(
 "_renderOn_html_",
 smalltalk.method({
@@ -367,6 +398,75 @@ referencedClasses: []
 smalltalk.HLBindingAction.klass);
 
 
+smalltalk.addClass('HLBindingInput', smalltalk.HLBindingAction, ['input'], 'Helios-KeyBindings');
+smalltalk.addMethod(
+"_applyOn_",
+smalltalk.method({
+selector: "applyOn:",
+category: 'actions',
+fn: function (aBinder){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
var $1,$2;
+$1=_st(self)._isActive();
+if(! smalltalk.assert($1)){
+$2=self;
+return $2;
+};
+_st(aBinder)._applyBindingInput_with_(self,_st(self)._input());
+return self}, function($ctx1) {$ctx1.fill(self,"applyOn:",{aBinder:aBinder},smalltalk.HLBindingInput)})},
+args: ["aBinder"],
+source: "applyOn: aBinder\x0a\x09self isActive ifFalse: [ ^ self ].\x0a\x09\x0a\x09aBinder applyBindingInput: self with: self input",
+messageSends: ["ifFalse:", "isActive", "applyBindingInput:with:", "input"],
+referencedClasses: []
+}),
+smalltalk.HLBindingInput);
+
+smalltalk.addMethod(
+"_input",
+smalltalk.method({
+selector: "input",
+category: 'actions',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
var $1;
+$1=_st(_st(self["@input"])._asJQuery())._val();
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"input",{},smalltalk.HLBindingInput)})},
+args: [],
+source: "input\x0a\x09^ input asJQuery val",
+messageSends: ["val", "asJQuery"],
+referencedClasses: []
+}),
+smalltalk.HLBindingInput);
+
+smalltalk.addMethod(
+"_renderBindingOn_actionOn_",
+smalltalk.method({
+selector: "renderBindingOn:actionOn:",
+category: 'rendering',
+fn: function (html,aBinder){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
var $1,$3,$4,$2;
+$1=_st(html)._span();
+_st($1)._class_("command");
+$2=_st($1)._with_((function(){
+return smalltalk.withContext(function($ctx2) {
$3=_st(html)._input();
+_st($3)._class_("search-query");
+$4=_st($3)._placeholder_(_st(self)._displayLabel());
+self["@input"]=$4;
+return self["@input"];
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
+_st(_st(self["@input"])._asJQuery())._focus();
+return self}, function($ctx1) {$ctx1.fill(self,"renderBindingOn:actionOn:",{html:html,aBinder:aBinder},smalltalk.HLBindingInput)})},
+args: ["html", "aBinder"],
+source: "renderBindingOn: html actionOn: aBinder\x0a\x0a\x09html span \x0a\x09\x09class: 'command'; \x0a\x09\x09with: [\x0a\x09\x09\x09\x22html form\x0a\x09\x09\x09\x09class: 'form-search';\x0a\x09\x09\x09\x09with: [\x0a\x09\x09\x09\x09\x09html div\x0a\x09\x09\x09\x09\x09  class: 'input-append';\x0a\x09\x09\x09\x09\x09  with: [\x0a\x09\x09\x09\x09\x09\x09html input\x0a\x09\x09\x09\x09\x09\x09\x09type: 'text';\x0a\x09\x09\x09\x09\x09\x09\x09class: 'search-query';\x0a\x09\x09\x09\x09\x09\x09\x09placeholder: self displayLabel.\x0a\x09\x09\x09\x09\x09\x09html button\x0a\x09\x09\x09\x09\x09\x09\x09type: 'submit';\x0a\x09\x09\x09\x09\x09\x09\x09class: 'btn';\x0a\x09\x09\x09\x09\x09\x09\x09with: 'Ok' ] ] ]\x0a\x09\x09\x22\x0a\x09\x09input := html input\x0a\x09\x09\x09class: 'search-query';\x0a\x09\x09\x09placeholder: self displayLabel ].\x0a\x09\x09input asJQuery focus",
+messageSends: ["class:", "span", "with:", "input", "placeholder:", "displayLabel", "focus", "asJQuery"],
+referencedClasses: []
+}),
+smalltalk.HLBindingInput);
+
+
+
 smalltalk.addClass('HLBindingGroup', smalltalk.HLBinding, ['bindings'], 'Helios-KeyBindings');
 smalltalk.addMethod(
 "_activeBindings",
@@ -751,6 +851,23 @@ referencedClasses: []
 }),
 smalltalk.HLKeyBinder);
 
+smalltalk.addMethod(
+"_applyBindingInput_with_",
+smalltalk.method({
+selector: "applyBindingInput:with:",
+category: 'actions',
+fn: function (aBinding,value){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
_st(_st(aBinding)._callback())._value_(value);
+_st(self)._deactivate();
+return self}, function($ctx1) {$ctx1.fill(self,"applyBindingInput:with:",{aBinding:aBinding,value:value},smalltalk.HLKeyBinder)})},
+args: ["aBinding", "value"],
+source: "applyBindingInput: aBinding with: value\x0a    aBinding callback value: value.\x0a\x09self deactivate",
+messageSends: ["value:", "callback", "deactivate"],
+referencedClasses: []
+}),
+smalltalk.HLKeyBinder);
+
 smalltalk.addMethod(
 "_bindings",
 smalltalk.method({
@@ -1176,31 +1293,15 @@ selector: "renderBindingGroup:on:",
 category: 'rendering',
 fn: function (aBindingGroup,html){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1,$3,$4,$5,$6,$2;
-_st(_st(_st(aBindingGroup)._activeBindings())._sorted_((function(a,b){
+return smalltalk.withContext(function($ctx1) { 
_st(_st(_st(aBindingGroup)._activeBindings())._sorted_((function(a,b){
 return smalltalk.withContext(function($ctx2) {
return _st(_st(a)._key()).__lt(_st(b)._key());
 }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1)})})))._do_((function(each){
-return smalltalk.withContext(function($ctx2) {
$1=_st(html)._span();
-_st($1)._class_("command");
-$2=_st($1)._with_((function(){
-return smalltalk.withContext(function($ctx3) {
$3=_st(html)._span();
-_st($3)._class_("label");
-$4=_st($3)._with_(_st(_st(each)._shortcut())._asLowercase());
-$4;
-$5=_st(html)._a();
-_st($5)._class_("action");
-_st($5)._with_(_st(each)._displayLabel());
-$6=_st($5)._onClick_((function(){
-return smalltalk.withContext(function($ctx4) {
return _st(_st(self)._keyBinder())._applyBinding_(each);
-}, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}));
-return $6;
-}, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
-return $2;
+return smalltalk.withContext(function($ctx2) {
return _st(each)._renderBindingOn_actionOn_(html,_st(self)._keyBinder());
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
 return self}, function($ctx1) {$ctx1.fill(self,"renderBindingGroup:on:",{aBindingGroup:aBindingGroup,html:html},smalltalk.HLKeyBinderHelper)})},
 args: ["aBindingGroup", "html"],
-source: "renderBindingGroup: aBindingGroup on: html\x0a\x09(aBindingGroup activeBindings \x0a    \x09sorted: [ :a :b | a key < b key ])\x0a        do: [ :each |\x0a\x09\x09\x09html span class: 'command'; with: [\x0a\x09\x09\x09\x09html span class: 'label'; with: each shortcut asLowercase.\x0a  \x09\x09\x09\x09html a \x0a                \x09class: 'action'; \x0a                    with: each displayLabel;\x0a  \x09\x09\x09\x09\x09onClick: [ self keyBinder applyBinding: each ] ] ]",
-messageSends: ["do:", "class:", "span", "with:", "asLowercase", "shortcut", "a", "displayLabel", "onClick:", "applyBinding:", "keyBinder", "sorted:", "<", "key", "activeBindings"],
+source: "renderBindingGroup: aBindingGroup on: html\x0a\x09(aBindingGroup activeBindings \x0a    \x09sorted: [ :a :b | a key < b key ])\x0a        do: [ :each | each renderBindingOn: html actionOn: self keyBinder ]",
+messageSends: ["do:", "renderBindingOn:actionOn:", "keyBinder", "sorted:", "<", "key", "activeBindings"],
 referencedClasses: []
 }),
 smalltalk.HLKeyBinderHelper);

+ 6 - 0
st/Helios-Browser.st

@@ -844,6 +844,12 @@ saveSourceCode
 	self announcer announce: HLSaveSourceCode new
 ! !
 
+!HLBrowserModel methodsFor: 'commands actions'!
+
+moveMethodToClass: aClassName
+	console log: 'moveMethodToClass ', aClassName
+! !
+
 !HLBrowserModel methodsFor: 'compiling'!
 
 compileClassComment: aString

+ 28 - 5
st/Helios-Commands-Browser.st

@@ -173,11 +173,6 @@ HLMoveMethodToCommand subclass: #HLMoveMethodToClassCommand
  instanceVariableNames: ''
  package: 'Helios-Commands-Browser'!
 
-!HLMoveMethodToClassCommand methodsFor: 'executing'!
-
-execute
-! !
-
 !HLMoveMethodToClassCommand class methodsFor: 'accessing'!
 
 key
@@ -188,6 +183,33 @@ label
 	^ 'to class'
 ! !
 
+HLMoveMethodToClassCommand subclass: #HLMethodMoveToClassSelectionCommand
+ instanceVariableNames: ''
+ package: 'Helios-Commands-Browser'!
+
+!HLMethodMoveToClassSelectionCommand methodsFor: 'actions'!
+
+execute: aClass
+	self model moveMethodToClass: aClass
+! !
+
+!HLMethodMoveToClassSelectionCommand methodsFor: 'converting'!
+
+asBinding
+	^ (HLBindingInput on: self key labelled: self label activeBlock: self activeBlock)
+    	callback: [:ex | self execute: ex ]
+! !
+
+!HLMethodMoveToClassSelectionCommand class methodsFor: 'accessing'!
+
+key
+	^ 13 "enter"
+!
+
+label
+	^ 'select a class'
+! !
+
 HLMoveMethodToCommand subclass: #HLMoveMethodToProtocolCommand
  instanceVariableNames: ''
  package: 'Helios-Commands-Browser'!
@@ -195,6 +217,7 @@ HLMoveMethodToCommand subclass: #HLMoveMethodToProtocolCommand
 !HLMoveMethodToProtocolCommand methodsFor: 'executing'!
 
 execute
+	self model moveMethodToProtocol
 ! !
 
 !HLMoveMethodToProtocolCommand class methodsFor: 'accessing'!

+ 63 - 8
st/Helios-KeyBindings.st

@@ -1,6 +1,6 @@
 Smalltalk current createPackage: 'Helios-KeyBindings'!
 Object subclass: #HLBinding
- instanceVariableNames: 'key label'
+ instanceVariableNames: 'key label each'
  package: 'Helios-KeyBindings'!
 
 !HLBinding methodsFor: 'accessing'!
@@ -37,6 +37,18 @@ applyOn: aKeyBinder
 
 !HLBinding methodsFor: 'rendering'!
 
+renderBindingOn: html actionOn: aBinder
+
+	html span class: 'command'; with: [
+		html span 
+			class: 'label'; 
+			with: self shortcut asLowercase.
+  		html a 
+        	class: 'action'; 
+            with: self displayLabel;
+  			onClick: [ aBinder applyBinding: self ] ]
+!
+
 renderOn: aBindingHelper html: html
 ! !
 
@@ -114,6 +126,50 @@ on: anInteger labelled: aString activeBlock: aBlock
 		yourself
 ! !
 
+HLBindingAction subclass: #HLBindingInput
+ instanceVariableNames: 'input'
+ package: 'Helios-KeyBindings'!
+
+!HLBindingInput methodsFor: 'actions'!
+
+applyOn: aBinder
+	self isActive ifFalse: [ ^ self ].
+	
+	aBinder applyBindingInput: self with: self input
+!
+
+input
+	^ input asJQuery val
+! !
+
+!HLBindingInput methodsFor: 'rendering'!
+
+renderBindingOn: html actionOn: aBinder
+
+	html span 
+		class: 'command'; 
+		with: [
+			"html form
+				class: 'form-search';
+				with: [
+					html div
+					  class: 'input-append';
+					  with: [
+						html input
+							type: 'text';
+							class: 'search-query';
+							placeholder: self displayLabel.
+						html button
+							type: 'submit';
+							class: 'btn';
+							with: 'Ok' ] ] ]
+		"
+		input := html input
+			class: 'search-query';
+			placeholder: self displayLabel ].
+		input asJQuery focus
+! !
+
 HLBinding subclass: #HLBindingGroup
  instanceVariableNames: 'bindings'
  package: 'Helios-KeyBindings'!
@@ -250,6 +306,11 @@ applyBindingGroup: aBinding
     self helper refresh
 !
 
+applyBindingInput: aBinding with: value
+    aBinding callback value: value.
+	self deactivate
+!
+
 deactivate
     selectedBinding := nil.
 	self helper hide
@@ -392,13 +453,7 @@ registerBindings
 renderBindingGroup: aBindingGroup on: html
 	(aBindingGroup activeBindings 
     	sorted: [ :a :b | a key < b key ])
-        do: [ :each |
-			html span class: 'command'; with: [
-				html span class: 'label'; with: each shortcut asLowercase.
-  				html a 
-                	class: 'action'; 
-                    with: each displayLabel;
-  					onClick: [ self keyBinder applyBinding: each ] ] ]
+        do: [ :each | each renderBindingOn: html actionOn: self keyBinder ]
 !
 
 renderBindingOn: html