Diff3TextView.st
author Claus Gittinger <cg@exept.de>
Tue, 12 Dec 1995 14:47:12 +0100
changeset 277 b4b2782bc733
parent 271 16d2d5f9c31c
child 290 5b9361cfa7b8
permissions -rw-r--r--
documentation
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
271
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"
277
b4b2782bc733 documentation
Claus Gittinger <cg@exept.de>
parents: 271
diff changeset
     2
 COPYRIGHT (c) 1995 by Claus Gittinger
b4b2782bc733 documentation
Claus Gittinger <cg@exept.de>
parents: 271
diff changeset
     3
              All Rights Reserved
271
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
 This software is furnished under a license and may be used
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
 hereby transferred.
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
"
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
ThreeColumnTextView subclass:#Diff3TextView
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
	instanceVariableNames:'useColors showSeparators addedColor addedBgColor removedColor
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
		removedBgColor changedColor changedBgColor'
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
	classVariableNames:''
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	poolDictionaries:''
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	category:'Views-Text'
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
!
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
!Diff3TextView class methodsFor:'documentation'!
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
copyright
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
"
277
b4b2782bc733 documentation
Claus Gittinger <cg@exept.de>
parents: 271
diff changeset
    25
 COPYRIGHT (c) 1995 by Claus Gittinger
b4b2782bc733 documentation
Claus Gittinger <cg@exept.de>
parents: 271
diff changeset
    26
              All Rights Reserved
271
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
 This software is furnished under a license and may be used
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
 only in accordance with the terms of that license and with the
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
 inclusion of the above copyright notice.   This software may not
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
 be provided or otherwise made available to, or used by, any
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
 other person.  No title to or ownership of the software is
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
 hereby transferred.
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
"
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
!
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
documentation
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
"
277
b4b2782bc733 documentation
Claus Gittinger <cg@exept.de>
parents: 271
diff changeset
    39
    a view showing merged diff3 (see rcsmerge / merge unix manual pages) output in a 
271
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
    user-friendly form.
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
    The view is created and opened with:
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
277
b4b2782bc733 documentation
Claus Gittinger <cg@exept.de>
parents: 271
diff changeset
    43
       d := Diff3TextView openOn:text label:l1 label:l2 label:l3.
271
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
277
b4b2782bc733 documentation
Claus Gittinger <cg@exept.de>
parents: 271
diff changeset
    45
    and it will show the 3 versions side-by-side
b4b2782bc733 documentation
Claus Gittinger <cg@exept.de>
parents: 271
diff changeset
    46
    Its main use is for the SourceCodeManager, to show merged sources after
b4b2782bc733 documentation
Claus Gittinger <cg@exept.de>
parents: 271
diff changeset
    47
    a failed checkin.
271
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
"
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
! !
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
!Diff3TextView class methodsFor:'instance creation'!
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
openOnMergedText:text label:firstLabel label:secondLabel label:thirdLabel
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
    "open up a view showing firstText, secondText and thirdText side-by-side,
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
     and labels for all views."
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
    |top v l1 l2 l3|
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
    top := StandardSystemView label:'three texts'.
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
    l1 := Label label:firstLabel in:top.
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
    l1 origin:0.0@0.0 corner:0.33@(l1 height).
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
    l2 := Label label:secondLabel in:top.
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
    l2 origin:0.33@0.0 corner:0.67@(l1 height).
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
    l3 := Label label:thirdLabel in:top.
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
    l3 origin:0.67@0.0 corner:1.0@(l1 height).
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
    v := HVScrollableView 
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
               for:self 
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
               miniScrollerH:true miniScrollerV:false
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
               in:top.
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
    v origin:0.0 @ (l1 height + ViewSpacing) corner:1.0 @ 1.0.
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
    v scrolledView updateListsFromMergedText:text.
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
    ^ top open
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
    "
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
     ThreeColumnTextView
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
        openOn:('smalltalk.rc' asFilename contentsOfEntireFile)
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
        label:'smalltalk.rc'
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
        and:('display.rc' asFilename contentsOfEntireFile)
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
        label:'display.rc'
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
        and:('private.rc' asFilename contentsOfEntireFile)
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
        label:'private.rc'
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
    "
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
    "Modified: 12.12.1995 / 13:09:13 / cg"
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
! !
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
!Diff3TextView methodsFor:'initialization'!
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
initStyle
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
    super initStyle.
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    93
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
    showSeparators := false.
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
    useColors := ColoredListEntry notNil.
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    97
    useColors ifTrue:[
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    98
	device hasColors ifTrue:[
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
	    addedColor := Color black.
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
	    addedBgColor := Color green.
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   102
	    removedColor := Color white.
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   103
	    removedBgColor := Color red.
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   104
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
	    changedColor := Color white.
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   106
	    changedBgColor := Color blue.
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
	] ifFalse:[
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
	    addedBgColor := removedBgColor := changedBgColor := Color black.
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
	    addedColor := removedColor := changedColor := Color white.
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
	]
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   111
    ].
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   112
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   113
    "Created: 16.11.1995 / 16:59:48 / cg"
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   114
    "Modified: 12.12.1995 / 12:25:55 / cg"
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   115
! !
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   116
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   117
!Diff3TextView methodsFor:'private'!
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   118
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   119
updateListsFromMergedText:mergedText
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   120
    "given the merge()/rcsmerge() merged output (as created by 'cvs update'),
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   121
     update my views contents"
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   122
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   123
    |idx1 idx2 idx3 dIdx dEnd state s nr1 nr2 nr3 entry c l1 l2 l3  
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   124
     textView1 textView2 textView3 skip max|
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   125
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   126
    textView1 := textViews at:1.
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   127
    textView2 := textViews at:2.
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   128
    textView3 := textViews at:3.
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   129
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   130
    l1 := OrderedCollection new.
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   131
    l2 := OrderedCollection new.
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   132
    l3 := OrderedCollection new.
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   133
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   134
    idx1 := 1.
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   135
    idx2 := 1.
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   136
    idx3 := 1.
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   137
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   138
    dIdx := 1.
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   139
    dEnd := mergedText size + 1.
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   140
    state := #initial.
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   141
    [dIdx < dEnd] whileTrue:[
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   142
        dIdx == dEnd ifTrue:[
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   143
            "dummy cleanup entry"
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   144
            entry := nil.
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   145
            state := #initial.
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   146
        ] ifFalse:[
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   147
            entry := mergedText at:dIdx.
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   148
            dIdx := dIdx + 1.
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   149
        ].
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   150
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   151
        state == #initial ifTrue:[
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   152
            "
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   153
             fill up to size difference from previous change
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   154
            "
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   155
            max := (l1 size max:l2 size) max:l3 size.
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   156
            [l1 size < max] whileTrue:[
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   157
                l1 add:nil
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   158
            ].
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   159
            [l2 size < max] whileTrue:[
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   160
                l2 add:nil
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   161
            ].
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   162
            [l3 size < max] whileTrue:[
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   163
                l3 add:nil
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   164
            ].
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   165
        
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   166
            "
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   167
             except for the first chunk, add a separating line
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   168
            "
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   169
            l1 size ~~ 0 ifTrue:[
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   170
                showSeparators ifTrue:[
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   171
                    l1 add:'--------'.
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   172
                    l2 add:'--------'.
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   173
                    l3 add:'--------'.
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   174
                ]
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   175
            ].
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   176
        ].
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   177
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   178
        skip := false.
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   179
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   180
        entry notNil ifTrue:[
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   181
            (entry startsWith:'<<<<<<<') ifTrue:[
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   182
                state := 1. skip := true.
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   183
            ] ifFalse:[
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   184
                (entry startsWith:'|||||||') ifTrue:[
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   185
                    state := 2. skip := true.
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   186
                ] ifFalse:[
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   187
                    (entry startsWith:'=======') ifTrue:[
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   188
                        state := 3. skip := true.
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   189
                    ] ifFalse:[
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   190
                        (entry startsWith:'>>>>>>>') ifTrue:[
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   191
                            state := #initial.
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   192
                            skip := true.
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   193
                        ]
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   194
                    ]
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   195
                ]
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   196
            ].
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   197
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   198
            skip ifFalse:[
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   199
                (state == #initial or:[state == 1]) ifTrue:[
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   200
                    (useColors and:[state == 1]) ifTrue:[
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   201
                        l1 add:(ColoredListEntry string:entry foregroundColor:changedColor backgroundColor:changedBgColor).
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   202
                    ] ifFalse:[
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   203
                        l1 add:entry
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   204
                    ]
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   205
                ].
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   206
                (state == #initial or:[state == 2]) ifTrue:[
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   207
                    (useColors and:[state == 2]) ifTrue:[
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   208
                        l2 add:(ColoredListEntry string:entry foregroundColor:changedColor backgroundColor:changedBgColor).
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   209
                    ] ifFalse:[
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   210
                        l2 add:entry
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   211
                    ]
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   212
                ].
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   213
                (state == #initial or:[state == 3]) ifTrue:[
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   214
                    (useColors and:[state == 3]) ifTrue:[
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   215
                        l3 add:(ColoredListEntry string:entry foregroundColor:changedColor backgroundColor:changedBgColor).
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   216
                    ] ifFalse:[
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   217
                        l3 add:entry
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   218
                    ]
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   219
                ].
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   220
            ].
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   221
        ].
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   222
    ].
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   223
        
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   224
    textView1 list:l1.
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   225
    textView2 list:l2.
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   226
    textView3 list:l3.
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   227
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   228
    "Modified: 12.12.1995 / 13:16:08 / cg"
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   229
! !
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   230
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   231
!Diff3TextView class methodsFor:'documentation'!
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   232
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   233
version
277
b4b2782bc733 documentation
Claus Gittinger <cg@exept.de>
parents: 271
diff changeset
   234
^ '$Header: /cvs/stx/stx/libtool/Diff3TextView.st,v 1.2 1995-12-12 13:47:12 cg Exp $'
271
16d2d5f9c31c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   235
! !