7006
|
1 |
"{ Package: 'stx:libtool' }"
|
|
2 |
|
|
3 |
"{ NameSpace: Tools }"
|
|
4 |
|
|
5 |
ApplicationModel subclass:#StoreProjectBrowser
|
|
6 |
instanceVariableNames:'connection commentTextHolder packagesList selectedVersionHolder
|
|
7 |
versionsList selectedPackageHolder packagesFilterHolder
|
|
8 |
infoLabelHolder'
|
|
9 |
classVariableNames:''
|
|
10 |
poolDictionaries:''
|
|
11 |
category:'System-SourceCodeManagement'
|
|
12 |
!
|
|
13 |
|
|
14 |
!StoreProjectBrowser class methodsFor:'documentation'!
|
|
15 |
|
|
16 |
documentation
|
|
17 |
"
|
|
18 |
documentation to be added.
|
|
19 |
|
|
20 |
[author:]
|
|
21 |
cg (cg@FUSI)
|
|
22 |
|
|
23 |
[instance variables:]
|
|
24 |
|
|
25 |
[class variables:]
|
|
26 |
|
|
27 |
[see also:]
|
|
28 |
|
|
29 |
"
|
|
30 |
!
|
|
31 |
|
|
32 |
examples
|
|
33 |
"
|
|
34 |
Starting the application:
|
|
35 |
[exBegin]
|
|
36 |
Tools::StoreProjectBrowser open
|
|
37 |
|
|
38 |
[exEnd]
|
|
39 |
|
|
40 |
more examples to be added:
|
|
41 |
[exBegin]
|
|
42 |
... add code fragment for
|
|
43 |
... executable example here ...
|
|
44 |
[exEnd]
|
|
45 |
"
|
|
46 |
!
|
|
47 |
|
|
48 |
history
|
|
49 |
"Created: / 26-08-2006 / 12:45:08 / cg"
|
|
50 |
! !
|
|
51 |
|
|
52 |
!StoreProjectBrowser class methodsFor:'interface specs'!
|
|
53 |
|
|
54 |
windowSpec
|
|
55 |
"This resource specification was automatically generated
|
|
56 |
by the UIPainter of ST/X."
|
|
57 |
|
|
58 |
"Do not manually edit this!! If it is corrupted,
|
|
59 |
the UIPainter may not be able to read the specification."
|
|
60 |
|
|
61 |
"
|
|
62 |
UIPainter new openOnClass:Tools::StoreProjectBrowser andSelector:#windowSpec
|
|
63 |
Tools::StoreProjectBrowser new openInterface:#windowSpec
|
|
64 |
Tools::StoreProjectBrowser open
|
|
65 |
"
|
|
66 |
|
|
67 |
<resource: #canvas>
|
|
68 |
|
|
69 |
^
|
|
70 |
#(FullSpec
|
|
71 |
name: windowSpec
|
|
72 |
window:
|
|
73 |
(WindowSpec
|
|
74 |
label: 'Tools::StoreProjectBrowser'
|
|
75 |
name: 'Tools::StoreProjectBrowser'
|
|
76 |
min: (Point 10 10)
|
|
77 |
max: (Point 1024 768)
|
|
78 |
bounds: (Rectangle 0 0 527 369)
|
|
79 |
menu: mainMenu
|
|
80 |
)
|
|
81 |
component:
|
|
82 |
(SpecCollection
|
|
83 |
collection: (
|
|
84 |
(VariableHorizontalPanelSpec
|
|
85 |
name: 'VariableHorizontalPanel1'
|
|
86 |
layout: (LayoutFrame 0 0 0 0 0 1 -30 1)
|
|
87 |
snapMode: both
|
|
88 |
handlePosition: right
|
|
89 |
component:
|
|
90 |
(SpecCollection
|
|
91 |
collection: (
|
|
92 |
(ViewSpec
|
|
93 |
name: 'Box1'
|
|
94 |
component:
|
|
95 |
(SpecCollection
|
|
96 |
collection: (
|
|
97 |
(LabelSpec
|
|
98 |
label: 'Bundles and Packages:'
|
|
99 |
name: 'Label1'
|
|
100 |
layout: (LayoutFrame 0 0 0 0 0 1 30 0)
|
|
101 |
translateLabel: true
|
|
102 |
adjust: left
|
|
103 |
)
|
|
104 |
(InputFieldSpec
|
|
105 |
name: 'EntryField1'
|
|
106 |
layout: (LayoutFrame 2 0 30 0 -2 1 58 0)
|
|
107 |
model: packagesFilterHolder
|
|
108 |
immediateAccept: true
|
|
109 |
acceptOnReturn: true
|
|
110 |
acceptOnTab: true
|
|
111 |
acceptOnLostFocus: true
|
|
112 |
acceptOnPointerLeave: false
|
|
113 |
)
|
|
114 |
(SequenceViewSpec
|
|
115 |
name: 'List1'
|
|
116 |
layout: (LayoutFrame 0 0 60 0 0 1 0 1)
|
|
117 |
model: selectedPackageHolder
|
|
118 |
hasHorizontalScrollBar: true
|
|
119 |
hasVerticalScrollBar: true
|
|
120 |
useIndex: true
|
|
121 |
sequenceList: packagesList
|
|
122 |
)
|
|
123 |
)
|
|
124 |
|
|
125 |
)
|
|
126 |
)
|
|
127 |
(ViewSpec
|
|
128 |
name: 'Box3'
|
|
129 |
component:
|
|
130 |
(SpecCollection
|
|
131 |
collection: (
|
|
132 |
(LabelSpec
|
|
133 |
label: 'Versions:'
|
|
134 |
name: 'Label2'
|
|
135 |
layout: (LayoutFrame 0 0 0 0 0 1 30 0)
|
|
136 |
translateLabel: true
|
|
137 |
adjust: left
|
|
138 |
)
|
|
139 |
(VariableVerticalPanelSpec
|
|
140 |
name: 'VariableVerticalPanel1'
|
|
141 |
layout: (LayoutFrame 0 0 30 0 0 1 0 1)
|
|
142 |
component:
|
|
143 |
(SpecCollection
|
|
144 |
collection: (
|
|
145 |
(SequenceViewSpec
|
|
146 |
name: 'VersionsList'
|
|
147 |
model: selectedVersionHolder
|
|
148 |
hasHorizontalScrollBar: true
|
|
149 |
hasVerticalScrollBar: true
|
|
150 |
useIndex: true
|
|
151 |
sequenceList: versionsList
|
|
152 |
)
|
|
153 |
(ViewSpec
|
|
154 |
name: 'Box2'
|
|
155 |
component:
|
|
156 |
(SpecCollection
|
|
157 |
collection: (
|
|
158 |
(LabelSpec
|
|
159 |
label: 'Comment:'
|
|
160 |
name: 'Label3'
|
|
161 |
layout: (LayoutFrame 0 0 0 0 0 1 30 0)
|
|
162 |
translateLabel: true
|
|
163 |
adjust: left
|
|
164 |
)
|
|
165 |
(TextEditorSpec
|
|
166 |
name: 'CommentTextEditor'
|
|
167 |
layout: (LayoutFrame 0 0 30 0 0 1 -1 1)
|
|
168 |
model: commentTextHolder
|
|
169 |
hasHorizontalScrollBar: true
|
|
170 |
hasVerticalScrollBar: true
|
|
171 |
)
|
|
172 |
)
|
|
173 |
|
|
174 |
)
|
|
175 |
)
|
|
176 |
)
|
|
177 |
|
|
178 |
)
|
|
179 |
handles: (Any 0.5 1.0)
|
|
180 |
)
|
|
181 |
)
|
|
182 |
|
|
183 |
)
|
|
184 |
)
|
|
185 |
)
|
|
186 |
|
|
187 |
)
|
|
188 |
handles: (Any 0.5 1.0)
|
|
189 |
)
|
|
190 |
(LabelSpec
|
|
191 |
name: 'InfoLabel'
|
|
192 |
layout: (LayoutFrame 2 0 -28 1 -1 1 -1 1)
|
|
193 |
level: -1
|
|
194 |
translateLabel: true
|
|
195 |
labelChannel: infoLabelHolder
|
|
196 |
adjust: left
|
|
197 |
)
|
|
198 |
)
|
|
199 |
|
|
200 |
)
|
|
201 |
)
|
|
202 |
! !
|
|
203 |
|
|
204 |
!StoreProjectBrowser class methodsFor:'internationalization'!
|
|
205 |
|
|
206 |
resourcePackName
|
|
207 |
^ 'StoreProjectBrowser'
|
|
208 |
! !
|
|
209 |
|
|
210 |
!StoreProjectBrowser class methodsFor:'menu specs'!
|
|
211 |
|
|
212 |
mainMenu
|
|
213 |
"This resource specification was automatically generated
|
|
214 |
by the MenuEditor of ST/X."
|
|
215 |
|
|
216 |
"Do not manually edit this!! If it is corrupted,
|
|
217 |
the MenuEditor may not be able to read the specification."
|
|
218 |
|
|
219 |
"
|
|
220 |
MenuEditor new openOnClass:Tools::StoreProjectBrowser andSelector:#mainMenu
|
|
221 |
(Menu new fromLiteralArrayEncoding:(Tools::StoreProjectBrowser mainMenu)) startUp
|
|
222 |
"
|
|
223 |
|
|
224 |
<resource: #menu>
|
|
225 |
|
|
226 |
^
|
|
227 |
#(Menu
|
|
228 |
(
|
|
229 |
(MenuItem
|
|
230 |
label: 'File'
|
|
231 |
translateLabel: true
|
|
232 |
submenu:
|
|
233 |
(Menu
|
|
234 |
(
|
|
235 |
(MenuItem
|
|
236 |
label: 'Fileout As...'
|
|
237 |
itemValue: menuFileoutAs
|
|
238 |
translateLabel: true
|
|
239 |
)
|
|
240 |
(MenuItem
|
|
241 |
label: '-'
|
|
242 |
)
|
|
243 |
(MenuItem
|
|
244 |
label: 'Update'
|
|
245 |
itemValue: menuUpdate
|
|
246 |
translateLabel: true
|
|
247 |
)
|
|
248 |
(MenuItem
|
|
249 |
label: '-'
|
|
250 |
)
|
|
251 |
(MenuItem
|
|
252 |
label: 'Exit'
|
|
253 |
itemValue: closeRequest
|
|
254 |
translateLabel: true
|
|
255 |
)
|
|
256 |
)
|
|
257 |
nil
|
|
258 |
nil
|
|
259 |
)
|
|
260 |
)
|
|
261 |
(MenuItem
|
|
262 |
label: 'Help'
|
|
263 |
translateLabel: true
|
|
264 |
startGroup: right
|
|
265 |
submenu:
|
|
266 |
(Menu
|
|
267 |
(
|
|
268 |
(MenuItem
|
|
269 |
label: 'Documentation'
|
|
270 |
itemValue: openDocumentation
|
|
271 |
translateLabel: true
|
|
272 |
)
|
|
273 |
(MenuItem
|
|
274 |
label: '-'
|
|
275 |
)
|
|
276 |
(MenuItem
|
|
277 |
label: 'About this Application...'
|
|
278 |
itemValue: openAboutThisApplication
|
|
279 |
translateLabel: true
|
|
280 |
)
|
|
281 |
)
|
|
282 |
nil
|
|
283 |
nil
|
|
284 |
)
|
|
285 |
)
|
|
286 |
)
|
|
287 |
nil
|
|
288 |
nil
|
|
289 |
)
|
|
290 |
! !
|
|
291 |
|
|
292 |
!StoreProjectBrowser class methodsFor:'startup'!
|
|
293 |
|
|
294 |
openOn:aDBInfo
|
|
295 |
|newApp|
|
|
296 |
|
|
297 |
newApp := self new.
|
|
298 |
newApp allButOpen.
|
|
299 |
newApp dbInfo:aDBInfo.
|
|
300 |
newApp open.
|
|
301 |
^ newApp
|
|
302 |
! !
|
|
303 |
|
|
304 |
!StoreProjectBrowser methodsFor:'aspects'!
|
|
305 |
|
|
306 |
commentTextHolder
|
|
307 |
"automatically generated by UIPainter ..."
|
|
308 |
|
|
309 |
"*** the code below creates a default model when invoked."
|
|
310 |
"*** (which may not be the one you wanted)"
|
|
311 |
"*** Please change as required and accept it in the browser."
|
|
312 |
"*** (and replace this comment by something more useful ;-)"
|
|
313 |
|
|
314 |
commentTextHolder isNil ifTrue:[
|
|
315 |
commentTextHolder := '' asValue.
|
|
316 |
"/ if your app needs to be notified of changes, uncomment one of the lines below:
|
|
317 |
"/ commentTextHolder addDependent:self.
|
|
318 |
"/ commentTextHolder onChangeSend:#commentTextHolderChanged to:self.
|
|
319 |
].
|
|
320 |
^ commentTextHolder.
|
|
321 |
!
|
|
322 |
|
|
323 |
infoLabelHolder
|
|
324 |
"automatically generated by UIPainter ..."
|
|
325 |
|
|
326 |
"*** the code below creates a default model when invoked."
|
|
327 |
"*** (which may not be the one you wanted)"
|
|
328 |
"*** Please change as required and accept it in the browser."
|
|
329 |
"*** (and replace this comment by something more useful ;-)"
|
|
330 |
|
|
331 |
infoLabelHolder isNil ifTrue:[
|
|
332 |
infoLabelHolder := ValueHolder new.
|
|
333 |
"/ if your app needs to be notified of changes, uncomment one of the lines below:
|
|
334 |
"/ infoLabelHolder addDependent:self.
|
|
335 |
"/ infoLabelHolder onChangeSend:#infoLabelHolderChanged to:self.
|
|
336 |
].
|
|
337 |
^ infoLabelHolder.
|
|
338 |
!
|
|
339 |
|
|
340 |
packagesFilterHolder
|
|
341 |
"automatically generated by UIPainter ..."
|
|
342 |
|
|
343 |
"*** the code below creates a default model when invoked."
|
|
344 |
"*** (which may not be the one you wanted)"
|
|
345 |
"*** Please change as required and accept it in the browser."
|
|
346 |
"*** (and replace this comment by something more useful ;-)"
|
|
347 |
|
|
348 |
packagesFilterHolder isNil ifTrue:[
|
|
349 |
packagesFilterHolder := ValueHolder new.
|
|
350 |
"/ if your app needs to be notified of changes, uncomment one of the lines below:
|
|
351 |
"/ packagesFilterHolder addDependent:self.
|
|
352 |
"/ packagesFilterHolder onChangeSend:#packagesFilterHolderChanged to:self.
|
|
353 |
].
|
|
354 |
^ packagesFilterHolder.
|
|
355 |
!
|
|
356 |
|
|
357 |
packagesList
|
|
358 |
"automatically generated by UIPainter ..."
|
|
359 |
|
|
360 |
"*** the code below creates a default model when invoked."
|
|
361 |
"*** (which may not be the one you wanted)"
|
|
362 |
"*** Please change as required and accept it in the browser."
|
|
363 |
"*** (and replace this comment by something more useful ;-)"
|
|
364 |
|
|
365 |
packagesList isNil ifTrue:[
|
|
366 |
packagesList := ValueHolder new.
|
|
367 |
"/ if your app needs to be notified of changes, uncomment one of the lines below:
|
|
368 |
"/ packagesList addDependent:self.
|
|
369 |
"/ packagesList onChangeSend:#packagesListChanged to:self.
|
|
370 |
].
|
|
371 |
^ packagesList.
|
|
372 |
!
|
|
373 |
|
|
374 |
selectedPackageHolder
|
|
375 |
"automatically generated by UIPainter ..."
|
|
376 |
|
|
377 |
"*** the code below creates a default model when invoked."
|
|
378 |
"*** (which may not be the one you wanted)"
|
|
379 |
"*** Please change as required and accept it in the browser."
|
|
380 |
"*** (and replace this comment by something more useful ;-)"
|
|
381 |
|
|
382 |
selectedPackageHolder isNil ifTrue:[
|
|
383 |
selectedPackageHolder := ValueHolder new.
|
|
384 |
"/ if your app needs to be notified of changes, uncomment one of the lines below:
|
|
385 |
"/ selectedPackageHolder addDependent:self.
|
|
386 |
"/ selectedPackageHolder onChangeSend:#selectedPackageHolderChanged to:self.
|
|
387 |
].
|
|
388 |
^ selectedPackageHolder.
|
|
389 |
!
|
|
390 |
|
|
391 |
selectedVersionHolder
|
|
392 |
"automatically generated by UIPainter ..."
|
|
393 |
|
|
394 |
"*** the code below creates a default model when invoked."
|
|
395 |
"*** (which may not be the one you wanted)"
|
|
396 |
"*** Please change as required and accept it in the browser."
|
|
397 |
"*** (and replace this comment by something more useful ;-)"
|
|
398 |
|
|
399 |
selectedVersionHolder isNil ifTrue:[
|
|
400 |
selectedVersionHolder := ValueHolder new.
|
|
401 |
"/ if your app needs to be notified of changes, uncomment one of the lines below:
|
|
402 |
"/ selectedVersionHolder addDependent:self.
|
|
403 |
"/ selectedVersionHolder onChangeSend:#selectedVersionHolderChanged to:self.
|
|
404 |
].
|
|
405 |
^ selectedVersionHolder.
|
|
406 |
!
|
|
407 |
|
|
408 |
versionsList
|
|
409 |
"automatically generated by UIPainter ..."
|
|
410 |
|
|
411 |
"*** the code below creates a default model when invoked."
|
|
412 |
"*** (which may not be the one you wanted)"
|
|
413 |
"*** Please change as required and accept it in the browser."
|
|
414 |
"*** (and replace this comment by something more useful ;-)"
|
|
415 |
|
|
416 |
versionsList isNil ifTrue:[
|
|
417 |
versionsList := ValueHolder new.
|
|
418 |
"/ if your app needs to be notified of changes, uncomment one of the lines below:
|
|
419 |
"/ versionsList addDependent:self.
|
|
420 |
"/ versionsList onChangeSend:#versionsListChanged to:self.
|
|
421 |
].
|
|
422 |
^ versionsList.
|
|
423 |
! !
|
|
424 |
|
|
425 |
!StoreProjectBrowser methodsFor:'db access'!
|
|
426 |
|
|
427 |
updatePackagesList
|
|
428 |
self halt.
|
|
429 |
! !
|
|
430 |
|
|
431 |
!StoreProjectBrowser methodsFor:'help'!
|
|
432 |
|
|
433 |
aboutThisApplicationText
|
|
434 |
^ super aboutThisApplicationText ,
|
|
435 |
'\\Written by Claus Gittinger, eXept Software AG.' withCRs
|
|
436 |
! !
|
|
437 |
|
|
438 |
!StoreProjectBrowser methodsFor:'initialization & release'!
|
|
439 |
|
|
440 |
dbInfo:aDBInfo
|
|
441 |
|session|
|
|
442 |
|
|
443 |
session := SQL::ODBCSession new.
|
|
444 |
session
|
|
445 |
connectWithUsername:(aDBInfo userName)
|
|
446 |
password:(aDBInfo password)
|
|
447 |
dbname:(aDBInfo dbName).
|
|
448 |
|
|
449 |
(session isConnected) ifFalse:[
|
|
450 |
^ self.
|
|
451 |
].
|
|
452 |
connection := session.
|
|
453 |
self window label:(aDBInfo dbName).
|
|
454 |
self infoLabelHolder value:('Connected to ',aDBInfo dbName).
|
|
455 |
^ self
|
|
456 |
!
|
|
457 |
|
|
458 |
postBuildWith:aBuilder
|
|
459 |
self updatePackagesList.
|
|
460 |
!
|
|
461 |
|
|
462 |
release
|
|
463 |
connection notNil ifTrue:[
|
|
464 |
connection disconnect.
|
|
465 |
connection := nil.
|
|
466 |
]
|
|
467 |
! !
|
|
468 |
|
|
469 |
!StoreProjectBrowser methodsFor:'menu actions'!
|
|
470 |
|
|
471 |
menuFileoutAs
|
|
472 |
"automatically generated by UIPainter ..."
|
|
473 |
|
|
474 |
"*** the code below performs no action"
|
|
475 |
"*** (except for some feedback on the Transcript)"
|
|
476 |
"*** Please change as required and accept in the browser."
|
|
477 |
|
|
478 |
"action to be added ..."
|
|
479 |
|
|
480 |
Transcript showCR:self class name, ': menu action for menuFileoutAs ...'.
|
|
481 |
!
|
|
482 |
|
|
483 |
menuOpen
|
|
484 |
"This method was generated by the Browser.
|
|
485 |
It will be invoked when the menu-item 'open' is selected."
|
|
486 |
|
|
487 |
"/ change below and add any actions as required here ...
|
|
488 |
self warn:'no action for ''open'' available.'.
|
|
489 |
!
|
|
490 |
|
|
491 |
menuUpdate
|
|
492 |
self updatePackagesList
|
|
493 |
!
|
|
494 |
|
|
495 |
openDocumentation
|
|
496 |
"This method was generated by the Browser.
|
|
497 |
It will be invoked when the menu-item 'help-documentation' is selected."
|
|
498 |
|
|
499 |
"/ change below as required ...
|
|
500 |
|
|
501 |
"/ to open an HTML viewer on some document (under 'doc/online/<language>/' ):
|
|
502 |
HTMLDocumentView openFullOnDocumentationFile:'TOP.html'.
|
|
503 |
|
|
504 |
"/ add application-specific help files under the 'doc/online/<language>/help/appName'
|
|
505 |
"/ directory, and open a viewer with:
|
|
506 |
"/ HTMLDocumentView openFullOnDocumentationFile:'help/<MyApplication>/TOP.html'.
|
|
507 |
! !
|
|
508 |
|
|
509 |
!StoreProjectBrowser class methodsFor:'documentation'!
|
|
510 |
|
|
511 |
version
|
|
512 |
^ '$Header: /cvs/stx/stx/libtool/Tools__StoreProjectBrowser.st,v 1.1 2006-08-26 13:32:45 cg Exp $'
|
|
513 |
! !
|