--- a/EditTextView.st Thu Jan 28 06:50:38 2016 +0100
+++ b/EditTextView.st Wed Feb 03 07:07:58 2016 +0100
@@ -6446,7 +6446,7 @@
('-' )
('Open FileBrowser on It' openFileBrowserOnIt )
('Open Workspace with It' openWorkspaceWithIt )
- ('Inspect String' inspectSelectedString )
+ ('Inspect Selected String' inspectSelectedString )
).
].
@@ -6528,7 +6528,7 @@
].
self hasSelection ifFalse:[
m disableAll:#(cut googleSpellingSuggestion babelFishTranslate openFileBrowserOnIt
- openWorkspaceWithIt sort indent splitLinesAtCharacterOrString).
+ openWorkspaceWithIt sort indent splitLinesAtCharacterOrString inspectSelectedString).
] ifTrue:[
(Error handle:[:ex |
ex return:false
--- a/FontPanel.st Thu Jan 28 06:50:38 2016 +0100
+++ b/FontPanel.st Wed Feb 03 07:07:58 2016 +0100
@@ -609,7 +609,7 @@
encodingLabel beInvisible
].
- Screen current supportsXFTFonts ifTrue:[
+ self graphicsDevice supportsXftFonts ifTrue:[
self xftFontsOnlyHolder value: (UserPreferences current useXftFontsOnly).
xftCheckBox := CheckBox label:(resources string:'XFT Fonts Only') in:box1.
xftCheckBox model:xftFontsOnlyHolder.
@@ -1075,7 +1075,7 @@
encodingLabel label:enc.
currentEncoding := enc.
fontName := deviceFont fullName.
- (font isKindOf:XftFontDescription) ifTrue:[fontName := fontName,' (xft)'].
+ font isXftFont ifTrue:[fontName := fontName,' (xft)'].
previewField contents:(font userFriendlyName,'\\' withCRs,(self class defaultSampleStringForEncoding:enc) asString).
] ifFalse:[
previewField contents:nil.
@@ -1562,8 +1562,15 @@
!
flushListOfAvailableFonts
- XftFontDescription flushListOfAvailableFonts.
- self updateFamilyList
+ self withWaitCursorDo:[
+ "this may take some time, especially with X11 XFT fonts"
+ self graphicsDevice
+ flushListOfAvailableFonts;
+ listOfAvailableFonts.
+
+ familyList list:nil.
+ self updateFamilyList.
+ ].
!
okPressed
@@ -1574,7 +1581,7 @@
szUnitUsed := (sizeUnit ? #pt).
sz := Number readFrom:currentSize.
- (currentSize endsWith:'px') ifTrue:[
+ (currentSize endsWith:#px) ifTrue:[
szUnitUsed := #px
].
@@ -1582,7 +1589,7 @@
okAction notNil ifTrue:[
currentFamily notNil ifTrue:[
okAction value:
- (((Screen current supportsXFTFonts and:[ self xftFontsOnlyHolder value ])
+ (((self graphicsDevice supportsXftFonts and:[self xftFontsOnlyHolder value])
ifTrue:[XftFontDescription]
ifFalse:[FontDescription])
family:currentFamily
--- a/Workspace.st Thu Jan 28 06:50:38 2016 +0100
+++ b/Workspace.st Wed Feb 03 07:07:58 2016 +0100
@@ -1962,14 +1962,27 @@
('-' )
('CommentIt' commentSelection CommentSelection )
('UncommentIt' uncommentSelection UncommentSelection ))
- resources:resources
- after:#'indent'.
+ resources:resources
+ after:#'indent'.
+ subsub
+ addItemList:#(
+ ('Inspect Instances' inspectInstances nil)
+ )
+ resources:resources
+
+ after:#inspectString.
+
+ (self hasSelection not
+ or:[ (sel := self selectionAsString asSymbolIfInterned) isNil
+ or:[ (Smalltalk at:sel) isBehavior not ]]) ifTrue:[
+ sub disable:#inspectInstances
+ ].
].
self hasSelection ifFalse:[
sub disableAll:#(browseImplementorsOfIt browseSendersOfIt
browseReferencesToIt timeIt spyOnIt
- browseSharedPoolOfIt browseIt).
+ browseSharedPoolOfIt browseIt inspectInstances).
self supportsSyntaxElements ifTrue:[
self syntaxElementForSelectorUnderCursor notNil ifTrue:[
sub enableAll:#(browseImplementorsOfIt browseSendersOfIt )
@@ -2089,6 +2102,24 @@
"Modified: / 20-12-2011 / 11:22:20 / cg"
!
+inspectInstances
+ |nameOfVariable cls insts|
+
+ nameOfVariable := self selectedTextOrSyntaxElement.
+ nameOfVariable isEmptyOrNil ifTrue:[^ self].
+ nameOfVariable := nameOfVariable asSymbolIfInterned.
+ nameOfVariable isNil ifTrue:[^ self].
+ cls := Smalltalk at:nameOfVariable.
+ cls isNil ifTrue:[^ self].
+ cls isBehavior ifFalse:[^ self].
+ insts := cls allInstances.
+ insts isEmpty ifTrue:[
+ Dialog information:(resources string:'No instances of %1' with:nameOfVariable).
+ ^ self.
+ ].
+ insts inspect.
+!
+
inspectIt
"user selected 'inspectIt' from menu; use doIt to evaluate the code
and start an inspector on the result"