author | fm |
Thu, 08 Oct 2009 14:02:18 +0200 | |
changeset 330 | 351c6e8eba56 |
parent 210 | 7640b1431703 |
child 403 | 7358e44af42e |
permissions | -rw-r--r-- |
9 | 1 |
"{ Package: 'cvut:stx/goodies/libsvn' }" |
2 |
||
3 |
"{ NameSpace: SVN }" |
|
4 |
||
5 |
Browser subclass:#WorkingCopyBrowser |
|
6 |
instanceVariableNames:'' |
|
7 |
classVariableNames:'' |
|
8 |
poolDictionaries:'' |
|
9 |
category:'SVN-UI-Browsers' |
|
10 |
! |
|
11 |
||
12 |
||
13 |
!WorkingCopyBrowser class methodsFor:'interface specs'! |
|
14 |
||
15 |
windowSpec |
|
16 |
"This resource specification was automatically generated |
|
17 |
by the UIPainter of ST/X." |
|
18 |
||
19 |
"Do not manually edit this!! If it is corrupted, |
|
20 |
the UIPainter may not be able to read the specification." |
|
21 |
||
22 |
" |
|
23 |
UIPainter new openOnClass:SVN::WCStatusApp andSelector:#windowSpec |
|
24 |
SVN::WCStatusApp new openInterface:#windowSpec |
|
25 |
SVN::WCStatusApp open |
|
26 |
" |
|
27 |
||
28 |
<resource: #canvas> |
|
29 |
||
30 |
^ |
|
31 |
#(FullSpec |
|
32 |
name: windowSpec |
|
33 |
window: |
|
34 |
(WindowSpec |
|
35 |
label: 'Working Copy Status' |
|
36 |
name: 'Working Copy Status' |
|
37 |
min: (Point 10 10) |
|
38 |
bounds: (Rectangle 0 0 300 300) |
|
39 |
) |
|
40 |
component: |
|
41 |
(SpecCollection |
|
42 |
collection: ( |
|
43 |
(DataSetSpec |
|
44 |
name: 'WCEntryTable' |
|
45 |
layout: (LayoutFrame 0 0 0 0 0 1 -30 1) |
|
46 |
model: selectionHolder |
|
47 |
menu: workingCopyEntryMenu |
|
48 |
hasHorizontalScrollBar: true |
|
49 |
hasVerticalScrollBar: true |
|
50 |
dataList: workingCopyEntriesAspect |
|
51 |
useIndex: false |
|
52 |
columnHolder: wcEntryTableColumns |
|
53 |
) |
|
54 |
(CheckBoxSpec |
|
55 |
label: 'Show only changed etries' |
|
56 |
name: 'ShowOnlyChanged' |
|
57 |
layout: (LayoutFrame 0 0 -30 1 0 1 0 1) |
|
58 |
model: showOnlyChanged |
|
59 |
translateLabel: true |
|
60 |
) |
|
61 |
) |
|
62 |
||
63 |
) |
|
64 |
) |
|
65 |
||
66 |
"Modified: / 22-10-2008 / 11:30:58 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
67 |
! ! |
|
68 |
||
69 |
!WorkingCopyBrowser class methodsFor:'menu specs'! |
|
70 |
||
71 |
workingCopyEntryMenu |
|
72 |
"This resource specification was automatically generated |
|
73 |
by the MenuEditor of ST/X." |
|
74 |
||
75 |
"Do not manually edit this!! If it is corrupted, |
|
76 |
the MenuEditor may not be able to read the specification." |
|
77 |
||
78 |
" |
|
79 |
MenuEditor new openOnClass:SVN::WCStatusApp andSelector:#workingCopyEntryMenu |
|
80 |
(Menu new fromLiteralArrayEncoding:(SVN::WCStatusApp workingCopyEntryMenu)) startUp |
|
81 |
" |
|
82 |
||
83 |
<resource: #menu> |
|
84 |
||
85 |
^ |
|
86 |
#(Menu |
|
87 |
( |
|
88 |
(MenuItem |
|
89 |
label: 'Show changes (against HEAD)' |
|
90 |
itemValue: menuActionShowChangesAgainstHEAD |
|
91 |
translateLabel: true |
|
92 |
labelImage: (ResourceRetriever #'SVN::IconLibrary' compare 'Show changes (against HEAD)') |
|
93 |
) |
|
94 |
(MenuItem |
|
95 |
label: 'Show changes' |
|
96 |
itemValue: menuActionShowChanges |
|
97 |
translateLabel: true |
|
98 |
labelImage: (ResourceRetriever #'SVN::IconLibrary' compare 'Show changes') |
|
99 |
) |
|
100 |
) |
|
101 |
nil |
|
102 |
nil |
|
103 |
) |
|
104 |
||
105 |
"Modified: / 19-04-2008 / 13:13:43 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
106 |
! ! |
|
107 |
||
108 |
!WorkingCopyBrowser class methodsFor:'plugIn spec'! |
|
109 |
||
110 |
aspectSelectors |
|
111 |
"This resource specification was automatically generated |
|
112 |
by the UIPainter of ST/X." |
|
113 |
||
114 |
"Do not manually edit this. If it is corrupted, |
|
115 |
the UIPainter may not be able to read the specification." |
|
116 |
||
117 |
"Return a description of exported aspects; |
|
118 |
these can be connected to aspects of an embedding application |
|
119 |
(if this app is embedded in a subCanvas)." |
|
120 |
||
121 |
^ #( |
|
122 |
#model |
|
123 |
). |
|
124 |
||
125 |
"Modified: / 21-10-2008 / 18:53:15 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
126 |
! ! |
|
127 |
||
128 |
!WorkingCopyBrowser class methodsFor:'tableColumns specs'! |
|
129 |
||
130 |
wcEntryTableColumns |
|
131 |
"This resource specification was automatically generated |
|
132 |
by the DataSetBuilder of ST/X." |
|
133 |
||
134 |
"Do not manually edit this!! If it is corrupted, |
|
135 |
the DataSetBuilder may not be able to read the specification." |
|
136 |
||
137 |
" |
|
138 |
DataSetBuilder new openOnClass:SVN::WorkingCopyStatusUI andSelector:#wcEntryTableColumns |
|
139 |
" |
|
140 |
||
141 |
<resource: #tableColumns> |
|
142 |
||
143 |
^#( |
|
144 |
(DataSetColumnSpec |
|
145 |
label: '' |
|
146 |
activeHelpKey: '' |
|
147 |
labelButtonType: Button |
|
148 |
printSelector: statusIcon |
|
149 |
canSelect: false |
|
150 |
showRowSeparator: false |
|
151 |
showColSeparator: false |
|
152 |
) |
|
153 |
(DataSetColumnSpec |
|
154 |
label: 'Container' |
|
155 |
activeHelpKey: '' |
|
156 |
labelButtonType: Button |
|
157 |
printSelector: pathText |
|
158 |
canSelect: false |
|
159 |
showRowSeparator: false |
|
160 |
showColSeparator: false |
|
161 |
) |
|
162 |
(DataSetColumnSpec |
|
163 |
label: 'Rev' |
|
164 |
activeHelpKey: '' |
|
165 |
labelButtonType: Button |
|
166 |
printSelector: revision |
|
167 |
canSelect: false |
|
168 |
showRowSeparator: false |
|
169 |
showColSeparator: false |
|
170 |
) |
|
171 |
(DataSetColumnSpec |
|
172 |
label: 'Author' |
|
173 |
activeHelpKey: '' |
|
174 |
labelButtonType: Button |
|
175 |
printSelector: author |
|
176 |
canSelect: false |
|
177 |
showRowSeparator: false |
|
178 |
showColSeparator: false |
|
179 |
) |
|
180 |
(DataSetColumnSpec |
|
181 |
label: 'Date' |
|
182 |
activeHelpKey: '' |
|
183 |
labelButtonType: Button |
|
184 |
printSelector: date |
|
185 |
canSelect: false |
|
186 |
showRowSeparator: false |
|
187 |
showColSeparator: false |
|
188 |
) |
|
189 |
) |
|
190 |
||
191 |
"Modified: / 18-08-2009 / 14:31:10 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
192 |
! ! |
|
193 |
||
194 |
!WorkingCopyBrowser methodsFor:'accessing'! |
|
195 |
||
196 |
workingCopy |
|
197 |
||
198 |
^self model |
|
199 |
||
200 |
"Created: / 11-04-2008 / 10:20:36 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
201 |
"Modified: / 12-04-2008 / 21:02:26 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
202 |
! |
|
203 |
||
204 |
workingCopy: aWorkingCopy |
|
205 |
||
206 |
self model: aWorkingCopy |
|
207 |
||
208 |
"Created: / 11-04-2008 / 10:20:22 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
209 |
"Modified: / 12-04-2008 / 21:02:34 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
210 |
! ! |
|
211 |
||
212 |
!WorkingCopyBrowser methodsFor:'aspects'! |
|
213 |
||
214 |
showOnlyChanged |
|
215 |
||
216 |
|holder| |
|
217 |
||
218 |
(holder := builder bindingAt:#showOnlyChanged) isNil ifTrue:[ |
|
219 |
holder := true asValue. |
|
220 |
holder onChangeEvaluate: |
|
221 |
[self model changed]. |
|
222 |
builder aspectAt:#showOnlyChanged put:holder. |
|
223 |
]. |
|
224 |
^ holder. |
|
225 |
||
226 |
"Created: / 21-10-2008 / 18:53:39 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
227 |
! |
|
228 |
||
229 |
workingCopyEntriesAspect |
|
230 |
||
231 |
||
232 |
|holder| |
|
233 |
||
234 |
(holder := builder bindingAt:#workingCopyEntriesAspect) isNil ifTrue:[ |
|
235 |
holder := (PluggableAdaptor on: self modelHolder) |
|
236 |
getBlock:[:model|self workingCopyEntries] |
|
237 |
putBlock:[:model :value|self error:'Should never be sent'] |
|
238 |
updateBlock:[:model :aspect :value|true]. |
|
239 |
builder aspectAt:#workingCopyEntriesAspect put:holder. |
|
240 |
]. |
|
241 |
^ holder. |
|
242 |
||
243 |
"Created: / 11-04-2008 / 10:24:40 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
244 |
"Modified: / 21-10-2008 / 18:55:05 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
245 |
! ! |
|
246 |
||
247 |
!WorkingCopyBrowser methodsFor:'hooks'! |
|
248 |
||
249 |
commonPostBuild |
|
250 |
||
251 |
^self model changed |
|
252 |
||
253 |
"Created: / 11-04-2008 / 10:33:10 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
254 |
"Modified: / 12-04-2008 / 21:05:05 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
255 |
! ! |
|
256 |
||
257 |
!WorkingCopyBrowser methodsFor:'menu actions'! |
|
258 |
||
259 |
menuActionShowChanges |
|
260 |
||
261 |
| entry log revision | |
|
262 |
entry := self selection. |
|
263 |
log := self model branch log: entry path. |
|
264 |
revision := SVN::RevisionSelectionDialog openOn: log. |
|
265 |
revision ifNotNil: |
|
266 |
[self menuActionShowChangesAgainst: revision] |
|
267 |
||
268 |
"Modified: / 22-10-2008 / 11:31:16 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
269 |
! |
|
270 |
||
271 |
menuActionShowChangesAgainst: rev |
|
272 |
||
273 |
| wc entry wcChangeSet repoChangeSet | |
|
274 |
wc := self model. |
|
275 |
entry := self selection. |
|
276 |
wcChangeSet := wc changeSetForContainer: entry path. |
|
277 |
repoChangeSet := wc branch changeSetForContainer: entry path revision: rev. |
|
278 |
Tools::SmalltalkDiffTool |
|
279 |
openOnDiffSet: (wcChangeSet diffSetsAgainst: repoChangeSet) |
|
280 |
labelA: 'Working copy' |
|
281 |
labelB: 'Revision ', rev printString |
|
282 |
title: 'Changes for ', entry path |
|
283 |
||
284 |
"Created: / 09-10-2008 / 20:14:24 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
285 |
"Modified: / 09-08-2009 / 14:14:21 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
286 |
! |
|
287 |
||
288 |
menuActionShowChangesAgainstHEAD |
|
289 |
||
290 |
self menuActionShowChangesAgainst: SVN::Revision head |
|
291 |
||
292 |
"Modified: / 09-10-2008 / 20:30:39 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
293 |
! ! |
|
294 |
||
295 |
!WorkingCopyBrowser methodsFor:'private'! |
|
296 |
||
297 |
workingCopyEntries |
|
298 |
| status | |
|
299 |
||
300 |
status := self model status. |
|
301 |
^ self showOnlyChanged value |
|
302 |
ifTrue: [ status reject: [:entry | entry status isNormal ] ] |
|
303 |
ifFalse: [ status ] |
|
304 |
||
305 |
"Created: / 21-10-2008 / 18:55:34 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
306 |
"Modified: / 18-08-2009 / 09:12:04 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
307 |
! ! |
|
308 |
||
309 |
!WorkingCopyBrowser class methodsFor:'documentation'! |
|
310 |
||
311 |
version |
|
312 |
^ '$Header$' |
|
210 | 313 |
! |
314 |
||
315 |
version_CVS |
|
316 |
^ '$Header$' |
|
317 |
! |
|
318 |
||
319 |
version_SVN |
|
330
351c6e8eba56
update #version_SVN with § as keyword expansion character
fm
parents:
210
diff
changeset
|
320 |
^'§Id: SVN__WorkingCopyBrowser.st 110 2009-08-19 13:21:10Z vranyj1 §' |
9 | 321 |
! ! |