RCSConflictEditTextView.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Thu, 14 Jun 2018 22:19:39 +0100
branchjv
changeset 18227 d25a407ba86d
parent 15950 23be8cf85415
permissions -rw-r--r--
Mini testrunner: show "green" if there's at least one pass and rest is pass or skip This is more meaningfull result then showing "gray" if there's at least one skip.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1750
1e7547bc0724 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1749
diff changeset
     1
"
1e7547bc0724 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1749
diff changeset
     2
 COPYRIGHT (c) 1998 by eXept Software AG
1e7547bc0724 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1749
diff changeset
     3
              All Rights Reserved
1e7547bc0724 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1749
diff changeset
     4
1e7547bc0724 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1749
diff changeset
     5
 This software is furnished under a license and may be used
1e7547bc0724 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1749
diff changeset
     6
 only in accordance with the terms of that license and with the
1e7547bc0724 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1749
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
1e7547bc0724 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1749
diff changeset
     8
 be provided or otherwise made available to, or used by, any
1e7547bc0724 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1749
diff changeset
     9
 other person.  No title to or ownership of the software is
1e7547bc0724 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1749
diff changeset
    10
 hereby transferred.
1e7547bc0724 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1749
diff changeset
    11
"
6816
39ecd68cc04a CRLF management
fm
parents: 1750
diff changeset
    12
"{ Package: 'stx:libtool' }"
39ecd68cc04a CRLF management
fm
parents: 1750
diff changeset
    13
15950
23be8cf85415 Bugfix in merge tool.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12650
diff changeset
    14
"{ NameSpace: Smalltalk }"
23be8cf85415 Bugfix in merge tool.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12650
diff changeset
    15
1749
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
EditTextView subclass:#RCSConflictEditTextView
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	instanceVariableNames:''
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	classVariableNames:''
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
	poolDictionaries:''
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
	category:'Views-Text'
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
!
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
!RCSConflictEditTextView class methodsFor:'documentation'!
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
1750
1e7547bc0724 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1749
diff changeset
    25
copyright
1e7547bc0724 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1749
diff changeset
    26
"
1e7547bc0724 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1749
diff changeset
    27
 COPYRIGHT (c) 1998 by eXept Software AG
1e7547bc0724 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1749
diff changeset
    28
              All Rights Reserved
1749
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
1750
1e7547bc0724 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1749
diff changeset
    30
 This software is furnished under a license and may be used
1e7547bc0724 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1749
diff changeset
    31
 only in accordance with the terms of that license and with the
1e7547bc0724 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1749
diff changeset
    32
 inclusion of the above copyright notice.   This software may not
1e7547bc0724 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1749
diff changeset
    33
 be provided or otherwise made available to, or used by, any
1e7547bc0724 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1749
diff changeset
    34
 other person.  No title to or ownership of the software is
1e7547bc0724 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1749
diff changeset
    35
 hereby transferred.
1e7547bc0724 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1749
diff changeset
    36
"
1e7547bc0724 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1749
diff changeset
    37
1e7547bc0724 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1749
diff changeset
    38
!
1e7547bc0724 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1749
diff changeset
    39
1e7547bc0724 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1749
diff changeset
    40
documentation
1e7547bc0724 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1749
diff changeset
    41
"
1e7547bc0724 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1749
diff changeset
    42
    like an editTextView, but adds two buttons to search forward/backward
1e7547bc0724 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1749
diff changeset
    43
    for next change.
1e7547bc0724 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1749
diff changeset
    44
"
1749
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
! !
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
!RCSConflictEditTextView methodsFor:'actions'!
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
moveToNextChanged
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
    "somewhat of a kludge - simply search for the next text-item"
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
    |start end lnNr max list|
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
    start := self lastLineShown + 1.
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
    list := self list.
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
    max  := list size.
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
    lnNr := start.
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
    [(lnNr > max or:[(list at:lnNr) isText])
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
    ] whileFalse:[
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
        lnNr := lnNr + 1
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
    ].
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
    (lnNr <= max) ifTrue:[
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
        (end isNil or:[lnNr < end]) ifTrue:[
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
            end := lnNr.
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
        ]
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
    ].
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
    end notNil ifTrue:[
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
        self scrollToLine:end
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
    ] ifFalse:[
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
        self beep
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
    ].
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
    "Modified: / 27.7.1998 / 12:29:24 / cg"
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
!
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
moveToPreviousChanged
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
    "somewhat of a kludge - simply search for the previous text-item"
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
    |start end found lnNr list|
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
    start := firstLineShown - 1.
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
    end   := 1.
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
    found := false.
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
    start > 1 ifTrue:[
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
        list := self list.
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
        lnNr := list size.
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    93
        lnNr >= start ifTrue:[
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
            lnNr := start
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
        ].
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    97
        [(lnNr == end or:[(list at:lnNr) isText])
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    98
        ] whileFalse:[
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
            lnNr := lnNr - 1
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
        ].
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
        (list at:lnNr) isText ifTrue:[
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   102
            end   := lnNr.
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   103
            found := true.
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   104
            "/ skip multiple text-lines
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
            [end > 1 and:[(list at:(end-1)) isText]] whileTrue:[
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   106
                end := end - 1
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
            ].
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
        ]
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
    ].
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
    found ifTrue:[
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   111
        self scrollToLine:end
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   112
    ] ifFalse:[
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   113
        self beep
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   114
    ]
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   115
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   116
    "Created: / 27.7.1998 / 12:25:34 / cg"
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   117
    "Modified: / 27.7.1998 / 12:31:26 / cg"
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   118
! !
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   119
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   120
!RCSConflictEditTextView methodsFor:'initialization'!
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   121
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   122
initialize
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   123
    |panel buttonPrev buttonNext|
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   124
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   125
    super initialize.
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   126
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   127
"set up-down buttons"
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   128
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   129
    panel := VerticalPanelView in:self.
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   130
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   131
    buttonPrev := Button label:'-' in:panel.
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   132
    buttonNext := Button label:'+' in:panel.
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   133
    buttonPrev extent:15@22.
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   134
    buttonNext extent:15@22.
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   135
    panel origin:0.0 @ 1.0 corner:(15 + SimpleView viewSpacing) @ 1.0.
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   136
    panel topInset:(2 * (buttonPrev preferredExtent y)) negated.
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   137
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   138
"set actions"
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   139
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   140
    buttonPrev pressAction:[
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   141
        buttonPrev turnOff.
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   142
        self moveToPreviousChanged
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   143
    ].
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   144
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   145
    buttonNext pressAction:[
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   146
        buttonNext turnOff.
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   147
        self moveToNextChanged
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   148
    ].
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   149
    self moveToNextChanged.
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   150
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   151
    "Modified: / 27.7.1998 / 12:22:31 / cg"
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   152
! !
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   153
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   154
!RCSConflictEditTextView class methodsFor:'documentation'!
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   155
044c5af08830 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   156
version
12261
b2a507f45d87 - Tools::ChangeSetBrowser2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12125
diff changeset
   157
    ^ '$Id: RCSConflictEditTextView.st 8016 2012-07-18 09:57:46Z vranyj1 $'
b2a507f45d87 - Tools::ChangeSetBrowser2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12125
diff changeset
   158
!
b2a507f45d87 - Tools::ChangeSetBrowser2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12125
diff changeset
   159
12650
e0f607754b9a Merged 18d06283743d and ff31bac2fd1b (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12261
diff changeset
   160
version_HG
e0f607754b9a Merged 18d06283743d and ff31bac2fd1b (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12261
diff changeset
   161
e0f607754b9a Merged 18d06283743d and ff31bac2fd1b (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12261
diff changeset
   162
    ^ '$Changeset: <not expanded> $'
e0f607754b9a Merged 18d06283743d and ff31bac2fd1b (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12261
diff changeset
   163
!
e0f607754b9a Merged 18d06283743d and ff31bac2fd1b (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12261
diff changeset
   164
12261
b2a507f45d87 - Tools::ChangeSetBrowser2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12125
diff changeset
   165
version_SVN
b2a507f45d87 - Tools::ChangeSetBrowser2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12125
diff changeset
   166
    ^ '$Id:: RCSConflictEditTextView.st 8016 2012-07-18 09:57:46Z vranyj1                                                           $'
12125
0c49a3b13e43 Merged with /trunk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12123
diff changeset
   167
! !
12650
e0f607754b9a Merged 18d06283743d and ff31bac2fd1b (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12261
diff changeset
   168