Ver Fonte

Helios: set inspector tab label when inspecting an object

Nicolas Petton há 10 anos atrás
pai
commit
04112b7662
2 ficheiros alterados com 24 adições e 0 exclusões
  1. 17 0
      src/Helios-Inspector.js
  2. 7 0
      src/Helios-Inspector.st

+ 17 - 0
src/Helios-Inspector.js

@@ -1217,6 +1217,23 @@ globals.HLInspectorWidget);
 
 
 smalltalk.addClass('HLInspector', globals.HLInspectorWidget, [], 'Helios-Inspector');
+smalltalk.addMethod(
+smalltalk.method({
+selector: "inspect:",
+protocol: 'as yet unclassified',
+fn: function (anObject){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+globals.HLInspector.superclass.fn.prototype._inspect_.apply(_st(self), [anObject]);
+self._setTabLabel_(_st(anObject)._printString());
+return self}, function($ctx1) {$ctx1.fill(self,"inspect:",{anObject:anObject},globals.HLInspector)})},
+args: ["anObject"],
+source: "inspect: anObject\x0a\x09super inspect: anObject.\x0a\x09self setTabLabel: anObject printString",
+messageSends: ["inspect:", "setTabLabel:", "printString"],
+referencedClasses: []
+}),
+globals.HLInspector);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "renderContentOn:",

+ 7 - 0
src/Helios-Inspector.st

@@ -375,6 +375,13 @@ HLInspectorWidget subclass: #HLInspector
 	instanceVariableNames: ''
 	package: 'Helios-Inspector'!
 
+!HLInspector methodsFor: 'as yet unclassified'!
+
+inspect: anObject
+	super inspect: anObject.
+	self setTabLabel: anObject printString
+! !
+
 !HLInspector methodsFor: 'rendering'!
 
 renderContentOn: html