extensions.st
changeset 15541 982ce96f4910
parent 15461 b77896d5819c
child 15548 184fe68803d5
--- a/extensions.st	Thu Mar 26 01:38:41 2015 +0100
+++ b/extensions.st	Thu Mar 26 11:12:35 2015 +0100
@@ -21,6 +21,14 @@
     "Created: / 25-07-2010 / 08:58:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
+!AbstractTime class methodsFor:'misc ui support'!
+
+iconInBrowserSymbol
+    <resource: #programImage>
+
+    ^ #timeClassBrowserIcon
+! !
+
 !ArrayedCollection methodsFor:'inspecting'!
 
 inspector2TabForHexDump
@@ -107,6 +115,30 @@
         yourself
 ! !
 
+!Behavior methodsFor:'misc ui support'!
+
+iconInBrowserSymbol
+    "can be redefined for a private icon in the browser (for me and my subclasses).
+     The returned symbol must be a selector of the ToolbarIconLibrary."
+
+    <resource: #programImage>
+
+    self isLoaded ifFalse:[
+        ^ #autoloadedClassBrowserIcon
+    ].
+    (self isBrowserStartable) ifTrue:[
+        self isVisualStartable ifTrue:[
+            ^ #visualStartableClassBrowserIcon
+        ].
+        ^ #startableClassBrowserIcon
+    ].
+
+    "/ give ruby and other special metaclasses a chance to provide their own icon...
+    ^ self class iconInBrowserSymbol
+
+    "Created: / 20-07-2007 / 08:52:17 / cg"
+! !
+
 !Behavior methodsFor:'inspecting'!
 
 inspectorExtraAttributes
@@ -498,7 +530,7 @@
     ^ self basicStoreString contractTo:30.
 ! !
 
-!Class methodsFor:'misc'!
+!Class methodsFor:'misc ui support'!
 
 inspectorClass
     "redefined to launch a ClassInspector, which knows about classVariables
@@ -510,6 +542,31 @@
     ^ super inspectorClass
 ! !
 
+!ClassDescription methodsFor:'misc ui support'!
+
+iconInBrowserForVariableNamed: varName
+    "variables for which an entry is found in the xml-spec (if any) are marked
+     with an <xml>-icon. 
+     For now, this is expecco-specific, but should be somehow lifted to the base system"
+
+    (Expecco::ExpeccoXMLDecoder notNil 
+    and:[self canUnderstand: #xmlSpecFor:]) ifTrue:[
+        Error handle:[:ex |
+        ] do:[
+            (Expecco::ExpeccoXMLDecoder xmlSpecForObject:self basicNew)
+                do:[:spec | 
+                    spec getter = varName ifTrue:[
+                        ^ SystemBrowser instVarOverlayXmlSpec
+                    ]
+                ].
+        ].
+    ].
+    ^ nil
+
+    "Created: / 12-04-2011 / 16:04:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 13-07-2011 / 15:31:38 / cg"
+! !
+
 !Collection methodsFor:'inspecting'!
 
 inspectorValueStringInListFor:anInspector
@@ -523,7 +580,15 @@
     ^ (super inspectorValueStringInListFor:anInspector),' size=',sz printString
 ! !
 
-!Color methodsFor:'inspecting'!
+!Collection class methodsFor:'misc ui support'!
+
+iconInBrowserSymbol
+    <resource: #programImage>
+
+    ^ #containerClassBrowserIcon
+! !
+
+!Color methodsFor:'misc ui support'!
 
 inspectorClass
     "return the class of an appropriate inspector.
@@ -615,7 +680,7 @@
     "Created: / 14-07-2011 / 11:57:18 / cg"
 ! !
 
-!Dictionary methodsFor:'inspecting'!
+!Dictionary methodsFor:'misc ui support'!
 
 inspectorClass
     "redefined to use DictionaryInspector
@@ -695,6 +760,14 @@
     "Created: / 16-02-2010 / 10:08:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
+!Error class methodsFor:'misc ui support'!
+
+iconInBrowserSymbol
+    <resource: #programImage>
+
+    ^ #errorClassBrowserIcon
+! !
+
 !ExecutableFunction methodsFor:'printing & storing'!
 
 printStringForBrowserWithSelector:selector
@@ -766,7 +839,7 @@
     "Modified: / 13-02-2015 / 20:57:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
-!Form methodsFor:'inspecting'!
+!Form methodsFor:'misc ui support'!
 
 inspectorClass
     "redefined to launch an ImageInspector
@@ -775,6 +848,14 @@
     ^ ImageInspectorView
 ! !
 
+!GenericException class methodsFor:'misc ui support'!
+
+iconInBrowserSymbol
+    <resource: #programImage>
+
+    ^ #exceptionClassBrowserIcon
+! !
+
 !GenericToolbarIconLibrary class methodsFor:'image specs-22x22'!
 
 bookmarks22x22
@@ -1077,7 +1158,7 @@
     "Modified: / 13-02-2015 / 21:02:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
-!Image methodsFor:'inspecting'!
+!Image methodsFor:'misc ui support'!
 
 inspectorClass
     "redefined to launch an ImageInspector
@@ -1127,6 +1208,21 @@
     ^ self classNameWithArticle
 ! !
 
+!LibraryDefinition class methodsFor:'misc ui support'!
+
+iconInBrowserSymbol
+    <resource: #programImage>
+
+    self theNonMetaclass isLibraryDefinition ifTrue:[^ #libraryDefinitionClassIcon ].
+    ^ super iconInBrowserSymbol
+
+"/        (c == LibraryDefinition) ifTrue:[
+"/            aClass ~~ LibraryDefinition ifTrue:[
+"/                ^ self packageIconSmall
+"/            ].
+"/        ].
+! !
+
 !LimitedPrecisionReal methodsFor:'inspecting'!
 
 inspectorExtraAttributes
@@ -1342,7 +1438,7 @@
     "Modified: / 20-07-2010 / 10:33:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
-!MethodDictionary methodsFor:'inspecting'!
+!MethodDictionary methodsFor:'misc ui support'!
 
 inspectorClass
     "redefined to use DictionaryInspector
@@ -1353,7 +1449,19 @@
     "Created: 12.6.1996 / 12:29:13 / stefan"
 ! !
 
-!NameSpace class methodsFor:'inspecting'!
+!MultiImage methodsFor:'misc ui support'!
+
+inspectorClass
+    "redefined to launch an ImageInspector
+     (instead of the default InspectorView)."
+
+    (self width notNil and:[self height notNil]) ifTrue:[
+        ^ ImageInspectorView
+    ].
+    ^ super inspectorClass
+! !
+
+!NameSpace class methodsFor:'misc ui support'!
 
 inspectorClass
     "{ Pragma: +optSpace }"
@@ -1366,6 +1474,14 @@
 
 ! !
 
+!Notification class methodsFor:'misc ui support'!
+
+iconInBrowserSymbol
+    <resource: #programImage>
+
+    ^ #notificationClassBrowserIcon
+! !
+
 !Object methodsFor:'debugging'!
 
 inspect
@@ -1566,7 +1682,7 @@
         ifNotNil:[(Smalltalk at: #'Tools::Inspector2Tab') new]
 ! !
 
-!OrderedCollection methodsFor:'inspecting'!
+!OrderedCollection methodsFor:'misc ui support'!
 
 inspectorClass
     "redefined to launch an OrderedCollectionInspector
@@ -1688,6 +1804,28 @@
     "Modified: / 24-02-2014 / 16:32:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
+!ProjectDefinition class methodsFor:'misc ui support'!
+
+iconInBrowserSymbol
+    <resource: #programImage>
+
+    self theNonMetaclass isApplicationDefinition ifTrue:[
+        self theNonMetaclass isGUIApplication ifTrue:[
+            ^ #guiApplicationDefinitionClassIcon
+        ].
+        ^ #applicationDefinitionClassIcon
+    ].
+    ^ super iconInBrowserSymbol
+! !
+
+!Query class methodsFor:'misc ui support'!
+
+iconInBrowserSymbol
+    <resource: #programImage>
+
+    ^ #queryClassBrowserIcon
+! !
+
 !Rectangle methodsFor:'inspecting'!
 
 inspectorValueStringInListFor:anInspector
@@ -1696,7 +1834,7 @@
     ^ self origin printString,'->',self corner printString
 ! !
 
-!RunArray methodsFor:'user interface'!
+!RunArray methodsFor:'misc ui support'!
 
 inspectorClass
     "Re-reimplemented so that we don't get an ordered collection inspector
@@ -1719,7 +1857,7 @@
     textStartLeft := something.
 ! !
 
-!Set methodsFor:'inspecting'!
+!Set methodsFor:'misc ui support'!
 
 inspectorClass
     "redefined to use SetInspector
@@ -1728,6 +1866,17 @@
     ^ SetInspectorView
 ! !
 
+!SharedPool class methodsFor:'misc ui support'!
+
+iconInBrowserSymbol
+    <resource: #programImage>
+
+    self == SharedPool ifTrue:[^ super iconInBrowserSymbol].
+    ^ #sharedPoolBrowserIcon
+
+    "Created: / 14-10-2010 / 12:04:32 / cg"
+! !
+
 !SimpleView methodsFor:'testing'!
 
 isCodeView2
@@ -1738,7 +1887,15 @@
     "Created: / 20-07-2010 / 15:42:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
-!Smalltalk class methodsFor:'queries'!
+!SimpleView class methodsFor:'misc ui support'!
+
+iconInBrowserSymbol
+    <resource: #programImage>
+
+    ^ #windowClassBrowserIcon
+! !
+
+!Smalltalk class methodsFor:'misc ui support'!
 
 inspectorClass
     "redefined to use DictionaryInspector
@@ -1759,6 +1916,17 @@
     "Created: / 05-08-2014 / 16:01:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
+!StandaloneStartup class methodsFor:'misc ui support'!
+
+iconInBrowserSymbol
+    <resource: #programImage>
+
+    self == StandaloneStartup ifFalse:[
+        ^ #standaloneStartupIcon 
+    ].
+    ^ super iconInBrowserSymbol
+! !
+
 !StringCollection methodsFor:'inspecting'!
 
 inspector2TabText
@@ -2524,10 +2692,18 @@
     "Created: / 07-06-2011 / 14:31:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
+!Warning class methodsFor:'misc ui support'!
+
+iconInBrowserSymbol
+    <resource: #programImage>
+
+    ^ #warningClassBrowserIcon
+! !
+
 !stx_libtool class methodsFor:'documentation'!
 
 extensionsVersion_CVS
-    ^ '$Header: /cvs/stx/stx/libtool/extensions.st,v 1.150 2015-02-27 21:23:45 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/extensions.st,v 1.151 2015-03-26 10:12:35 cg Exp $'
 ! !
 
 !stx_libtool class methodsFor:'documentation'!