HierarchicalItem.st
changeset 3913 9b59aafa16d2
parent 3912 b020ebbffa8a
child 3914 084e5ac32b90
equal deleted inserted replaced
3912:b020ebbffa8a 3913:9b59aafa16d2
    92 
    92 
    93 getChildren
    93 getChildren
    94     "returns the children as they are present (or not); not going to the model..."
    94     "returns the children as they are present (or not); not going to the model..."
    95 
    95 
    96     ^ children
    96     ^ children
    97 
       
    98     "Modified: / 09-07-2010 / 08:43:29 / cg"
       
    99 !
    97 !
   100 
    98 
   101 level
    99 level
   102     "returns the level starting with 1"
   100     "returns the level starting with 0 for the root"
   103 
   101 
   104     |item level|
   102     |item level|
   105 
   103 
   106     "/ for optimization we try to suppress a block
   104     item := self.
   107 
   105     level := 0.
   108     item  := self.
   106 
   109 
   107     [ (item := item parentOrModel) notNil] whileTrue:[
   110     (item := item parentOrModel) isNil ifTrue:[^ 0].
       
   111     (item := item parentOrModel) isNil ifTrue:[^ 1].
       
   112     (item := item parentOrModel) isNil ifTrue:[^ 2].
       
   113     (item := item parentOrModel) isNil ifTrue:[^ 3].
       
   114     (item := item parentOrModel) isNil ifTrue:[^ 4].
       
   115     (item := item parentOrModel) isNil ifTrue:[^ 5].
       
   116     (item := item parentOrModel) isNil ifTrue:[^ 6].
       
   117 
       
   118     level := 7.
       
   119 
       
   120     [(item := item parentOrModel) notNil] whileTrue:[
       
   121         level := level + 1.
   108         level := level + 1.
   122         level > 100000 ifTrue:[
   109         level > 100000 ifTrue:[
   123             self halt:'possibly recursive item hierarchy'
   110             self halt:'possibly recursive item hierarchy'
   124         ].
   111         ].
   125     ].
   112     ].
   126     ^ level
   113     ^ level
   127 
   114 
   128     "Modified: / 09-07-2010 / 08:40:56 / cg"
   115     "Modified: / 09-07-2010 / 08:56:27 / cg"
   129 !
   116 !
   130 
   117 
   131 parent
   118 parent
   132     "returns the parent or nil"
   119     "returns the parent or nil"
   133 
   120 
   134     ^ (parent notNil and:[parent isHierarchicalItem]) 
   121     ^ (parent notNil and:[parent isHierarchicalItem]) 
   135         ifTrue:[parent]
   122         ifTrue:[parent]
   136         ifFalse:[nil]
   123         ifFalse:[nil]
   137 
       
   138     "Modified: / 09-07-2010 / 08:36:07 / cg"
       
   139 !
   124 !
   140 
   125 
   141 parent:aParent
   126 parent:aParent
   142     "set the parent (or the model if the item is the root item)"
   127     "set the parent (or the model if the item is the root item)"
   143 
   128 
   144     parent := aParent
   129     parent := aParent
   145 
       
   146     "Modified: / 09-07-2010 / 08:35:52 / cg"
       
   147 !
   130 !
   148 
   131 
   149 rootItem
   132 rootItem
   150     "returns the root item"
   133     "returns the root item"
   151 
   134 
   152     parent isHierarchicalItem ifTrue:[
   135     parent isHierarchicalItem ifTrue:[
   153         ^ parent rootItem
   136         ^ parent rootItem
   154     ].
   137     ].
   155     ^ self
   138     ^ self
   156 
       
   157     "Modified: / 09-07-2010 / 08:32:41 / cg"
       
   158 ! !
   139 ! !
   159 
   140 
   160 !HierarchicalItem methodsFor:'accessing-children'!
   141 !HierarchicalItem methodsFor:'accessing-children'!
   161 
   142 
   162 at:anIndex
   143 at:anIndex
   234 
   215 
   235 last
   216 last
   236     "returns the last child"
   217     "returns the last child"
   237 
   218 
   238     ^ self at:(self size)
   219     ^ self at:(self size)
   239 
       
   240     "Modified: / 09-07-2010 / 08:41:00 / cg"
       
   241 !
   220 !
   242 
   221 
   243 second
   222 second
   244     "returns the second child"
   223     "returns the second child"
   245 
   224 
   246     ^ self at:2
   225     ^ self at:2
   247 
       
   248     "Modified: / 09-07-2010 / 08:32:37 / cg"
       
   249 ! !
   226 ! !
   250 
   227 
   251 !HierarchicalItem methodsFor:'accessing-hierarchy'!
   228 !HierarchicalItem methodsFor:'accessing-hierarchy'!
   252 
   229 
   253 collapse
   230 collapse
   327         self criticalDo:[
   304         self criticalDo:[
   328             parent expand.
   305             parent expand.
   329             parent makeVisible
   306             parent makeVisible
   330         ]
   307         ]
   331     ].
   308     ].
   332 
       
   333     "Modified: / 09-07-2010 / 08:40:37 / cg"
       
   334 !
   309 !
   335 
   310 
   336 recursiveCollapse
   311 recursiveCollapse
   337     "collapse all item and sub items
   312     "collapse all item and sub items
   338      **** must be expanded
   313      **** must be expanded
   394 
   369 
   395                 index ~~ 0 ifTrue:[self hierarchyChanged]
   370                 index ~~ 0 ifTrue:[self hierarchyChanged]
   396             ]
   371             ]
   397         ]
   372         ]
   398     ].
   373     ].
   399 
       
   400     "Modified: / 09-07-2010 / 08:33:58 / cg"
       
   401 !
   374 !
   402 
   375 
   403 recursiveToggleExpand
   376 recursiveToggleExpand
   404     "if the item is collapsed, the item and all its sub-items
   377     "if the item is collapsed, the item and all its sub-items
   405      are expanded otherwise collapsed"
   378      are expanded otherwise collapsed"
   417     isExpanded ifTrue:[
   390     isExpanded ifTrue:[
   418         self collapse
   391         self collapse
   419     ] ifFalse:[
   392     ] ifFalse:[
   420         self expand
   393         self expand
   421     ].
   394     ].
   422 
       
   423     "Modified: / 29-06-2010 / 21:41:53 / cg"
       
   424 ! !
   395 ! !
   425 
   396 
   426 !HierarchicalItem methodsFor:'accessing-mvc'!
   397 !HierarchicalItem methodsFor:'accessing-mvc'!
   427 
   398 
   428 application
   399 application
   460         item := next.
   431         item := next.
   461     ].
   432     ].
   462 
   433 
   463     item isHierarchicalItem ifFalse:[^ item].
   434     item isHierarchicalItem ifFalse:[^ item].
   464     ^ nil
   435     ^ nil
   465 
       
   466     "Modified: / 09-07-2010 / 08:40:23 / cg"
       
   467 ! !
   436 ! !
   468 
   437 
   469 !HierarchicalItem methodsFor:'adding & removing'!
   438 !HierarchicalItem methodsFor:'adding & removing'!
   470 
   439 
   471 add:aChildItem
   440 add:aChildItem
   595     parent notNil ifTrue:[                                      "check whether parent exists"
   564     parent notNil ifTrue:[                                      "check whether parent exists"
   596         parent isHierarchicalItem ifTrue:[parent remove:self]   "parent is HierarchicalItem"
   565         parent isHierarchicalItem ifTrue:[parent remove:self]   "parent is HierarchicalItem"
   597                                  ifFalse:[parent root:nil]      "parent is HierarchicalList"
   566                                  ifFalse:[parent root:nil]      "parent is HierarchicalList"
   598     ].
   567     ].
   599     ^ self
   568     ^ self
   600 
       
   601     "Modified: / 09-07-2010 / 08:33:24 / cg"
       
   602 !
   569 !
   603 
   570 
   604 remove:aChild
   571 remove:aChild
   605     "remove a child"
   572     "remove a child"
   606 
   573 
   607     self removeIndex:(self identityIndexOf:aChild)
   574     self removeIndex:(self identityIndexOf:aChild)
   608 
       
   609     "Modified: / 09-07-2010 / 08:33:19 / cg"
       
   610 !
   575 !
   611 
   576 
   612 removeAll
   577 removeAll
   613     "remove all children"
   578     "remove all children"
   614 
   579 
   615     |size|
   580     |size|
   616 
   581 
   617     (size := children size) ~~ 0 ifTrue:[
   582     (size := children size) ~~ 0 ifTrue:[
   618         self removeFromIndex:1 toIndex:size
   583         self removeFromIndex:1 toIndex:size
   619     ]
   584     ]
   620 
       
   621     "Modified: / 09-07-2010 / 08:33:12 / cg"
       
   622 !
   585 !
   623 
   586 
   624 removeAll:aList
   587 removeAll:aList
   625     "remove all children in the collection"
   588     "remove all children in the collection"
   626 
   589 
   634                 ]
   597                 ]
   635             ]
   598             ]
   636         ]
   599         ]
   637     ].
   600     ].
   638     ^ aList
   601     ^ aList
   639 
       
   640     "Modified: / 09-07-2010 / 08:33:08 / cg"
       
   641 !
   602 !
   642 
   603 
   643 removeFromIndex:startIndex
   604 removeFromIndex:startIndex
   644     "remove the children from startIndex up to end of children"
   605     "remove the children from startIndex up to end of children"
   645 
   606 
   646     ^ self removeFromIndex:startIndex toIndex:(children size)
   607     ^ self removeFromIndex:startIndex toIndex:(children size)
   647 
       
   648     "Modified: / 09-07-2010 / 08:33:03 / cg"
       
   649 !
   608 !
   650 
   609 
   651 removeFromIndex:startIndex toIndex:stopIndex
   610 removeFromIndex:startIndex toIndex:stopIndex
   652     "remove the children from startIndex up to and including
   611     "remove the children from startIndex up to and including
   653      the child under stopIndex."
   612      the child under stopIndex."
   667     children size == 0 ifTrue:[
   626     children size == 0 ifTrue:[
   668         self clearExpandedWhenLastChildWasRemoved ifTrue:[
   627         self clearExpandedWhenLastChildWasRemoved ifTrue:[
   669             isExpanded := false.
   628             isExpanded := false.
   670         ]
   629         ]
   671     ].
   630     ].
   672 
       
   673     "Modified: / 09-07-2010 / 08:32:57 / cg"
       
   674 !
   631 !
   675 
   632 
   676 removeIndex:anIndex
   633 removeIndex:anIndex
   677     "remove the child at an index"
   634     "remove the child at an index"
   678 
   635 
   679     anIndex > 0 ifTrue:[
   636     anIndex > 0 ifTrue:[
   680         self removeFromIndex:anIndex toIndex:anIndex
   637         self removeFromIndex:anIndex toIndex:anIndex
   681     ]
   638     ]
   682 
       
   683     "Modified: / 09-07-2010 / 08:32:53 / cg"
       
   684 ! !
   639 ! !
   685 
   640 
   686 !HierarchicalItem methodsFor:'basic adding & removing'!
   641 !HierarchicalItem methodsFor:'basic adding & removing'!
   687 
   642 
   688 basicAdd:aChild sortBlock:aBlock
   643 basicAdd:aChild sortBlock:aBlock
   760     model itemAddAll:coll beforeIndex:(index + 1).
   715     model itemAddAll:coll beforeIndex:(index + 1).
   761 
   716 
   762     notify notNil ifTrue:[
   717     notify notNil ifTrue:[
   763         notify changed
   718         notify changed
   764     ].
   719     ].
   765   ^ aList
   720     ^ aList
   766 !
   721 !
   767 
   722 
   768 basicRemoveFromIndex:startIndex toIndex:stopIndex
   723 basicRemoveFromIndex:startIndex toIndex:stopIndex
   769     "remove the children from startIndex up to and including
   724     "remove the children from startIndex up to and including
   770      the child under stopIndex."
   725      the child under stopIndex."
   889 
   844 
   890 hierarchyChanged
   845 hierarchyChanged
   891     "hierarchy changed; optimize redrawing"
   846     "hierarchy changed; optimize redrawing"
   892 
   847 
   893     self changed:#hierarchy with:nil
   848     self changed:#hierarchy with:nil
   894 
       
   895     "Modified: / 09-07-2010 / 08:42:30 / cg"
       
   896 !
   849 !
   897 
   850 
   898 iconChanged
   851 iconChanged
   899     "icon changed; optimize redrawing"
   852     "icon changed; optimize redrawing"
   900 
   853 
   901     self changed:#icon with:nil
   854     self changed:#icon with:nil
   902 
       
   903     "Modified: / 09-07-2010 / 08:42:20 / cg"
       
   904 ! !
   855 ! !
   905 
   856 
   906 !HierarchicalItem methodsFor:'enumerating'!
   857 !HierarchicalItem methodsFor:'enumerating'!
   907 
   858 
   908 collect:aBlock
   859 collect:aBlock
   968 
   919 
   969     self criticalDo:[
   920     self criticalDo:[
   970         res := self nonCriticalFrom:startIndex to:endIndex reverseDo:aOneArgBlock
   921         res := self nonCriticalFrom:startIndex to:endIndex reverseDo:aOneArgBlock
   971     ].
   922     ].
   972     ^ res
   923     ^ res
   973 
       
   974     "Modified: / 09-07-2010 / 08:43:36 / cg"
       
   975 !
   924 !
   976 
   925 
   977 keysAndValuesDo:aTwoArgBlock
   926 keysAndValuesDo:aTwoArgBlock
   978     "evaluate the argument, aBlock for every child,
   927     "evaluate the argument, aBlock for every child,
   979      passing both index and element as arguments."
   928      passing both index and element as arguments."
   986     self do:[:el|
   935     self do:[:el|
   987         res := el value:key value:el.
   936         res := el value:key value:el.
   988         key := key + 1.
   937         key := key + 1.
   989     ].
   938     ].
   990     ^ res
   939     ^ res
   991 
       
   992     "Modified: / 09-07-2010 / 08:41:15 / cg"
       
   993 !
   940 !
   994 
   941 
   995 keysAndValuesReverseDo:aTwoArgBlock
   942 keysAndValuesReverseDo:aTwoArgBlock
   996     "evaluate the argument, aBlock in reverse order for every
   943     "evaluate the argument, aBlock in reverse order for every
   997      child, passing both index and element as arguments."
   944      child, passing both index and element as arguments."
  1003 
   950 
  1004     self criticalDo:[
   951     self criticalDo:[
  1005         res := self nonCriticalKeysAndValuesReverseDo:aTwoArgBlock
   952         res := self nonCriticalKeysAndValuesReverseDo:aTwoArgBlock
  1006     ].
   953     ].
  1007     ^ res
   954     ^ res
  1008 
       
  1009     "Modified: / 09-07-2010 / 08:41:10 / cg"
       
  1010 !
   955 !
  1011 
   956 
  1012 recursiveCollect:aBlock
   957 recursiveCollect:aBlock
  1013     "for each child in the receiver, evaluate the argument, aBlock
   958     "for each child in the receiver, evaluate the argument, aBlock
  1014      and return a new collection with the results"
   959      and return a new collection with the results"
  1016     |coll|
   961     |coll|
  1017 
   962 
  1018     coll := OrderedCollection new.
   963     coll := OrderedCollection new.
  1019     self recursiveDo:[:el| coll add:(aBlock value:el) ].
   964     self recursiveDo:[:el| coll add:(aBlock value:el) ].
  1020     ^ coll
   965     ^ coll
  1021 
       
  1022     "Modified: / 09-07-2010 / 08:34:24 / cg"
       
  1023 !
   966 !
  1024 
   967 
  1025 recursiveDo:aOneArgBlock
   968 recursiveDo:aOneArgBlock
  1026     "evaluate a block on each item and all the sub-items"
   969     "evaluate a block on each item and all the sub-items"
  1027 
   970 
  1028     self do:[:aChild|
   971     self do:[:aChild|
  1029         aOneArgBlock value:aChild.
   972         aOneArgBlock value:aChild.
  1030         aChild nonCriticalRecursiveDo:aOneArgBlock
   973         aChild nonCriticalRecursiveDo:aOneArgBlock
  1031     ].
   974     ].
  1032 
       
  1033     "Modified: / 09-07-2010 / 08:34:05 / cg"
       
  1034 !
   975 !
  1035 
   976 
  1036 recursiveReverseDo:aOneArgBlock
   977 recursiveReverseDo:aOneArgBlock
  1037     "evaluate a block on each item and all the sub-items;
   978     "evaluate a block on each item and all the sub-items;
  1038      proccesing children in reverse direction"
   979      proccesing children in reverse direction"
  1039 
   980 
  1040     self reverseDo:[:aChild|
   981     self reverseDo:[:aChild|
  1041         aChild nonCriticalRecursiveReverseDo:aOneArgBlock.
   982         aChild nonCriticalRecursiveReverseDo:aOneArgBlock.
  1042         aOneArgBlock value:aChild.
   983         aOneArgBlock value:aChild.
  1043     ].
   984     ].
  1044 
       
  1045     "Modified: / 09-07-2010 / 08:33:52 / cg"
       
  1046 !
   985 !
  1047 
   986 
  1048 recursiveSelect:aBlock
   987 recursiveSelect:aBlock
  1049     "return a new collection with all children and subChildren from the receiver, for which
   988     "return a new collection with all children and subChildren from the receiver, for which
  1050      the argument aBlock evaluates to true."
   989      the argument aBlock evaluates to true."
  1052     |coll|
   991     |coll|
  1053 
   992 
  1054     coll := OrderedCollection new.
   993     coll := OrderedCollection new.
  1055     self recursiveDo:[:el| (aBlock value:el) ifTrue:[coll add:el] ].
   994     self recursiveDo:[:el| (aBlock value:el) ifTrue:[coll add:el] ].
  1056     ^ coll
   995     ^ coll
  1057 
       
  1058     "Modified: / 09-07-2010 / 08:33:47 / cg"
       
  1059 !
   996 !
  1060 
   997 
  1061 reverseDo:aOneArgBlock
   998 reverseDo:aOneArgBlock
  1062     "evaluate a block on each child in reverse direction"
   999     "evaluate a block on each child in reverse direction"
  1063 
  1000 
  1064     ^ self from:1 reverseDo:aOneArgBlock
  1001     ^ self from:1 reverseDo:aOneArgBlock
  1065 
       
  1066     "Modified: / 09-07-2010 / 08:32:48 / cg"
       
  1067 !
  1002 !
  1068 
  1003 
  1069 select:aBlock
  1004 select:aBlock
  1070     "return a new collection with all items from the receiver, for which
  1005     "return a new collection with all items from the receiver, for which
  1071      the argument aBlock evaluates to true."
  1006      the argument aBlock evaluates to true."
  1073     |coll|
  1008     |coll|
  1074 
  1009 
  1075     coll := OrderedCollection new.
  1010     coll := OrderedCollection new.
  1076     self do:[:el| (aBlock value:el) ifTrue:[coll add:el] ].
  1011     self do:[:el| (aBlock value:el) ifTrue:[coll add:el] ].
  1077     ^ coll
  1012     ^ coll
  1078 
       
  1079     "Modified: / 09-07-2010 / 08:32:32 / cg"
       
  1080 !
  1013 !
  1081 
  1014 
  1082 withAllDo:aOneArgBlock
  1015 withAllDo:aOneArgBlock
  1083     "evaluate the block on each item and subitem including self"
  1016     "evaluate the block on each item and subitem including self"
  1084 
  1017 
  1086 
  1019 
  1087     self do:[:el|
  1020     self do:[:el|
  1088         aOneArgBlock value:el.
  1021         aOneArgBlock value:el.
  1089         el nonCriticalRecursiveDo:aOneArgBlock.
  1022         el nonCriticalRecursiveDo:aOneArgBlock.
  1090     ].
  1023     ].
  1091 
       
  1092     "Modified: / 09-07-2010 / 08:31:43 / cg"
       
  1093 ! !
  1024 ! !
  1094 
  1025 
  1095 !HierarchicalItem methodsFor:'enumerating parents'!
  1026 !HierarchicalItem methodsFor:'enumerating parents'!
  1096 
  1027 
  1097 parentsDetect:aBlock
  1028 parentsDetect:aBlock
  1098     "find the first parent, for which evaluation of the block returns
  1029     "find the first parent, for which evaluation of the block returns
  1099      true; if none does so, report an error"
  1030      true; if none does so, report an error"
  1100 
  1031 
  1101     ^ self parentsDetect:aBlock ifNone:[self errorNotFound]
  1032     ^ self parentsDetect:aBlock ifNone:[self errorNotFound]
  1102 
       
  1103     "Modified: / 09-07-2010 / 08:35:43 / cg"
       
  1104 !
  1033 !
  1105 
  1034 
  1106 parentsDetect:aBlock ifNone:anExceptionBlock
  1035 parentsDetect:aBlock ifNone:anExceptionBlock
  1107     "find the first parent, for which evaluation of the block returns
  1036     "find the first parent, for which evaluation of the block returns
  1108      true; if none does so, return the evaluation of anExceptionBlock"
  1037      true; if none does so, return the evaluation of anExceptionBlock"
  1115         [(prnt := prnt parent) notNil and:[prnt isHierarchicalItem]] whileTrue:[
  1044         [(prnt := prnt parent) notNil and:[prnt isHierarchicalItem]] whileTrue:[
  1116             (aBlock value:prnt) ifTrue:[^ prnt]
  1045             (aBlock value:prnt) ifTrue:[^ prnt]
  1117         ]
  1046         ]
  1118     ].
  1047     ].
  1119     ^ anExceptionBlock value
  1048     ^ anExceptionBlock value
  1120 
       
  1121     "Modified: / 09-07-2010 / 08:35:37 / cg"
       
  1122 !
  1049 !
  1123 
  1050 
  1124 parentsDo:aBlock
  1051 parentsDo:aBlock
  1125     "evaluate a block for each parent"
  1052     "evaluate a block for each parent"
  1126 
  1053 
  1131     self criticalDo:[
  1058     self criticalDo:[
  1132         [(prnt := prnt parent) notNil and:[prnt isHierarchicalItem]] whileTrue:[
  1059         [(prnt := prnt parent) notNil and:[prnt isHierarchicalItem]] whileTrue:[
  1133             aBlock value:prnt
  1060             aBlock value:prnt
  1134         ]
  1061         ]
  1135     ].
  1062     ].
  1136 
       
  1137     "Modified: / 09-07-2010 / 08:35:31 / cg"
       
  1138 ! !
  1063 ! !
  1139 
  1064 
  1140 !HierarchicalItem methodsFor:'initialization'!
  1065 !HierarchicalItem methodsFor:'initialization'!
  1141 
  1066 
  1142 initialize
  1067 initialize
  1181         (index ~~ 0 or:[parent == model]) ifTrue:[
  1106         (index ~~ 0 or:[parent == model]) ifTrue:[
  1182             ^ index
  1107             ^ index
  1183         ]
  1108         ]
  1184     ].
  1109     ].
  1185     ^ nil
  1110     ^ nil
  1186 
       
  1187     "Modified: / 09-07-2010 / 08:40:50 / cg"
       
  1188 !
  1111 !
  1189 
  1112 
  1190 numberOfVisibleChildren
  1113 numberOfVisibleChildren
  1191     "returns number of all visible children including subchildren"
  1114     "returns number of all visible children including subchildren"
  1192 
  1115 
  1203 
  1126 
  1204 parentOrModel
  1127 parentOrModel
  1205     "returns the parent without checking for item or model"
  1128     "returns the parent without checking for item or model"
  1206 
  1129 
  1207     ^ parent
  1130     ^ parent
  1208 
       
  1209     "Modified: / 09-07-2010 / 08:35:48 / cg"
       
  1210 !
  1131 !
  1211 
  1132 
  1212 setExpanded:aBoolean
  1133 setExpanded:aBoolean
  1213     "set expanded flag without any computation or notification"
  1134     "set expanded flag without any computation or notification"
  1214 
  1135 
  1253       ^ h
  1174       ^ h
  1254     ].
  1175     ].
  1255 
  1176 
  1256     h := 1 + (aLabel occurrencesOf:(Character cr)).
  1177     h := 1 + (aLabel occurrencesOf:(Character cr)).
  1257     ^ h * (aGC font height)
  1178     ^ h * (aGC font height)
  1258 
       
  1259     "Modified: / 09-07-2010 / 08:42:40 / cg"
       
  1260 !
  1179 !
  1261 
  1180 
  1262 widthOf:aLabel on:aGC
  1181 widthOf:aLabel on:aGC
  1263     "returns the height of the label or 0"
  1182     "returns the height of the label or 0"
  1264 
  1183 
  1279     ].
  1198     ].
  1280 
  1199 
  1281     w := 0.
  1200     w := 0.
  1282     aLabel asCollectionOfLines do:[:el|w := w max:(el widthOn:aGC)].
  1201     aLabel asCollectionOfLines do:[:el|w := w max:(el widthOn:aGC)].
  1283     ^ w
  1202     ^ w
  1284 
       
  1285     "Modified: / 09-07-2010 / 08:32:03 / cg"
       
  1286 ! !
  1203 ! !
  1287 
  1204 
  1288 !HierarchicalItem methodsFor:'private-enumerating'!
  1205 !HierarchicalItem methodsFor:'private-enumerating'!
  1289 
  1206 
  1290 nonCriticalDo:aOneArgBlock
  1207 nonCriticalDo:aOneArgBlock
  1291     "evaluate a block noncritical for each child."
  1208     "evaluate a block noncritical for each child."
  1292 
  1209 
  1293     ^ self nonCriticalFrom:1 to:nil do:aOneArgBlock
  1210     ^ self nonCriticalFrom:1 to:nil do:aOneArgBlock
  1294 
       
  1295     "Modified: / 09-07-2010 / 08:37:57 / cg"
       
  1296 !
  1211 !
  1297 
  1212 
  1298 nonCriticalFrom:startIndex to:endIndex do:aOneArgBlock
  1213 nonCriticalFrom:startIndex to:endIndex do:aOneArgBlock
  1299     "evaluate a block noncritical for each child starting with the
  1214     "evaluate a block noncritical for each child starting with the
  1300      child at startIndex to the endIndex (if nil to end of list)."
  1215      child at startIndex to the endIndex (if nil to end of list)."
  1308     resp := nil.
  1223     resp := nil.
  1309 
  1224 
  1310     endIndex notNil ifTrue:[
  1225     endIndex notNil ifTrue:[
  1311         size := size min:endIndex
  1226         size := size min:endIndex
  1312     ].
  1227     ].
  1313     startIndex to:size do:[:i| |item|
  1228     startIndex to:size do:[:i| 
       
  1229         |item|
       
  1230 
  1314         item := list at:i ifAbsent:nil.
  1231         item := list at:i ifAbsent:nil.
  1315         item isNil ifTrue:[^ resp].
  1232         item isNil ifTrue:[^ resp].
  1316         resp := aOneArgBlock value:item.
  1233         resp := aOneArgBlock value:item.
  1317     ].
  1234     ].
  1318     ^ resp
  1235     ^ resp
  1319 
       
  1320     "Modified: / 09-07-2010 / 08:37:50 / cg"
       
  1321 !
  1236 !
  1322 
  1237 
  1323 nonCriticalFrom:startIndex to:endIndex reverseDo:aOneArgBlock
  1238 nonCriticalFrom:startIndex to:endIndex reverseDo:aOneArgBlock
  1324     "evaluate a block non critical for each child starting with the
  1239     "evaluate a block non critical for each child starting with the
  1325      child at endIndex (if nil to end of list) to startIndex."
  1240      child at endIndex (if nil to end of list) to startIndex."
  1339         item := list at:i ifAbsent:nil.
  1254         item := list at:i ifAbsent:nil.
  1340         item isNil ifTrue:[^ resp].
  1255         item isNil ifTrue:[^ resp].
  1341         resp := aOneArgBlock value:item.
  1256         resp := aOneArgBlock value:item.
  1342     ].
  1257     ].
  1343     ^ resp
  1258     ^ resp
  1344 
       
  1345     "Modified: / 09-07-2010 / 08:37:43 / cg"
       
  1346 !
  1259 !
  1347 
  1260 
  1348 nonCriticalKeysAndValuesReverseDo:aOneArgBlock
  1261 nonCriticalKeysAndValuesReverseDo:aOneArgBlock
  1349     "evaluate the argument, aBlock in reverse order for every
  1262     "evaluate the argument, aBlock in reverse order for every
  1350      child, passing both index and element as arguments."
  1263      child, passing both index and element as arguments."
  1361         item := list at:i ifAbsent:nil.
  1274         item := list at:i ifAbsent:nil.
  1362         item isNil ifTrue:[^ resp].
  1275         item isNil ifTrue:[^ resp].
  1363         resp := aOneArgBlock value:i value:item.
  1276         resp := aOneArgBlock value:i value:item.
  1364     ].
  1277     ].
  1365     ^ resp
  1278     ^ resp
  1366 
       
  1367     "Modified: / 09-07-2010 / 08:37:23 / cg"
       
  1368 !
  1279 !
  1369 
  1280 
  1370 nonCriticalRecursiveDo:aOneArgBlock
  1281 nonCriticalRecursiveDo:aOneArgBlock
  1371     "evaluate the block non critical for each item and all the sub-items"
  1282     "evaluate the block non critical for each item and all the sub-items"
  1372 
  1283 
  1373     self nonCriticalFrom:1 to:nil do:[:aChild|
  1284     self nonCriticalFrom:1 to:nil do:[:eachChild|
  1374         aOneArgBlock value:aChild.
  1285         aOneArgBlock value:eachChild.
  1375         aChild nonCriticalRecursiveDo:aOneArgBlock
  1286         eachChild nonCriticalRecursiveDo:aOneArgBlock
  1376     ].
  1287     ].
  1377 
       
  1378     "Modified: / 09-07-2010 / 08:36:58 / cg"
       
  1379 !
  1288 !
  1380 
  1289 
  1381 nonCriticalRecursiveReverseDo:aOneArgBlock
  1290 nonCriticalRecursiveReverseDo:aOneArgBlock
  1382     "evaluate the block non critical for each item and all the sub-items;
  1291     "evaluate the block non critical for each item and all the sub-items;
  1383      proccesing children in reverse direction"
  1292      proccesing children in reverse direction"
  1384 
  1293 
  1385     self nonCriticalFrom:1 to:nil reverseDo:[:aChild|
  1294     self nonCriticalFrom:1 to:nil reverseDo:[:eachChild|
  1386         aChild nonCriticalRecursiveReverseDo:aOneArgBlock.
  1295         eachChild nonCriticalRecursiveReverseDo:aOneArgBlock.
  1387         aOneArgBlock value:aChild.
  1296         aOneArgBlock value:eachChild.
  1388     ].
  1297     ].
  1389 
       
  1390     "Modified: / 09-07-2010 / 08:36:49 / cg"
       
  1391 !
  1298 !
  1392 
  1299 
  1393 nonCriticalRecursiveSort:aSortBlock
  1300 nonCriticalRecursiveSort:aSortBlock
  1394     "evaluate a block noncritical for each child."
  1301     "evaluate a block noncritical for each child."
  1395 
  1302 
  1400     unsorted size ~~ 0 ifTrue:[
  1307     unsorted size ~~ 0 ifTrue:[
  1401         sorted := unsorted sort:aSortBlock.
  1308         sorted := unsorted sort:aSortBlock.
  1402         sorted do:[:el| el nonCriticalRecursiveSort:aSortBlock ].
  1309         sorted do:[:el| el nonCriticalRecursiveSort:aSortBlock ].
  1403         children := sorted.
  1310         children := sorted.
  1404     ].
  1311     ].
  1405 
       
  1406     "Modified: / 09-07-2010 / 08:36:33 / cg"
       
  1407 ! !
  1312 ! !
  1408 
  1313 
  1409 !HierarchicalItem methodsFor:'private-hierarchy'!
  1314 !HierarchicalItem methodsFor:'private-hierarchy'!
  1410 
  1315 
  1411 recursiveSetCollapsed
  1316 recursiveSetCollapsed
  1482 
  1387 
  1483     (model := self model) notNil ifTrue:[
  1388     (model := self model) notNil ifTrue:[
  1484         ^ model iconFor:self
  1389         ^ model iconFor:self
  1485     ].
  1390     ].
  1486     ^ nil
  1391     ^ nil
  1487 
       
  1488     "Modified: / 09-07-2010 / 08:42:25 / cg"
       
  1489 !
  1392 !
  1490 
  1393 
  1491 label
  1394 label
  1492     "returns the label displayed on aGC;
  1395     "returns the label displayed on aGC;
  1493      *** to optimize:redefine by subClass"
  1396      *** to optimize:redefine by subClass"
  1496 
  1399 
  1497     (model := self model) notNil ifTrue:[
  1400     (model := self model) notNil ifTrue:[
  1498         ^ model labelFor:self
  1401         ^ model labelFor:self
  1499     ].
  1402     ].
  1500     ^ nil
  1403     ^ nil
  1501 
       
  1502     "Modified: / 09-07-2010 / 08:41:04 / cg"
       
  1503 !
  1404 !
  1504 
  1405 
  1505 middleButtonMenu
  1406 middleButtonMenu
  1506     "returns the items middleButtonMenu or nil if no menu is defined.
  1407     "returns the items middleButtonMenu or nil if no menu is defined.
  1507      If nil is returned, the view is asked for a menu."
  1408      If nil is returned, the view is asked for a menu."
  1512 
  1413 
  1513     (model := self model) notNil ifTrue:[
  1414     (model := self model) notNil ifTrue:[
  1514         ^ model middleButtonMenuFor:self
  1415         ^ model middleButtonMenuFor:self
  1515     ].
  1416     ].
  1516     ^ nil
  1417     ^ nil
  1517 
       
  1518     "Modified: / 09-07-2010 / 08:40:32 / cg"
       
  1519 !
  1418 !
  1520 
  1419 
  1521 recursiveSortChildren:aSortBlock
  1420 recursiveSortChildren:aSortBlock
  1522     |children|
  1421     |children|
  1523 
  1422 
  1571 
  1470 
  1572     height isNil ifTrue:[
  1471     height isNil ifTrue:[
  1573         height := self heightOf:(self label) on:aGC
  1472         height := self heightOf:(self label) on:aGC
  1574     ].
  1473     ].
  1575     ^ height
  1474     ^ height
  1576 
       
  1577     "Modified: / 09-07-2010 / 08:42:35 / cg"
       
  1578 !
  1475 !
  1579 
  1476 
  1580 widthOn:aGC
  1477 widthOn:aGC
  1581     "return the width of the receiver, if it is to be displayed on aGC"
  1478     "return the width of the receiver, if it is to be displayed on aGC"
  1582 
  1479 
  1583     width isNil ifTrue:[
  1480     width isNil ifTrue:[
  1584         width := self widthOf:(self label) on:aGC
  1481         width := self widthOf:(self label) on:aGC
  1585     ].
  1482     ].
  1586     ^ width
  1483     ^ width
  1587 
       
  1588     "Modified: / 09-07-2010 / 08:31:53 / cg"
       
  1589 ! !
  1484 ! !
  1590 
  1485 
  1591 !HierarchicalItem methodsFor:'protocol-event processing'!
  1486 !HierarchicalItem methodsFor:'protocol-event processing'!
  1592 
  1487 
  1593 processButtonPress:button x:x y:y
  1488 processButtonPress:button x:x y:y
  1594     "a mouse button was pressed in my label.
  1489     "a mouse button was pressed in my label.
  1595      Return true, if the event is eaten (ignored by the gc).
  1490      Return true, if the event is eaten (ignored by the gc).
  1596      By default, false is returned (should be handled by the gc)."
  1491      By default, false is returned (should be handled by the gc)."
  1597 
  1492 
  1598     ^ false
  1493     ^ false
  1599 
       
  1600     "Modified: / 09-07-2010 / 08:35:22 / cg"
       
  1601 !
  1494 !
  1602 
  1495 
  1603 processButtonPress:button x:x y:y on:aGC
  1496 processButtonPress:button x:x y:y on:aGC
  1604     "a mouse button was pressed in my label.
  1497     "a mouse button was pressed in my label.
  1605      Return true, if the event is eaten (ignored by the gc).
  1498      Return true, if the event is eaten (ignored by the gc).
  1606      By default, false is returned (should be handled by the gc)."
  1499      By default, false is returned (should be handled by the gc)."
  1607 
  1500 
  1608     ^ self processButtonPress:button x:x y:y
  1501     ^ self processButtonPress:button x:x y:y
  1609 
       
  1610     "Modified: / 09-07-2010 / 08:35:10 / cg"
       
  1611 !
  1502 !
  1612 
  1503 
  1613 processButtonPressOnIcon:button on:aGC
  1504 processButtonPressOnIcon:button on:aGC
  1614     "a mouse button was pressed in my icon.
  1505     "a mouse button was pressed in my icon.
  1615      Return true, if the event is eaten (ignored by the gc).
  1506      Return true, if the event is eaten (ignored by the gc).
  1616      By default, false is returned (should be handled by the gc)."
  1507      By default, false is returned (should be handled by the gc)."
  1617 
  1508 
  1618     ^ false
  1509     ^ false
  1619 
       
  1620     "Modified: / 09-07-2010 / 08:35:00 / cg"
       
  1621 ! !
  1510 ! !
  1622 
  1511 
  1623 !HierarchicalItem methodsFor:'protocol-monitoring'!
  1512 !HierarchicalItem methodsFor:'protocol-monitoring'!
  1624 
  1513 
  1625 monitoringCycle
  1514 monitoringCycle
  1626     "called every 'n' seconds by the model, if the monitoring
  1515     "called every 'n' seconds by the model, if the monitoring
  1627      cycle is enabled. The item can perform some checks, ..
  1516      cycle is enabled. The item can perform some checks, ..
  1628      **** can be redefined by subclass to perform some actions
  1517      **** can be redefined by subclass to perform some actions
  1629     "
  1518     "
  1630 
       
  1631     "Modified: / 09-07-2010 / 08:38:06 / cg"
       
  1632 ! !
  1519 ! !
  1633 
  1520 
  1634 !HierarchicalItem methodsFor:'protocol-queries'!
  1521 !HierarchicalItem methodsFor:'protocol-queries'!
  1635 
  1522 
  1636 canCollapse
  1523 canCollapse
  1673     "checks whether the item has children; 
  1560     "checks whether the item has children; 
  1674      the list needs not to be loaded yet( example. FileDirectory ).
  1561      the list needs not to be loaded yet( example. FileDirectory ).
  1675      *** to optimize: redefine in subClass"
  1562      *** to optimize: redefine in subClass"
  1676 
  1563 
  1677     ^ self children size ~~ 0
  1564     ^ self children size ~~ 0
  1678 
       
  1679     "Modified: / 09-07-2010 / 08:42:50 / cg"
       
  1680 !
  1565 !
  1681 
  1566 
  1682 hasIndicator
  1567 hasIndicator
  1683     "on default the indicator is drawn if the item has children"
  1568     "on default the indicator is drawn if the item has children"
  1684 
  1569 
  1685     ^ self hasChildren
  1570     ^ self hasChildren
  1686 
       
  1687     "Modified: / 09-07-2010 / 08:42:46 / cg"
       
  1688 !
  1571 !
  1689 
  1572 
  1690 isSelectable
  1573 isSelectable
  1691     "returns true if the item is selectable"
  1574     "returns true if the item is selectable"
  1692 
  1575 
  1693     ^ true
  1576     ^ true
  1694 
       
  1695     "Modified: / 09-07-2010 / 08:41:30 / cg"
       
  1696 !
  1577 !
  1697 
  1578 
  1698 string
  1579 string
  1699     "access the printable string used for steping through a list
  1580     "access the printable string used for stepping through a list
  1700      searching for an entry starting with a character.
  1581      searching for an entry starting with a character.
  1701      *** to optimize:redefine by subClass"
  1582      *** to optimize:redefine by subClass"
  1702 
  1583 
  1703     |label|
  1584     |label|
  1704 
  1585 
  1716                 s notNil ifTrue:[^ s].
  1597                 s notNil ifTrue:[^ s].
  1717             ]
  1598             ]
  1718         ]
  1599         ]
  1719     ].
  1600     ].
  1720     ^ nil
  1601     ^ nil
  1721 
       
  1722     "Modified: / 09-07-2010 / 08:32:12 / cg"
       
  1723 ! !
  1602 ! !
  1724 
  1603 
  1725 !HierarchicalItem methodsFor:'queries'!
  1604 !HierarchicalItem methodsFor:'queries'!
  1726 
  1605 
  1727 isChildOf:anItem
  1606 isChildOf:anItem
  1735         ((item := item parent) notNil and:[item isHierarchicalItem]) ifFalse:[
  1614         ((item := item parent) notNil and:[item isHierarchicalItem]) ifFalse:[
  1736             ^ false
  1615             ^ false
  1737         ]
  1616         ]
  1738     ].
  1617     ].
  1739     ^ true
  1618     ^ true
  1740 
       
  1741     "Modified: / 09-07-2010 / 08:41:58 / cg"
       
  1742 !
  1619 !
  1743 
  1620 
  1744 isCollapsed
  1621 isCollapsed
  1745     "returns true if the item is collapsed"
  1622     "returns true if the item is collapsed"
  1746 
  1623 
  1762 
  1639 
  1763 isHierarchicalItem
  1640 isHierarchicalItem
  1764     "used to decide if the parent is a hierarchical item or the model"
  1641     "used to decide if the parent is a hierarchical item or the model"
  1765 
  1642 
  1766     ^ true
  1643     ^ true
  1767 
       
  1768     "Modified: / 09-07-2010 / 08:41:43 / cg"
       
  1769 !
  1644 !
  1770 
  1645 
  1771 isRealChildOf:anItem
  1646 isRealChildOf:anItem
  1772     "returns true if the item is a child of anItem"
  1647     "returns true if the item is a child of anItem"
  1773 
  1648 
  1777     [item notNil] whileTrue:[
  1652     [item notNil] whileTrue:[
  1778         item == anItem ifTrue:[^ true].
  1653         item == anItem ifTrue:[^ true].
  1779         item := item parent.
  1654         item := item parent.
  1780     ].
  1655     ].
  1781     ^ false
  1656     ^ false
  1782 
       
  1783     "Modified: / 09-07-2010 / 08:41:36 / cg"
       
  1784 !
  1657 !
  1785 
  1658 
  1786 isRootItem
  1659 isRootItem
  1787     "returns true if the item is the root item"
  1660     "returns true if the item is the root item"
  1788 
  1661 
  1789     ^ parent isHierarchicalItem not
  1662     ^ parent isHierarchicalItem not
  1790 
       
  1791     "Modified: / 09-07-2010 / 08:41:26 / cg"
       
  1792 !
  1663 !
  1793 
  1664 
  1794 size
  1665 size
  1795     "return the number of children"
  1666     "return the number of children"
  1796 
  1667 
  1797     ^ self children size
  1668     ^ self children size
  1798 
       
  1799     "Modified: / 09-07-2010 / 08:32:24 / cg"
       
  1800 ! !
  1669 ! !
  1801 
  1670 
  1802 !HierarchicalItem methodsFor:'searching'!
  1671 !HierarchicalItem methodsFor:'searching'!
  1803 
  1672 
  1804 detect:aOneArgBlock
  1673 detect:aOneArgBlock
  1814 
  1683 
  1815     self do:[:el| 
  1684     self do:[:el| 
  1816         (aOneArgBlock value:el) ifTrue:[^ el] 
  1685         (aOneArgBlock value:el) ifTrue:[^ el] 
  1817     ].
  1686     ].
  1818     ^ exceptionBlock value
  1687     ^ exceptionBlock value
  1819 
       
  1820     "Modified: / 13-09-2006 / 11:17:53 / cg"
       
  1821 !
  1688 !
  1822 
  1689 
  1823 detectLast:aOneArgBlock
  1690 detectLast:aOneArgBlock
  1824     "find the last child, for which evaluation of the block returns
  1691     "find the last child, for which evaluation of the block returns
  1825      true; if none does so, an exception is raised"
  1692      true; if none does so, an exception is raised"
  1854 
  1721 
  1855 identityIndexOf:aChild
  1722 identityIndexOf:aChild
  1856     "return the index of aChild or 0 if not found. Compare using =="
  1723     "return the index of aChild or 0 if not found. Compare using =="
  1857 
  1724 
  1858     ^ self identityIndexOf:aChild startingAt:1
  1725     ^ self identityIndexOf:aChild startingAt:1
  1859 
       
  1860     "Modified: / 09-07-2010 / 08:42:12 / cg"
       
  1861 !
  1726 !
  1862 
  1727 
  1863 identityIndexOf:aChild startingAt:startIndex
  1728 identityIndexOf:aChild startingAt:startIndex
  1864     "return the index of aChild, starting search at startIndex.
  1729     "return the index of aChild, starting search at startIndex.
  1865      Compare using ==; return 0 if not found"
  1730      Compare using ==; return 0 if not found"
  1871     self from:startIndex do:[:el|
  1736     self from:startIndex do:[:el|
  1872         el == aChild ifTrue:[^ index ].
  1737         el == aChild ifTrue:[^ index ].
  1873         index := index + 1.
  1738         index := index + 1.
  1874     ].
  1739     ].
  1875     ^ 0
  1740     ^ 0
  1876 
       
  1877     "Modified: / 09-07-2010 / 08:42:07 / cg"
       
  1878 !
  1741 !
  1879 
  1742 
  1880 recursiveDetect:aOneArgBlock
  1743 recursiveDetect:aOneArgBlock
  1881     "recursive find the first child, for which evaluation 
  1744     "recursive find the first child, for which evaluation 
  1882      of the block returns true; if none nil is returned"
  1745      of the block returns true; if none nil is returned"
  1883 
  1746 
  1884     self recursiveDo:[:aChild|
  1747     self recursiveDo:[:aChild|
  1885         (aOneArgBlock value:aChild) ifTrue:[^ aChild]
  1748         (aOneArgBlock value:aChild) ifTrue:[^ aChild]
  1886     ].
  1749     ].
  1887     ^ nil
  1750     ^ nil
  1888 
       
  1889     "Modified: / 09-07-2010 / 08:34:17 / cg"
       
  1890 !
  1751 !
  1891 
  1752 
  1892 recursiveDetectLast:aBlock
  1753 recursiveDetectLast:aBlock
  1893     "find the last child, for which evaluation of the block returns
  1754     "find the last child, for which evaluation of the block returns
  1894      true; if none does so, nil id returned"
  1755      true; if none does so, nil id returned"
  1895 
  1756 
  1896     self recursiveReverseDo:[:aChild|
  1757     self recursiveReverseDo:[:aChild|
  1897         (aBlock value:aChild) ifTrue:[^ aChild].
  1758         (aBlock value:aChild) ifTrue:[^ aChild].
  1898     ].
  1759     ].
  1899     ^ nil
  1760     ^ nil
  1900 
       
  1901     "Modified: / 09-07-2010 / 08:34:12 / cg"
       
  1902 !
  1761 !
  1903 
  1762 
  1904 withAllDetect:aOneArgBlock
  1763 withAllDetect:aOneArgBlock
  1905     "recursive find the first item including self, for which evaluation
  1764     "recursive find the first item including self, for which evaluation
  1906      of the block returns true; if none nil is returned"
  1765      of the block returns true; if none nil is returned"
  1907 
  1766 
  1908     (aOneArgBlock value:self) ifTrue:[^ self].
  1767     (aOneArgBlock value:self) ifTrue:[^ self].
  1909 
  1768 
  1910     ^ self recursiveDetect:aOneArgBlock
  1769     ^ self recursiveDetect:aOneArgBlock
  1911 
       
  1912     "Modified: / 09-07-2010 / 08:31:47 / cg"
       
  1913 ! !
  1770 ! !
  1914 
  1771 
  1915 !HierarchicalItem methodsFor:'sorting & reordering'!
  1772 !HierarchicalItem methodsFor:'sorting & reordering'!
  1916 
  1773 
  1917 recursiveSort:aSortBlock
  1774 recursiveSort:aSortBlock
  1921         children size ~~ 0 ifTrue:[
  1778         children size ~~ 0 ifTrue:[
  1922             self nonCriticalRecursiveSort:aSortBlock.
  1779             self nonCriticalRecursiveSort:aSortBlock.
  1923             self childrenOrderChanged.
  1780             self childrenOrderChanged.
  1924         ]
  1781         ]
  1925     ].
  1782     ].
  1926 
       
  1927     "Modified: / 09-07-2010 / 08:33:34 / cg"
       
  1928 !
  1783 !
  1929 
  1784 
  1930 sort:aSortBlock
  1785 sort:aSortBlock
  1931     "sort the children inplace using the 2-arg block sortBlock for comparison"
  1786     "sort the children inplace using the 2-arg block sortBlock for comparison"
  1932 
  1787 
  1938         unsorted size ~~ 0 ifTrue:[
  1793         unsorted size ~~ 0 ifTrue:[
  1939             children := unsorted sort:aSortBlock.
  1794             children := unsorted sort:aSortBlock.
  1940             self childrenOrderChanged.
  1795             self childrenOrderChanged.
  1941         ]
  1796         ]
  1942     ].
  1797     ].
  1943 
       
  1944     "Modified: / 09-07-2010 / 08:32:19 / cg"
       
  1945 ! !
  1798 ! !
  1946 
  1799 
  1947 !HierarchicalItem::Example class methodsFor:'instance creation'!
  1800 !HierarchicalItem::Example class methodsFor:'instance creation'!
  1948 
  1801 
  1949 labeled:aLabel
  1802 labeled:aLabel
  2082 ! !
  1935 ! !
  2083 
  1936 
  2084 !HierarchicalItem class methodsFor:'documentation'!
  1937 !HierarchicalItem class methodsFor:'documentation'!
  2085 
  1938 
  2086 version
  1939 version
  2087     ^ '$Header: /cvs/stx/stx/libwidg2/HierarchicalItem.st,v 1.93 2010-07-09 06:43:47 cg Exp $'
  1940     ^ '$Header: /cvs/stx/stx/libwidg2/HierarchicalItem.st,v 1.94 2010-07-09 07:00:29 cg Exp $'
  2088 !
  1941 !
  2089 
  1942 
  2090 version_CVS
  1943 version_CVS
  2091     ^ '$Header: /cvs/stx/stx/libwidg2/HierarchicalItem.st,v 1.93 2010-07-09 06:43:47 cg Exp $'
  1944     ^ '$Header: /cvs/stx/stx/libwidg2/HierarchicalItem.st,v 1.94 2010-07-09 07:00:29 cg Exp $'
  2092 ! !
  1945 ! !