reuse methods and instances defined
authorca
Wed, 25 Feb 1998 15:56:07 +0100
changeset 787 bbd70842b40b
parent 786 bf1885e29419
child 788 826f9374823b
reuse methods and instances defined by SelectionInTreeView
FileSelectionTree.st
--- a/FileSelectionTree.st	Wed Feb 25 15:54:48 1998 +0100
+++ b/FileSelectionTree.st	Wed Feb 25 15:56:07 1998 +0100
@@ -13,7 +13,7 @@
 
 
 SelectionInTreeView subclass:#FileSelectionTree
-	instanceVariableNames:'triggerMonitorBlock monitoringDelayTime fileIcons itemClass'
+	instanceVariableNames:'triggerMonitorBlock monitoringDelayTime itemClass'
 	classVariableNames:''
 	poolDictionaries:''
 	category:'Views-Text'
@@ -146,7 +146,7 @@
     top := StandardSystemView new label:'select'; extent:300@500.
     scr := HVScrollableView for:FileSelectionTree origin:(0.0 @ 0.0) corner:(1.0 @ 1.0) in:top.
     scr := scr scrolledView.
-    scr itemClass:(FileSelectionItem directoriesOnly).
+    scr itemClass:(FileSelectionItem filterClassForDirectoriesOnly).
     scr directory:'/'.
 
     scr action:[:anIndex| Transcript showCR:anIndex.
@@ -218,7 +218,7 @@
     list ignoreDirectories:true.
     list pattern:(field editValue).
 
-    tree itemClass:(FileSelectionItem directoriesOnly).
+    tree itemClass:(FileSelectionItem filterClassForDirectoriesOnly).
     tree directory:(Filename homeDirectory).
     tree showDirectoryIndicator:true.
     list directory:(tree directory).
@@ -243,8 +243,8 @@
     listD := listD scrolledView.
     listF := listF scrolledView.
 
-    listD itemClass:(FileSelectionItem directoriesOnly).
-    listF itemClass:(FileSelectionItem filesOnly).
+    listD itemClass:(FileSelectionItem filterClassForDirectoriesOnly).
+    listF itemClass:(FileSelectionItem filterClassForFilesOnly).
     listD showDirectoryIndicator:true.
     listD showLines:false.
     listF showLines:false.
@@ -452,14 +452,6 @@
     ]
 ! !
 
-!FileSelectionTree methodsFor:'drawing basics'!
-
-figureFor:aNode
-    "get the image used for the node entry.
-    "
-    ^ fileIcons at:(aNode drawableImageType)
-! !
-
 !FileSelectionTree methodsFor:'initialization'!
 
 destroy
@@ -472,24 +464,10 @@
 
 !
 
-fetchImageResources
-    "initialize heavily used device resources - to avoid rendering
-     images again and again later; returns maximum extent of the images used.
+fetchDefaultImages
+    "returns a directory with default keys and images
     "
-    |y x t|
-
-    fileIcons := self itemClass iconsOn:device.
-
-    t := super fetchImageResources.
-    y := t y.
-    x := t x.
-
-    fileIcons do:[:anIcon|
-        (t := anIcon heightOn:self) > y ifTrue:[y := t].
-        (t := anIcon widthOn:self)  > x ifTrue:[x := t].
-    ].
-  ^ x @ y
-
+    ^ self itemClass keysAndIcons.
 !
 
 initialize
@@ -631,7 +609,7 @@
                 model root:root.
 
                 sz ~~ 0 ifTrue:[
-                    sz == 1 ifTrue:[   Transcript showCR:'lll'.
+                    sz == 1 ifTrue:[
                         self selectNode:sel.
                     ] ifFalse:[
                         new := OrderedCollection new.
@@ -718,5 +696,5 @@
 !FileSelectionTree class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/FileSelectionTree.st,v 1.10 1998-01-28 14:58:04 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/FileSelectionTree.st,v 1.11 1998-02-25 14:56:07 ca Exp $'
 ! !