Procházet zdrojové kódy

- Implementation of the #moveMethod:toProtocol: behavior
- Implementation of behavior and command for method removal

Benjamin Van Ryseghem před 11 roky
rodič
revize
84554467ab

+ 34 - 6
js/Helios-Browser.deploy.js

@@ -1792,6 +1792,19 @@ return self}, function($ctx1) {$ctx1.fill(self,"handleUnkownVariableError:",{anE
 messageSends: ["announce:", "error:", "new", "yourself", "announcer"]}),
 smalltalk.HLBrowserModel);
 
+smalltalk.addMethod(
+"_manager",
+smalltalk.method({
+selector: "manager",
+fn: function (){
+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.HLBrowserModel)})},
+messageSends: ["current"]}),
+smalltalk.HLBrowserModel);
+
 smalltalk.addMethod(
 "_moveMethodToClass_",
 smalltalk.method({
@@ -1804,14 +1817,14 @@ messageSends: ["moveMethod:toClass:", "selectedMethod", "environment"]}),
 smalltalk.HLBrowserModel);
 
 smalltalk.addMethod(
-"_moveMethodToClass_ifAbsent_",
+"_moveMethodToProtocol_",
 smalltalk.method({
-selector: "moveMethodToClass:ifAbsent:",
-fn: function (aClassName,aBlock){
+selector: "moveMethodToProtocol:",
+fn: function (aProtocol){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._environment())._moveMethod_toClass_ifAbsent_(_st(self)._selectedMethod(),aClassName,aBlock);
-return self}, function($ctx1) {$ctx1.fill(self,"moveMethodToClass:ifAbsent:",{aClassName:aClassName,aBlock:aBlock},smalltalk.HLBrowserModel)})},
-messageSends: ["moveMethod:toClass:ifAbsent:", "selectedMethod", "environment"]}),
+return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._environment())._moveMethod_toProtocol_(_st(self)._selectedMethod(),aProtocol);
+return self}, function($ctx1) {$ctx1.fill(self,"moveMethodToProtocol:",{aProtocol:aProtocol},smalltalk.HLBrowserModel)})},
+messageSends: ["moveMethod:toProtocol:", "selectedMethod", "environment"]}),
 smalltalk.HLBrowserModel);
 
 smalltalk.addMethod(
@@ -1827,6 +1840,21 @@ return $1;
 messageSends: ["packages", "environment"]}),
 smalltalk.HLBrowserModel);
 
+smalltalk.addMethod(
+"_removeMethod",
+smalltalk.method({
+selector: "removeMethod",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
var $1;
+$1=_st(_st(self)._manager())._confirm_(_st(_st(_st("Do you REALLY want to remove method ").__comma(_st(_st(_st(self)._selectedMethod())._methodClass())._name())).__comma(" >> #")).__comma(_st(_st(self)._selectedMethod())._selector()));
+if(smalltalk.assert($1)){
+_st(_st(self)._environment())._removeMethod_(_st(self)._selectedMethod());
+};
+return self}, function($ctx1) {$ctx1.fill(self,"removeMethod",{},smalltalk.HLBrowserModel)})},
+messageSends: ["ifTrue:", "removeMethod:", "selectedMethod", "environment", "confirm:", ",", "selector", "name", "methodClass", "manager"]}),
+smalltalk.HLBrowserModel);
+
 smalltalk.addMethod(
 "_save_",
 smalltalk.method({

+ 47 - 9
js/Helios-Browser.js

@@ -2326,7 +2326,7 @@ smalltalk.addMethod(
 "_handleUnkownVariableError_",
 smalltalk.method({
 selector: "handleUnkownVariableError:",
-category: 'error handling',
+category: 'accessing',
 fn: function (anError){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1,$2;
@@ -2342,6 +2342,24 @@ referencedClasses: ["HLUnknownVariableErrorRaised"]
 }),
 smalltalk.HLBrowserModel);
 
+smalltalk.addMethod(
+"_manager",
+smalltalk.method({
+selector: "manager",
+category: 'accessing',
+fn: function (){
+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.HLBrowserModel)})},
+args: [],
+source: "manager\x0a\x09^ HLManager current",
+messageSends: ["current"],
+referencedClasses: ["HLManager"]
+}),
+smalltalk.HLBrowserModel);
+
 smalltalk.addMethod(
 "_moveMethodToClass_",
 smalltalk.method({
@@ -2359,17 +2377,17 @@ referencedClasses: []
 smalltalk.HLBrowserModel);
 
 smalltalk.addMethod(
-"_moveMethodToClass_ifAbsent_",
+"_moveMethodToProtocol_",
 smalltalk.method({
-selector: "moveMethodToClass:ifAbsent:",
+selector: "moveMethodToProtocol:",
 category: 'commands actions',
-fn: function (aClassName,aBlock){
+fn: function (aProtocol){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._environment())._moveMethod_toClass_ifAbsent_(_st(self)._selectedMethod(),aClassName,aBlock);
-return self}, function($ctx1) {$ctx1.fill(self,"moveMethodToClass:ifAbsent:",{aClassName:aClassName,aBlock:aBlock},smalltalk.HLBrowserModel)})},
-args: ["aClassName", "aBlock"],
-source: "moveMethodToClass: aClassName ifAbsent: aBlock\x0a\x09self environment \x0a\x09\x09moveMethod: self selectedMethod \x0a\x09\x09toClass: aClassName \x0a\x09\x09ifAbsent: aBlock",
-messageSends: ["moveMethod:toClass:ifAbsent:", "selectedMethod", "environment"],
+return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._environment())._moveMethod_toProtocol_(_st(self)._selectedMethod(),aProtocol);
+return self}, function($ctx1) {$ctx1.fill(self,"moveMethodToProtocol:",{aProtocol:aProtocol},smalltalk.HLBrowserModel)})},
+args: ["aProtocol"],
+source: "moveMethodToProtocol: aProtocol\x0a\x09self environment moveMethod: self selectedMethod toProtocol: aProtocol",
+messageSends: ["moveMethod:toProtocol:", "selectedMethod", "environment"],
 referencedClasses: []
 }),
 smalltalk.HLBrowserModel);
@@ -2392,6 +2410,26 @@ referencedClasses: []
 }),
 smalltalk.HLBrowserModel);
 
+smalltalk.addMethod(
+"_removeMethod",
+smalltalk.method({
+selector: "removeMethod",
+category: 'commands actions',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
var $1;
+$1=_st(_st(self)._manager())._confirm_(_st(_st(_st("Do you REALLY want to remove method ").__comma(_st(_st(_st(self)._selectedMethod())._methodClass())._name())).__comma(" >> #")).__comma(_st(_st(self)._selectedMethod())._selector()));
+if(smalltalk.assert($1)){
+_st(_st(self)._environment())._removeMethod_(_st(self)._selectedMethod());
+};
+return self}, function($ctx1) {$ctx1.fill(self,"removeMethod",{},smalltalk.HLBrowserModel)})},
+args: [],
+source: "removeMethod\x0a\x09(self manager confirm: 'Do you REALLY want to remove method ', self selectedMethod methodClass name,' >> #', self selectedMethod selector)\x0a\x09\x09ifTrue: [ self environment removeMethod: self selectedMethod ]",
+messageSends: ["ifTrue:", "removeMethod:", "selectedMethod", "environment", "confirm:", ",", "selector", "name", "methodClass", "manager"],
+referencedClasses: []
+}),
+smalltalk.HLBrowserModel);
+
 smalltalk.addMethod(
 "_save_",
 smalltalk.method({

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

@@ -450,6 +450,80 @@ messageSends: []}),
 smalltalk.HLMoveMethodToProtocolCommand.klass);
 
 
+smalltalk.addClass('HLRemoveCommand', smalltalk.HLBrowserCommand, [], 'Helios-Commands-Browser');
+
+smalltalk.addMethod(
+"_key",
+smalltalk.method({
+selector: "key",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
return (88);
+}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLRemoveCommand.klass)})},
+messageSends: []}),
+smalltalk.HLRemoveCommand.klass);
+
+smalltalk.addMethod(
+"_label",
+smalltalk.method({
+selector: "label",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
return "Remove";
+}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLRemoveCommand.klass)})},
+messageSends: []}),
+smalltalk.HLRemoveCommand.klass);
+
+
+smalltalk.addClass('HLRemoveMethodCommand', smalltalk.HLRemoveCommand, [], 'Helios-Commands-Browser');
+smalltalk.addMethod(
+"_execute",
+smalltalk.method({
+selector: "execute",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._model())._removeMethod();
+return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLRemoveMethodCommand)})},
+messageSends: ["removeMethod", "model"]}),
+smalltalk.HLRemoveMethodCommand);
+
+smalltalk.addMethod(
+"_isActive",
+smalltalk.method({
+selector: "isActive",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
var $1;
+$1=_st(_st(_st(self)._model())._selectedMethod())._notNil();
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"isActive",{},smalltalk.HLRemoveMethodCommand)})},
+messageSends: ["notNil", "selectedMethod", "model"]}),
+smalltalk.HLRemoveMethodCommand);
+
+
+smalltalk.addMethod(
+"_key",
+smalltalk.method({
+selector: "key",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
return (77);
+}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLRemoveMethodCommand.klass)})},
+messageSends: []}),
+smalltalk.HLRemoveMethodCommand.klass);
+
+smalltalk.addMethod(
+"_label",
+smalltalk.method({
+selector: "label",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
return "Method";
+}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLRemoveMethodCommand.klass)})},
+messageSends: []}),
+smalltalk.HLRemoveMethodCommand.klass);
+
+
 smalltalk.addClass('HLToggleCommand', smalltalk.HLBrowserCommand, [], 'Helios-Commands-Browser');
 
 smalltalk.addMethod(

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

@@ -635,6 +635,110 @@ referencedClasses: []
 smalltalk.HLMoveMethodToProtocolCommand.klass);
 
 
+smalltalk.addClass('HLRemoveCommand', smalltalk.HLBrowserCommand, [], 'Helios-Commands-Browser');
+
+smalltalk.addMethod(
+"_key",
+smalltalk.method({
+selector: "key",
+category: 'accessing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
return (88);
+}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLRemoveCommand.klass)})},
+args: [],
+source: "key\x0a\x09^ 88",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLRemoveCommand.klass);
+
+smalltalk.addMethod(
+"_label",
+smalltalk.method({
+selector: "label",
+category: 'accessing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
return "Remove";
+}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLRemoveCommand.klass)})},
+args: [],
+source: "label\x0a\x09^ 'Remove'",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLRemoveCommand.klass);
+
+
+smalltalk.addClass('HLRemoveMethodCommand', smalltalk.HLRemoveCommand, [], '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())._removeMethod();
+return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLRemoveMethodCommand)})},
+args: [],
+source: "execute\x0a\x09self model removeMethod",
+messageSends: ["removeMethod", "model"],
+referencedClasses: []
+}),
+smalltalk.HLRemoveMethodCommand);
+
+smalltalk.addMethod(
+"_isActive",
+smalltalk.method({
+selector: "isActive",
+category: 'testing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
var $1;
+$1=_st(_st(_st(self)._model())._selectedMethod())._notNil();
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"isActive",{},smalltalk.HLRemoveMethodCommand)})},
+args: [],
+source: "isActive\x0a\x09^ self model selectedMethod notNil",
+messageSends: ["notNil", "selectedMethod", "model"],
+referencedClasses: []
+}),
+smalltalk.HLRemoveMethodCommand);
+
+
+smalltalk.addMethod(
+"_key",
+smalltalk.method({
+selector: "key",
+category: 'accessing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
return (77);
+}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLRemoveMethodCommand.klass)})},
+args: [],
+source: "key\x0a\x09^ 77",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLRemoveMethodCommand.klass);
+
+smalltalk.addMethod(
+"_label",
+smalltalk.method({
+selector: "label",
+category: 'accessing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
return "Method";
+}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLRemoveMethodCommand.klass)})},
+args: [],
+source: "label\x0a\x09^ 'Method'",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLRemoveMethodCommand.klass);
+
+
 smalltalk.addClass('HLToggleCommand', smalltalk.HLBrowserCommand, [], 'Helios-Commands-Browser');
 
 smalltalk.addMethod(

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

@@ -107,6 +107,17 @@ return self}, function($ctx1) {$ctx1.fill(self,"moveMethod:toClass:",{aMethod:aM
 messageSends: ["subclassResponsibility"]}),
 smalltalk.HLEnvironment);
 
+smalltalk.addMethod(
+"_moveMethod_toProtocol_",
+smalltalk.method({
+selector: "moveMethod:toProtocol:",
+fn: function (aMethod,aProtocol){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
_st(self)._subclassResponsibility();
+return self}, function($ctx1) {$ctx1.fill(self,"moveMethod:toProtocol:",{aMethod:aMethod,aProtocol:aProtocol},smalltalk.HLEnvironment)})},
+messageSends: ["subclassResponsibility"]}),
+smalltalk.HLEnvironment);
+
 smalltalk.addMethod(
 "_packages",
 smalltalk.method({
@@ -120,6 +131,17 @@ return $1;
 messageSends: ["subclassResponsibility"]}),
 smalltalk.HLEnvironment);
 
+smalltalk.addMethod(
+"_removeMethod_",
+smalltalk.method({
+selector: "removeMethod:",
+fn: function (aMethod){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
_st(self)._sublcassResponsibility();
+return self}, function($ctx1) {$ctx1.fill(self,"removeMethod:",{aMethod:aMethod},smalltalk.HLEnvironment)})},
+messageSends: ["sublcassResponsibility"]}),
+smalltalk.HLEnvironment);
+
 
 
 smalltalk.addClass('HLLocalEnvironment', smalltalk.HLEnvironment, [], 'Helios-Environments');
@@ -223,6 +245,17 @@ return self}, function($ctx1) {$ctx1.fill(self,"moveMethod:toClass:",{aMethod:aM
 messageSends: ["at:", "asSymbol", "current", "ifNil:", "error:", "ifTrue:", "==", "methodClass", "adoptMethod:", "forsakeMethod:"]}),
 smalltalk.HLLocalEnvironment);
 
+smalltalk.addMethod(
+"_moveMethod_toProtocol_",
+smalltalk.method({
+selector: "moveMethod:toProtocol:",
+fn: function (aMethod,aProtocol){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
_st(aMethod)._category_(aProtocol);
+return self}, function($ctx1) {$ctx1.fill(self,"moveMethod:toProtocol:",{aMethod:aMethod,aProtocol:aProtocol},smalltalk.HLLocalEnvironment)})},
+messageSends: ["category:"]}),
+smalltalk.HLLocalEnvironment);
+
 smalltalk.addMethod(
 "_packages",
 smalltalk.method({
@@ -236,6 +269,17 @@ return $1;
 messageSends: ["packages", "current"]}),
 smalltalk.HLLocalEnvironment);
 
+smalltalk.addMethod(
+"_removeMethod_",
+smalltalk.method({
+selector: "removeMethod:",
+fn: function (aMethod){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
_st(_st(aMethod)._methodClass())._forsakeMethod_(aMethod);
+return self}, function($ctx1) {$ctx1.fill(self,"removeMethod:",{aMethod:aMethod},smalltalk.HLLocalEnvironment)})},
+messageSends: ["forsakeMethod:", "methodClass"]}),
+smalltalk.HLLocalEnvironment);
+
 
 
 smalltalk.addClass('HLRemoteEnvironment', smalltalk.HLEnvironment, [], 'Helios-Environments');

+ 64 - 0
js/Helios-Environments.js

@@ -153,6 +153,22 @@ referencedClasses: []
 }),
 smalltalk.HLEnvironment);
 
+smalltalk.addMethod(
+"_moveMethod_toProtocol_",
+smalltalk.method({
+selector: "moveMethod:toProtocol:",
+category: 'actions',
+fn: function (aMethod,aProtocol){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
_st(self)._subclassResponsibility();
+return self}, function($ctx1) {$ctx1.fill(self,"moveMethod:toProtocol:",{aMethod:aMethod,aProtocol:aProtocol},smalltalk.HLEnvironment)})},
+args: ["aMethod", "aProtocol"],
+source: "moveMethod: aMethod toProtocol: aProtocol\x0a\x09self subclassResponsibility",
+messageSends: ["subclassResponsibility"],
+referencedClasses: []
+}),
+smalltalk.HLEnvironment);
+
 smalltalk.addMethod(
 "_packages",
 smalltalk.method({
@@ -171,6 +187,22 @@ referencedClasses: []
 }),
 smalltalk.HLEnvironment);
 
+smalltalk.addMethod(
+"_removeMethod_",
+smalltalk.method({
+selector: "removeMethod:",
+category: 'actions',
+fn: function (aMethod){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
_st(self)._sublcassResponsibility();
+return self}, function($ctx1) {$ctx1.fill(self,"removeMethod:",{aMethod:aMethod},smalltalk.HLEnvironment)})},
+args: ["aMethod"],
+source: "removeMethod: aMethod\x0a\x09self sublcassResponsibility",
+messageSends: ["sublcassResponsibility"],
+referencedClasses: []
+}),
+smalltalk.HLEnvironment);
+
 
 
 smalltalk.addClass('HLLocalEnvironment', smalltalk.HLEnvironment, [], 'Helios-Environments');
@@ -299,6 +331,22 @@ referencedClasses: ["Smalltalk"]
 }),
 smalltalk.HLLocalEnvironment);
 
+smalltalk.addMethod(
+"_moveMethod_toProtocol_",
+smalltalk.method({
+selector: "moveMethod:toProtocol:",
+category: 'actions',
+fn: function (aMethod,aProtocol){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
_st(aMethod)._category_(aProtocol);
+return self}, function($ctx1) {$ctx1.fill(self,"moveMethod:toProtocol:",{aMethod:aMethod,aProtocol:aProtocol},smalltalk.HLLocalEnvironment)})},
+args: ["aMethod", "aProtocol"],
+source: "moveMethod: aMethod toProtocol: aProtocol\x0a\x09aMethod category: aProtocol",
+messageSends: ["category:"],
+referencedClasses: []
+}),
+smalltalk.HLLocalEnvironment);
+
 smalltalk.addMethod(
 "_packages",
 smalltalk.method({
@@ -317,6 +365,22 @@ referencedClasses: ["Smalltalk"]
 }),
 smalltalk.HLLocalEnvironment);
 
+smalltalk.addMethod(
+"_removeMethod_",
+smalltalk.method({
+selector: "removeMethod:",
+category: 'actions',
+fn: function (aMethod){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
_st(_st(aMethod)._methodClass())._forsakeMethod_(aMethod);
+return self}, function($ctx1) {$ctx1.fill(self,"removeMethod:",{aMethod:aMethod},smalltalk.HLLocalEnvironment)})},
+args: ["aMethod"],
+source: "removeMethod: aMethod\x0a\x09aMethod methodClass forsakeMethod: aMethod",
+messageSends: ["forsakeMethod:", "methodClass"],
+referencedClasses: []
+}),
+smalltalk.HLLocalEnvironment);
+
 
 
 smalltalk.addClass('HLRemoteEnvironment', smalltalk.HLEnvironment, [], 'Helios-Environments');

+ 17 - 11
st/Helios-Browser.st

@@ -721,6 +721,16 @@ environment: anEnvironment
 	environment := anEnvironment
 !
 
+handleUnkownVariableError: anError
+	self announcer announce: (HLUnknownVariableErrorRaised new
+		error: anError;
+		yourself)
+!
+
+manager
+	^ HLManager current
+!
+
 packages
 	^ self environment packages
 !
@@ -860,11 +870,13 @@ moveMethodToClass: aClassName
 		toClass: aClassName
 !
 
-moveMethodToClass: aClassName ifAbsent: aBlock
-	self environment 
-		moveMethod: self selectedMethod 
-		toClass: aClassName 
-		ifAbsent: aBlock
+moveMethodToProtocol: aProtocol
+	self environment moveMethod: self selectedMethod toProtocol: aProtocol
+!
+
+removeMethod
+	(self manager confirm: 'Do you REALLY want to remove method ', self selectedMethod methodClass name,' >> #', self selectedMethod selector)
+		ifTrue: [ self environment removeMethod: self selectedMethod ]
 ! !
 
 !HLBrowserModel methodsFor: 'compiling'!
@@ -926,12 +938,6 @@ handleParseError: anError
 		yourself)
 !
 
-handleUnkownVariableError: anError
-	self announcer announce: (HLUnknownVariableErrorRaised new
-		error: anError;
-		yourself)
-!
-
 withCompileErrorHandling: aBlock
 	[
 		[

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

@@ -249,6 +249,46 @@ label
 	^ 'to protocol'
 ! !
 
+HLBrowserCommand subclass: #HLRemoveCommand
+	instanceVariableNames: ''
+	package: 'Helios-Commands-Browser'!
+
+!HLRemoveCommand class methodsFor: 'accessing'!
+
+key
+	^ 88
+!
+
+label
+	^ 'Remove'
+! !
+
+HLRemoveCommand subclass: #HLRemoveMethodCommand
+	instanceVariableNames: ''
+	package: 'Helios-Commands-Browser'!
+
+!HLRemoveMethodCommand methodsFor: 'executing'!
+
+execute
+	self model removeMethod
+! !
+
+!HLRemoveMethodCommand methodsFor: 'testing'!
+
+isActive
+	^ self model selectedMethod notNil
+! !
+
+!HLRemoveMethodCommand class methodsFor: 'accessing'!
+
+key
+	^ 77
+!
+
+label
+	^ 'Method'
+! !
+
 HLBrowserCommand subclass: #HLToggleCommand
 	instanceVariableNames: ''
 	package: 'Helios-Commands-Browser'!

+ 16 - 0
st/Helios-Environments.st

@@ -32,6 +32,14 @@ eval: someCode on: aReceiver
 
 moveMethod: aMethod toClass: aClassName
 	self subclassResponsibility
+!
+
+moveMethod: aMethod toProtocol: aProtocol
+	self subclassResponsibility
+!
+
+removeMethod: aMethod
+	self sublcassResponsibility
 ! !
 
 !HLEnvironment methodsFor: 'compiling'!
@@ -104,6 +112,14 @@ moveMethod: aMethod toClass: aClassName
 	
 	destinationClass adoptMethod: aMethod.
 	aMethod methodClass forsakeMethod: aMethod.
+!
+
+moveMethod: aMethod toProtocol: aProtocol
+	aMethod category: aProtocol
+!
+
+removeMethod: aMethod
+	aMethod methodClass forsakeMethod: aMethod
 ! !
 
 HLEnvironment subclass: #HLRemoteEnvironment