Browse Source

Package commit handling

Benjamin Van Ryseghem 12 years ago
parent
commit
bae8efea4f

+ 57 - 2
js/Helios-Browser.deploy.js

@@ -882,14 +882,20 @@ fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1,$2;
 $1=_st((smalltalk.SystemAnnouncer || SystemAnnouncer))._current();
+_st($1)._on_do_((smalltalk.ProtocolAdded || ProtocolAdded),(function(ann){
+return smalltalk.withContext(function($ctx2) {
return _st(self)._onProtocolAdded_(_st(ann)._theClass());
+}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
+_st($1)._on_do_((smalltalk.ProtocolRemoved || ProtocolRemoved),(function(ann){
+return smalltalk.withContext(function($ctx2) {
return _st(self)._onProtocolRemoved_(_st(ann)._theClass());
+}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
 _st($1)._on_do_((smalltalk.MethodAdded || MethodAdded),(function(ann){
 return smalltalk.withContext(function($ctx2) {
return _st(self)._onMethodAdded_(_st(ann)._method());
 }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
 $2=_st($1)._on_do_((smalltalk.MethodRemoved || MethodRemoved),(function(ann){
 return smalltalk.withContext(function($ctx2) {
return _st(self)._onMethodRemoved_(_st(ann)._method());
 }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"observeSystem",{}, smalltalk.HLMethodsListWidget)})},
-messageSends: ["on:do:", "onMethodAdded:", "method", "current", "onMethodRemoved:"]}),
+return self}, function($ctx1) {$ctx1.fill(self,"observeSystem",{},smalltalk.HLMethodsListWidget)})},
+messageSends: ["on:do:", "onProtocolAdded:", "theClass", "current", "onProtocolRemoved:", "onMethodAdded:", "method", "onMethodRemoved:"]}),
 smalltalk.HLMethodsListWidget);
 
 smalltalk.addMethod(
@@ -975,6 +981,44 @@ return self}, function($ctx1) {$ctx1.fill(self,"onMethodsFocusRequested",{}, sma
 messageSends: ["focus"]}),
 smalltalk.HLMethodsListWidget);
 
+smalltalk.addMethod(
+"_onProtocolAdded_",
+smalltalk.method({
+selector: "onProtocolAdded:",
+fn: function (aClass){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
var $1,$2;
+$1=_st(_st(_st(self)._model())._selectedClass()).__eq(aClass);
+if(! smalltalk.assert($1)){
+$2=self;
+return $2;
+};
+_st(self)._setItemsForSelectedProtocol();
+_st(self)._refresh();
+_st(self)._focus();
+return self}, function($ctx1) {$ctx1.fill(self,"onProtocolAdded:",{aClass:aClass},smalltalk.HLMethodsListWidget)})},
+messageSends: ["ifFalse:", "=", "selectedClass", "model", "setItemsForSelectedProtocol", "refresh", "focus"]}),
+smalltalk.HLMethodsListWidget);
+
+smalltalk.addMethod(
+"_onProtocolRemoved_",
+smalltalk.method({
+selector: "onProtocolRemoved:",
+fn: function (aClass){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
var $1,$2;
+$1=_st(_st(_st(self)._model())._selectedClass()).__eq(aClass);
+if(! smalltalk.assert($1)){
+$2=self;
+return $2;
+};
+_st(self)._setItemsForSelectedProtocol();
+_st(self)._refresh();
+_st(self)._focus();
+return self}, function($ctx1) {$ctx1.fill(self,"onProtocolRemoved:",{aClass:aClass},smalltalk.HLMethodsListWidget)})},
+messageSends: ["ifFalse:", "=", "selectedClass", "model", "setItemsForSelectedProtocol", "refresh", "focus"]}),
+smalltalk.HLMethodsListWidget);
+
 smalltalk.addMethod(
 "_onProtocolSelected_",
 smalltalk.method({
@@ -1584,6 +1628,17 @@ return $1;
 messageSends: ["availableProtocolsFor:", "selectedClass", "environment"]}),
 smalltalk.HLBrowserModel);
 
+smalltalk.addMethod(
+"_commitPackage",
+smalltalk.method({
+selector: "commitPackage",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._environment())._commitPackage_(_st(self)._selectedPackage());
+return self}, function($ctx1) {$ctx1.fill(self,"commitPackage",{},smalltalk.HLBrowserModel)})},
+messageSends: ["commitPackage:", "selectedPackage", "environment"]}),
+smalltalk.HLBrowserModel);
+
 smalltalk.addMethod(
 "_compilationProtocol",
 smalltalk.method({

+ 74 - 4
js/Helios-Browser.js

@@ -1153,17 +1153,23 @@ fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1,$2;
 $1=_st((smalltalk.SystemAnnouncer || SystemAnnouncer))._current();
+_st($1)._on_do_((smalltalk.ProtocolAdded || ProtocolAdded),(function(ann){
+return smalltalk.withContext(function($ctx2) {
return _st(self)._onProtocolAdded_(_st(ann)._theClass());
+}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
+_st($1)._on_do_((smalltalk.ProtocolRemoved || ProtocolRemoved),(function(ann){
+return smalltalk.withContext(function($ctx2) {
return _st(self)._onProtocolRemoved_(_st(ann)._theClass());
+}, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
 _st($1)._on_do_((smalltalk.MethodAdded || MethodAdded),(function(ann){
 return smalltalk.withContext(function($ctx2) {
return _st(self)._onMethodAdded_(_st(ann)._method());
 }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
 $2=_st($1)._on_do_((smalltalk.MethodRemoved || MethodRemoved),(function(ann){
 return smalltalk.withContext(function($ctx2) {
return _st(self)._onMethodRemoved_(_st(ann)._method());
 }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"observeSystem",{}, smalltalk.HLMethodsListWidget)})},
+return self}, function($ctx1) {$ctx1.fill(self,"observeSystem",{},smalltalk.HLMethodsListWidget)})},
 args: [],
-source: "observeSystem\x0a\x09SystemAnnouncer current \x0a    \x09on: MethodAdded \x0a        do: [ :ann | self onMethodAdded: ann method ];\x0a        on: MethodRemoved \x0a        do: [ :ann | self onMethodRemoved: ann method ]",
-messageSends: ["on:do:", "onMethodAdded:", "method", "current", "onMethodRemoved:"],
-referencedClasses: ["MethodAdded", "SystemAnnouncer", "MethodRemoved"]
+source: "observeSystem\x0a\x09SystemAnnouncer current \x0a    \x09on: ProtocolAdded\x0a        do: [ :ann | self onProtocolAdded: ann theClass ];\x0a    \x09on: ProtocolRemoved\x0a        do: [ :ann | self onProtocolRemoved: ann theClass ];\x0a    \x09on: MethodAdded \x0a        do: [ :ann | self onMethodAdded: ann method ];\x0a        on: MethodRemoved \x0a        do: [ :ann | self onMethodRemoved: ann method ]",
+messageSends: ["on:do:", "onProtocolAdded:", "theClass", "current", "onProtocolRemoved:", "onMethodAdded:", "method", "onMethodRemoved:"],
+referencedClasses: ["ProtocolAdded", "SystemAnnouncer", "ProtocolRemoved", "MethodAdded", "MethodRemoved"]
 }),
 smalltalk.HLMethodsListWidget);
 
@@ -1270,6 +1276,54 @@ referencedClasses: []
 }),
 smalltalk.HLMethodsListWidget);
 
+smalltalk.addMethod(
+"_onProtocolAdded_",
+smalltalk.method({
+selector: "onProtocolAdded:",
+category: 'reactions',
+fn: function (aClass){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
var $1,$2;
+$1=_st(_st(_st(self)._model())._selectedClass()).__eq(aClass);
+if(! smalltalk.assert($1)){
+$2=self;
+return $2;
+};
+_st(self)._setItemsForSelectedProtocol();
+_st(self)._refresh();
+_st(self)._focus();
+return self}, function($ctx1) {$ctx1.fill(self,"onProtocolAdded:",{aClass:aClass},smalltalk.HLMethodsListWidget)})},
+args: ["aClass"],
+source: "onProtocolAdded: aClass\x0a\x09self model selectedClass = aClass ifFalse: [ ^ self ].\x0a\x09\x0a\x09self setItemsForSelectedProtocol.\x0a    self refresh.\x0a\x09self focus",
+messageSends: ["ifFalse:", "=", "selectedClass", "model", "setItemsForSelectedProtocol", "refresh", "focus"],
+referencedClasses: []
+}),
+smalltalk.HLMethodsListWidget);
+
+smalltalk.addMethod(
+"_onProtocolRemoved_",
+smalltalk.method({
+selector: "onProtocolRemoved:",
+category: 'reactions',
+fn: function (aClass){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
var $1,$2;
+$1=_st(_st(_st(self)._model())._selectedClass()).__eq(aClass);
+if(! smalltalk.assert($1)){
+$2=self;
+return $2;
+};
+_st(self)._setItemsForSelectedProtocol();
+_st(self)._refresh();
+_st(self)._focus();
+return self}, function($ctx1) {$ctx1.fill(self,"onProtocolRemoved:",{aClass:aClass},smalltalk.HLMethodsListWidget)})},
+args: ["aClass"],
+source: "onProtocolRemoved: aClass\x0a\x09self model selectedClass = aClass ifFalse: [ ^ self ].\x0a\x09\x0a\x09self setItemsForSelectedProtocol.\x0a    self refresh.\x0a\x09self focus",
+messageSends: ["ifFalse:", "=", "selectedClass", "model", "setItemsForSelectedProtocol", "refresh", "focus"],
+referencedClasses: []
+}),
+smalltalk.HLMethodsListWidget);
+
 smalltalk.addMethod(
 "_onProtocolSelected_",
 smalltalk.method({
@@ -2064,6 +2118,22 @@ referencedClasses: []
 }),
 smalltalk.HLBrowserModel);
 
+smalltalk.addMethod(
+"_commitPackage",
+smalltalk.method({
+selector: "commitPackage",
+category: 'commands actions',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._environment())._commitPackage_(_st(self)._selectedPackage());
+return self}, function($ctx1) {$ctx1.fill(self,"commitPackage",{},smalltalk.HLBrowserModel)})},
+args: [],
+source: "commitPackage\x0a\x09self environment commitPackage: self selectedPackage",
+messageSends: ["commitPackage:", "selectedPackage", "environment"],
+referencedClasses: []
+}),
+smalltalk.HLBrowserModel);
+
 smalltalk.addMethod(
 "_compilationProtocol",
 smalltalk.method({

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

@@ -223,6 +223,53 @@ messageSends: []}),
 smalltalk.HLGoToSourceCodeCommand.klass);
 
 
+smalltalk.addClass('HLCommitPackageCommand', smalltalk.HLBrowserCommand, [], 'Helios-Commands-Browser');
+smalltalk.addMethod(
+"_execute",
+smalltalk.method({
+selector: "execute",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._model())._commitPackage();
+return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLCommitPackageCommand)})},
+messageSends: ["commitPackage", "model"]}),
+smalltalk.HLCommitPackageCommand);
+
+smalltalk.addMethod(
+"_isActive",
+smalltalk.method({
+selector: "isActive",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
return true;
+}, function($ctx1) {$ctx1.fill(self,"isActive",{},smalltalk.HLCommitPackageCommand)})},
+messageSends: []}),
+smalltalk.HLCommitPackageCommand);
+
+
+smalltalk.addMethod(
+"_key",
+smalltalk.method({
+selector: "key",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
return (75);
+}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLCommitPackageCommand.klass)})},
+messageSends: []}),
+smalltalk.HLCommitPackageCommand.klass);
+
+smalltalk.addMethod(
+"_label",
+smalltalk.method({
+selector: "label",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
return "Commit package";
+}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLCommitPackageCommand.klass)})},
+messageSends: []}),
+smalltalk.HLCommitPackageCommand.klass);
+
+
 smalltalk.addClass('HLMoveToCommand', smalltalk.HLBrowserCommand, [], 'Helios-Commands-Browser');
 
 smalltalk.addMethod(

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

@@ -313,6 +313,73 @@ referencedClasses: []
 smalltalk.HLGoToSourceCodeCommand.klass);
 
 
+smalltalk.addClass('HLCommitPackageCommand', smalltalk.HLBrowserCommand, [], 'Helios-Commands-Browser');
+smalltalk.addMethod(
+"_execute",
+smalltalk.method({
+selector: "execute",
+category: 'executing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._model())._commitPackage();
+return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLCommitPackageCommand)})},
+args: [],
+source: "execute\x0a\x09self model commitPackage",
+messageSends: ["commitPackage", "model"],
+referencedClasses: []
+}),
+smalltalk.HLCommitPackageCommand);
+
+smalltalk.addMethod(
+"_isActive",
+smalltalk.method({
+selector: "isActive",
+category: 'testing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
return true;
+}, function($ctx1) {$ctx1.fill(self,"isActive",{},smalltalk.HLCommitPackageCommand)})},
+args: [],
+source: "isActive\x0a\x09^ true\x0a\x09\x22 slf model isPackageDirty\x22",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLCommitPackageCommand);
+
+
+smalltalk.addMethod(
+"_key",
+smalltalk.method({
+selector: "key",
+category: 'accessing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
return (75);
+}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLCommitPackageCommand.klass)})},
+args: [],
+source: "key\x0a\x09^ 75",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLCommitPackageCommand.klass);
+
+smalltalk.addMethod(
+"_label",
+smalltalk.method({
+selector: "label",
+category: 'accessing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
return "Commit package";
+}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLCommitPackageCommand.klass)})},
+args: [],
+source: "label\x0a\x09^ 'Commit package'",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLCommitPackageCommand.klass);
+
+
 smalltalk.addClass('HLMoveToCommand', smalltalk.HLBrowserCommand, [], 'Helios-Commands-Browser');
 
 smalltalk.addMethod(

+ 29 - 0
js/Helios-Core.deploy.js

@@ -1344,3 +1344,32 @@ messageSends: []}),
 smalltalk.HLTranscript.klass);
 
 
+smalltalk.addMethod(
+"_ajaxPutAt_data_",
+smalltalk.method({
+selector: "ajaxPutAt:data:",
+fn: function (aURL,aString){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
_st(jQuery)._ajax_options_(aURL,smalltalk.HashedCollection._fromPairs_([_st("type").__minus_gt("PUT"),_st("data").__minus_gt(aString),_st("contentType").__minus_gt("text/plain;charset=UTF-8"),_st("error").__minus_gt((function(xhr){
+return smalltalk.withContext(function($ctx2) {
return _st(window)._alert_(_st(_st(_st(_st("Commiting ").__comma(aURL)).__comma(" failed with reason: \x22")).__comma(_st(xhr)._responseText())).__comma("\x22"));
+}, function($ctx2) {$ctx2.fillBlock({xhr:xhr},$ctx1)})}))]));
+return self}, function($ctx1) {$ctx1.fill(self,"ajaxPutAt:data:",{aURL:aURL,aString:aString},smalltalk.Package)})},
+messageSends: ["ajax:options:", "->", "alert:", ",", "responseText"]}),
+smalltalk.Package);
+
+smalltalk.addMethod(
+"_heliosCommit",
+smalltalk.method({
+selector: "heliosCommit",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
_st([_st((smalltalk.Exporter || Exporter)).__minus_gt(_st(_st(_st(_st(self)._commitPathJs()).__comma("/")).__comma(_st(self)._name())).__comma(".js")),_st((smalltalk.StrippedExporter || StrippedExporter)).__minus_gt(_st(_st(_st(_st(self)._commitPathJs()).__comma("/")).__comma(_st(self)._name())).__comma(".deploy.js")),_st((smalltalk.ChunkExporter || ChunkExporter)).__minus_gt(_st(_st(_st(_st(self)._commitPathSt()).__comma("/")).__comma(_st(self)._name())).__comma(".st"))])._do_((function(commitStrategy){
+var fileContents;
+return smalltalk.withContext(function($ctx2) {
fileContents=_st(_st(_st(commitStrategy)._key())._new())._exportPackage_(_st(self)._name());
+fileContents;
+return _st(self)._ajaxPutAt_data_(_st(commitStrategy)._value(),fileContents);
+}, function($ctx2) {$ctx2.fillBlock({commitStrategy:commitStrategy,fileContents:fileContents},$ctx1)})}));
+return self}, function($ctx1) {$ctx1.fill(self,"heliosCommit",{},smalltalk.Package)})},
+messageSends: ["do:", "exportPackage:", "name", "new", "key", "ajaxPutAt:data:", "value", "->", ",", "commitPathJs", "commitPathSt"]}),
+smalltalk.Package);
+

+ 39 - 0
js/Helios-Core.js

@@ -1779,3 +1779,42 @@ referencedClasses: []
 smalltalk.HLTranscript.klass);
 
 
+smalltalk.addMethod(
+"_ajaxPutAt_data_",
+smalltalk.method({
+selector: "ajaxPutAt:data:",
+category: '*Helios-Core',
+fn: function (aURL,aString){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
_st(jQuery)._ajax_options_(aURL,smalltalk.HashedCollection._fromPairs_([_st("type").__minus_gt("PUT"),_st("data").__minus_gt(aString),_st("contentType").__minus_gt("text/plain;charset=UTF-8"),_st("error").__minus_gt((function(xhr){
+return smalltalk.withContext(function($ctx2) {
return _st(window)._alert_(_st(_st(_st(_st("Commiting ").__comma(aURL)).__comma(" failed with reason: \x22")).__comma(_st(xhr)._responseText())).__comma("\x22"));
+}, function($ctx2) {$ctx2.fillBlock({xhr:xhr},$ctx1)})}))]));
+return self}, function($ctx1) {$ctx1.fill(self,"ajaxPutAt:data:",{aURL:aURL,aString:aString},smalltalk.Package)})},
+args: ["aURL", "aString"],
+source: "ajaxPutAt: aURL data: aString\x0a\x09jQuery\x0a\x09\x09ajax: aURL \x0a\x09\x09options: #{ 'type' -> 'PUT'.\x0a\x09\x09\x09\x09\x09'data' -> aString.\x0a\x09\x09\x09\x09\x09'contentType' -> 'text/plain;charset=UTF-8'.\x0a\x09\x09\x09\x09\x09'error' -> [:xhr | window \x0a\x09\x09\x09\x09\x09\x09alert: 'Commiting ' , aURL , ' failed with reason: \x22' , (xhr responseText) , '\x22'] }",
+messageSends: ["ajax:options:", "->", "alert:", ",", "responseText"],
+referencedClasses: []
+}),
+smalltalk.Package);
+
+smalltalk.addMethod(
+"_heliosCommit",
+smalltalk.method({
+selector: "heliosCommit",
+category: '*Helios-Core',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
_st([_st((smalltalk.Exporter || Exporter)).__minus_gt(_st(_st(_st(_st(self)._commitPathJs()).__comma("/")).__comma(_st(self)._name())).__comma(".js")),_st((smalltalk.StrippedExporter || StrippedExporter)).__minus_gt(_st(_st(_st(_st(self)._commitPathJs()).__comma("/")).__comma(_st(self)._name())).__comma(".deploy.js")),_st((smalltalk.ChunkExporter || ChunkExporter)).__minus_gt(_st(_st(_st(_st(self)._commitPathSt()).__comma("/")).__comma(_st(self)._name())).__comma(".st"))])._do_((function(commitStrategy){
+var fileContents;
+return smalltalk.withContext(function($ctx2) {
fileContents=_st(_st(_st(commitStrategy)._key())._new())._exportPackage_(_st(self)._name());
+fileContents;
+return _st(self)._ajaxPutAt_data_(_st(commitStrategy)._value(),fileContents);
+}, function($ctx2) {$ctx2.fillBlock({commitStrategy:commitStrategy,fileContents:fileContents},$ctx1)})}));
+return self}, function($ctx1) {$ctx1.fill(self,"heliosCommit",{},smalltalk.Package)})},
+args: [],
+source: "heliosCommit\x0a\x0a\x09{ Exporter -> (self commitPathJs, '/', self name, '.js').\x0a\x09\x09\x09StrippedExporter -> (self commitPathJs, '/', self name, '.deploy.js').\x0a\x09\x09\x09ChunkExporter -> (self commitPathSt, '/', self name, '.st')\x0a\x09\x09} do: [ :commitStrategy || fileContents |\x0a\x09\x09\x09fileContents := (commitStrategy key new exportPackage: self name).\x0a\x09\x09\x09self ajaxPutAt: commitStrategy value data: fileContents ]",
+messageSends: ["do:", "exportPackage:", "name", "new", "key", "ajaxPutAt:data:", "value", "->", ",", "commitPathJs", "commitPathSt"],
+referencedClasses: ["Exporter", "StrippedExporter", "ChunkExporter"]
+}),
+smalltalk.Package);
+

+ 22 - 0
js/Helios-Environments.deploy.js

@@ -50,6 +50,17 @@ return $1;
 messageSends: ["subclassResponsibility"]}),
 smalltalk.HLEnvironment);
 
+smalltalk.addMethod(
+"_commitPackage_",
+smalltalk.method({
+selector: "commitPackage:",
+fn: function (aPackage){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
_st(self)._subclassResponsibility();
+return self}, function($ctx1) {$ctx1.fill(self,"commitPackage:",{aPackage:aPackage},smalltalk.HLEnvironment)})},
+messageSends: ["subclassResponsibility"]}),
+smalltalk.HLEnvironment);
+
 smalltalk.addMethod(
 "_compileClassComment_for_",
 smalltalk.method({
@@ -194,6 +205,17 @@ return $1;
 messageSends: ["new"]}),
 smalltalk.HLLocalEnvironment);
 
+smalltalk.addMethod(
+"_commitPackage_",
+smalltalk.method({
+selector: "commitPackage:",
+fn: function (aPackage){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
_st(aPackage)._heliosCommit();
+return self}, function($ctx1) {$ctx1.fill(self,"commitPackage:",{aPackage:aPackage},smalltalk.HLLocalEnvironment)})},
+messageSends: ["heliosCommit"]}),
+smalltalk.HLLocalEnvironment);
+
 smalltalk.addMethod(
 "_eval_on_",
 smalltalk.method({

+ 32 - 0
js/Helios-Environments.js

@@ -71,6 +71,22 @@ referencedClasses: []
 }),
 smalltalk.HLEnvironment);
 
+smalltalk.addMethod(
+"_commitPackage_",
+smalltalk.method({
+selector: "commitPackage:",
+category: 'actions',
+fn: function (aPackage){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
_st(self)._subclassResponsibility();
+return self}, function($ctx1) {$ctx1.fill(self,"commitPackage:",{aPackage:aPackage},smalltalk.HLEnvironment)})},
+args: ["aPackage"],
+source: "commitPackage: aPackage\x0a\x09self subclassResponsibility",
+messageSends: ["subclassResponsibility"],
+referencedClasses: []
+}),
+smalltalk.HLEnvironment);
+
 smalltalk.addMethod(
 "_compileClassComment_for_",
 smalltalk.method({
@@ -270,6 +286,22 @@ referencedClasses: ["ClassBuilder"]
 }),
 smalltalk.HLLocalEnvironment);
 
+smalltalk.addMethod(
+"_commitPackage_",
+smalltalk.method({
+selector: "commitPackage:",
+category: 'actions',
+fn: function (aPackage){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
_st(aPackage)._heliosCommit();
+return self}, function($ctx1) {$ctx1.fill(self,"commitPackage:",{aPackage:aPackage},smalltalk.HLLocalEnvironment)})},
+args: ["aPackage"],
+source: "commitPackage: aPackage\x0a\x09aPackage heliosCommit",
+messageSends: ["heliosCommit"],
+referencedClasses: []
+}),
+smalltalk.HLLocalEnvironment);
+
 smalltalk.addMethod(
 "_eval_on_",
 smalltalk.method({

+ 24 - 0
st/Helios-Browser.st

@@ -419,6 +419,10 @@ observeModel
 
 observeSystem
 	SystemAnnouncer current 
+    	on: ProtocolAdded
+        do: [ :ann | self onProtocolAdded: ann theClass ];
+    	on: ProtocolRemoved
+        do: [ :ann | self onProtocolRemoved: ann theClass ];
     	on: MethodAdded 
         do: [ :ann | self onMethodAdded: ann method ];
         on: MethodRemoved 
@@ -487,6 +491,22 @@ onMethodsFocusRequested
 	self focus
 !
 
+onProtocolAdded: aClass
+	self model selectedClass = aClass ifFalse: [ ^ self ].
+	
+	self setItemsForSelectedProtocol.
+    self refresh.
+	self focus
+!
+
+onProtocolRemoved: aClass
+	self model selectedClass = aClass ifFalse: [ ^ self ].
+	
+	self setItemsForSelectedProtocol.
+    self refresh.
+	self focus
+!
+
 onProtocolSelected: aString
     self selectedItem: nil.
     
@@ -864,6 +884,10 @@ saveSourceCode
 
 !HLBrowserModel methodsFor: 'commands actions'!
 
+commitPackage
+	self environment commitPackage: self selectedPackage
+!
+
 moveMethodToClass: aClassName
 	self environment 
 		moveMethod: self selectedMethod 

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

@@ -135,6 +135,33 @@ label
 	^ 'Source code'
 ! !
 
+HLBrowserCommand subclass: #HLCommitPackageCommand
+	instanceVariableNames: ''
+	package: 'Helios-Commands-Browser'!
+
+!HLCommitPackageCommand methodsFor: 'executing'!
+
+execute
+	self model commitPackage
+! !
+
+!HLCommitPackageCommand methodsFor: 'testing'!
+
+isActive
+	^ true
+	" slf model isPackageDirty"
+! !
+
+!HLCommitPackageCommand class methodsFor: 'accessing'!
+
+key
+	^ 75
+!
+
+label
+	^ 'Commit package'
+! !
+
 HLBrowserCommand subclass: #HLMoveToCommand
 	instanceVariableNames: ''
 	package: 'Helios-Commands-Browser'!

+ 40 - 18
st/Helios-Core.st

@@ -1,7 +1,7 @@
 Smalltalk current createPackage: 'Helios-Core'!
 Object subclass: #HLTab
- instanceVariableNames: 'widget label'
- package: 'Helios-Core'!
+	instanceVariableNames: 'widget label'
+	package: 'Helios-Core'!
 
 !HLTab methodsFor: 'accessing'!
 
@@ -60,8 +60,8 @@ on: aWidget labelled: aString
 ! !
 
 Widget subclass: #HLWidget
- instanceVariableNames: 'wrapper'
- package: 'Helios-Core'!
+	instanceVariableNames: 'wrapper'
+	package: 'Helios-Core'!
 
 !HLWidget methodsFor: 'accessing'!
 
@@ -141,12 +141,12 @@ canBeOpenAsTab
 ! !
 
 HLWidget subclass: #HLDebugger
- instanceVariableNames: ''
- package: 'Helios-Core'!
+	instanceVariableNames: ''
+	package: 'Helios-Core'!
 
 HLWidget subclass: #HLFocusableWidget
- instanceVariableNames: 'hiddenInput'
- package: 'Helios-Core'!
+	instanceVariableNames: 'hiddenInput'
+	package: 'Helios-Core'!
 
 !HLFocusableWidget methodsFor: 'accessing'!
 
@@ -198,8 +198,8 @@ canHaveFocus
 ! !
 
 HLFocusableWidget subclass: #HLListWidget
- instanceVariableNames: 'items selectedItem'
- package: 'Helios-Core'!
+	instanceVariableNames: 'items selectedItem'
+	package: 'Helios-Core'!
 
 !HLListWidget methodsFor: 'accessing'!
 
@@ -335,8 +335,8 @@ renderListOn: html
 ! !
 
 HLListWidget subclass: #HLNavigationListWidget
- instanceVariableNames: 'previous next'
- package: 'Helios-Core'!
+	instanceVariableNames: 'previous next'
+	package: 'Helios-Core'!
 
 !HLNavigationListWidget methodsFor: 'accessing'!
 
@@ -381,8 +381,8 @@ setupKeyBindings
 ! !
 
 HLWidget subclass: #HLManager
- instanceVariableNames: 'tabs activeTab keyBinder environment history'
- package: 'Helios-Core'!
+	instanceVariableNames: 'tabs activeTab keyBinder environment history'
+	package: 'Helios-Core'!
 
 !HLManager methodsFor: 'accessing'!
 
@@ -556,8 +556,8 @@ new
 ! !
 
 HLWidget subclass: #HLSUnit
- instanceVariableNames: ''
- package: 'Helios-Core'!
+	instanceVariableNames: ''
+	package: 'Helios-Core'!
 
 !HLSUnit class methodsFor: 'accessing'!
 
@@ -576,8 +576,8 @@ canBeOpenAsTab
 ! !
 
 HLWidget subclass: #HLTranscript
- instanceVariableNames: ''
- package: 'Helios-Core'!
+	instanceVariableNames: ''
+	package: 'Helios-Core'!
 
 !HLTranscript class methodsFor: 'accessing'!
 
@@ -595,3 +595,25 @@ canBeOpenAsTab
 	^ true
 ! !
 
+!Package methodsFor: '*Helios-Core'!
+
+ajaxPutAt: aURL data: aString
+	jQuery
+		ajax: aURL 
+		options: #{ 'type' -> 'PUT'.
+					'data' -> aString.
+					'contentType' -> 'text/plain;charset=UTF-8'.
+					'error' -> [:xhr | window 
+						alert: 'Commiting ' , aURL , ' failed with reason: "' , (xhr responseText) , '"'] }
+!
+
+heliosCommit
+
+	{ Exporter -> (self commitPathJs, '/', self name, '.js').
+			StrippedExporter -> (self commitPathJs, '/', self name, '.deploy.js').
+			ChunkExporter -> (self commitPathSt, '/', self name, '.st')
+		} do: [ :commitStrategy || fileContents |
+			fileContents := (commitStrategy key new exportPackage: self name).
+			self ajaxPutAt: commitStrategy value data: fileContents ]
+! !
+

+ 8 - 0
st/Helios-Environments.st

@@ -25,6 +25,10 @@ packages
 
 !HLEnvironment methodsFor: 'actions'!
 
+commitPackage: aPackage
+	self subclassResponsibility
+!
+
 eval: someCode on: aReceiver
 
 	^ self subclassResponsibility
@@ -95,6 +99,10 @@ packages
 
 !HLLocalEnvironment methodsFor: 'actions'!
 
+commitPackage: aPackage
+	aPackage heliosCommit
+!
+
 eval: aString on: aReceiver
 	| compiler  |
 	compiler := Compiler new.