浏览代码

Class icons for Helios

Nicolas Petton 11 年之前
父节点
当前提交
b3008dc9a3

+ 11 - 0
js/Canvas.deploy.js

@@ -2643,6 +2643,17 @@ messageSends: []}),
 smalltalk.Widget);
 
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "heliosClass",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+return "widget";
+}, function($ctx1) {$ctx1.fill(self,"heliosClass",{},smalltalk.Widget.klass)})},
+messageSends: []}),
+smalltalk.Widget.klass);
+
 
 smalltalk.addMethod(
 smalltalk.method({

+ 16 - 0
js/Canvas.js

@@ -3678,6 +3678,22 @@ referencedClasses: []
 smalltalk.Widget);
 
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "heliosClass",
+category: 'helios',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+return "widget";
+}, function($ctx1) {$ctx1.fill(self,"heliosClass",{},smalltalk.Widget.klass)})},
+args: [],
+source: "heliosClass\x0a\x09^ 'widget'",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.Widget.klass);
+
 
 smalltalk.addMethod(
 smalltalk.method({

+ 11 - 0
js/Kernel-Collections.deploy.js

@@ -578,6 +578,17 @@ messageSends: ["subclassResponsibility"]}),
 smalltalk.Collection);
 
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "heliosClass",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+return "collection";
+}, function($ctx1) {$ctx1.fill(self,"heliosClass",{},smalltalk.Collection.klass)})},
+messageSends: []}),
+smalltalk.Collection.klass);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "new:",

+ 16 - 0
js/Kernel-Collections.js

@@ -765,6 +765,22 @@ referencedClasses: []
 smalltalk.Collection);
 
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "heliosClass",
+category: 'helios',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+return "collection";
+}, function($ctx1) {$ctx1.fill(self,"heliosClass",{},smalltalk.Collection.klass)})},
+args: [],
+source: "heliosClass\x0a\x09^ 'collection'",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.Collection.klass);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "new:",

+ 11 - 0
js/Kernel-Exceptions.deploy.js

@@ -92,6 +92,17 @@ messageSends: ["messageText:", "signal"]}),
 smalltalk.Error);
 
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "heliosClass",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+return "exception";
+}, function($ctx1) {$ctx1.fill(self,"heliosClass",{},smalltalk.Error.klass)})},
+messageSends: []}),
+smalltalk.Error.klass);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "signal",

+ 16 - 0
js/Kernel-Exceptions.js

@@ -133,6 +133,22 @@ referencedClasses: []
 smalltalk.Error);
 
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "heliosClass",
+category: 'helios',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+return "exception";
+}, function($ctx1) {$ctx1.fill(self,"heliosClass",{},smalltalk.Error.klass)})},
+args: [],
+source: "heliosClass\x0a\x09^ 'exception'",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.Error.klass);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "signal",

+ 41 - 3
js/Kernel-Objects.deploy.js

@@ -794,6 +794,17 @@ messageSends: ["=", "=="]}),
 smalltalk.Object);
 
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "heliosClass",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+return "class";
+}, function($ctx1) {$ctx1.fill(self,"heliosClass",{},smalltalk.Object.klass)})},
+messageSends: []}),
+smalltalk.Object.klass);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "initialize",
@@ -1835,6 +1846,30 @@ return $1;
 messageSends: ["packages", "current"]}),
 smalltalk.Environment);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "registerErrorHandler:",
+fn: function (anErrorHandler){
+var self=this;
+function $ErrorHandler(){return smalltalk.ErrorHandler||(typeof ErrorHandler=="undefined"?nil:ErrorHandler)}
+return smalltalk.withContext(function($ctx1) { 
+_st($ErrorHandler())._setCurrent_(anErrorHandler);
+return self}, function($ctx1) {$ctx1.fill(self,"registerErrorHandler:",{anErrorHandler:anErrorHandler},smalltalk.Environment)})},
+messageSends: ["setCurrent:"]}),
+smalltalk.Environment);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "registerInspector:",
+fn: function (anInspector){
+var self=this;
+function $InspectorHandler(){return smalltalk.InspectorHandler||(typeof InspectorHandler=="undefined"?nil:InspectorHandler)}
+return smalltalk.withContext(function($ctx1) { 
+_st($InspectorHandler())._register_(anInspector);
+return self}, function($ctx1) {$ctx1.fill(self,"registerInspector:",{anInspector:anInspector},smalltalk.Environment)})},
+messageSends: ["register:"]}),
+smalltalk.Environment);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "removeClass:",
@@ -3685,7 +3720,7 @@ fn: function (aString){
 var self=this;
 var result;
 return smalltalk.withContext(function($ctx1) { 
-var $1;
+var $2,$3,$1;
 _st(self)._try_catch_((function(){
 return smalltalk.withContext(function($ctx2) {
 result=_st(self)._basicParse_(aString);
@@ -3694,10 +3729,13 @@ return result;
 return smalltalk.withContext(function($ctx2) {
 return _st(_st(self)._parseError_parsing_(ex,aString))._signal();
 }, function($ctx2) {$ctx2.fillBlock({ex:ex},$ctx1)})}));
-$1=result;
+$2=result;
+_st($2)._source_(aString);
+$3=_st($2)._yourself();
+$1=$3;
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"parse:",{aString:aString,result:result},smalltalk.Smalltalk)})},
-messageSends: ["try:catch:", "basicParse:", "signal", "parseError:parsing:"]}),
+messageSends: ["try:catch:", "basicParse:", "signal", "parseError:parsing:", "source:", "yourself"]}),
 smalltalk.Smalltalk);
 
 smalltalk.addMethod(

+ 57 - 4
js/Kernel-Objects.js

@@ -1105,6 +1105,22 @@ referencedClasses: []
 smalltalk.Object);
 
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "heliosClass",
+category: 'helios',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+return "class";
+}, function($ctx1) {$ctx1.fill(self,"heliosClass",{},smalltalk.Object.klass)})},
+args: [],
+source: "heliosClass\x0a\x09\x22Should be an Helios extension. Unfortunately, since helios can browse remote\x0a\x09environments, we can't extend base classes\x22\x0a\x09\x0a\x09^ 'class'",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.Object.klass);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "initialize",
@@ -2534,6 +2550,40 @@ referencedClasses: ["Smalltalk"]
 }),
 smalltalk.Environment);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "registerErrorHandler:",
+category: 'actions',
+fn: function (anErrorHandler){
+var self=this;
+function $ErrorHandler(){return smalltalk.ErrorHandler||(typeof ErrorHandler=="undefined"?nil:ErrorHandler)}
+return smalltalk.withContext(function($ctx1) { 
+_st($ErrorHandler())._setCurrent_(anErrorHandler);
+return self}, function($ctx1) {$ctx1.fill(self,"registerErrorHandler:",{anErrorHandler:anErrorHandler},smalltalk.Environment)})},
+args: ["anErrorHandler"],
+source: "registerErrorHandler: anErrorHandler\x0a\x09ErrorHandler setCurrent: anErrorHandler",
+messageSends: ["setCurrent:"],
+referencedClasses: ["ErrorHandler"]
+}),
+smalltalk.Environment);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "registerInspector:",
+category: 'actions',
+fn: function (anInspector){
+var self=this;
+function $InspectorHandler(){return smalltalk.InspectorHandler||(typeof InspectorHandler=="undefined"?nil:InspectorHandler)}
+return smalltalk.withContext(function($ctx1) { 
+_st($InspectorHandler())._register_(anInspector);
+return self}, function($ctx1) {$ctx1.fill(self,"registerInspector:",{anInspector:anInspector},smalltalk.Environment)})},
+args: ["anInspector"],
+source: "registerInspector: anInspector\x0a\x09InspectorHandler register: anInspector",
+messageSends: ["register:"],
+referencedClasses: ["InspectorHandler"]
+}),
+smalltalk.Environment);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "removeClass:",
@@ -5030,7 +5080,7 @@ fn: function (aString){
 var self=this;
 var result;
 return smalltalk.withContext(function($ctx1) { 
-var $1;
+var $2,$3,$1;
 _st(self)._try_catch_((function(){
 return smalltalk.withContext(function($ctx2) {
 result=_st(self)._basicParse_(aString);
@@ -5039,12 +5089,15 @@ return result;
 return smalltalk.withContext(function($ctx2) {
 return _st(_st(self)._parseError_parsing_(ex,aString))._signal();
 }, function($ctx2) {$ctx2.fillBlock({ex:ex},$ctx1)})}));
-$1=result;
+$2=result;
+_st($2)._source_(aString);
+$3=_st($2)._yourself();
+$1=$3;
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"parse:",{aString:aString,result:result},smalltalk.Smalltalk)})},
 args: ["aString"],
-source: "parse: aString\x0a\x09| result |\x0a\x09self try: [result := self basicParse: aString] catch: [:ex | (self parseError: ex parsing: aString) signal].\x0a\x09^result",
-messageSends: ["try:catch:", "basicParse:", "signal", "parseError:parsing:"],
+source: "parse: aString\x0a\x09| result |\x0a\x09\x0a\x09self \x0a\x09\x09try: [result := self basicParse: aString] \x0a\x09\x09catch: [:ex | (self parseError: ex parsing: aString) signal].\x0a\x09\x09\x0a\x09^ result\x0a\x09\x09source: aString;\x0a\x09\x09yourself",
+messageSends: ["try:catch:", "basicParse:", "signal", "parseError:parsing:", "source:", "yourself"],
 referencedClasses: []
 }),
 smalltalk.Smalltalk);

+ 11 - 0
js/SUnit.deploy.js

@@ -338,6 +338,17 @@ return $1;
 messageSends: ["collect:", "selector:", "allTestSelectors"]}),
 smalltalk.TestCase.klass);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "heliosClass",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+return "test";
+}, function($ctx1) {$ctx1.fill(self,"heliosClass",{},smalltalk.TestCase.klass)})},
+messageSends: []}),
+smalltalk.TestCase.klass);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "isAbstract",

+ 16 - 0
js/SUnit.js

@@ -459,6 +459,22 @@ referencedClasses: []
 }),
 smalltalk.TestCase.klass);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "heliosClass",
+category: 'helios',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+return "test";
+}, function($ctx1) {$ctx1.fill(self,"heliosClass",{},smalltalk.TestCase.klass)})},
+args: [],
+source: "heliosClass\x0a\x09^ 'test'",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.TestCase.klass);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "isAbstract",

+ 6 - 0
st/Canvas.st

@@ -1058,6 +1058,12 @@ renderOn: html
 	self
 ! !
 
+!Widget class methodsFor: 'helios'!
+
+heliosClass
+	^ 'widget'
+! !
+
 !Object methodsFor: '*Canvas'!
 
 appendToBrush: aTagBrush

+ 6 - 0
st/Kernel-Collections.st

@@ -241,6 +241,12 @@ notEmpty
 	^self isEmpty not
 ! !
 
+!Collection class methodsFor: 'helios'!
+
+heliosClass
+	^ 'collection'
+! !
+
 !Collection class methodsFor: 'instance creation'!
 
 new: anInteger

+ 6 - 0
st/Kernel-Exceptions.st

@@ -51,6 +51,12 @@ isSmalltalkError
 	<return self.smalltalkError === true>
 ! !
 
+!Error class methodsFor: 'helios'!
+
+heliosClass
+	^ 'exception'
+! !
+
 !Error class methodsFor: 'instance creation'!
 
 signal

+ 25 - 2
st/Kernel-Objects.st

@@ -361,6 +361,15 @@ respondsTo: aSelector
 	^self class canUnderstand: aSelector
 ! !
 
+!Object class methodsFor: 'helios'!
+
+heliosClass
+	"Should be an Helios extension. Unfortunately, since helios can browse remote
+	environments, we can't extend base classes"
+	
+	^ 'class'
+! !
+
 !Object class methodsFor: 'initialization'!
 
 initialize
@@ -791,6 +800,14 @@ moveMethod: aMethod toProtocol: aProtocol
 	aMethod category: aProtocol
 !
 
+registerErrorHandler: anErrorHandler
+	ErrorHandler setCurrent: anErrorHandler
+!
+
+registerInspector: anInspector
+	InspectorHandler register: anInspector
+!
+
 removeClass: aClass
 	Smalltalk current removeClass: aClass
 !
@@ -1717,8 +1734,14 @@ at: aString
 
 parse: aString
 	| result |
-	self try: [result := self basicParse: aString] catch: [:ex | (self parseError: ex parsing: aString) signal].
-	^result
+	
+	self 
+		try: [result := self basicParse: aString] 
+		catch: [:ex | (self parseError: ex parsing: aString) signal].
+		
+	^ result
+		source: aString;
+		yourself
 !
 
 readJSObject: anObject

+ 6 - 0
st/SUnit.st

@@ -168,6 +168,12 @@ testSelectors
 	^self methodDictionary keys select: [:each | each match: '^test']
 ! !
 
+!TestCase class methodsFor: 'helios'!
+
+heliosClass
+	^ 'test'
+! !
+
 !TestCase class methodsFor: 'testing'!
 
 isAbstract