HierarchyNode.st
author ca
Tue, 01 Jul 1997 15:21:03 +0200
changeset 439 08c889635dfd
parent 438 19f0f3a171f6
child 442 930fe1485dc2
permissions -rw-r--r--
create: addChildAndSubChildren:aHierarchyNode after:aChild
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
 COPYRIGHT (c) 1994 by AEG Industry Automation
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
 COPYRIGHT (c) 1994 by Claus Gittinger
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
	      All Rights Reserved
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
 This software is furnished under a license and may be used
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
 only in accordance with the terms of that license and with the
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
 inclusion of the above copyright notice.   This software may not
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
 be provided or otherwise made available to, or used by, any
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
 other person.  No title to or ownership of the software is
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
 hereby transferred.
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
"
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
Object subclass:#HierarchyNode
435
ca
parents: 359
diff changeset
    15
	instanceVariableNames:'name id parent children contents disabled hide level
ca
parents: 359
diff changeset
    16
		childCollectionClass'
253
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
    17
	classVariableNames:''
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
    18
	poolDictionaries:''
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
    19
	category:'Interface-Support'
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
!
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
359
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    22
!HierarchyNode class methodsFor:'documentation'!
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
copyright 
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
"
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
 COPYRIGHT (c) 1994 by AEG Industry Automation
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
 COPYRIGHT (c) 1994 by Claus Gittinger
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
	      All Rights Reserved
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
 This software is furnished under a license and may be used
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
 only in accordance with the terms of that license and with the
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
 inclusion of the above copyright notice.   This software may not
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
 be provided or otherwise made available to, or used by, any
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
 other person.  No title to or ownership of the software is
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
 hereby transferred.
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
"
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
!
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
documentation
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
"
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
    class to build up tree like structures to represent
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
    file-trees, class tress etc.
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
    Especially suited for use with SelectionInHierarchy and
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
    SelectionInHierarchyView.
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
    See examples in SelectionInHierarchyView.
253
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
    46
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
    47
    [Author:]
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
    48
        W. Olberding AEG Factory Automation
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
    49
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
    50
    [See also:]
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
    51
        SelectionInHierarchy
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
    52
        SelectionInHierarchyView
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
"
118
2821a094ba30 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
    54
! !
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
359
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    56
!HierarchyNode class methodsFor:'instance creation'!
253
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
    57
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
    58
new
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
    59
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
    60
	^super new initialize
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
    61
!
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
359
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    63
newAsTreeFromSmalltalkClass:aClass
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    64
    "create a tree of nodes with aClass and all its
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    65
    subclasses as contents."
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
359
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    67
    ^ self
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    68
        newAsTreeFromSmalltalkClass:aClass
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    69
        level:(aClass allSuperclasses size).
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    70
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    71
    "Modified: 15.4.1997 / 16:34:23 / cg"
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
!
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
359
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    74
newAsTreeFromSmalltalkClass:aClass level:level
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    75
    "create a tree of nodes with aClass and all its
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    76
     subclasses as contents. Set the initial level as given."
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    77
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    78
    |newInst|
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    79
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    80
    newInst := super new initialize.
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    81
    newInst name:aClass name.
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    82
    newInst contents:aClass.
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    83
    newInst level:level.
438
19f0f3a171f6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
    84
    newInst childCollectionClass:OrderedCollection.
19f0f3a171f6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
    85
    (aClass subclasses asSortedCollection:[:a :b | a name < b name])
19f0f3a171f6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
    86
    do:[:aSubClass |
359
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    87
        newInst addChild:(self newAsTreeFromSmalltalkClass:aSubClass level:level+1).
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    88
    ].
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    89
    ^newInst
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
359
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    91
    "Created: 15.4.1997 / 16:33:52 / cg"
438
19f0f3a171f6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
    92
    "Modified: 1.7.1997 / 11:57:15 / cg"
359
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    93
!
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    94
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    95
newWithName:aString
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    96
    "create a new node with a name"
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    97
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    98
    |newInst|
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    99
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   100
    newInst := super new initialize.
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   101
    newInst name: aString.
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   102
    ^newInst
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   103
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   104
    "Modified: 15.4.1997 / 16:32:06 / cg"
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
!
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   106
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
newWithName: aString andId: anId
359
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   108
    "create a new node with a name and id"
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
359
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   110
    |newInst|
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   111
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   112
    newInst := super new initialize.
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   113
    newInst name: aString.
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   114
    newInst id:   anId.
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   115
    ^newInst
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   116
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   117
    "Modified: 15.4.1997 / 16:32:22 / cg"
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   118
! !
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   119
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   120
!HierarchyNode methodsFor:'accessing'!
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   121
435
ca
parents: 359
diff changeset
   122
childCollectionClass:aCollectionClass
ca
parents: 359
diff changeset
   123
    "set the class of the child-collection.
ca
parents: 359
diff changeset
   124
     Default is Set."
ca
parents: 359
diff changeset
   125
ca
parents: 359
diff changeset
   126
     childCollectionClass := aCollectionClass.
ca
parents: 359
diff changeset
   127
     children := aCollectionClass withAll:children.
ca
parents: 359
diff changeset
   128
!
ca
parents: 359
diff changeset
   129
359
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   130
children
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   131
    "Answer my immediate children."
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   132
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   133
    ^ children
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   134
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   135
	"Modified: 10.10.94 / 16:13:34 / W.Olberding"!
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   136
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   137
children:aCollectionWithElementsOfMyKind 
253
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   138
    "set my children"
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   139
359
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   140
    aCollectionWithElementsOfMyKind do:[:child | 
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   141
         child parent: self.
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   142
         child level: level + 1.
253
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   143
    ].
359
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   144
    children := aCollectionWithElementsOfMyKind.
253
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   145
359
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   146
    "Modified: 10.10.1994 / 16:13:33 / W.Olberding"
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   147
    "Modified: 15.4.1997 / 16:48:38 / cg"
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   148
!
253
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   149
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   150
contents
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   151
    "Answer the contents of me (e.g. a set of items)"
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   152
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   153
    ^contents
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   154
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   155
	"Modified: 10.10.94 / 16:13:33 / W.Olberding"!
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   156
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   157
contents: anObject 
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   158
    "Set the contents of me to any object (e.g. a set of items)"
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   159
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   160
    ^contents:= anObject
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   161
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   162
	"Modified: 10.10.94 / 16:13:33 / W.Olberding"!
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   163
253
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   164
disabled
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   165
    "return disabled"
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   166
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   167
    ^ disabled
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   168
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   169
	"Modified: 10.10.94 / 16:13:33 / W.Olberding"!
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   170
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   171
disabled: aBool 
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   172
    "set disabled"
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   173
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   174
    disabled := aBool.
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   175
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   176
	"Modified: 10.10.94 / 16:13:33 / W.Olberding"!
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   177
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   178
hide: aBoolean
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   179
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   180
   "Set hide to aBoolean"
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   181
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   182
   hide:= aBoolean
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   183
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   184
	"Modified: 10.10.94 / 16:13:33 / W.Olberding"!
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   185
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   186
hideToFalseForPath
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   187
    "set the hide-flag to false"
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   188
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   189
      hide:= false.
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   190
      parent isNil ifTrue: [^self].
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   191
      parent hideToFalseForPath
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   192
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   193
	"Modified: 10.10.94 / 16:13:33 / W.Olberding"!
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   194
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   195
id
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   196
    "return id"
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   197
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   198
    ^ id
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   199
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   200
	"Modified: 10.10.94 / 16:13:33 / W.Olberding"!
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   201
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   202
id:something
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   203
    "set id"
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   204
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   205
    id := something.
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   206
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   207
	"Modified: 10.10.94 / 16:13:33 / W.Olberding"!
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   208
253
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   209
level
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   210
    "answer the level in hierarchy (0=root)"
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   211
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   212
    ^level
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   213
253
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   214
	"Modified: 10.10.94 / 16:13:33 / W.Olberding"!
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   215
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   216
level: anInteger 
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   217
    "set the level in hierarchy (0=root)"
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   218
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   219
    level := anInteger.
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   220
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   221
	"Modified: 10.10.94 / 16:13:33 / W.Olberding"!
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   222
253
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   223
name
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   224
    "return name"
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   225
253
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   226
    ^ name
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   227
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   228
	"Modified: 10.10.94 / 16:13:33 / W.Olberding"!
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   229
253
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   230
name: aString 
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   231
    "set the name that identifys me within my parent's context."
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   232
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   233
    name :=   aString.
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   234
253
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   235
	"Modified: 10.10.94 / 16:13:33 / W.Olberding"!
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   236
435
ca
parents: 359
diff changeset
   237
ordered:aBoolean
ca
parents: 359
diff changeset
   238
    "set/clear the children-are-ordered flag.
ca
parents: 359
diff changeset
   239
     If unordered (the default), children are kept in a set;
ca
parents: 359
diff changeset
   240
     if ordered, they are kept in an orderedCollection."
ca
parents: 359
diff changeset
   241
ca
parents: 359
diff changeset
   242
     aBoolean ifTrue:[
ca
parents: 359
diff changeset
   243
        children := children asOrderedCollection
ca
parents: 359
diff changeset
   244
     ] ifFalse:[
ca
parents: 359
diff changeset
   245
        children := children asSet
ca
parents: 359
diff changeset
   246
     ].
ca
parents: 359
diff changeset
   247
!
ca
parents: 359
diff changeset
   248
253
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   249
parent:something
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   250
    "set parent"
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   251
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   252
    parent := something.
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   253
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   254
	"Modified: 10.10.94 / 16:13:33 / W.Olberding"!
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   255
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   256
pathName
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   257
    "return a full path name to me"
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   258
359
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   259
    |n|
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   260
359
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   261
    n := self delimiterString , name.
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   262
    parent isNil ifTrue: [^ n].
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   263
    ^ parent pathName , n.
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   264
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   265
    "Modified: 10.10.1994 / 16:13:33 / W.Olberding"
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   266
    "Modified: 15.4.1997 / 16:52:02 / cg"
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   267
! !
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   268
253
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   269
!HierarchyNode methodsFor:'constants'!
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   270
253
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   271
delimiter
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   272
	"Answer the delimiter character"
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   273
253
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   274
	^$/
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   275
253
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   276
	"Modified: 10.10.94 / 16:13:35 / W.Olberding"!
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   277
253
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   278
delimiterString
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   279
	"Answer the delimiter character asString"
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   280
253
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   281
	^self delimiter asString
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   282
253
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   283
	"Modified: 10.10.94 / 16:13:35 / W.Olberding"! !
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   284
439
08c889635dfd create:
ca
parents: 438
diff changeset
   285
!HierarchyNode methodsFor:'copy'!
08c889635dfd create:
ca
parents: 438
diff changeset
   286
08c889635dfd create:
ca
parents: 438
diff changeset
   287
copyWithParent:aParent
08c889635dfd create:
ca
parents: 438
diff changeset
   288
    |node chd|
08c889635dfd create:
ca
parents: 438
diff changeset
   289
08c889635dfd create:
ca
parents: 438
diff changeset
   290
    node := self copy.
08c889635dfd create:
ca
parents: 438
diff changeset
   291
    node parent:aParent.
08c889635dfd create:
ca
parents: 438
diff changeset
   292
    node level:((aParent level) + 1).
08c889635dfd create:
ca
parents: 438
diff changeset
   293
    node children:(children collect:[:aChild| aChild copyWithParent:self]).
08c889635dfd create:
ca
parents: 438
diff changeset
   294
  ^ node
08c889635dfd create:
ca
parents: 438
diff changeset
   295
! !
08c889635dfd create:
ca
parents: 438
diff changeset
   296
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   297
!HierarchyNode methodsFor:'hierarchy operations'!
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   298
359
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   299
addChild:anObjectOfMyKind 
253
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   300
    "add anObjectOfMyKind to my children"
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   301
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   302
    anObjectOfMyKind parent: self.
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   303
    anObjectOfMyKind level: level +1.
359
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   304
    self children add:anObjectOfMyKind.
253
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   305
359
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   306
    "Modified: 10.10.1994 / 16:13:34 / W.Olberding"
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   307
    "Modified: 15.4.1997 / 16:49:17 / cg"
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   308
!
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   309
439
08c889635dfd create:
ca
parents: 438
diff changeset
   310
addChildAndSubChildren:aHierarchyNode after:aChild
08c889635dfd create:
ca
parents: 438
diff changeset
   311
    "add aHierarchyNode to my children after an existing child or at end"
08c889635dfd create:
ca
parents: 438
diff changeset
   312
08c889635dfd create:
ca
parents: 438
diff changeset
   313
    |node index|
08c889635dfd create:
ca
parents: 438
diff changeset
   314
08c889635dfd create:
ca
parents: 438
diff changeset
   315
    node := aHierarchyNode copyWithParent:self.
08c889635dfd create:
ca
parents: 438
diff changeset
   316
08c889635dfd create:
ca
parents: 438
diff changeset
   317
    (index := self indexOfChild:aChild) == 0 ifTrue:[
08c889635dfd create:
ca
parents: 438
diff changeset
   318
        self children add:node
08c889635dfd create:
ca
parents: 438
diff changeset
   319
    ] ifFalse:[
08c889635dfd create:
ca
parents: 438
diff changeset
   320
        self children add:node afterIndex:index
08c889635dfd create:
ca
parents: 438
diff changeset
   321
    ].
08c889635dfd create:
ca
parents: 438
diff changeset
   322
!
08c889635dfd create:
ca
parents: 438
diff changeset
   323
253
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   324
addChildren: aCollectionWithElementsOfMyKind 
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   325
    "add aCollectionWithElementsOfMyKind to my children"
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   326
359
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   327
    aCollectionWithElementsOfMyKind do:[:child | 
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   328
         child parent: self.
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   329
         child level: level +1.
253
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   330
    ].
359
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   331
    self children addAll:aCollectionWithElementsOfMyKind.
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   332
359
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   333
    "Modified: 10.10.1994 / 16:13:34 / W.Olberding"
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   334
    "Modified: 15.4.1997 / 16:49:03 / cg"
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   335
!
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   336
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   337
allChildren
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   338
    "Answer my immediate children plus all my grandchildren
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   339
      -- in hierachical order and alphabeticaly sorted by name within one level."
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   340
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   341
     | kids |
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   342
     kids := OrderedCollection new.
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   343
     self addAllChildrenTo: kids.
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   344
     ^kids.
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   345
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   346
	"Modified: 10.10.94 / 16:13:34 / W.Olberding"!
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   347
253
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   348
allParents 
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   349
    "return all my parents (next first - root last)"
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   350
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   351
    parent isNil ifTrue:  [ ^OrderedCollection new: 0  ]
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   352
		 ifFalse: [ ^parent, parent allParents ].
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   353
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   354
	"Modified: 10.10.94 / 16:13:34 / W.Olberding"!
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   355
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   356
collapse 
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   357
      "Hide my children in hierachical printouts."
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   358
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   359
	 hide := true
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   360
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   361
	"Modified: 10.10.94 / 16:13:34 / W.Olberding"!
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   362
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   363
collapseAll 
359
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   364
    "Hide my children and all my grandchildren in hierachical printouts."
253
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   365
359
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   366
    hide := true.
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   367
    self children do: [:kid | kid collapseAll ].
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   368
359
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   369
    "Modified: 10.10.1994 / 16:13:34 / W.Olberding"
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   370
    "Modified: 15.4.1997 / 16:49:34 / cg"
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   371
!
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   372
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   373
expand 
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   374
      "Show my immediate children in hierachical printouts."
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   375
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   376
	 hide := false.
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   377
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   378
	"Modified: 10.10.94 / 16:13:34 / W.Olberding"!
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   379
253
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   380
expandAll 
359
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   381
    "Show my children and all grand children in hierachical printouts."
253
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   382
359
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   383
    hide := false.
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   384
    self children do: [:kid | kid expandAll ].
253
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   385
359
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   386
    "Modified: 10.10.1994 / 16:13:34 / W.Olberding"
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   387
    "Modified: 15.4.1997 / 16:49:48 / cg"
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   388
!
253
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   389
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   390
parent
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   391
    "return parent"
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   392
253
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   393
    ^ parent
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   394
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   395
	"Modified: 10.10.94 / 16:13:34 / W.Olberding"!
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   396
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   397
removeAllChildren
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   398
    "Remove all children of me from the tree, i.e. let them
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   399
     forget myself as parent."
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   400
359
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   401
    | kids |
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   402
359
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   403
    kids := self allChildren.
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   404
    kids do: [:kid | kid parent: nil ].
435
ca
parents: 359
diff changeset
   405
    children := childCollectionClass new.
359
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   406
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   407
    "Modified: 10.10.1994 / 16:13:34 / W.Olberding"
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   408
    "Modified: 15.4.1997 / 16:50:01 / cg"
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   409
!
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   410
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   411
removeChild: anObjectOfMyKind 
359
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   412
    "remove anObjectOfMyKind from my children"
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   413
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   414
    anObjectOfMyKind parent: nil.
359
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   415
    children remove: anObjectOfMyKind.
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   416
359
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   417
    "Modified: 10.10.1994 / 16:13:34 / W.Olberding"
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   418
    "Modified: 15.4.1997 / 16:50:23 / cg"
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   419
!
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   420
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   421
removeYourself
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   422
    "remove me and all my children"
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   423
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   424
    parent isNil ifTrue: [^nil].
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   425
    parent removeChild: self.
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   426
359
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   427
    "Modified: 10.10.1994 / 16:13:34 / W.Olberding"
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   428
    "Modified: 15.4.1997 / 16:52:33 / cg"
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   429
!
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   430
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   431
withAllChildren
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   432
    "Answer me, my immediate children and all my grandchildren
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   433
      -- in hierachical order and alphabeticaly sorted by name within one level."
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   434
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   435
     | kids |
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   436
     kids := OrderedCollection with: self .
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   437
     self addAllChildrenTo: kids.
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   438
     ^kids.
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   439
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   440
	"Modified: 10.10.94 / 16:13:34 / W.Olberding"!
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   441
253
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   442
withAllShownChildren
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   443
    "Answer me, my immediate children and all my grandchildren which are
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   444
     currently not hidden.
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   445
      -- in hierachical order and alphabeticaly sorted by name within one level."
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   446
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   447
     | kids |
253
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   448
     kids := OrderedCollection with: self .
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   449
     self addAllShownChildrenTo: kids.
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   450
     ^kids.
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   451
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   452
	"Modified: 10.10.94 / 16:13:34 / W.Olberding"! !
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   453
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   454
!HierarchyNode methodsFor:'initialize-release'!
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   455
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   456
initialize
359
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   457
        "init some defaults"
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   458
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   459
     "  name 
359
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   460
        id 
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   461
        parent --"
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   462
435
ca
parents: 359
diff changeset
   463
    childCollectionClass := Set.
359
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   464
    children := Set new.
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   465
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   466
       " contents    := Set new."
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   467
359
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   468
    disabled := false.
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   469
    hide     := false.
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   470
    level    := 0. "=root"
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   471
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   472
    "Modified: 10.10.1994 / 16:13:35 / W.Olberding"
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   473
    "Modified: 15.4.1997 / 16:50:44 / cg"
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   474
! !
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   475
253
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   476
!HierarchyNode methodsFor:'private'!
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   477
359
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   478
addAllChildrenTo:aCollection
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   479
    "Add all my children in hierachical and alphabetical order
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   480
     to aCollection."
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   481
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   482
    |myChildren|
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   483
435
ca
parents: 359
diff changeset
   484
    "/ myChildren := children asSortedCollection:[:x :y | x name < y name ].
ca
parents: 359
diff changeset
   485
    myChildren := self children.
359
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   486
    myChildren do:[:aChild |
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   487
        aCollection addLast: aChild.
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   488
        aChild addAllChildrenTo:aCollection.
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   489
    ].
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   490
359
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   491
    "Modified: 10.10.1994 / 16:13:35 / W.Olberding"
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   492
    "Modified: 15.4.1997 / 16:47:53 / cg"
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   493
!
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   494
253
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   495
addAllShownChildrenTo: aCollection
359
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   496
    "Add all my children in hierachical and alphabetical order
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   497
     if they are not hidden."
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   498
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   499
    |myChildren|
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   500
359
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   501
    hide ifTrue: [^self].
435
ca
parents: 359
diff changeset
   502
"/    myChildren := self children asSortedCollection:[:x :y | x name < y name ].
ca
parents: 359
diff changeset
   503
    myChildren := self children.
359
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   504
    myChildren do: [:aChild |
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   505
        aCollection addLast: aChild.
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   506
        aChild addAllShownChildrenTo: aCollection.
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   507
    ].
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   508
359
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   509
    "Modified: 10.10.1994 / 16:13:35 / W.Olberding"
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   510
    "Modified: 15.4.1997 / 16:53:08 / cg"
439
08c889635dfd create:
ca
parents: 438
diff changeset
   511
!
08c889635dfd create:
ca
parents: 438
diff changeset
   512
08c889635dfd create:
ca
parents: 438
diff changeset
   513
indexOfChild:aChild
08c889635dfd create:
ca
parents: 438
diff changeset
   514
    |seq|
08c889635dfd create:
ca
parents: 438
diff changeset
   515
08c889635dfd create:
ca
parents: 438
diff changeset
   516
    aChild notNil ifTrue:[
08c889635dfd create:
ca
parents: 438
diff changeset
   517
        seq := self children.
08c889635dfd create:
ca
parents: 438
diff changeset
   518
        seq isSequenceable ifTrue:[
08c889635dfd create:
ca
parents: 438
diff changeset
   519
            ^ seq findFirst:[:aChild| aChild == aChild ]
08c889635dfd create:
ca
parents: 438
diff changeset
   520
        ]
08c889635dfd create:
ca
parents: 438
diff changeset
   521
    ].
08c889635dfd create:
ca
parents: 438
diff changeset
   522
  ^ 0
359
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   523
! !
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   524
253
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   525
!HierarchyNode methodsFor:'queries'!
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   526
253
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   527
childrenHidden
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   528
      "Answer true if my children shall be hidden
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   529
       in hierachical printouts etc."
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   530
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   531
      ^hide.
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   532
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   533
	"Modified: 10.10.94 / 16:13:33 / W.Olberding"!
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   534
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   535
childrenShown
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   536
      "Answer true if my children shall be shown
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   537
       in hierachical printouts etc."
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   538
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   539
      ^hide not.
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   540
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   541
	"Modified: 10.10.94 / 16:13:33 / W.Olberding"!
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   542
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   543
hasChildren
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   544
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   545
	^children size > 0.
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   546
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   547
	"Modified: 10.10.94 / 16:13:33 / W.Olberding"!
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   548
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   549
isCollapsable
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   550
	"Answer true if I have shown children"
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   551
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   552
	self hasChildren ifTrue: [ ^hide == false ].
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   553
	^false.
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   554
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   555
	"Modified: 10.10.94 / 16:13:33 / W.Olberding"!
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   556
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   557
isExpandable
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   558
	"Answer true if I have hidden children"
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   559
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   560
	self hasChildren ifTrue: [ ^hide == true ].
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   561
	^false.
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   562
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   563
	"Modified: 10.10.94 / 16:13:33 / W.Olberding"! !
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   564
359
a4f931c5a7d9 comments
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   565
!HierarchyNode class methodsFor:'documentation'!
253
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   566
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   567
version
439
08c889635dfd create:
ca
parents: 438
diff changeset
   568
    ^ '$Header: /cvs/stx/stx/libwidg2/HierarchyNode.st,v 1.8 1997-07-01 13:21:03 ca Exp $'
253
01498f4ffcca comment
Claus Gittinger <cg@exept.de>
parents: 118
diff changeset
   569
! !