Browse Source

Keybinding action activation

Nicolas Petton 11 years ago
parent
commit
6225ff993c

+ 55 - 41
js/Helios-Browser.deploy.js

@@ -1,5 +1,5 @@
 smalltalk.addPackage('Helios-Browser');
-smalltalk.addClass('HLBrowser', smalltalk.HLWidget, ['model', 'packagesListWidget', 'classesListWidget', 'protocolsListWidget', 'methodsListWidget', 'sourceWidget'], 'Helios-Browser');
+smalltalk.addClass('HLBrowser', smalltalk.HLWidget, ['model', 'built', 'packagesListWidget', 'classesListWidget', 'protocolsListWidget', 'methodsListWidget', 'sourceWidget'], 'Helios-Browser');
 smalltalk.addMethod(
 "_announcer",
 smalltalk.method({
@@ -46,6 +46,18 @@ return $1;
 messageSends: ["environment", "model"]}),
 smalltalk.HLBrowser);
 
+smalltalk.addMethod(
+"_initialize",
+smalltalk.method({
+selector: "initialize",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
smalltalk.HLWidget.fn.prototype._initialize.apply(_st(self), []);
+self["@built"]=false;
+return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.HLBrowser)})},
+messageSends: ["initialize"]}),
+smalltalk.HLBrowser);
+
 smalltalk.addMethod(
 "_methodsListWidget",
 smalltalk.method({
@@ -164,9 +176,16 @@ smalltalk.method({
 selector: "renderContentOn:",
 fn: function (html){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(html)._with_(_st((smalltalk.HLContainer || HLContainer))._with_(_st((smalltalk.HLHorizontalSplitter || HLHorizontalSplitter))._with_with_(_st((smalltalk.HLVerticalSplitter || HLVerticalSplitter))._with_with_(_st((smalltalk.HLVerticalSplitter || HLVerticalSplitter))._with_with_(_st(self)._packagesListWidget(),_st(self)._classesListWidget()),_st((smalltalk.HLVerticalSplitter || HLVerticalSplitter))._with_with_(_st(self)._protocolsListWidget(),_st(self)._methodsListWidget())),_st(self)._sourceWidget())));
+return smalltalk.withContext(function($ctx1) { 
var $1;
+_st(html)._with_(_st((smalltalk.HLContainer || HLContainer))._with_(_st((smalltalk.HLHorizontalSplitter || HLHorizontalSplitter))._with_with_(_st((smalltalk.HLVerticalSplitter || HLVerticalSplitter))._with_with_(_st((smalltalk.HLVerticalSplitter || HLVerticalSplitter))._with_with_(_st(self)._packagesListWidget(),_st(self)._classesListWidget()),_st((smalltalk.HLVerticalSplitter || HLVerticalSplitter))._with_with_(_st(self)._protocolsListWidget(),_st(self)._methodsListWidget())),_st(self)._sourceWidget())));
+$1=self["@built"];
+if(! smalltalk.assert($1)){
+_st(_st(self)._packagesListWidget())._focus();
+self["@built"]=true;
+self["@built"];
+};
 return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html}, smalltalk.HLBrowser)})},
-messageSends: ["with:", "with:with:", "packagesListWidget", "classesListWidget", "protocolsListWidget", "methodsListWidget", "sourceWidget"]}),
+messageSends: ["with:", "with:with:", "packagesListWidget", "classesListWidget", "protocolsListWidget", "methodsListWidget", "sourceWidget", "ifFalse:", "focus"]}),
 smalltalk.HLBrowser);
 
 smalltalk.addMethod(
@@ -1576,24 +1595,31 @@ selector: "compilationProtocol",
 fn: function (){
 var self=this;
 var currentProtocol;
-return smalltalk.withContext(function($ctx1) { 
var $1,$3,$2;
+return smalltalk.withContext(function($ctx1) { 
var $1,$2,$4,$3;
 currentProtocol=_st(self)._selectedProtocol();
-$1=_st(self)._selectedMethod();
+$1=currentProtocol;
 if(($receiver = $1) == nil || $receiver == undefined){
+currentProtocol=_st(self)._unclassifiedProtocol();
+currentProtocol;
+} else {
 $1;
+};
+$2=_st(self)._selectedMethod();
+if(($receiver = $2) == nil || $receiver == undefined){
+$2;
 } else {
 currentProtocol=_st(_st(self)._selectedMethod())._protocol();
 currentProtocol;
 };
-$3=_st(currentProtocol).__eq(_st(self)._allProtocol());
-if(smalltalk.assert($3)){
-$2=_st(self)._unclassifiedProtocol();
+$4=_st(currentProtocol).__eq(_st(self)._allProtocol());
+if(smalltalk.assert($4)){
+$3=_st(self)._unclassifiedProtocol();
 } else {
-$2=currentProtocol;
+$3=currentProtocol;
 };
-return $2;
-}, function($ctx1) {$ctx1.fill(self,"compilationProtocol",{currentProtocol:currentProtocol}, smalltalk.HLBrowserModel)})},
-messageSends: ["selectedProtocol", "ifNotNil:", "protocol", "selectedMethod", "ifTrue:ifFalse:", "unclassifiedProtocol", "=", "allProtocol"]}),
+return $3;
+}, function($ctx1) {$ctx1.fill(self,"compilationProtocol",{currentProtocol:currentProtocol},smalltalk.HLBrowserModel)})},
+messageSends: ["selectedProtocol", "ifNil:", "unclassifiedProtocol", "ifNotNil:", "protocol", "selectedMethod", "ifTrue:ifFalse:", "=", "allProtocol"]}),
 smalltalk.HLBrowserModel);
 
 smalltalk.addMethod(
@@ -1789,20 +1815,15 @@ smalltalk.method({
 selector: "save:",
 fn: function (aString){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1,$2;
-$1=_st(self)._shouldCompileClassDefinition();
+return smalltalk.withContext(function($ctx1) { 
var $1;
+$1=_st(self)._shouldCompileClassDefinition_(aString);
 if(smalltalk.assert($1)){
 _st(self)._compileClassDefinition_(aString);
 } else {
-$2=_st(self)._shouldCompileClassComment();
-if(smalltalk.assert($2)){
-_st(self)._compileClassComment_(aString);
-} else {
 _st(self)._compileMethod_(aString);
 };
-};
-return self}, function($ctx1) {$ctx1.fill(self,"save:",{aString:aString}, smalltalk.HLBrowserModel)})},
-messageSends: ["ifTrue:ifFalse:", "compileClassDefinition:", "compileClassComment:", "compileMethod:", "shouldCompileClassComment", "shouldCompileClassDefinition"]}),
+return self}, function($ctx1) {$ctx1.fill(self,"save:",{aString:aString},smalltalk.HLBrowserModel)})},
+messageSends: ["ifTrue:ifFalse:", "compileClassDefinition:", "compileMethod:", "shouldCompileClassDefinition:"]}),
 smalltalk.HLBrowserModel);
 
 smalltalk.addMethod(
@@ -1878,11 +1899,13 @@ $2=_st(self)._selectedClass();
 if(($receiver = $2) == nil || $receiver == undefined){
 $1=$2;
 } else {
-$1=_st(_st(_st(self)._selectedClass())._methodDictionary())._at_(self["@selectedSelector"]);
+$1=_st(_st(_st(self)._selectedClass())._methodDictionary())._at_ifAbsent_(self["@selectedSelector"],(function(){
+return smalltalk.withContext(function($ctx2) {
return nil;
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
 };
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"selectedMethod",{}, smalltalk.HLBrowserModel)})},
-messageSends: ["ifNotNil:", "at:", "methodDictionary", "selectedClass"]}),
+}, function($ctx1) {$ctx1.fill(self,"selectedMethod",{},smalltalk.HLBrowserModel)})},
+messageSends: ["ifNotNil:", "at:ifAbsent:", "methodDictionary", "selectedClass"]}),
 smalltalk.HLBrowserModel);
 
 smalltalk.addMethod(
@@ -1980,27 +2003,18 @@ messageSends: ["ifTrue:", "=", "selectedMethod:", "announce:", "on:", "announcer
 smalltalk.HLBrowserModel);
 
 smalltalk.addMethod(
-"_shouldCompileClassComment",
+"_shouldCompileClassDefinition_",
 smalltalk.method({
-selector: "shouldCompileClassComment",
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return false;
-}, function($ctx1) {$ctx1.fill(self,"shouldCompileClassComment",{}, smalltalk.HLBrowserModel)})},
-messageSends: []}),
-smalltalk.HLBrowserModel);
-
-smalltalk.addMethod(
-"_shouldCompileClassDefinition",
-smalltalk.method({
-selector: "shouldCompileClassDefinition",
-fn: function (){
+selector: "shouldCompileClassDefinition:",
+fn: function (aString){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1;
-$1=_st(_st(self)._selectedProtocol())._isNil();
+$1=_st(_st(_st(self)._selectedClass())._isNil())._or_((function(){
+return smalltalk.withContext(function($ctx2) {
return _st(_st(_st(aString)._first())._asUppercase()).__eq(_st(aString)._first());
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"shouldCompileClassDefinition",{}, smalltalk.HLBrowserModel)})},
-messageSends: ["isNil", "selectedProtocol"]}),
+}, function($ctx1) {$ctx1.fill(self,"shouldCompileClassDefinition:",{aString:aString},smalltalk.HLBrowserModel)})},
+messageSends: ["or:", "=", "first", "asUppercase", "isNil", "selectedClass"]}),
 smalltalk.HLBrowserModel);
 
 smalltalk.addMethod(

+ 66 - 52
js/Helios-Browser.js

@@ -1,5 +1,5 @@
 smalltalk.addPackage('Helios-Browser');
-smalltalk.addClass('HLBrowser', smalltalk.HLWidget, ['model', 'packagesListWidget', 'classesListWidget', 'protocolsListWidget', 'methodsListWidget', 'sourceWidget'], 'Helios-Browser');
+smalltalk.addClass('HLBrowser', smalltalk.HLWidget, ['model', 'built', 'packagesListWidget', 'classesListWidget', 'protocolsListWidget', 'methodsListWidget', 'sourceWidget'], 'Helios-Browser');
 smalltalk.addMethod(
 "_announcer",
 smalltalk.method({
@@ -61,6 +61,23 @@ referencedClasses: []
 }),
 smalltalk.HLBrowser);
 
+smalltalk.addMethod(
+"_initialize",
+smalltalk.method({
+selector: "initialize",
+category: 'initialization',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
smalltalk.HLWidget.fn.prototype._initialize.apply(_st(self), []);
+self["@built"]=false;
+return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.HLBrowser)})},
+args: [],
+source: "initialize\x0a\x09super initialize.\x0a\x09built := false",
+messageSends: ["initialize"],
+referencedClasses: []
+}),
+smalltalk.HLBrowser);
+
 smalltalk.addMethod(
 "_methodsListWidget",
 smalltalk.method({
@@ -210,11 +227,18 @@ selector: "renderContentOn:",
 category: 'rendering',
 fn: function (html){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(html)._with_(_st((smalltalk.HLContainer || HLContainer))._with_(_st((smalltalk.HLHorizontalSplitter || HLHorizontalSplitter))._with_with_(_st((smalltalk.HLVerticalSplitter || HLVerticalSplitter))._with_with_(_st((smalltalk.HLVerticalSplitter || HLVerticalSplitter))._with_with_(_st(self)._packagesListWidget(),_st(self)._classesListWidget()),_st((smalltalk.HLVerticalSplitter || HLVerticalSplitter))._with_with_(_st(self)._protocolsListWidget(),_st(self)._methodsListWidget())),_st(self)._sourceWidget())));
+return smalltalk.withContext(function($ctx1) { 
var $1;
+_st(html)._with_(_st((smalltalk.HLContainer || HLContainer))._with_(_st((smalltalk.HLHorizontalSplitter || HLHorizontalSplitter))._with_with_(_st((smalltalk.HLVerticalSplitter || HLVerticalSplitter))._with_with_(_st((smalltalk.HLVerticalSplitter || HLVerticalSplitter))._with_with_(_st(self)._packagesListWidget(),_st(self)._classesListWidget()),_st((smalltalk.HLVerticalSplitter || HLVerticalSplitter))._with_with_(_st(self)._protocolsListWidget(),_st(self)._methodsListWidget())),_st(self)._sourceWidget())));
+$1=self["@built"];
+if(! smalltalk.assert($1)){
+_st(_st(self)._packagesListWidget())._focus();
+self["@built"]=true;
+self["@built"];
+};
 return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html}, smalltalk.HLBrowser)})},
 args: ["html"],
-source: "renderContentOn: html\x0a\x09html with: (HLContainer with: (HLHorizontalSplitter \x0a    \x09with: (HLVerticalSplitter\x0a        \x09with: (HLVerticalSplitter\x0a            \x09with: self packagesListWidget\x0a                with: self classesListWidget)\x0a            with: (HLVerticalSplitter\x0a            \x09with: self protocolsListWidget\x0a                with: self methodsListWidget)) \x0a        with: self sourceWidget))",
-messageSends: ["with:", "with:with:", "packagesListWidget", "classesListWidget", "protocolsListWidget", "methodsListWidget", "sourceWidget"],
+source: "renderContentOn: html\x0a\x09html with: (HLContainer with: (HLHorizontalSplitter \x0a    \x09with: (HLVerticalSplitter\x0a        \x09with: (HLVerticalSplitter\x0a            \x09with: self packagesListWidget\x0a                with: self classesListWidget)\x0a            with: (HLVerticalSplitter\x0a            \x09with: self protocolsListWidget\x0a                with: self methodsListWidget)) \x0a        with: self sourceWidget)).\x0a\x09\x0a\x09built ifFalse: [\x0a\x09\x09self packagesListWidget focus.\x0a\x09\x09built := true ]",
+messageSends: ["with:", "with:with:", "packagesListWidget", "classesListWidget", "protocolsListWidget", "methodsListWidget", "sourceWidget", "ifFalse:", "focus"],
 referencedClasses: ["HLVerticalSplitter", "HLHorizontalSplitter", "HLContainer"]
 }),
 smalltalk.HLBrowser);
@@ -2047,26 +2071,33 @@ category: 'private',
 fn: function (){
 var self=this;
 var currentProtocol;
-return smalltalk.withContext(function($ctx1) { 
var $1,$3,$2;
+return smalltalk.withContext(function($ctx1) { 
var $1,$2,$4,$3;
 currentProtocol=_st(self)._selectedProtocol();
-$1=_st(self)._selectedMethod();
+$1=currentProtocol;
 if(($receiver = $1) == nil || $receiver == undefined){
+currentProtocol=_st(self)._unclassifiedProtocol();
+currentProtocol;
+} else {
 $1;
+};
+$2=_st(self)._selectedMethod();
+if(($receiver = $2) == nil || $receiver == undefined){
+$2;
 } else {
 currentProtocol=_st(_st(self)._selectedMethod())._protocol();
 currentProtocol;
 };
-$3=_st(currentProtocol).__eq(_st(self)._allProtocol());
-if(smalltalk.assert($3)){
-$2=_st(self)._unclassifiedProtocol();
+$4=_st(currentProtocol).__eq(_st(self)._allProtocol());
+if(smalltalk.assert($4)){
+$3=_st(self)._unclassifiedProtocol();
 } else {
-$2=currentProtocol;
+$3=currentProtocol;
 };
-return $2;
-}, function($ctx1) {$ctx1.fill(self,"compilationProtocol",{currentProtocol:currentProtocol}, smalltalk.HLBrowserModel)})},
+return $3;
+}, function($ctx1) {$ctx1.fill(self,"compilationProtocol",{currentProtocol:currentProtocol},smalltalk.HLBrowserModel)})},
 args: [],
-source: "compilationProtocol\x0a\x09| currentProtocol |\x0a\x09\x0a\x09currentProtocol := self selectedProtocol.\x0a\x09self selectedMethod ifNotNil: [ currentProtocol := self selectedMethod protocol ].\x0a\x0a\x09^ currentProtocol = self allProtocol\x0a\x09\x09ifTrue: [ self unclassifiedProtocol ]\x0a\x09\x09ifFalse: [ currentProtocol ]",
-messageSends: ["selectedProtocol", "ifNotNil:", "protocol", "selectedMethod", "ifTrue:ifFalse:", "unclassifiedProtocol", "=", "allProtocol"],
+source: "compilationProtocol\x0a\x09| currentProtocol |\x0a\x09\x0a\x09currentProtocol := self selectedProtocol.\x0a\x09currentProtocol ifNil: [ currentProtocol := self unclassifiedProtocol ].\x0a\x09self selectedMethod ifNotNil: [ currentProtocol := self selectedMethod protocol ].\x0a\x0a\x09^ currentProtocol = self allProtocol\x0a\x09\x09ifTrue: [ self unclassifiedProtocol ]\x0a\x09\x09ifFalse: [ currentProtocol ]",
+messageSends: ["selectedProtocol", "ifNil:", "unclassifiedProtocol", "ifNotNil:", "protocol", "selectedMethod", "ifTrue:ifFalse:", "=", "allProtocol"],
 referencedClasses: []
 }),
 smalltalk.HLBrowserModel);
@@ -2335,22 +2366,17 @@ selector: "save:",
 category: 'actions',
 fn: function (aString){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1,$2;
-$1=_st(self)._shouldCompileClassDefinition();
+return smalltalk.withContext(function($ctx1) { 
var $1;
+$1=_st(self)._shouldCompileClassDefinition_(aString);
 if(smalltalk.assert($1)){
 _st(self)._compileClassDefinition_(aString);
 } else {
-$2=_st(self)._shouldCompileClassComment();
-if(smalltalk.assert($2)){
-_st(self)._compileClassComment_(aString);
-} else {
 _st(self)._compileMethod_(aString);
 };
-};
-return self}, function($ctx1) {$ctx1.fill(self,"save:",{aString:aString}, smalltalk.HLBrowserModel)})},
+return self}, function($ctx1) {$ctx1.fill(self,"save:",{aString:aString},smalltalk.HLBrowserModel)})},
 args: ["aString"],
-source: "save: aString\x0a\x09self shouldCompileClassDefinition \x0a\x09\x09ifTrue: [ self compileClassDefinition: aString ]\x0a\x09\x09ifFalse: [ \x0a\x09\x09\x09self shouldCompileClassComment \x0a\x09\x09\x09\x09ifTrue: [ self compileClassComment: aString ]\x0a\x09\x09\x09\x09ifFalse: [ self compileMethod: aString ] ]",
-messageSends: ["ifTrue:ifFalse:", "compileClassDefinition:", "compileClassComment:", "compileMethod:", "shouldCompileClassComment", "shouldCompileClassDefinition"],
+source: "save: aString\x0a\x09(self shouldCompileClassDefinition: aString)\x0a\x09\x09ifTrue: [ self compileClassDefinition: aString ]\x0a\x09\x09ifFalse: [ self compileMethod: aString ]",
+messageSends: ["ifTrue:ifFalse:", "compileClassDefinition:", "compileMethod:", "shouldCompileClassDefinition:"],
 referencedClasses: []
 }),
 smalltalk.HLBrowserModel);
@@ -2444,13 +2470,15 @@ $2=_st(self)._selectedClass();
 if(($receiver = $2) == nil || $receiver == undefined){
 $1=$2;
 } else {
-$1=_st(_st(_st(self)._selectedClass())._methodDictionary())._at_(self["@selectedSelector"]);
+$1=_st(_st(_st(self)._selectedClass())._methodDictionary())._at_ifAbsent_(self["@selectedSelector"],(function(){
+return smalltalk.withContext(function($ctx2) {
return nil;
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
 };
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"selectedMethod",{}, smalltalk.HLBrowserModel)})},
+}, function($ctx1) {$ctx1.fill(self,"selectedMethod",{},smalltalk.HLBrowserModel)})},
 args: [],
-source: "selectedMethod\x0a\x09^ self selectedClass\x0a    \x09ifNotNil: [ self selectedClass methodDictionary at: selectedSelector ]",
-messageSends: ["ifNotNil:", "at:", "methodDictionary", "selectedClass"],
+source: "selectedMethod\x0a\x09^ self selectedClass ifNotNil: [ \x0a\x09\x09\x09self selectedClass methodDictionary \x0a\x09\x09\x09\x09at: selectedSelector \x0a\x09\x09\x09\x09ifAbsent: [ nil ] ]",
+messageSends: ["ifNotNil:", "at:ifAbsent:", "methodDictionary", "selectedClass"],
 referencedClasses: []
 }),
 smalltalk.HLBrowserModel);
@@ -2575,35 +2603,21 @@ referencedClasses: ["HLProtocolSelected"]
 smalltalk.HLBrowserModel);
 
 smalltalk.addMethod(
-"_shouldCompileClassComment",
-smalltalk.method({
-selector: "shouldCompileClassComment",
-category: 'testing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
return false;
-}, function($ctx1) {$ctx1.fill(self,"shouldCompileClassComment",{}, smalltalk.HLBrowserModel)})},
-args: [],
-source: "shouldCompileClassComment\x0a\x09\x22TODO\x22\x0a\x09\x0a\x09^ false",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.HLBrowserModel);
-
-smalltalk.addMethod(
-"_shouldCompileClassDefinition",
+"_shouldCompileClassDefinition_",
 smalltalk.method({
-selector: "shouldCompileClassDefinition",
+selector: "shouldCompileClassDefinition:",
 category: 'testing',
-fn: function (){
+fn: function (aString){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1;
-$1=_st(_st(self)._selectedProtocol())._isNil();
+$1=_st(_st(_st(self)._selectedClass())._isNil())._or_((function(){
+return smalltalk.withContext(function($ctx2) {
return _st(_st(_st(aString)._first())._asUppercase()).__eq(_st(aString)._first());
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"shouldCompileClassDefinition",{}, smalltalk.HLBrowserModel)})},
-args: [],
-source: "shouldCompileClassDefinition\x0a\x09^ self selectedProtocol isNil",
-messageSends: ["isNil", "selectedProtocol"],
+}, function($ctx1) {$ctx1.fill(self,"shouldCompileClassDefinition:",{aString:aString},smalltalk.HLBrowserModel)})},
+args: ["aString"],
+source: "shouldCompileClassDefinition: aString\x0a\x09^ self selectedClass isNil or: [\x0a\x09\x09aString first asUppercase = aString first ]",
+messageSends: ["or:", "=", "first", "asUppercase", "isNil", "selectedClass"],
 referencedClasses: []
 }),
 smalltalk.HLBrowserModel);

+ 2 - 2
js/Helios-Commands.deploy.js

@@ -463,8 +463,8 @@ smalltalk.method({
 selector: "key",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (67);
-}, function($ctx1) {$ctx1.fill(self,"key",{}, smalltalk.HLCloseTabCommand.klass)})},
+return smalltalk.withContext(function($ctx1) { 
return (87);
+}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLCloseTabCommand.klass)})},
 messageSends: []}),
 smalltalk.HLCloseTabCommand.klass);
 

+ 3 - 3
js/Helios-Commands.js

@@ -649,10 +649,10 @@ selector: "key",
 category: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (67);
-}, function($ctx1) {$ctx1.fill(self,"key",{}, smalltalk.HLCloseTabCommand.klass)})},
+return smalltalk.withContext(function($ctx1) { 
return (87);
+}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLCloseTabCommand.klass)})},
 args: [],
-source: "key\x0a\x09^ 67",
+source: "key\x0a\x09^ 87",
 messageSends: [],
 referencedClasses: []
 }),

+ 115 - 13
js/Helios-KeyBindings.deploy.js

@@ -24,6 +24,19 @@ return $1;
 messageSends: ["label"]}),
 smalltalk.HLBinding);
 
+smalltalk.addMethod(
+"_isActive",
+smalltalk.method({
+selector: "isActive",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
var $1;
+$1=_st(self)._subclassResponsibility();
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"isActive",{},smalltalk.HLBinding)})},
+messageSends: ["subclassResponsibility"]}),
+smalltalk.HLBinding);
+
 smalltalk.addMethod(
 "_isBindingAction",
 smalltalk.method({
@@ -136,16 +149,54 @@ messageSends: ["key:", "new", "label:", "yourself"]}),
 smalltalk.HLBinding.klass);
 
 
-smalltalk.addClass('HLBindingAction', smalltalk.HLBinding, ['callback'], 'Helios-KeyBindings');
+smalltalk.addClass('HLBindingAction', smalltalk.HLBinding, ['callback', 'activeBlock'], 'Helios-KeyBindings');
+smalltalk.addMethod(
+"_activeBlock",
+smalltalk.method({
+selector: "activeBlock",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
var $2,$1;
+$2=self["@activeBlock"];
+if(($receiver = $2) == nil || $receiver == undefined){
+self["@activeBlock"]=(function(){
+return smalltalk.withContext(function($ctx2) {
return true;
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
+$1=self["@activeBlock"];
+} else {
+$1=$2;
+};
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"activeBlock",{},smalltalk.HLBindingAction)})},
+messageSends: ["ifNil:"]}),
+smalltalk.HLBindingAction);
+
+smalltalk.addMethod(
+"_activeBlock_",
+smalltalk.method({
+selector: "activeBlock:",
+fn: function (aBlock){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
self["@activeBlock"]=aBlock;
+return self}, function($ctx1) {$ctx1.fill(self,"activeBlock:",{aBlock:aBlock},smalltalk.HLBindingAction)})},
+messageSends: []}),
+smalltalk.HLBindingAction);
+
 smalltalk.addMethod(
 "_applyOn_",
 smalltalk.method({
 selector: "applyOn:",
 fn: function (aKeyBinder){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(aKeyBinder)._applyBindingAction_(self);
-return self}, function($ctx1) {$ctx1.fill(self,"applyOn:",{aKeyBinder:aKeyBinder}, smalltalk.HLBindingAction)})},
-messageSends: ["applyBindingAction:"]}),
+return smalltalk.withContext(function($ctx1) { 
var $1,$2;
+$1=_st(self)._isActive();
+if(! smalltalk.assert($1)){
+$2=self;
+return $2;
+};
+_st(aKeyBinder)._applyBindingAction_(self);
+return self}, function($ctx1) {$ctx1.fill(self,"applyOn:",{aKeyBinder:aKeyBinder},smalltalk.HLBindingAction)})},
+messageSends: ["ifFalse:", "isActive", "applyBindingAction:"]}),
 smalltalk.HLBindingAction);
 
 smalltalk.addMethod(
@@ -172,6 +223,19 @@ return self}, function($ctx1) {$ctx1.fill(self,"callback:",{aBlock:aBlock}, smal
 messageSends: []}),
 smalltalk.HLBindingAction);
 
+smalltalk.addMethod(
+"_isActive",
+smalltalk.method({
+selector: "isActive",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
var $1;
+$1=_st(_st(self)._activeBlock())._value();
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"isActive",{},smalltalk.HLBindingAction)})},
+messageSends: ["value", "activeBlock"]}),
+smalltalk.HLBindingAction);
+
 smalltalk.addMethod(
 "_isBindingAction",
 smalltalk.method({
@@ -186,6 +250,21 @@ smalltalk.HLBindingAction);
 
 
 smalltalk.addClass('HLBindingGroup', smalltalk.HLBinding, ['bindings'], 'Helios-KeyBindings');
+smalltalk.addMethod(
+"_activeBindings",
+smalltalk.method({
+selector: "activeBindings",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
var $1;
+$1=_st(_st(self)._bindings())._select_((function(each){
+return smalltalk.withContext(function($ctx2) {
return _st(each)._isActive();
+}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"activeBindings",{},smalltalk.HLBindingGroup)})},
+messageSends: ["select:", "isActive", "bindings"]}),
+smalltalk.HLBindingGroup);
+
 smalltalk.addMethod(
 "_add_",
 smalltalk.method({
@@ -246,9 +325,15 @@ smalltalk.method({
 selector: "applyOn:",
 fn: function (aKeyBinder){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(aKeyBinder)._applyBindingGroup_(self);
-return self}, function($ctx1) {$ctx1.fill(self,"applyOn:",{aKeyBinder:aKeyBinder}, smalltalk.HLBindingGroup)})},
-messageSends: ["applyBindingGroup:"]}),
+return smalltalk.withContext(function($ctx1) { 
var $1,$2;
+$1=_st(self)._isActive();
+if(! smalltalk.assert($1)){
+$2=self;
+return $2;
+};
+_st(aKeyBinder)._applyBindingGroup_(self);
+return self}, function($ctx1) {$ctx1.fill(self,"applyOn:",{aKeyBinder:aKeyBinder},smalltalk.HLBindingGroup)})},
+messageSends: ["ifFalse:", "isActive", "applyBindingGroup:"]}),
 smalltalk.HLBindingGroup);
 
 smalltalk.addMethod(
@@ -317,6 +402,19 @@ return $1;
 messageSends: [",", "displayLabel"]}),
 smalltalk.HLBindingGroup);
 
+smalltalk.addMethod(
+"_isActive",
+smalltalk.method({
+selector: "isActive",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
var $1;
+$1=_st(_st(self)._activeBindings())._notEmpty();
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"isActive",{},smalltalk.HLBindingGroup)})},
+messageSends: ["notEmpty", "activeBindings"]}),
+smalltalk.HLBindingGroup);
+
 smalltalk.addMethod(
 "_isBindingGroup",
 smalltalk.method({
@@ -334,9 +432,13 @@ smalltalk.method({
 selector: "renderOn:html:",
 fn: function (aBindingHelper,html){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(aBindingHelper)._renderBindingGroup_on_(self,html);
-return self}, function($ctx1) {$ctx1.fill(self,"renderOn:html:",{aBindingHelper:aBindingHelper,html:html}, smalltalk.HLBindingGroup)})},
-messageSends: ["renderBindingGroup:on:"]}),
+return smalltalk.withContext(function($ctx1) { 
var $1;
+$1=_st(self)._isActive();
+if(smalltalk.assert($1)){
+_st(aBindingHelper)._renderBindingGroup_on_(self,html);
+};
+return self}, function($ctx1) {$ctx1.fill(self,"renderOn:html:",{aBindingHelper:aBindingHelper,html:html},smalltalk.HLBindingGroup)})},
+messageSends: ["ifTrue:", "renderBindingGroup:on:", "isActive"]}),
 smalltalk.HLBindingGroup);
 
 
@@ -725,7 +827,7 @@ 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)._bindings())._sorted_((function(a,b){
+_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();
@@ -745,8 +847,8 @@ return $6;
 }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
 return $2;
 }, 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", "bindings"]}),
+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"]}),
 smalltalk.HLKeyBinderHelper);
 
 smalltalk.addMethod(

+ 149 - 17
js/Helios-KeyBindings.js

@@ -34,6 +34,24 @@ referencedClasses: []
 }),
 smalltalk.HLBinding);
 
+smalltalk.addMethod(
+"_isActive",
+smalltalk.method({
+selector: "isActive",
+category: 'testing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
var $1;
+$1=_st(self)._subclassResponsibility();
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"isActive",{},smalltalk.HLBinding)})},
+args: [],
+source: "isActive\x0a\x09^ self subclassResponsibility",
+messageSends: ["subclassResponsibility"],
+referencedClasses: []
+}),
+smalltalk.HLBinding);
+
 smalltalk.addMethod(
 "_isBindingAction",
 smalltalk.method({
@@ -191,7 +209,49 @@ referencedClasses: []
 smalltalk.HLBinding.klass);
 
 
-smalltalk.addClass('HLBindingAction', smalltalk.HLBinding, ['callback'], 'Helios-KeyBindings');
+smalltalk.addClass('HLBindingAction', smalltalk.HLBinding, ['callback', 'activeBlock'], 'Helios-KeyBindings');
+smalltalk.addMethod(
+"_activeBlock",
+smalltalk.method({
+selector: "activeBlock",
+category: 'accessing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
var $2,$1;
+$2=self["@activeBlock"];
+if(($receiver = $2) == nil || $receiver == undefined){
+self["@activeBlock"]=(function(){
+return smalltalk.withContext(function($ctx2) {
return true;
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
+$1=self["@activeBlock"];
+} else {
+$1=$2;
+};
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"activeBlock",{},smalltalk.HLBindingAction)})},
+args: [],
+source: "activeBlock\x0a\x09^ activeBlock ifNil: [ activeBlock := [ true ] ]",
+messageSends: ["ifNil:"],
+referencedClasses: []
+}),
+smalltalk.HLBindingAction);
+
+smalltalk.addMethod(
+"_activeBlock_",
+smalltalk.method({
+selector: "activeBlock:",
+category: 'accessing',
+fn: function (aBlock){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
self["@activeBlock"]=aBlock;
+return self}, function($ctx1) {$ctx1.fill(self,"activeBlock:",{aBlock:aBlock},smalltalk.HLBindingAction)})},
+args: ["aBlock"],
+source: "activeBlock: aBlock\x0a\x09activeBlock := aBlock",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLBindingAction);
+
 smalltalk.addMethod(
 "_applyOn_",
 smalltalk.method({
@@ -199,11 +259,17 @@ selector: "applyOn:",
 category: 'actions',
 fn: function (aKeyBinder){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(aKeyBinder)._applyBindingAction_(self);
-return self}, function($ctx1) {$ctx1.fill(self,"applyOn:",{aKeyBinder:aKeyBinder}, smalltalk.HLBindingAction)})},
+return smalltalk.withContext(function($ctx1) { 
var $1,$2;
+$1=_st(self)._isActive();
+if(! smalltalk.assert($1)){
+$2=self;
+return $2;
+};
+_st(aKeyBinder)._applyBindingAction_(self);
+return self}, function($ctx1) {$ctx1.fill(self,"applyOn:",{aKeyBinder:aKeyBinder},smalltalk.HLBindingAction)})},
 args: ["aKeyBinder"],
-source: "applyOn: aKeyBinder\x0a\x09aKeyBinder applyBindingAction: self",
-messageSends: ["applyBindingAction:"],
+source: "applyOn: aKeyBinder\x0a\x09self isActive ifFalse: [ ^ self ].\x0a\x09\x0a\x09aKeyBinder applyBindingAction: self",
+messageSends: ["ifFalse:", "isActive", "applyBindingAction:"],
 referencedClasses: []
 }),
 smalltalk.HLBindingAction);
@@ -242,6 +308,24 @@ referencedClasses: []
 }),
 smalltalk.HLBindingAction);
 
+smalltalk.addMethod(
+"_isActive",
+smalltalk.method({
+selector: "isActive",
+category: 'testing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
var $1;
+$1=_st(_st(self)._activeBlock())._value();
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"isActive",{},smalltalk.HLBindingAction)})},
+args: [],
+source: "isActive\x0a\x09^ self activeBlock value",
+messageSends: ["value", "activeBlock"],
+referencedClasses: []
+}),
+smalltalk.HLBindingAction);
+
 smalltalk.addMethod(
 "_isBindingAction",
 smalltalk.method({
@@ -261,6 +345,26 @@ smalltalk.HLBindingAction);
 
 
 smalltalk.addClass('HLBindingGroup', smalltalk.HLBinding, ['bindings'], 'Helios-KeyBindings');
+smalltalk.addMethod(
+"_activeBindings",
+smalltalk.method({
+selector: "activeBindings",
+category: 'accessing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
var $1;
+$1=_st(_st(self)._bindings())._select_((function(each){
+return smalltalk.withContext(function($ctx2) {
return _st(each)._isActive();
+}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"activeBindings",{},smalltalk.HLBindingGroup)})},
+args: [],
+source: "activeBindings\x0a\x09^ self bindings select: [ :each | each isActive ]",
+messageSends: ["select:", "isActive", "bindings"],
+referencedClasses: []
+}),
+smalltalk.HLBindingGroup);
+
 smalltalk.addMethod(
 "_add_",
 smalltalk.method({
@@ -342,11 +446,17 @@ selector: "applyOn:",
 category: 'actions',
 fn: function (aKeyBinder){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(aKeyBinder)._applyBindingGroup_(self);
-return self}, function($ctx1) {$ctx1.fill(self,"applyOn:",{aKeyBinder:aKeyBinder}, smalltalk.HLBindingGroup)})},
+return smalltalk.withContext(function($ctx1) { 
var $1,$2;
+$1=_st(self)._isActive();
+if(! smalltalk.assert($1)){
+$2=self;
+return $2;
+};
+_st(aKeyBinder)._applyBindingGroup_(self);
+return self}, function($ctx1) {$ctx1.fill(self,"applyOn:",{aKeyBinder:aKeyBinder},smalltalk.HLBindingGroup)})},
 args: ["aKeyBinder"],
-source: "applyOn: aKeyBinder\x0a\x09aKeyBinder applyBindingGroup: self",
-messageSends: ["applyBindingGroup:"],
+source: "applyOn: aKeyBinder\x0a\x09self isActive ifFalse: [ ^ self ].\x0a\x09\x0a\x09aKeyBinder applyBindingGroup: self",
+messageSends: ["ifFalse:", "isActive", "applyBindingGroup:"],
 referencedClasses: []
 }),
 smalltalk.HLBindingGroup);
@@ -437,6 +547,24 @@ referencedClasses: []
 }),
 smalltalk.HLBindingGroup);
 
+smalltalk.addMethod(
+"_isActive",
+smalltalk.method({
+selector: "isActive",
+category: 'testing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
var $1;
+$1=_st(_st(self)._activeBindings())._notEmpty();
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"isActive",{},smalltalk.HLBindingGroup)})},
+args: [],
+source: "isActive\x0a\x09^ self activeBindings notEmpty",
+messageSends: ["notEmpty", "activeBindings"],
+referencedClasses: []
+}),
+smalltalk.HLBindingGroup);
+
 smalltalk.addMethod(
 "_isBindingGroup",
 smalltalk.method({
@@ -460,11 +588,15 @@ selector: "renderOn:html:",
 category: 'rendering',
 fn: function (aBindingHelper,html){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(aBindingHelper)._renderBindingGroup_on_(self,html);
-return self}, function($ctx1) {$ctx1.fill(self,"renderOn:html:",{aBindingHelper:aBindingHelper,html:html}, smalltalk.HLBindingGroup)})},
+return smalltalk.withContext(function($ctx1) { 
var $1;
+$1=_st(self)._isActive();
+if(smalltalk.assert($1)){
+_st(aBindingHelper)._renderBindingGroup_on_(self,html);
+};
+return self}, function($ctx1) {$ctx1.fill(self,"renderOn:html:",{aBindingHelper:aBindingHelper,html:html},smalltalk.HLBindingGroup)})},
 args: ["aBindingHelper", "html"],
-source: "renderOn: aBindingHelper html: html\x0a\x09aBindingHelper renderBindingGroup: self on: html",
-messageSends: ["renderBindingGroup:on:"],
+source: "renderOn: aBindingHelper html: html\x0a\x09self isActive ifTrue: [\x0a\x09\x09aBindingHelper renderBindingGroup: self on: html ]",
+messageSends: ["ifTrue:", "renderBindingGroup:on:", "isActive"],
 referencedClasses: []
 }),
 smalltalk.HLBindingGroup);
@@ -986,7 +1118,7 @@ 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)._bindings())._sorted_((function(a,b){
+_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();
@@ -1006,10 +1138,10 @@ return $6;
 }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
 return $2;
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"renderBindingGroup:on:",{aBindingGroup:aBindingGroup,html:html}, smalltalk.HLKeyBinderHelper)})},
+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 bindings \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", "bindings"],
+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"],
 referencedClasses: []
 }),
 smalltalk.HLKeyBinderHelper);

+ 42 - 36
st/Helios-Browser.st

@@ -1,7 +1,7 @@
 Smalltalk current createPackage: 'Helios-Browser'!
 HLWidget subclass: #HLBrowser
-	instanceVariableNames: 'model packagesListWidget classesListWidget protocolsListWidget methodsListWidget sourceWidget'
-	package: 'Helios-Browser'!
+ instanceVariableNames: 'model built packagesListWidget classesListWidget protocolsListWidget methodsListWidget sourceWidget'
+ package: 'Helios-Browser'!
 
 !HLBrowser methodsFor: 'accessing'!
 
@@ -21,6 +21,13 @@ model: aModel
 	model := aModel
 ! !
 
+!HLBrowser methodsFor: 'initialization'!
+
+initialize
+	super initialize.
+	built := false
+! !
+
 !HLBrowser methodsFor: 'keybindings'!
 
 registerBindingsOn: aBindingGroup
@@ -46,7 +53,11 @@ renderContentOn: html
             with: (HLVerticalSplitter
             	with: self protocolsListWidget
                 with: self methodsListWidget)) 
-        with: self sourceWidget))
+        with: self sourceWidget)).
+	
+	built ifFalse: [
+		self packagesListWidget focus.
+		built := true ]
 ! !
 
 !HLBrowser methodsFor: 'widgets'!
@@ -103,8 +114,8 @@ canBeOpenAsTab
 ! !
 
 HLNavigationListWidget subclass: #HLBrowserListWidget
-	instanceVariableNames: 'model'
-	package: 'Helios-Browser'!
+ instanceVariableNames: 'model'
+ package: 'Helios-Browser'!
 
 !HLBrowserListWidget methodsFor: 'accessing'!
 
@@ -143,8 +154,8 @@ on: aModel
 ! !
 
 HLBrowserListWidget subclass: #HLClassesListWidget
-	instanceVariableNames: ''
-	package: 'Helios-Browser'!
+ instanceVariableNames: ''
+ package: 'Helios-Browser'!
 
 !HLClassesListWidget methodsFor: 'accessing'!
 
@@ -324,8 +335,8 @@ renderListOn: html
 ! !
 
 HLBrowserListWidget subclass: #HLMethodsListWidget
-	instanceVariableNames: ''
-	package: 'Helios-Browser'!
+ instanceVariableNames: ''
+ package: 'Helios-Browser'!
 
 !HLMethodsListWidget methodsFor: 'accessing'!
 
@@ -512,8 +523,8 @@ selectorsCache
 ! !
 
 HLBrowserListWidget subclass: #HLPackagesListWidget
-	instanceVariableNames: ''
-	package: 'Helios-Browser'!
+ instanceVariableNames: ''
+ package: 'Helios-Browser'!
 
 !HLPackagesListWidget methodsFor: 'accessing'!
 
@@ -579,8 +590,8 @@ renderButtonsOn: html
 ! !
 
 HLBrowserListWidget subclass: #HLProtocolsListWidget
-	instanceVariableNames: ''
-	package: 'Helios-Browser'!
+ instanceVariableNames: ''
+ package: 'Helios-Browser'!
 
 !HLProtocolsListWidget methodsFor: 'accessing'!
 
@@ -681,8 +692,8 @@ renderContentOn: html
 ! !
 
 Object subclass: #HLBrowserModel
-	instanceVariableNames: 'announcer environment selectedPackage selectedClass selectedProtocol selectedSelector showInstance showComment'
-	package: 'Helios-Browser'!
+ instanceVariableNames: 'announcer environment selectedPackage selectedClass selectedProtocol selectedSelector showInstance showComment'
+ package: 'Helios-Browser'!
 
 !HLBrowserModel methodsFor: 'accessing'!
 
@@ -722,8 +733,10 @@ selectedClass: aClass
 !
 
 selectedMethod
-	^ self selectedClass
-    	ifNotNil: [ self selectedClass methodDictionary at: selectedSelector ]
+	^ self selectedClass ifNotNil: [ 
+			self selectedClass methodDictionary 
+				at: selectedSelector 
+				ifAbsent: [ nil ] ]
 !
 
 selectedMethod: aCompiledMethod
@@ -818,12 +831,9 @@ focusOnSourceCode
 !
 
 save: aString
-	self shouldCompileClassDefinition 
+	(self shouldCompileClassDefinition: aString)
 		ifTrue: [ self compileClassDefinition: aString ]
-		ifFalse: [ 
-			self shouldCompileClassComment 
-				ifTrue: [ self compileClassComment: aString ]
-				ifFalse: [ self compileMethod: aString ] ]
+		ifFalse: [ self compileMethod: aString ]
 !
 
 saveSourceCode
@@ -915,6 +925,7 @@ compilationProtocol
 	| currentProtocol |
 	
 	currentProtocol := self selectedProtocol.
+	currentProtocol ifNil: [ currentProtocol := self unclassifiedProtocol ].
 	self selectedMethod ifNotNil: [ currentProtocol := self selectedMethod protocol ].
 
 	^ currentProtocol = self allProtocol
@@ -924,14 +935,9 @@ compilationProtocol
 
 !HLBrowserModel methodsFor: 'testing'!
 
-shouldCompileClassComment
-	"TODO"
-	
-	^ false
-!
-
-shouldCompileClassDefinition
-	^ self selectedProtocol isNil
+shouldCompileClassDefinition: aString
+	^ self selectedClass isNil or: [
+		aString first asUppercase = aString first ]
 ! !
 
 !HLBrowserModel class methodsFor: 'actions'!
@@ -944,8 +950,8 @@ on: anEnvironment
 ! !
 
 HLWidget subclass: #HLBrowserSourceWidget
-	instanceVariableNames: 'model methodContents codeWidget'
-	package: 'Helios-Browser'!
+ instanceVariableNames: 'model methodContents codeWidget'
+ package: 'Helios-Browser'!
 
 !HLBrowserSourceWidget methodsFor: 'accessing'!
 
@@ -1078,8 +1084,8 @@ on: aBrowserModel
 ! !
 
 Object subclass: #HLClassCache
-	instanceVariableNames: 'class selectorsCache overrideCache overriddenCache'
-	package: 'Helios-Browser'!
+ instanceVariableNames: 'class selectorsCache overrideCache overriddenCache'
+ package: 'Helios-Browser'!
 
 !HLClassCache methodsFor: 'accessing'!
 
@@ -1165,8 +1171,8 @@ on: aClass selectorsCache: aSelectorsCache
 ! !
 
 Object subclass: #HLSelectorsCache
-	instanceVariableNames: 'classesCache'
-	package: 'Helios-Browser'!
+ instanceVariableNames: 'classesCache'
+ package: 'Helios-Browser'!
 
 !HLSelectorsCache methodsFor: 'accessing'!
 

+ 35 - 35
st/Helios-Commands.st

@@ -1,7 +1,7 @@
 Smalltalk current createPackage: 'Helios-Commands'!
 Object subclass: #HLCommand
-	instanceVariableNames: ''
-	package: 'Helios-Commands'!
+ instanceVariableNames: ''
+ package: 'Helios-Commands'!
 
 !HLCommand methodsFor: 'accessing'!
 
@@ -48,8 +48,8 @@ label
 ! !
 
 HLCommand subclass: #HLBrowserCommand
-	instanceVariableNames: 'model'
-	package: 'Helios-Commands'!
+ instanceVariableNames: 'model'
+ package: 'Helios-Commands'!
 
 !HLBrowserCommand methodsFor: 'accessing'!
 
@@ -70,8 +70,8 @@ on: aBrowserModel
 ! !
 
 HLBrowserCommand subclass: #HLGoToCommand
-	instanceVariableNames: ''
-	package: 'Helios-Commands'!
+ instanceVariableNames: ''
+ package: 'Helios-Commands'!
 
 !HLGoToCommand class methodsFor: 'accessing'!
 
@@ -80,8 +80,8 @@ bindingGroup
 ! !
 
 HLGoToCommand subclass: #HLGoToClassesCommand
-	instanceVariableNames: ''
-	package: 'Helios-Commands'!
+ instanceVariableNames: ''
+ package: 'Helios-Commands'!
 
 !HLGoToClassesCommand methodsFor: 'executing'!
 
@@ -102,8 +102,8 @@ label
 ! !
 
 HLGoToCommand subclass: #HLGoToMethodsCommand
-	instanceVariableNames: ''
-	package: 'Helios-Commands'!
+ instanceVariableNames: ''
+ package: 'Helios-Commands'!
 
 !HLGoToMethodsCommand methodsFor: 'executing'!
 
@@ -124,8 +124,8 @@ label
 ! !
 
 HLGoToCommand subclass: #HLGoToPackagesCommand
-	instanceVariableNames: ''
-	package: 'Helios-Commands'!
+ instanceVariableNames: ''
+ package: 'Helios-Commands'!
 
 !HLGoToPackagesCommand methodsFor: 'executing'!
 
@@ -146,8 +146,8 @@ label
 ! !
 
 HLGoToCommand subclass: #HLGoToProtocolsCommand
-	instanceVariableNames: ''
-	package: 'Helios-Commands'!
+ instanceVariableNames: ''
+ package: 'Helios-Commands'!
 
 !HLGoToProtocolsCommand methodsFor: 'executing'!
 
@@ -168,8 +168,8 @@ label
 ! !
 
 HLGoToCommand subclass: #HLGoToSourceCodeCommand
-	instanceVariableNames: ''
-	package: 'Helios-Commands'!
+ instanceVariableNames: ''
+ package: 'Helios-Commands'!
 
 !HLGoToSourceCodeCommand methodsFor: 'executing'!
 
@@ -190,8 +190,8 @@ label
 ! !
 
 HLBrowserCommand subclass: #HLToggleCommand
-	instanceVariableNames: ''
-	package: 'Helios-Commands'!
+ instanceVariableNames: ''
+ package: 'Helios-Commands'!
 
 !HLToggleCommand class methodsFor: 'accessing'!
 
@@ -200,8 +200,8 @@ bindingGroup
 ! !
 
 HLToggleCommand subclass: #HLToggleClassSideCommand
-	instanceVariableNames: ''
-	package: 'Helios-Commands'!
+ instanceVariableNames: ''
+ package: 'Helios-Commands'!
 
 !HLToggleClassSideCommand methodsFor: 'executing'!
 
@@ -222,8 +222,8 @@ label
 ! !
 
 HLToggleCommand subclass: #HLToggleInstanceSideCommand
-	instanceVariableNames: ''
-	package: 'Helios-Commands'!
+ instanceVariableNames: ''
+ package: 'Helios-Commands'!
 
 !HLToggleInstanceSideCommand methodsFor: 'executing'!
 
@@ -244,8 +244,8 @@ label
 ! !
 
 HLCommand subclass: #HLCloseTabCommand
-	instanceVariableNames: ''
-	package: 'Helios-Commands'!
+ instanceVariableNames: ''
+ package: 'Helios-Commands'!
 
 !HLCloseTabCommand methodsFor: 'executing'!
 
@@ -260,7 +260,7 @@ bindingGroup
 !
 
 key
-	^ 67
+	^ 87
 !
 
 label
@@ -268,8 +268,8 @@ label
 ! !
 
 HLCommand subclass: #HLOpenCommand
-	instanceVariableNames: ''
-	package: 'Helios-Commands'!
+ instanceVariableNames: ''
+ package: 'Helios-Commands'!
 
 !HLOpenCommand class methodsFor: 'accessing'!
 
@@ -278,8 +278,8 @@ bindingGroup
 ! !
 
 HLOpenCommand subclass: #HLOpenBrowserCommand
-	instanceVariableNames: ''
-	package: 'Helios-Commands'!
+ instanceVariableNames: ''
+ package: 'Helios-Commands'!
 
 !HLOpenBrowserCommand methodsFor: 'executing'!
 
@@ -298,8 +298,8 @@ label
 ! !
 
 HLOpenCommand subclass: #HLOpenTranscriptCommand
-	instanceVariableNames: ''
-	package: 'Helios-Commands'!
+ instanceVariableNames: ''
+ package: 'Helios-Commands'!
 
 !HLOpenTranscriptCommand methodsFor: 'executing'!
 
@@ -318,8 +318,8 @@ label
 ! !
 
 HLOpenCommand subclass: #HLOpenWorkspaceCommand
-	instanceVariableNames: ''
-	package: 'Helios-Commands'!
+ instanceVariableNames: ''
+ package: 'Helios-Commands'!
 
 !HLOpenWorkspaceCommand methodsFor: 'executing'!
 
@@ -338,6 +338,6 @@ label
 ! !
 
 HLCommand subclass: #HLViewCommand
-	instanceVariableNames: ''
-	package: 'Helios-Commands'!
+ instanceVariableNames: ''
+ package: 'Helios-Commands'!
 

+ 41 - 12
st/Helios-KeyBindings.st

@@ -1,7 +1,7 @@
 Smalltalk current createPackage: 'Helios-KeyBindings'!
 Object subclass: #HLBinding
-	instanceVariableNames: 'key label'
-	package: 'Helios-KeyBindings'!
+ instanceVariableNames: 'key label'
+ package: 'Helios-KeyBindings'!
 
 !HLBinding methodsFor: 'accessing'!
 
@@ -42,6 +42,10 @@ renderOn: aBindingHelper html: html
 
 !HLBinding methodsFor: 'testing'!
 
+isActive
+	^ self subclassResponsibility
+!
+
 isBindingAction
 	^ false
 !
@@ -60,11 +64,19 @@ on: anInteger labelled: aString
 ! !
 
 HLBinding subclass: #HLBindingAction
-	instanceVariableNames: 'callback'
-	package: 'Helios-KeyBindings'!
+ instanceVariableNames: 'callback activeBlock'
+ package: 'Helios-KeyBindings'!
 
 !HLBindingAction methodsFor: 'accessing'!
 
+activeBlock
+	^ activeBlock ifNil: [ activeBlock := [ true ] ]
+!
+
+activeBlock: aBlock
+	activeBlock := aBlock
+!
+
 callback
 	^ callback
 !
@@ -76,21 +88,31 @@ callback: aBlock
 !HLBindingAction methodsFor: 'actions'!
 
 applyOn: aKeyBinder
+	self isActive ifFalse: [ ^ self ].
+	
 	aKeyBinder applyBindingAction: self
 ! !
 
 !HLBindingAction methodsFor: 'testing'!
 
+isActive
+	^ self activeBlock value
+!
+
 isBindingAction
 	^ true
 ! !
 
 HLBinding subclass: #HLBindingGroup
-	instanceVariableNames: 'bindings'
-	package: 'Helios-KeyBindings'!
+ instanceVariableNames: 'bindings'
+ package: 'Helios-KeyBindings'!
 
 !HLBindingGroup methodsFor: 'accessing'!
 
+activeBindings
+	^ self bindings select: [ :each | each isActive ]
+!
+
 add: aBinding
 	^ self bindings add: aBinding
 !
@@ -134,24 +156,31 @@ displayLabel
 !HLBindingGroup methodsFor: 'actions'!
 
 applyOn: aKeyBinder
+	self isActive ifFalse: [ ^ self ].
+	
 	aKeyBinder applyBindingGroup: self
 ! !
 
 !HLBindingGroup methodsFor: 'rendering'!
 
 renderOn: aBindingHelper html: html
-	aBindingHelper renderBindingGroup: self on: html
+	self isActive ifTrue: [
+		aBindingHelper renderBindingGroup: self on: html ]
 ! !
 
 !HLBindingGroup methodsFor: 'testing'!
 
+isActive
+	^ self activeBindings notEmpty
+!
+
 isBindingGroup
 	^ true
 ! !
 
 Object subclass: #HLKeyBinder
-	instanceVariableNames: 'modifierKey active helper bindings selectedBinding'
-	package: 'Helios-KeyBindings'!
+ instanceVariableNames: 'modifierKey active helper bindings selectedBinding'
+ package: 'Helios-KeyBindings'!
 
 !HLKeyBinder methodsFor: 'accessing'!
 
@@ -292,8 +321,8 @@ systemIsMac
 ! !
 
 HLWidget subclass: #HLKeyBinderHelper
-	instanceVariableNames: 'keyBinder'
-	package: 'Helios-KeyBindings'!
+ instanceVariableNames: 'keyBinder'
+ package: 'Helios-KeyBindings'!
 
 !HLKeyBinderHelper methodsFor: 'accessing'!
 
@@ -332,7 +361,7 @@ registerBindings
 !HLKeyBinderHelper methodsFor: 'rendering'!
 
 renderBindingGroup: aBindingGroup on: html
-	(aBindingGroup bindings 
+	(aBindingGroup activeBindings 
     	sorted: [ :a :b | a key < b key ])
         do: [ :each |
 			html span class: 'command'; with: [