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