SelectionInHierarchyView.st
author Claus Gittinger <cg@exept.de>
Fri, 15 Jun 2018 10:54:35 +0200
changeset 5816 7876c07931a7
parent 5160 c946616ee338
child 5197 4c7442c47ab5
permissions -rw-r--r--
#DOCUMENTATION by cg class: ComboListView class comment/format in: #documentation
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
254
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
     1
"
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
     2
 COPYRIGHT (c) 1994 by AEG Industry Automation
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
     3
 COPYRIGHT (c) 1994 by Claus Gittinger
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
     4
	      All Rights Reserved
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
     5
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
     6
 This software is furnished under a license and may be used
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
     7
 only in accordance with the terms of that license and with the
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
     8
 inclusion of the above copyright notice.   This software may not
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
     9
 be provided or otherwise made available to, or used by, any
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    10
 other person.  No title to or ownership of the software is
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    11
 hereby transferred.
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    12
"
5160
c946616ee338 #REFACTORING by mawalch
mawalch
parents: 3150
diff changeset
    13
"{ Package: 'stx:libwidg2' }"
254
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    14
5160
c946616ee338 #REFACTORING by mawalch
mawalch
parents: 3150
diff changeset
    15
"{ NameSpace: Smalltalk }"
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
    16
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
SelectionInListView subclass:#SelectionInHierarchyView
361
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
    18
	instanceVariableNames:'itemList showConnectingLines itemClass indent itemPrintConverter'
252
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
    19
	classVariableNames:''
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
    20
	poolDictionaries:''
1233
ba2244433fd4 category change
Claus Gittinger <cg@exept.de>
parents: 443
diff changeset
    21
	category:'Views-Trees'
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
!
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
259
f930922963ce commentary - mhmh
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    24
!SelectionInHierarchyView class methodsFor:'documentation'!
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
    26
copyright
254
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    27
"
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    28
 COPYRIGHT (c) 1994 by AEG Industry Automation
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    29
 COPYRIGHT (c) 1994 by Claus Gittinger
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    30
	      All Rights Reserved
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    31
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    32
 This software is furnished under a license and may be used
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    33
 only in accordance with the terms of that license and with the
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    34
 inclusion of the above copyright notice.   This software may not
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    35
 be provided or otherwise made available to, or used by, any
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    36
 other person.  No title to or ownership of the software is
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    37
 hereby transferred.
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    38
"
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    39
!
84
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
documentation
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
"
443
fdff91162cac added obsoleteness warning
Claus Gittinger <cg@exept.de>
parents: 361
diff changeset
    43
    [warning:]
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
    44
	this class has been more or less obsoleted by
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
    45
	the SelectionInTreeView and HierarchicalListView classes.
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
    46
	SelectionInHierarchyView remains in the system for backward
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
    47
	compatibility, but will be no longer maintained.
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
    48
	New applications should use SelectionInTreeView,
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
    49
	or (even better) HierarchicalListView.
443
fdff91162cac added obsoleteness warning
Claus Gittinger <cg@exept.de>
parents: 361
diff changeset
    50
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
    somewhat like a SelectionInListView; but specialized for hierarchical (i.e. tree-like)
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
    52
    lists and adds the functions to show/hide subtrees.
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
    Requires SelectionInHierarchy as model and HierarchyNode (or compatible) list entries.
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
    See examples.
252
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
    55
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
    56
    [Author:]
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
    57
	W. Olberding AEG Factory Automation
252
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
    58
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
    59
    [See also:]
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
    60
	SelectionInTreeView
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
    61
	SelectionInHierarchy HierarchyNode
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
    62
	SelectionInListView
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
"
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
!
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
examples
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
"
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
    shows the tree of smalltalk classes:
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
    69
									[exBegin]
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
      |top hierarchy hierarchyV scroller|
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
      hierarchy := SelectionInHierarchy new.
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
      hierarchy root:(HierarchyNode newAsTreeFromSmalltalkClass:Object).
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
      hierarchy setHideToChildren:true startingAt:hierarchy root.
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
      top := StandardSystemView new.
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
      top extent:300@300.
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
      hierarchyV := SelectionInHierarchyView new.
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
      hierarchyV model: hierarchy.
184
13a2f3677c68 showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
    81
      hierarchyV action:[:nr | Transcript show:'selected:'; showCR:nr].
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
      top add:(ScrollableView forView:hierarchyV)
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
    84
	  in:((0.0 @ 0.0 ) corner:( 1.0 @ 1.0)).
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
      top open.
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
    86
									[exEnd]
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
    same, with nice connecting links:
259
f930922963ce commentary - mhmh
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    89
    (sorry - this works only with some fonts - see comment in #getListFromModel)
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
    90
									[exBegin]
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
      |top hierarchy hierarchyV scroller|
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    93
      hierarchy := SelectionInHierarchy new.
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
      hierarchy root:(HierarchyNode newAsTreeFromSmalltalkClass:Object).
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
      hierarchy setHideToChildren:true startingAt:hierarchy root.
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    97
      top := StandardSystemView new.
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    98
      top extent:300@300.
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
      hierarchyV := SelectionInHierarchyView new.
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
      hierarchyV showConnectingLines:true.
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   102
      hierarchyV model: hierarchy.
184
13a2f3677c68 showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   103
      hierarchyV action:[:nr | Transcript show:'selected:'; showCR:nr].
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   104
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
      top add:(ScrollableView forView:hierarchyV)
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   106
	  in:((0.0 @ 0.0 ) corner:( 1.0 @ 1.0)).
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
      top open.
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   108
									[exEnd]
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
"
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
! !
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   111
361
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   112
!SelectionInHierarchyView methodsFor:'accessing - selection'!
252
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   113
254
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   114
selectElement:anObject
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   115
    "select the element with same printString as the argument, anObject"
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   116
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   117
    |index|
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   118
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   119
    index:= 1.
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   120
    list notNil ifTrue:[
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   121
	list do:[:each|
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   122
	  ((each withoutSpaces) = (anObject printString)) ifTrue:[
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   123
	      self selection:index.
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   124
	      ^ index
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   125
	  ].
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   126
	  index:= index + 1.
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   127
	].
254
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   128
    ].
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   129
    ^index
252
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   130
361
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   131
    "Modified: 10.10.1994 / 16:13:39 / W.Olberding"
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   132
    "Modified: 16.4.1997 / 12:40:05 / cg"
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   133
!
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   134
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   135
selection: anIndex
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   136
	"Pass the selection along to the model."
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   137
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   138
	super selection:  anIndex.
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   139
	model selection:  anIndex.
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   140
5160
c946616ee338 #REFACTORING by mawalch
mawalch
parents: 3150
diff changeset
   141
	"Modified: 10.10.94 / 16:13:38 / W.Olberding"
c946616ee338 #REFACTORING by mawalch
mawalch
parents: 3150
diff changeset
   142
!
361
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   143
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   144
selectionIndex: anIndex
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   145
	"Pass the selection along to the model."
361
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   146
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   147
	super selection:  anIndex.
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   148
	model selection:  anIndex.
361
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   149
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   150
	"Modified: 10.10.94 / 16:13:38 / W.Olberding"
361
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   151
! !
252
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   152
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   153
!SelectionInHierarchyView methodsFor:'event handling'!
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
buttonPress:button x:x y:y
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   156
    |oldSelection listLineNr|
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   157
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   158
    ((button == 1) or:[button == #select]) ifTrue:[
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   159
	enabled ifTrue:[
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   160
	    oldSelection := selection.
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   161
	    listLineNr := self visibleLineToListLine:(self visibleLineOfY:y).
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   162
	    (selectConditionBlock isNil or:[selectConditionBlock value:listLineNr]) ifTrue:[
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   163
		listLineNr notNil ifTrue: [
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   164
		    self selectWithoutScroll:listLineNr
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   165
		].
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   166
		((ignoreReselect not and:[selection notNil])
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   167
		 or:[selection ~= oldSelection]) ifTrue:[
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   168
		    "actionBlock notNil ifTrue:[actionBlock value:selection]."
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   169
		    "the ST-80 way of doing things"
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   170
		    model notNil ifTrue:[
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   171
			model perform:#selectionIndex: with:(selection)
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   172
		    ]
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   173
		].
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   174
		clickLine := listLineNr
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   175
	    ]
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   176
	]
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   177
    ] ifFalse:[
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   178
	super buttonPress:button x:x y:y
84
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
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   181
	"Modified: 10.10.94 / 17:13:38 / W.Olberding"
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   182
	"Modified: 08.11.94 / 15:38:43 / R.Sailer"
252
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   183
!
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   184
254
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   185
keyPress:key x:x y:y
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   186
    "a key was pressed - handle [-][+][*] here"
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   187
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   188
    (key == $-)    ifTrue: [^ model collapse].
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   189
    (key == $+)    ifTrue: [^ model expand].
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   190
    (key == $*)    ifTrue: [^ model expandAll].
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   191
    (key == $.)    ifTrue: [^ model collapseAll].
254
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   192
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   193
    super keyPress:key x:x y:y
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   194
5160
c946616ee338 #REFACTORING by mawalch
mawalch
parents: 3150
diff changeset
   195
	"Modified: 10.10.94 / 16:13:38 / W.Olberding"
c946616ee338 #REFACTORING by mawalch
mawalch
parents: 3150
diff changeset
   196
! !
252
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   197
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   198
!SelectionInHierarchyView methodsFor:'initialization'!
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   199
254
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   200
initialize
252
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   201
254
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   202
    super initialize.
361
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   203
254
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   204
    showConnectingLines := true.
361
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   205
    indent := 2.
252
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   206
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   207
    self  doubleClickAction:
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   208
	  [:selection | model doubleClickSelection: selection ].
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   209
	  "this will usualy initiate a hide/show operation"
361
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   210
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   211
    "Modified: 10.10.1994 / 16:13:39 / W.Olberding"
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   212
    "Modified: 16.4.1997 / 12:37:38 / cg"
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   213
!
252
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   214
361
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   215
itemPrintConverter:aBlock
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   216
    "set a converter block, which returns a listEntry
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   217
     for a passed node. If left undefined, an indented string
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   218
     based upon the nodes name is generated."
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   219
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   220
    itemPrintConverter := aBlock
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   221
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   222
    "Modified: 16.4.1997 / 13:06:22 / cg"
252
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   223
!
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   224
254
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   225
showConnectingLines:aBoolean
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   226
    showConnectingLines := aBoolean
252
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   227
! !
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   228
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   229
!SelectionInHierarchyView methodsFor:'model access'!
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   230
254
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   231
getListAttributes
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   232
      "get list attributes (selectable, disabled ...) from model)"
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   233
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   234
       ^Array new: 0.
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   235
5160
c946616ee338 #REFACTORING by mawalch
mawalch
parents: 3150
diff changeset
   236
	"Modified: 10.10.94 / 16:13:38 / W.Olberding"
c946616ee338 #REFACTORING by mawalch
mawalch
parents: 3150
diff changeset
   237
!
254
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   238
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   239
getListFromModel
259
f930922963ce commentary - mhmh
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
   240
    "Get list entries from model.
f930922963ce commentary - mhmh
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
   241
     Answer them as idented Text."
254
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   242
361
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   243
    |listOfNodes itemList textLine treeLevels isLastOnLevel oldLevel
259
f930922963ce commentary - mhmh
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
   244
     blockGraphicCharacters|
254
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   245
259
f930922963ce commentary - mhmh
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
   246
    listOfNodes := model list.
f930922963ce commentary - mhmh
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
   247
    listOfNodes isNil ifTrue:[^ #()].
254
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   248
361
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   249
    itemPrintConverter notNil ifTrue:[
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   250
	"/ externally provided node-to-listentry converter
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   251
	"/ allows hierarchyNodes to be presented in any
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   252
	"/ programmer defined way ...
361
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   253
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   254
	itemList := listOfNodes collect:[:aNode |
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   255
	    itemPrintConverter value:aNode
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   256
	].
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   257
    ] ifFalse:[
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   258
	showConnectingLines ifFalse:[
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   259
	    itemList := listOfNodes collect: [ :aNode |
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   260
		textLine := ReadWriteStream on: String new.
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   261
		aNode level timesRepeat: [
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   262
		    textLine spaces:indent.
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   263
		].
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   264
		textLine nextPutAll: aNode name.
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   265
		aNode isExpandable ifTrue: [
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   266
		    textLine nextPutAll: ' ...'.
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   267
		].
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   268
		textLine contents.
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   269
	    ].
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   270
	] ifTrue:[
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   271
	    "/ claus:
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   272
	    "/ mhmh - the AEG code depends on those blockGraphic
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   273
	    "/        characters being in the font.
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   274
	    "/
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   275
	    "/ how can we find out what characters there are ?
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   276
	    "/ (X maps missing chars to a space).
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   277
	    "/ we should really rewrite this to use a private bitmap font ...
361
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   278
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   279
	    blockGraphicCharacters := Array with:$|
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   280
					    with:$+
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   281
					    with:$+
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   282
					    with:$-.
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   283
361
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   284
    "/        blockGraphicCharacters := Array with:(Character value:25)
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   285
    "/                                        with:(Character value:14)
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   286
    "/                                        with:(Character value:21)
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   287
    "/                                        with:(Character value:18).
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   288
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   289
	    isLastOnLevel:=Set new.
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   290
	    treeLevels:=Set new.
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   291
	    oldLevel:=0.
259
f930922963ce commentary - mhmh
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
   292
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   293
	    listOfNodes reverseDo: [ :aNode |
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   294
		(treeLevels includes:(aNode level)) ifFalse:[
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   295
		    isLastOnLevel add:aNode.
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   296
		    treeLevels add:(aNode level).
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   297
		].
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   298
		aNode level < oldLevel ifTrue:[
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   299
		    treeLevels remove:oldLevel.
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   300
		].
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   301
		oldLevel:=aNode level.
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   302
	    ].
361
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   303
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   304
	    treeLevels:=Set new.
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   305
	    oldLevel:=0.
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   306
	    itemList := listOfNodes collect: [ :aNode |
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   307
		textLine := ReadWriteStream on: String new.
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   308
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   309
		1 to:((aNode level)-1) do: [ :l |
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   310
		    (treeLevels includes:l) ifTrue:[
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   311
			textLine space; nextPut:(blockGraphicCharacters at:1); space.
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   312
		    ]ifFalse:[
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   313
			textLine space; space; space.
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   314
		    ]
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   315
		].
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   316
		treeLevels add:(aNode level).
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   317
		oldLevel:=aNode level.
361
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   318
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   319
		(aNode = (listOfNodes first)) ifFalse:[
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   320
		    textLine space.
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   321
		    (isLastOnLevel includes:aNode)ifTrue:[
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   322
			 textLine nextPut:(blockGraphicCharacters at:2).
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   323
			 treeLevels remove:(aNode level).
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   324
		    ] ifFalse:[
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   325
			textLine nextPut:(blockGraphicCharacters at:3).
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   326
		    ].
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   327
		    textLine nextPut:(blockGraphicCharacters at:4).
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   328
		].
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   329
		aNode isExpandable ifTrue: [
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   330
		    textLine nextPutAll: '[+]'.
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   331
		] ifFalse:[
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   332
		    aNode isCollapsable ifTrue: [
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   333
		       textLine nextPutAll: '[-]'.
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   334
		    ] ifFalse:[
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   335
			textLine nextPut:(blockGraphicCharacters at:4).
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   336
		    ].
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   337
		].
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   338
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   339
		textLine nextPutAll:' ', aNode name.
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   340
		textLine contents.
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   341
	    ].
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   342
	]
259
f930922963ce commentary - mhmh
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
   343
    ].
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   344
361
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   345
   ^itemList
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   346
361
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   347
    "Modified: 10.10.1994 / 16:13:39 / W.Olberding"
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   348
    "Modified: 16.4.1997 / 12:43:20 / cg"
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   349
!
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   350
252
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   351
getSelectionFromModel
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   352
      "Get the current list selection from model. "
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   353
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   354
    ^  model selectionIndex
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   355
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   356
	"Modified: 10.10.94 / 16:13:39 / W.Olberding"
252
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   357
!
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   358
254
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   359
model:aModel
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   360
    super model:aModel.
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   361
    self setNewList
252
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   362
! !
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   363
252
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   364
!SelectionInHierarchyView methodsFor:'private'!
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   365
254
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   366
setNewList
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   367
	"Build a completely new hierarchy list."
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   368
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   369
254
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   370
       self setList: (self getListFromModel).
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   371
"/       self attributes: (self getListAttributes).
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   372
       self selection: (self getSelectionFromModel).
252
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   373
254
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   374
	"Modified: 10.10.94 / 17:13:38 / W.Olberding"
5160
c946616ee338 #REFACTORING by mawalch
mawalch
parents: 3150
diff changeset
   375
	"Modified: 08.11.94 / 15:28:03 / R.Sailer"
c946616ee338 #REFACTORING by mawalch
mawalch
parents: 3150
diff changeset
   376
! !
84
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
!SelectionInHierarchyView methodsFor:'updating'!
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   379
254
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   380
update: aSymbol with:aParameter from:changedObject
5160
c946616ee338 #REFACTORING by mawalch
mawalch
parents: 3150
diff changeset
   381
      "Change my appearance according to the occurred change."
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   382
5160
c946616ee338 #REFACTORING by mawalch
mawalch
parents: 3150
diff changeset
   383
     aSymbol == #list
c946616ee338 #REFACTORING by mawalch
mawalch
parents: 3150
diff changeset
   384
        ifTrue: [^self setNewList].
c946616ee338 #REFACTORING by mawalch
mawalch
parents: 3150
diff changeset
   385
     aSymbol == #selection
c946616ee338 #REFACTORING by mawalch
mawalch
parents: 3150
diff changeset
   386
        ifTrue: [^self selection: self getSelectionFromModel].
c946616ee338 #REFACTORING by mawalch
mawalch
parents: 3150
diff changeset
   387
     aSymbol == #attributes
c946616ee338 #REFACTORING by mawalch
mawalch
parents: 3150
diff changeset
   388
        ifTrue: [].
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   389
5160
c946616ee338 #REFACTORING by mawalch
mawalch
parents: 3150
diff changeset
   390
        "Modified: 10.10.94 / 16:13:38 / W.Olberding"
c946616ee338 #REFACTORING by mawalch
mawalch
parents: 3150
diff changeset
   391
! !
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   392
259
f930922963ce commentary - mhmh
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
   393
!SelectionInHierarchyView class methodsFor:'documentation'!
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   394
252
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   395
version
5160
c946616ee338 #REFACTORING by mawalch
mawalch
parents: 3150
diff changeset
   396
    ^ '$Header$'
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   397
! !
5160
c946616ee338 #REFACTORING by mawalch
mawalch
parents: 3150
diff changeset
   398