Browse Source

Fixed tabs handling and rendering

Nicolas Petton 12 years ago
parent
commit
69582296d6

+ 18 - 18
css/helios.css

@@ -88,7 +88,7 @@ a {
 }
 
 
-#container {
+.tool_container {
     position: fixed;
     top: 26px;
     bottom: 0;
@@ -96,26 +96,26 @@ a {
     right: 0;
 }
 
-#container .panes {
+.tool_container .panes {
     height: 100%;
     width: 100%;
     overflow: hidden;
 }
 
-#container .panes .pane {
+.tool_container .panes .pane {
     overflow: auto;
 }
 
-#container .panes .pane {
+.tool_container .panes .pane {
     overflow: auto;
 }
 
-#container .panes .pane > div {
+.tool_container .panes .pane > div {
     height: 100%;
     position: relative;
 }
 
-#container .panes .pane .nav-pills {
+.tool_container .panes .pane .nav-pills {
     position: absolute;
     overflow-y: auto;
     top: 0;
@@ -124,7 +124,7 @@ a {
     margin: 0;
 }
 
-#container .panes .pane .pane_actions {
+.tool_container .panes .pane .pane_actions {
     position: absolute;
     overflow: hidden;
     width: 100%;
@@ -137,7 +137,7 @@ a {
     text-align: center;
 }
 
-#container .panes .pane .pane_actions .info {
+.tool_container .panes .pane .pane_actions .info {
     padding: 10px 5px 5px;
     font-weight: bold;
     color: #666;
@@ -145,50 +145,50 @@ a {
 }
 
 
-#container .panes .pane .pane_actions .btn-group {
+.tool_container .panes .pane .pane_actions .btn-group {
     display: inline;
     margin-left: 5px;
 }
 
-#container .panes .pane .pane_actions .btn-group .btn {
+.tool_container .panes .pane .pane_actions .btn-group .btn {
     margin: 0;
 }
 
-#container .panes .pane .pane_actions .btn-group.switch .btn.active:first-child {
+.tool_container .panes .pane .pane_actions .btn-group.switch .btn.active:first-child {
     background: #5AD;
     color: white;
     text-shadow: 0 1px 0 #333;
 }
 
-#container .panes .pane .pane_actions .btn {
+.tool_container .panes .pane .pane_actions .btn {
     margin-left: 5px;
 }
 
-#container .panes .pane .class_side .nav-pills {
+.tool_container .panes .pane .class_side .nav-pills {
     font-weight: bold;
     background: #ffd;
 }
 
 
-#container .panes.horizontal > .pane {
+.tool_container .panes.horizontal > .pane {
     height: 50%;
     min-height: 50px;
 }
 
-#container .panes.vertical > .pane {
+.tool_container .panes.vertical > .pane {
     width: 50%;
     display: inline;
     float: left;
     height: 100%;
 }
 
-#container .splitter {
+.tool_container .splitter {
     z-index: 10;
     background: #E6E6E6;
     border: 1px solid #bbb;
 }
 
-#container .splitter.vertical {
+.tool_container .splitter.vertical {
     width: 4px;
     height: 100%;
     float: left;
@@ -198,7 +198,7 @@ a {
     background-position: center;
 }
 
-#container .splitter.horizontal {
+.tool_container .splitter.horizontal {
     height: 4px;
     cursor: s-resize;
     background-image: url('/images/hsplitter.png');

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

@@ -13,6 +13,17 @@ return $1;
 messageSends: ["announcer", "model"]}),
 smalltalk.HLBrowser);
 
+smalltalk.addMethod(
+"_canHaveFocus",
+smalltalk.method({
+selector: "canHaveFocus",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
return true;
+}, function($ctx1) {$ctx1.fill(self,"canHaveFocus",{},smalltalk.HLBrowser)})},
+messageSends: []}),
+smalltalk.HLBrowser);
+
 smalltalk.addMethod(
 "_classesListWidget",
 smalltalk.method({
@@ -46,6 +57,19 @@ return $1;
 messageSends: ["environment", "model"]}),
 smalltalk.HLBrowser);
 
+smalltalk.addMethod(
+"_focus",
+smalltalk.method({
+selector: "focus",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
var $1;
+$1=_st(_st(self)._packagesListWidget())._focus();
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"focus",{},smalltalk.HLBrowser)})},
+messageSends: ["focus", "packagesListWidget"]}),
+smalltalk.HLBrowser);
+
 smalltalk.addMethod(
 "_methodsListWidget",
 smalltalk.method({

+ 35 - 1
js/Helios-Browser.js

@@ -18,6 +18,22 @@ referencedClasses: []
 }),
 smalltalk.HLBrowser);
 
+smalltalk.addMethod(
+"_canHaveFocus",
+smalltalk.method({
+selector: "canHaveFocus",
+category: 'testing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
return true;
+}, function($ctx1) {$ctx1.fill(self,"canHaveFocus",{},smalltalk.HLBrowser)})},
+args: [],
+source: "canHaveFocus\x0a\x09^ true",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLBrowser);
+
 smalltalk.addMethod(
 "_classesListWidget",
 smalltalk.method({
@@ -61,6 +77,24 @@ referencedClasses: []
 }),
 smalltalk.HLBrowser);
 
+smalltalk.addMethod(
+"_focus",
+smalltalk.method({
+selector: "focus",
+category: 'actions',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
var $1;
+$1=_st(_st(self)._packagesListWidget())._focus();
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"focus",{},smalltalk.HLBrowser)})},
+args: [],
+source: "focus\x0a\x09^ self packagesListWidget focus",
+messageSends: ["focus", "packagesListWidget"],
+referencedClasses: []
+}),
+smalltalk.HLBrowser);
+
 smalltalk.addMethod(
 "_methodsListWidget",
 smalltalk.method({
@@ -185,7 +219,7 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
_st((smalltalk.HLBrowserCommand || HLBrowserCommand))._registerConcreteClassesOn_for_(aBindingGroup,_st(self)._model());
 return self}, function($ctx1) {$ctx1.fill(self,"registerBindingsOn:",{aBindingGroup:aBindingGroup},smalltalk.HLBrowser)})},
 args: ["aBindingGroup"],
-source: "registerBindingsOn: aBindingGroup\x0a\x09HLBrowserCommand registerConcreteClassesOn: aBindingGroup for: self model\x0a\x09\x0a\x09\x22aBindingGroup \x0a    \x09addGroupKey: 66 labelled: 'Browse';\x0a        addGroupKey: 71 labelled: 'Go to';\x0a        addGroupKey: 84 labelled: 'Toggle';\x0a\x09\x09addGroupKey: 77 labelled: 'Move'.\x0a\x09\x09\x09\x0a\x09(aBindingGroup at: 'Move')\x0a\x09\x09addGroupKey: 77 labelled: 'Method';\x0a\x09\x09addGroupKey: 67 labelled: 'Class';\x0a\x09\x09addGroupKey: 80 labelled: 'Protocol'.\x0a        \x0a\x09HLMoveMethodToCommand concreteClasses do: [ :each |\x0a  \x09\x09\x09(aBindingGroup at: 'Move') \x0a\x09\x09\x09\x09at: each bindingGroup \x0a  \x09\x09\x09\x09add: (each on: self model) asBinding ].\x0a\x09\x09\x09\x0a   \x09HLBrowserCommand concreteClasses do: [ :each |\x0a  \x09\x09\x09aBindingGroup \x0a\x09\x09\x09\x09at: each bindingGroup\x0a  \x09\x09\x09\x09add: (each on: self model) asBinding ]\x22",
+source: "registerBindingsOn: aBindingGroup\x0a\x09HLBrowserCommand \x0a\x09\x09registerConcreteClassesOn: aBindingGroup \x0a\x09\x09for: self model",
 messageSends: ["registerConcreteClassesOn:for:", "model"],
 referencedClasses: ["HLBrowserCommand"]
 }),

+ 123 - 22
js/Helios-Core.deploy.js

@@ -1,5 +1,5 @@
 smalltalk.addPackage('Helios-Core');
-smalltalk.addClass('HLTab', smalltalk.Object, ['widget', 'label'], 'Helios-Core');
+smalltalk.addClass('HLTab', smalltalk.Widget, ['widget', 'label', 'root'], 'Helios-Core');
 smalltalk.addMethod(
 "_activate",
 smalltalk.method({
@@ -7,7 +7,7 @@ selector: "activate",
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._manager())._activate_(self);
-return self}, function($ctx1) {$ctx1.fill(self,"activate",{}, smalltalk.HLTab)})},
+return self}, function($ctx1) {$ctx1.fill(self,"activate",{},smalltalk.HLTab)})},
 messageSends: ["activate:", "manager"]}),
 smalltalk.HLTab);
 
@@ -18,7 +18,7 @@ selector: "add",
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._manager())._addTab_(self);
-return self}, function($ctx1) {$ctx1.fill(self,"add",{}, smalltalk.HLTab)})},
+return self}, function($ctx1) {$ctx1.fill(self,"add",{},smalltalk.HLTab)})},
 messageSends: ["addTab:", "manager"]}),
 smalltalk.HLTab);
 
@@ -55,6 +55,23 @@ return self}, function($ctx1) {$ctx1.fill(self,"focus",{},smalltalk.HLTab)})},
 messageSends: ["ifTrue:", "focus", "widget", "canHaveFocus"]}),
 smalltalk.HLTab);
 
+smalltalk.addMethod(
+"_hide",
+smalltalk.method({
+selector: "hide",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
var $1;
+$1=self["@root"];
+if(($receiver = $1) == nil || $receiver == undefined){
+$1;
+} else {
+_st(_st(self["@root"])._asJQuery())._hide();
+};
+return self}, function($ctx1) {$ctx1.fill(self,"hide",{},smalltalk.HLTab)})},
+messageSends: ["ifNotNil:", "hide", "asJQuery"]}),
+smalltalk.HLTab);
+
 smalltalk.addMethod(
 "_isActive",
 smalltalk.method({
@@ -64,7 +81,7 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1;
 $1=_st(_st(_st(self)._manager())._activeTab()).__eq(self);
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"isActive",{}, smalltalk.HLTab)})},
+}, function($ctx1) {$ctx1.fill(self,"isActive",{},smalltalk.HLTab)})},
 messageSends: ["=", "activeTab", "manager"]}),
 smalltalk.HLTab);
 
@@ -82,7 +99,7 @@ $1="";
 $1=$2;
 };
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"label",{}, smalltalk.HLTab)})},
+}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLTab)})},
 messageSends: ["ifNil:"]}),
 smalltalk.HLTab);
 
@@ -93,7 +110,7 @@ selector: "label:",
 fn: function (aString){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
self["@label"]=aString;
-return self}, function($ctx1) {$ctx1.fill(self,"label:",{aString:aString}, smalltalk.HLTab)})},
+return self}, function($ctx1) {$ctx1.fill(self,"label:",{aString:aString},smalltalk.HLTab)})},
 messageSends: []}),
 smalltalk.HLTab);
 
@@ -106,10 +123,90 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1;
 $1=_st((smalltalk.HLManager || HLManager))._current();
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"manager",{}, smalltalk.HLTab)})},
+}, function($ctx1) {$ctx1.fill(self,"manager",{},smalltalk.HLTab)})},
 messageSends: ["current"]}),
 smalltalk.HLTab);
 
+smalltalk.addMethod(
+"_registerBindings",
+smalltalk.method({
+selector: "registerBindings",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._widget())._registerBindings();
+return self}, function($ctx1) {$ctx1.fill(self,"registerBindings",{},smalltalk.HLTab)})},
+messageSends: ["registerBindings", "widget"]}),
+smalltalk.HLTab);
+
+smalltalk.addMethod(
+"_remove",
+smalltalk.method({
+selector: "remove",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
var $1;
+$1=self["@root"];
+if(($receiver = $1) == nil || $receiver == undefined){
+$1;
+} else {
+_st(_st(self["@root"])._asJQuery())._remove();
+};
+return self}, function($ctx1) {$ctx1.fill(self,"remove",{},smalltalk.HLTab)})},
+messageSends: ["ifNotNil:", "remove", "asJQuery"]}),
+smalltalk.HLTab);
+
+smalltalk.addMethod(
+"_renderOn_",
+smalltalk.method({
+selector: "renderOn:",
+fn: function (html){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
var $1,$2;
+$1=_st(html)._div();
+_st($1)._class_("tab");
+$2=_st($1)._yourself();
+self["@root"]=$2;
+_st(self)._renderTab();
+return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},smalltalk.HLTab)})},
+messageSends: ["class:", "div", "yourself", "renderTab"]}),
+smalltalk.HLTab);
+
+smalltalk.addMethod(
+"_renderTab",
+smalltalk.method({
+selector: "renderTab",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
var $1,$2;
+_st(self["@root"])._contents_((function(html){
+return smalltalk.withContext(function($ctx2) {
$1=_st(html)._div();
+_st($1)._class_("amber_box");
+$2=_st($1)._with_((function(){
+return smalltalk.withContext(function($ctx3) {
return _st(_st(self)._widget())._renderOn_(html);
+}, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
+return $2;
+}, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1)})}));
+return self}, function($ctx1) {$ctx1.fill(self,"renderTab",{},smalltalk.HLTab)})},
+messageSends: ["contents:", "class:", "div", "with:", "renderOn:", "widget"]}),
+smalltalk.HLTab);
+
+smalltalk.addMethod(
+"_show",
+smalltalk.method({
+selector: "show",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
var $1;
+$1=self["@root"];
+if(($receiver = $1) == nil || $receiver == undefined){
+_st(self)._appendToJQuery_(_st("body")._asJQuery());
+} else {
+_st(_st(self["@root"])._asJQuery())._show();
+};
+return self}, function($ctx1) {$ctx1.fill(self,"show",{},smalltalk.HLTab)})},
+messageSends: ["ifNil:ifNotNil:", "appendToJQuery:", "asJQuery", "show"]}),
+smalltalk.HLTab);
+
 smalltalk.addMethod(
 "_widget",
 smalltalk.method({
@@ -119,7 +216,7 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1;
 $1=self["@widget"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"widget",{}, smalltalk.HLTab)})},
+}, function($ctx1) {$ctx1.fill(self,"widget",{},smalltalk.HLTab)})},
 messageSends: []}),
 smalltalk.HLTab);
 
@@ -130,7 +227,7 @@ selector: "widget:",
 fn: function (aWidget){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
self["@widget"]=aWidget;
-return self}, function($ctx1) {$ctx1.fill(self,"widget:",{aWidget:aWidget}, smalltalk.HLTab)})},
+return self}, function($ctx1) {$ctx1.fill(self,"widget:",{aWidget:aWidget},smalltalk.HLTab)})},
 messageSends: []}),
 smalltalk.HLTab);
 
@@ -148,7 +245,7 @@ _st($2)._label_(aString);
 $3=_st($2)._yourself();
 $1=$3;
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"on:labelled:",{aWidget:aWidget,aString:aString}, smalltalk.HLTab.klass)})},
+}, function($ctx1) {$ctx1.fill(self,"on:labelled:",{aWidget:aWidget,aString:aString},smalltalk.HLTab.klass)})},
 messageSends: ["widget:", "new", "label:", "yourself"]}),
 smalltalk.HLTab.klass);
 
@@ -929,13 +1026,14 @@ fn: function (aTab){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1,$2;
 _st(_st(self)._keyBinder())._flushBindings();
+_st(aTab)._registerBindings();
 self["@activeTab"]=aTab;
 $1=self;
 _st($1)._refresh();
 _st($1)._addToHistory_(aTab);
 $2=_st($1)._show_(aTab);
-return self}, function($ctx1) {$ctx1.fill(self,"activate:",{aTab:aTab}, smalltalk.HLManager)})},
-messageSends: ["flushBindings", "keyBinder", "refresh", "addToHistory:", "show:"]}),
+return self}, function($ctx1) {$ctx1.fill(self,"activate:",{aTab:aTab},smalltalk.HLManager)})},
+messageSends: ["flushBindings", "keyBinder", "registerBindings", "refresh", "addToHistory:", "show:"]}),
 smalltalk.HLManager);
 
 smalltalk.addMethod(
@@ -1086,9 +1184,8 @@ selector: "refresh",
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
_st(_st(window)._jQuery_(".navbar"))._remove();
-_st(_st(window)._jQuery_("#container"))._remove();
 _st(self)._appendToJQuery_(_st("body")._asJQuery());
-return self}, function($ctx1) {$ctx1.fill(self,"refresh",{}, smalltalk.HLManager)})},
+return self}, function($ctx1) {$ctx1.fill(self,"refresh",{},smalltalk.HLManager)})},
 messageSends: ["remove", "jQuery:", "appendToJQuery:", "asJQuery"]}),
 smalltalk.HLManager);
 
@@ -1131,12 +1228,13 @@ return $2;
 _st(self)._removeFromHistory_(aTab);
 _st(_st(self)._tabs())._remove_(aTab);
 _st(_st(self)._keyBinder())._flushBindings();
+_st(aTab)._remove();
 _st(self)._refresh();
 _st(_st(self)._history())._ifNotEmpty_((function(){
 return smalltalk.withContext(function($ctx2) {
return _st(_st(_st(self)._history())._last())._activate();
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
 return self}, function($ctx1) {$ctx1.fill(self,"removeTab:",{aTab:aTab},smalltalk.HLManager)})},
-messageSends: ["ifFalse:", "includes:", "tabs", "removeFromHistory:", "remove:", "flushBindings", "keyBinder", "refresh", "ifNotEmpty:", "activate", "last", "history"]}),
+messageSends: ["ifFalse:", "includes:", "tabs", "removeFromHistory:", "remove:", "flushBindings", "keyBinder", "remove", "refresh", "ifNotEmpty:", "activate", "last", "history"]}),
 smalltalk.HLManager);
 
 smalltalk.addMethod(
@@ -1198,9 +1296,8 @@ return smalltalk.withContext(function($ctx3) {
return _st(self)._renderTabsOn_(h
 }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
 return $4;
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
-_st(_st(html)._div())._id_("container");
-return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html}, smalltalk.HLManager)})},
-messageSends: ["class:", "div", "with:", "renderTabsOn:", "id:"]}),
+return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLManager)})},
+messageSends: ["class:", "div", "with:", "renderTabsOn:"]}),
 smalltalk.HLManager);
 
 smalltalk.addMethod(
@@ -1250,11 +1347,15 @@ smalltalk.method({
 selector: "show:",
 fn: function (aTab){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(_st(window)._jQuery_("#container"))._empty();
-_st(_st(aTab)._widget())._appendToJQuery_(_st("#container")._asJQuery());
-_st(aTab)._focus();
+return smalltalk.withContext(function($ctx1) { 
var $1,$2;
+_st(_st(self)._tabs())._do_((function(each){
+return smalltalk.withContext(function($ctx2) {
return _st(each)._hide();
+}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
+$1=aTab;
+_st($1)._show();
+$2=_st($1)._focus();
 return self}, function($ctx1) {$ctx1.fill(self,"show:",{aTab:aTab},smalltalk.HLManager)})},
-messageSends: ["empty", "jQuery:", "appendToJQuery:", "asJQuery", "widget", "focus"]}),
+messageSends: ["do:", "hide", "tabs", "show", "focus"]}),
 smalltalk.HLManager);
 
 smalltalk.addMethod(

+ 158 - 27
js/Helios-Core.js

@@ -1,5 +1,5 @@
 smalltalk.addPackage('Helios-Core');
-smalltalk.addClass('HLTab', smalltalk.Object, ['widget', 'label'], 'Helios-Core');
+smalltalk.addClass('HLTab', smalltalk.Widget, ['widget', 'label', 'root'], 'Helios-Core');
 smalltalk.addMethod(
 "_activate",
 smalltalk.method({
@@ -8,7 +8,7 @@ category: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._manager())._activate_(self);
-return self}, function($ctx1) {$ctx1.fill(self,"activate",{}, smalltalk.HLTab)})},
+return self}, function($ctx1) {$ctx1.fill(self,"activate",{},smalltalk.HLTab)})},
 args: [],
 source: "activate\x0a\x09self manager activate: self",
 messageSends: ["activate:", "manager"],
@@ -24,7 +24,7 @@ category: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._manager())._addTab_(self);
-return self}, function($ctx1) {$ctx1.fill(self,"add",{}, smalltalk.HLTab)})},
+return self}, function($ctx1) {$ctx1.fill(self,"add",{},smalltalk.HLTab)})},
 args: [],
 source: "add\x0a\x09self manager addTab: self",
 messageSends: ["addTab:", "manager"],
@@ -75,6 +75,28 @@ referencedClasses: []
 }),
 smalltalk.HLTab);
 
+smalltalk.addMethod(
+"_hide",
+smalltalk.method({
+selector: "hide",
+category: 'actions',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
var $1;
+$1=self["@root"];
+if(($receiver = $1) == nil || $receiver == undefined){
+$1;
+} else {
+_st(_st(self["@root"])._asJQuery())._hide();
+};
+return self}, function($ctx1) {$ctx1.fill(self,"hide",{},smalltalk.HLTab)})},
+args: [],
+source: "hide\x0a\x09root ifNotNil: [\x0a\x09\x09root asJQuery hide ]",
+messageSends: ["ifNotNil:", "hide", "asJQuery"],
+referencedClasses: []
+}),
+smalltalk.HLTab);
+
 smalltalk.addMethod(
 "_isActive",
 smalltalk.method({
@@ -85,7 +107,7 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1;
 $1=_st(_st(_st(self)._manager())._activeTab()).__eq(self);
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"isActive",{}, smalltalk.HLTab)})},
+}, function($ctx1) {$ctx1.fill(self,"isActive",{},smalltalk.HLTab)})},
 args: [],
 source: "isActive\x0a\x09^ self manager activeTab = self",
 messageSends: ["=", "activeTab", "manager"],
@@ -108,7 +130,7 @@ $1="";
 $1=$2;
 };
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"label",{}, smalltalk.HLTab)})},
+}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLTab)})},
 args: [],
 source: "label\x0a\x09^ label ifNil: [ '' ]",
 messageSends: ["ifNil:"],
@@ -124,7 +146,7 @@ category: 'accessing',
 fn: function (aString){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
self["@label"]=aString;
-return self}, function($ctx1) {$ctx1.fill(self,"label:",{aString:aString}, smalltalk.HLTab)})},
+return self}, function($ctx1) {$ctx1.fill(self,"label:",{aString:aString},smalltalk.HLTab)})},
 args: ["aString"],
 source: "label: aString\x0a\x09label := aString",
 messageSends: [],
@@ -142,7 +164,7 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1;
 $1=_st((smalltalk.HLManager || HLManager))._current();
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"manager",{}, smalltalk.HLTab)})},
+}, function($ctx1) {$ctx1.fill(self,"manager",{},smalltalk.HLTab)})},
 args: [],
 source: "manager\x0a\x09^ HLManager current",
 messageSends: ["current"],
@@ -150,6 +172,111 @@ referencedClasses: ["HLManager"]
 }),
 smalltalk.HLTab);
 
+smalltalk.addMethod(
+"_registerBindings",
+smalltalk.method({
+selector: "registerBindings",
+category: 'actions',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._widget())._registerBindings();
+return self}, function($ctx1) {$ctx1.fill(self,"registerBindings",{},smalltalk.HLTab)})},
+args: [],
+source: "registerBindings\x0a\x09self widget registerBindings",
+messageSends: ["registerBindings", "widget"],
+referencedClasses: []
+}),
+smalltalk.HLTab);
+
+smalltalk.addMethod(
+"_remove",
+smalltalk.method({
+selector: "remove",
+category: 'actions',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
var $1;
+$1=self["@root"];
+if(($receiver = $1) == nil || $receiver == undefined){
+$1;
+} else {
+_st(_st(self["@root"])._asJQuery())._remove();
+};
+return self}, function($ctx1) {$ctx1.fill(self,"remove",{},smalltalk.HLTab)})},
+args: [],
+source: "remove\x0a\x09root ifNotNil: [ root asJQuery remove ]",
+messageSends: ["ifNotNil:", "remove", "asJQuery"],
+referencedClasses: []
+}),
+smalltalk.HLTab);
+
+smalltalk.addMethod(
+"_renderOn_",
+smalltalk.method({
+selector: "renderOn:",
+category: 'rendering',
+fn: function (html){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
var $1,$2;
+$1=_st(html)._div();
+_st($1)._class_("tab");
+$2=_st($1)._yourself();
+self["@root"]=$2;
+_st(self)._renderTab();
+return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},smalltalk.HLTab)})},
+args: ["html"],
+source: "renderOn: html\x0a\x09root := html div\x0a\x09\x09class: 'tab';\x0a\x09\x09yourself.\x0a\x09self renderTab",
+messageSends: ["class:", "div", "yourself", "renderTab"],
+referencedClasses: []
+}),
+smalltalk.HLTab);
+
+smalltalk.addMethod(
+"_renderTab",
+smalltalk.method({
+selector: "renderTab",
+category: 'rendering',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
var $1,$2;
+_st(self["@root"])._contents_((function(html){
+return smalltalk.withContext(function($ctx2) {
$1=_st(html)._div();
+_st($1)._class_("amber_box");
+$2=_st($1)._with_((function(){
+return smalltalk.withContext(function($ctx3) {
return _st(_st(self)._widget())._renderOn_(html);
+}, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
+return $2;
+}, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1)})}));
+return self}, function($ctx1) {$ctx1.fill(self,"renderTab",{},smalltalk.HLTab)})},
+args: [],
+source: "renderTab\x0a\x09root contents: [ :html |\x0a\x09\x09html div\x0a\x09\x09\x09class: 'amber_box';\x0a\x09\x09\x09with: [ self widget renderOn: html ] ]",
+messageSends: ["contents:", "class:", "div", "with:", "renderOn:", "widget"],
+referencedClasses: []
+}),
+smalltalk.HLTab);
+
+smalltalk.addMethod(
+"_show",
+smalltalk.method({
+selector: "show",
+category: 'actions',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
var $1;
+$1=self["@root"];
+if(($receiver = $1) == nil || $receiver == undefined){
+_st(self)._appendToJQuery_(_st("body")._asJQuery());
+} else {
+_st(_st(self["@root"])._asJQuery())._show();
+};
+return self}, function($ctx1) {$ctx1.fill(self,"show",{},smalltalk.HLTab)})},
+args: [],
+source: "show\x0a\x09root\x0a\x09\x09ifNil: [ self appendToJQuery: 'body' asJQuery ]\x0a\x09\x09ifNotNil: [ root asJQuery show ]\x09",
+messageSends: ["ifNil:ifNotNil:", "appendToJQuery:", "asJQuery", "show"],
+referencedClasses: []
+}),
+smalltalk.HLTab);
+
 smalltalk.addMethod(
 "_widget",
 smalltalk.method({
@@ -160,7 +287,7 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1;
 $1=self["@widget"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"widget",{}, smalltalk.HLTab)})},
+}, function($ctx1) {$ctx1.fill(self,"widget",{},smalltalk.HLTab)})},
 args: [],
 source: "widget\x0a\x09^ widget",
 messageSends: [],
@@ -176,7 +303,7 @@ category: 'accessing',
 fn: function (aWidget){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
self["@widget"]=aWidget;
-return self}, function($ctx1) {$ctx1.fill(self,"widget:",{aWidget:aWidget}, smalltalk.HLTab)})},
+return self}, function($ctx1) {$ctx1.fill(self,"widget:",{aWidget:aWidget},smalltalk.HLTab)})},
 args: ["aWidget"],
 source: "widget: aWidget\x0a\x09widget := aWidget",
 messageSends: [],
@@ -199,7 +326,7 @@ _st($2)._label_(aString);
 $3=_st($2)._yourself();
 $1=$3;
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"on:labelled:",{aWidget:aWidget,aString:aString}, smalltalk.HLTab.klass)})},
+}, function($ctx1) {$ctx1.fill(self,"on:labelled:",{aWidget:aWidget,aString:aString},smalltalk.HLTab.klass)})},
 args: ["aWidget", "aString"],
 source: "on: aWidget labelled: aString\x0a\x09^ self new\x0a\x09\x09widget: aWidget;\x0a\x09\x09label: aString;\x0a\x09\x09yourself",
 messageSends: ["widget:", "new", "label:", "yourself"],
@@ -1235,15 +1362,16 @@ fn: function (aTab){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1,$2;
 _st(_st(self)._keyBinder())._flushBindings();
+_st(aTab)._registerBindings();
 self["@activeTab"]=aTab;
 $1=self;
 _st($1)._refresh();
 _st($1)._addToHistory_(aTab);
 $2=_st($1)._show_(aTab);
-return self}, function($ctx1) {$ctx1.fill(self,"activate:",{aTab:aTab}, smalltalk.HLManager)})},
+return self}, function($ctx1) {$ctx1.fill(self,"activate:",{aTab:aTab},smalltalk.HLManager)})},
 args: ["aTab"],
-source: "activate: aTab\x0a\x09self keyBinder flushBindings.\x0a\x09activeTab := aTab.\x0a\x09\x0a\x09self \x0a\x09\x09refresh;\x0a\x09\x09addToHistory: aTab;\x0a\x09\x09show: aTab",
-messageSends: ["flushBindings", "keyBinder", "refresh", "addToHistory:", "show:"],
+source: "activate: aTab\x0a\x09self keyBinder flushBindings.\x0a\x09aTab registerBindings.\x0a\x09activeTab := aTab.\x0a\x09\x0a\x09self \x0a\x09\x09refresh;\x0a\x09\x09addToHistory: aTab;\x0a\x09\x09show: aTab",
+messageSends: ["flushBindings", "keyBinder", "registerBindings", "refresh", "addToHistory:", "show:"],
 referencedClasses: []
 }),
 smalltalk.HLManager);
@@ -1447,11 +1575,10 @@ category: 'rendering',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
_st(_st(window)._jQuery_(".navbar"))._remove();
-_st(_st(window)._jQuery_("#container"))._remove();
 _st(self)._appendToJQuery_(_st("body")._asJQuery());
-return self}, function($ctx1) {$ctx1.fill(self,"refresh",{}, smalltalk.HLManager)})},
+return self}, function($ctx1) {$ctx1.fill(self,"refresh",{},smalltalk.HLManager)})},
 args: [],
-source: "refresh\x0a\x09(window jQuery: '.navbar') remove.\x0a\x09(window jQuery: '#container') remove.\x0a\x09self appendToJQuery: 'body' asJQuery",
+source: "refresh\x0a\x09(window jQuery: '.navbar') remove.\x0a\x09self appendToJQuery: 'body' asJQuery",
 messageSends: ["remove", "jQuery:", "appendToJQuery:", "asJQuery"],
 referencedClasses: []
 }),
@@ -1507,14 +1634,15 @@ return $2;
 _st(self)._removeFromHistory_(aTab);
 _st(_st(self)._tabs())._remove_(aTab);
 _st(_st(self)._keyBinder())._flushBindings();
+_st(aTab)._remove();
 _st(self)._refresh();
 _st(_st(self)._history())._ifNotEmpty_((function(){
 return smalltalk.withContext(function($ctx2) {
return _st(_st(_st(self)._history())._last())._activate();
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
 return self}, function($ctx1) {$ctx1.fill(self,"removeTab:",{aTab:aTab},smalltalk.HLManager)})},
 args: ["aTab"],
-source: "removeTab: aTab\x0a\x09(self tabs includes: aTab) ifFalse: [ ^ self ].\x0a\x0a\x09self removeFromHistory: aTab.\x0a\x09self tabs remove: aTab.\x0a\x09self keyBinder flushBindings.\x0a\x09self refresh.\x0a\x09self history ifNotEmpty: [\x0a\x09\x09self history last activate ]",
-messageSends: ["ifFalse:", "includes:", "tabs", "removeFromHistory:", "remove:", "flushBindings", "keyBinder", "refresh", "ifNotEmpty:", "activate", "last", "history"],
+source: "removeTab: aTab\x0a\x09(self tabs includes: aTab) ifFalse: [ ^ self ].\x0a\x0a\x09self removeFromHistory: aTab.\x0a\x09self tabs remove: aTab.\x0a\x09self keyBinder flushBindings.\x0a\x09aTab remove.\x0a\x09self refresh.\x0a\x09self history ifNotEmpty: [\x0a\x09\x09self history last activate ]",
+messageSends: ["ifFalse:", "includes:", "tabs", "removeFromHistory:", "remove:", "flushBindings", "keyBinder", "remove", "refresh", "ifNotEmpty:", "activate", "last", "history"],
 referencedClasses: []
 }),
 smalltalk.HLManager);
@@ -1584,11 +1712,10 @@ return smalltalk.withContext(function($ctx3) {
return _st(self)._renderTabsOn_(h
 }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
 return $4;
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
-_st(_st(html)._div())._id_("container");
-return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html}, smalltalk.HLManager)})},
+return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLManager)})},
 args: ["html"],
-source: "renderContentOn: html\x0a\x09html div \x0a\x09\x09class: 'navbar navbar-fixed-top';\x0a\x09\x09with: [ html div \x0a\x09\x09\x09class: 'navbar-inner';\x0a\x09\x09\x09with: [ self renderTabsOn: html ] ].\x0a\x09html div id: 'container'",
-messageSends: ["class:", "div", "with:", "renderTabsOn:", "id:"],
+source: "renderContentOn: html\x0a\x09html div \x0a\x09\x09class: 'navbar navbar-fixed-top';\x0a\x09\x09with: [ html div \x0a\x09\x09\x09class: 'navbar-inner';\x0a\x09\x09\x09with: [ self renderTabsOn: html ] ]",
+messageSends: ["class:", "div", "with:", "renderTabsOn:"],
 referencedClasses: []
 }),
 smalltalk.HLManager);
@@ -1646,13 +1773,17 @@ selector: "show:",
 category: 'rendering',
 fn: function (aTab){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(_st(window)._jQuery_("#container"))._empty();
-_st(_st(aTab)._widget())._appendToJQuery_(_st("#container")._asJQuery());
-_st(aTab)._focus();
+return smalltalk.withContext(function($ctx1) { 
var $1,$2;
+_st(_st(self)._tabs())._do_((function(each){
+return smalltalk.withContext(function($ctx2) {
return _st(each)._hide();
+}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
+$1=aTab;
+_st($1)._show();
+$2=_st($1)._focus();
 return self}, function($ctx1) {$ctx1.fill(self,"show:",{aTab:aTab},smalltalk.HLManager)})},
 args: ["aTab"],
-source: "show: aTab\x0a\x09(window jQuery: '#container') empty.\x0a\x09aTab widget appendToJQuery: '#container' asJQuery.\x0a\x09aTab focus",
-messageSends: ["empty", "jQuery:", "appendToJQuery:", "asJQuery", "widget", "focus"],
+source: "show: aTab\x0a\x09self tabs do: [ :each | each hide ].\x0a\x09aTab show; focus",
+messageSends: ["do:", "hide", "tabs", "show", "focus"],
 referencedClasses: []
 }),
 smalltalk.HLManager);

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

@@ -8,13 +8,13 @@ fn: function (html){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1,$2;
 $1=_st(html)._div();
-_st($1)._id_("container");
+_st($1)._class_("tool_container");
 $2=_st($1)._with_(_st(self)._splitter());
 _st(_st(window)._jQuery_(window))._bind_do_("resize",(function(){
 return smalltalk.withContext(function($ctx2) {
return _st(_st(self)._splitter())._resize();
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html}, smalltalk.HLContainer)})},
-messageSends: ["id:", "div", "with:", "splitter", "bind:do:", "resize", "jQuery:"]}),
+return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},smalltalk.HLContainer)})},
+messageSends: ["class:", "div", "with:", "splitter", "bind:do:", "resize", "jQuery:"]}),
 smalltalk.HLContainer);
 
 smalltalk.addMethod(

+ 4 - 4
js/Helios-Layout.js

@@ -9,15 +9,15 @@ fn: function (html){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1,$2;
 $1=_st(html)._div();
-_st($1)._id_("container");
+_st($1)._class_("tool_container");
 $2=_st($1)._with_(_st(self)._splitter());
 _st(_st(window)._jQuery_(window))._bind_do_("resize",(function(){
 return smalltalk.withContext(function($ctx2) {
return _st(_st(self)._splitter())._resize();
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html}, smalltalk.HLContainer)})},
+return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},smalltalk.HLContainer)})},
 args: ["html"],
-source: "renderOn: html\x0a\x09html div \x0a    \x09id: 'container'; \x0a        with: self splitter.\x0a        \x0a   (window jQuery: window) bind: 'resize' do: [ self splitter resize ]",
-messageSends: ["id:", "div", "with:", "splitter", "bind:do:", "resize", "jQuery:"],
+source: "renderOn: html\x0a\x09html div \x0a    \x09class: 'tool_container'; \x0a        with: self splitter.\x0a        \x0a   (window jQuery: window) bind: 'resize' do: [ self splitter resize ]",
+messageSends: ["class:", "div", "with:", "splitter", "bind:do:", "resize", "jQuery:"],
 referencedClasses: []
 }),
 smalltalk.HLContainer);

+ 15 - 22
st/Helios-Browser.st

@@ -21,31 +21,18 @@ model: aModel
 	model := aModel
 ! !
 
+!HLBrowser methodsFor: 'actions'!
+
+focus
+	^ self packagesListWidget focus
+! !
+
 !HLBrowser methodsFor: 'keybindings'!
 
 registerBindingsOn: aBindingGroup
-	HLBrowserCommand registerConcreteClassesOn: aBindingGroup for: self model
-	
-	"aBindingGroup 
-    	addGroupKey: 66 labelled: 'Browse';
-        addGroupKey: 71 labelled: 'Go to';
-        addGroupKey: 84 labelled: 'Toggle';
-		addGroupKey: 77 labelled: 'Move'.
-			
-	(aBindingGroup at: 'Move')
-		addGroupKey: 77 labelled: 'Method';
-		addGroupKey: 67 labelled: 'Class';
-		addGroupKey: 80 labelled: 'Protocol'.
-        
-	HLMoveMethodToCommand concreteClasses do: [ :each |
-  			(aBindingGroup at: 'Move') 
-				at: each bindingGroup 
-  				add: (each on: self model) asBinding ].
-			
-   	HLBrowserCommand concreteClasses do: [ :each |
-  			aBindingGroup 
-				at: each bindingGroup
-  				add: (each on: self model) asBinding ]"
+	HLBrowserCommand 
+		registerConcreteClassesOn: aBindingGroup 
+		for: self model
 ! !
 
 !HLBrowser methodsFor: 'rendering'!
@@ -64,6 +51,12 @@ renderContentOn: html
 	self packagesListWidget focus
 ! !
 
+!HLBrowser methodsFor: 'testing'!
+
+canHaveFocus
+	^ true
+! !
+
 !HLBrowser methodsFor: 'widgets'!
 
 classesListWidget

+ 44 - 8
st/Helios-Core.st

@@ -1,6 +1,6 @@
 Smalltalk current createPackage: 'Helios-Core'!
-Object subclass: #HLTab
-	instanceVariableNames: 'widget label'
+Widget subclass: #HLTab
+	instanceVariableNames: 'widget label root'
 	package: 'Helios-Core'!
 
 !HLTab methodsFor: 'accessing'!
@@ -44,6 +44,43 @@ widget: aWidget
 	widget := aWidget
 ! !
 
+!HLTab methodsFor: 'actions'!
+
+hide
+	root ifNotNil: [
+		root asJQuery hide ]
+!
+
+registerBindings
+	self widget registerBindings
+!
+
+remove
+	root ifNotNil: [ root asJQuery remove ]
+!
+
+show
+	root
+		ifNil: [ self appendToJQuery: 'body' asJQuery ]
+		ifNotNil: [ root asJQuery show ]
+! !
+
+!HLTab methodsFor: 'rendering'!
+
+renderOn: html
+	root := html div
+		class: 'tab';
+		yourself.
+	self renderTab
+!
+
+renderTab
+	root contents: [ :html |
+		html div
+			class: 'amber_box';
+			with: [ self widget renderOn: html ] ]
+! !
+
 !HLTab methodsFor: 'testing'!
 
 isActive
@@ -446,6 +483,7 @@ tabs
 
 activate: aTab
 	self keyBinder flushBindings.
+	aTab registerBindings.
 	activeTab := aTab.
 	
 	self 
@@ -478,6 +516,7 @@ removeTab: aTab
 	self removeFromHistory: aTab.
 	self tabs remove: aTab.
 	self keyBinder flushBindings.
+	aTab remove.
 	self refresh.
 	self history ifNotEmpty: [
 		self history last activate ]
@@ -500,7 +539,6 @@ initialize
 
 refresh
 	(window jQuery: '.navbar') remove.
-	(window jQuery: '#container') remove.
 	self appendToJQuery: 'body' asJQuery
 !
 
@@ -532,8 +570,7 @@ renderContentOn: html
 		class: 'navbar navbar-fixed-top';
 		with: [ html div 
 			class: 'navbar-inner';
-			with: [ self renderTabsOn: html ] ].
-	html div id: 'container'
+			with: [ self renderTabsOn: html ] ]
 !
 
 renderTabsOn: html
@@ -554,9 +591,8 @@ renderTabsOn: html
 !
 
 show: aTab
-	(window jQuery: '#container') empty.
-	aTab widget appendToJQuery: '#container' asJQuery.
-	aTab focus
+	self tabs do: [ :each | each hide ].
+	aTab show; focus
 ! !
 
 HLManager class instanceVariableNames: 'current'!

+ 1 - 1
st/Helios-Layout.st

@@ -17,7 +17,7 @@ splitter: aSplitter
 
 renderOn: html
 	html div 
-    	id: 'container'; 
+    	class: 'tool_container'; 
         with: self splitter.
         
    (window jQuery: window) bind: 'resize' do: [ self splitter resize ]