author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Wed, 19 Jul 2017 09:42:32 +0200 | |
branch | jv |
changeset 17619 | edb119820fcb |
parent 15950 | 23be8cf85415 |
permissions | -rw-r--r-- |
1750 | 1 |
" |
2 |
COPYRIGHT (c) 1998 by eXept Software AG |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
6816 | 12 |
"{ Package: 'stx:libtool' }" |
13 |
||
15950 | 14 |
"{ NameSpace: Smalltalk }" |
15 |
||
1749 | 16 |
EditTextView subclass:#RCSConflictEditTextView |
17 |
instanceVariableNames:'' |
|
18 |
classVariableNames:'' |
|
19 |
poolDictionaries:'' |
|
20 |
category:'Views-Text' |
|
21 |
! |
|
22 |
||
23 |
!RCSConflictEditTextView class methodsFor:'documentation'! |
|
24 |
||
1750 | 25 |
copyright |
26 |
" |
|
27 |
COPYRIGHT (c) 1998 by eXept Software AG |
|
28 |
All Rights Reserved |
|
1749 | 29 |
|
1750 | 30 |
This software is furnished under a license and may be used |
31 |
only in accordance with the terms of that license and with the |
|
32 |
inclusion of the above copyright notice. This software may not |
|
33 |
be provided or otherwise made available to, or used by, any |
|
34 |
other person. No title to or ownership of the software is |
|
35 |
hereby transferred. |
|
36 |
" |
|
37 |
||
38 |
! |
|
39 |
||
40 |
documentation |
|
41 |
" |
|
42 |
like an editTextView, but adds two buttons to search forward/backward |
|
43 |
for next change. |
|
44 |
" |
|
1749 | 45 |
! ! |
46 |
||
47 |
!RCSConflictEditTextView methodsFor:'actions'! |
|
48 |
||
49 |
moveToNextChanged |
|
50 |
"somewhat of a kludge - simply search for the next text-item" |
|
51 |
||
52 |
|start end lnNr max list| |
|
53 |
||
54 |
start := self lastLineShown + 1. |
|
55 |
||
56 |
list := self list. |
|
57 |
max := list size. |
|
58 |
lnNr := start. |
|
59 |
||
60 |
[(lnNr > max or:[(list at:lnNr) isText]) |
|
61 |
] whileFalse:[ |
|
62 |
lnNr := lnNr + 1 |
|
63 |
]. |
|
64 |
||
65 |
(lnNr <= max) ifTrue:[ |
|
66 |
(end isNil or:[lnNr < end]) ifTrue:[ |
|
67 |
end := lnNr. |
|
68 |
] |
|
69 |
]. |
|
70 |
||
71 |
end notNil ifTrue:[ |
|
72 |
self scrollToLine:end |
|
73 |
] ifFalse:[ |
|
74 |
self beep |
|
75 |
]. |
|
76 |
||
77 |
"Modified: / 27.7.1998 / 12:29:24 / cg" |
|
78 |
! |
|
79 |
||
80 |
moveToPreviousChanged |
|
81 |
"somewhat of a kludge - simply search for the previous text-item" |
|
82 |
||
83 |
|start end found lnNr list| |
|
84 |
||
85 |
start := firstLineShown - 1. |
|
86 |
end := 1. |
|
87 |
found := false. |
|
88 |
||
89 |
start > 1 ifTrue:[ |
|
90 |
list := self list. |
|
91 |
lnNr := list size. |
|
92 |
||
93 |
lnNr >= start ifTrue:[ |
|
94 |
lnNr := start |
|
95 |
]. |
|
96 |
||
97 |
[(lnNr == end or:[(list at:lnNr) isText]) |
|
98 |
] whileFalse:[ |
|
99 |
lnNr := lnNr - 1 |
|
100 |
]. |
|
101 |
(list at:lnNr) isText ifTrue:[ |
|
102 |
end := lnNr. |
|
103 |
found := true. |
|
104 |
"/ skip multiple text-lines |
|
105 |
[end > 1 and:[(list at:(end-1)) isText]] whileTrue:[ |
|
106 |
end := end - 1 |
|
107 |
]. |
|
108 |
] |
|
109 |
]. |
|
110 |
found ifTrue:[ |
|
111 |
self scrollToLine:end |
|
112 |
] ifFalse:[ |
|
113 |
self beep |
|
114 |
] |
|
115 |
||
116 |
"Created: / 27.7.1998 / 12:25:34 / cg" |
|
117 |
"Modified: / 27.7.1998 / 12:31:26 / cg" |
|
118 |
! ! |
|
119 |
||
120 |
!RCSConflictEditTextView methodsFor:'initialization'! |
|
121 |
||
122 |
initialize |
|
123 |
|panel buttonPrev buttonNext| |
|
124 |
||
125 |
super initialize. |
|
126 |
||
127 |
"set up-down buttons" |
|
128 |
||
129 |
panel := VerticalPanelView in:self. |
|
130 |
||
131 |
buttonPrev := Button label:'-' in:panel. |
|
132 |
buttonNext := Button label:'+' in:panel. |
|
133 |
buttonPrev extent:15@22. |
|
134 |
buttonNext extent:15@22. |
|
135 |
panel origin:0.0 @ 1.0 corner:(15 + SimpleView viewSpacing) @ 1.0. |
|
136 |
panel topInset:(2 * (buttonPrev preferredExtent y)) negated. |
|
137 |
||
138 |
"set actions" |
|
139 |
||
140 |
buttonPrev pressAction:[ |
|
141 |
buttonPrev turnOff. |
|
142 |
self moveToPreviousChanged |
|
143 |
]. |
|
144 |
||
145 |
buttonNext pressAction:[ |
|
146 |
buttonNext turnOff. |
|
147 |
self moveToNextChanged |
|
148 |
]. |
|
149 |
self moveToNextChanged. |
|
150 |
||
151 |
"Modified: / 27.7.1998 / 12:22:31 / cg" |
|
152 |
! ! |
|
153 |
||
154 |
!RCSConflictEditTextView class methodsFor:'documentation'! |
|
155 |
||
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 | 167 |
! ! |
12650
e0f607754b9a
Merged 18d06283743d and ff31bac2fd1b (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12261
diff
changeset
|
168 |