class: InspectorView
added: #iconForValue:
made it a reusable utility on the class side
--- a/InspectorView.st Sat May 02 17:37:41 2015 +0200
+++ b/InspectorView.st Mon May 04 09:21:35 2015 +0200
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
"
COPYRIGHT (c) 1989 by Claus Gittinger
All Rights Reserved
@@ -754,6 +756,8 @@
!
imageFor_nil
+ <resource: #programImage>
+
^ self imageFor_nil2
"Modified: / 21-11-2012 / 14:24:21 / cg"
@@ -1106,6 +1110,77 @@
]
! !
+!InspectorView class methodsFor:'presentation'!
+
+iconForValue: anObject
+ |value|
+
+ anObject isNil ifTrue:[
+ ^ self imageFor_nil
+ ].
+ anObject isLazyValue ifTrue:[
+ ^ self imageFor_others
+ ].
+ anObject isNumber ifTrue:[
+ anObject isInteger ifTrue:[
+ ^ self imageFor_integers
+ ].
+ anObject isFloat ifTrue:[
+ ^ self imageFor_floats
+ ].
+ anObject isFraction ifTrue:[
+ ^ self imageFor_fractions
+ ].
+ ].
+ anObject isCollection ifTrue:[
+ anObject isString ifTrue:[
+ anObject isSymbol ifTrue:[
+ ^ self imageFor_symbols
+ ].
+ ^ self imageFor_strings
+ ].
+ (anObject isDictionary) ifTrue:[
+ ^ self imageFor_dictionaries
+ ].
+ (anObject isArray) ifTrue:[
+ ^ self imageFor_arrays
+ ].
+ (anObject isSequenceable) ifTrue:[
+ ^ self imageFor_sequenceableCollections
+ ].
+ ^ self imageFor_collections
+ ].
+ anObject == true ifTrue:[
+ ^ self imageFor_true
+ ].
+ anObject == false ifTrue:[
+ ^ self imageFor_false
+ ].
+ anObject isCharacter ifTrue:[
+ ^ self imageFor_characters
+ ].
+ anObject isBehavior ifTrue:[
+ ^ self imageFor_classes
+ ].
+ anObject isColor ifTrue:[
+ ^ self imageFor_colors
+ ].
+ anObject isValueModel ifTrue:[
+ Error handle:[:ex |
+ ] do:[
+ value := anObject value.
+ value == true ifTrue:[^ self imageFor_trueHolder].
+ value == false ifTrue:[^ self imageFor_falseHolder].
+ value == nil ifTrue:[^ self imageFor_nilHolder].
+ ^ self imageFor_othersHolder
+ ].
+ ].
+
+ ^ self imageFor_others
+
+ "Created: / 16-05-2012 / 17:58:20 / cg"
+! !
+
!InspectorView class methodsFor:'queries-plugin'!
aspectSelectors
@@ -2711,74 +2786,8 @@
"Modified: / 16-05-2012 / 17:55:05 / cg"
!
-iconForValue: anObject
- |value cls|
-
- cls := self class.
- anObject isNil ifTrue:[
- ^ cls imageFor_nil
- ].
- anObject isLazyValue ifTrue:[
- ^ cls imageFor_others
- ].
- anObject isNumber ifTrue:[
- anObject isInteger ifTrue:[
- ^ cls imageFor_integers
- ].
- anObject isFloat ifTrue:[
- ^ cls imageFor_floats
- ].
- anObject isFraction ifTrue:[
- ^ cls imageFor_fractions
- ].
- ].
- anObject isCollection ifTrue:[
- anObject isString ifTrue:[
- anObject isSymbol ifTrue:[
- ^ cls imageFor_symbols
- ].
- ^ cls imageFor_strings
- ].
- (anObject isDictionary) ifTrue:[
- ^ cls imageFor_dictionaries
- ].
- (anObject isArray) ifTrue:[
- ^ cls imageFor_arrays
- ].
- (anObject isSequenceable) ifTrue:[
- ^ cls imageFor_sequenceableCollections
- ].
- ^ cls imageFor_collections
- ].
- anObject == true ifTrue:[
- ^ cls imageFor_true
- ].
- anObject == false ifTrue:[
- ^ cls imageFor_false
- ].
- anObject isCharacter ifTrue:[
- ^ cls imageFor_characters
- ].
- anObject isBehavior ifTrue:[
- ^ cls imageFor_classes
- ].
- anObject isColor ifTrue:[
- ^ cls imageFor_colors
- ].
- anObject isValueModel ifTrue:[
- Error handle:[:ex |
- ] do:[
- value := anObject value.
- value == true ifTrue:[^ cls imageFor_trueHolder].
- value == false ifTrue:[^ cls imageFor_falseHolder].
- value == nil ifTrue:[^ cls imageFor_nilHolder].
- ^ cls imageFor_othersHolder
- ].
- ].
-
- ^ cls imageFor_others
-
- "Created: / 16-05-2012 / 17:58:20 / cg"
+iconForValue:arg
+ ^ self class iconForValue:arg
!
listEntryForName:nameString value:value
@@ -3984,10 +3993,10 @@
!InspectorView class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libtool/InspectorView.st,v 1.341 2015-02-12 17:36:02 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libtool/InspectorView.st,v 1.342 2015-05-04 07:21:35 cg Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libtool/InspectorView.st,v 1.341 2015-02-12 17:36:02 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libtool/InspectorView.st,v 1.342 2015-05-04 07:21:35 cg Exp $'
! !