130
|
1 |
"{ Package: 'stx:goodies/monticello' }"
|
|
2 |
|
|
3 |
Object subclass:#MCToolWindowBuilder
|
|
4 |
instanceVariableNames:'builder window currentFrame tool'
|
|
5 |
classVariableNames:''
|
|
6 |
poolDictionaries:''
|
596
|
7 |
category:'SCM-Monticello-UI'
|
130
|
8 |
!
|
|
9 |
|
|
10 |
|
|
11 |
!MCToolWindowBuilder class methodsFor:'as yet unclassified'!
|
|
12 |
|
|
13 |
builder: aBuilder tool: aTool
|
|
14 |
^ self basicNew initializeWithBuilder: aBuilder tool: aTool
|
|
15 |
! !
|
|
16 |
|
|
17 |
!MCToolWindowBuilder methodsFor:'as yet unclassified'!
|
|
18 |
|
|
19 |
build
|
|
20 |
^ builder build: window
|
|
21 |
!
|
|
22 |
|
|
23 |
buttonRow
|
|
24 |
^ self buttonRow: tool buttonSpecs
|
|
25 |
!
|
|
26 |
|
|
27 |
buttonRow: specArray
|
|
28 |
| panel button |
|
|
29 |
panel _ builder pluggablePanelSpec new.
|
|
30 |
panel children: OrderedCollection new.
|
|
31 |
specArray do:
|
|
32 |
[:spec |
|
|
33 |
|
|
34 |
button := builder pluggableButtonSpec new.
|
|
35 |
button model: tool.
|
|
36 |
button label: spec first asString.
|
|
37 |
button action: spec second.
|
|
38 |
button help: spec third.
|
|
39 |
button enabled: (spec at: 4 ifAbsent: [#buttonEnabled]).
|
|
40 |
button state: (spec at: 5 ifAbsent: [#buttonSelected]).
|
|
41 |
panel children add: button].
|
|
42 |
panel layout: #horizontal.
|
|
43 |
panel frame: currentFrame.
|
|
44 |
window children add: panel
|
|
45 |
!
|
|
46 |
|
|
47 |
frame: aLayoutFrame
|
|
48 |
currentFrame _ aLayoutFrame
|
|
49 |
!
|
|
50 |
|
|
51 |
initializeWithBuilder: aBuilder tool: aTool
|
|
52 |
builder _ aBuilder.
|
|
53 |
tool _ aTool.
|
|
54 |
window _ builder pluggableWindowSpec new.
|
|
55 |
window children: OrderedCollection new.
|
|
56 |
window label: tool label asString.
|
|
57 |
window model: tool.
|
|
58 |
window extent: tool defaultExtent.
|
|
59 |
!
|
|
60 |
|
|
61 |
listMorph: listSymbol
|
|
62 |
^ self
|
|
63 |
listMorph: (listSymbol, 'List') asSymbol
|
|
64 |
selection: (listSymbol, 'Selection') asSymbol
|
|
65 |
menu: (listSymbol, 'ListMenu:') asSymbol
|
|
66 |
!
|
|
67 |
|
|
68 |
listMorph: listSymbol keystroke: keystrokeSymbol
|
|
69 |
^ (self
|
|
70 |
listMorph: (listSymbol, 'List') asSymbol
|
|
71 |
selection: (listSymbol, 'Selection') asSymbol
|
|
72 |
menu: (listSymbol, 'ListMenu:') asSymbol)
|
|
73 |
keystrokeActionSelector: keystrokeSymbol;
|
|
74 |
yourself
|
|
75 |
!
|
|
76 |
|
|
77 |
listMorph: listSymbol selection: selectionSymbol
|
|
78 |
self listMorph: listSymbol selection: selectionSymbol menu: nil
|
|
79 |
!
|
|
80 |
|
|
81 |
listMorph: listSymbol selection: selectionSymbol menu: menuSymbol
|
|
82 |
self listMorph: listSymbol selection: selectionSymbol menu: menuSymbol keystroke: nil
|
|
83 |
!
|
|
84 |
|
|
85 |
listMorph: listSymbol selection: selectionSymbol menu: menuSymbol keystroke: keystrokeSymbol
|
|
86 |
| list |
|
|
87 |
list := builder pluggableListSpec new.
|
|
88 |
list
|
|
89 |
model: tool;
|
|
90 |
list: listSymbol;
|
|
91 |
getIndex: selectionSymbol;
|
|
92 |
setIndex: (selectionSymbol, ':') asSymbol;
|
|
93 |
frame: currentFrame.
|
|
94 |
menuSymbol ifNotNil: [list menu: menuSymbol].
|
|
95 |
keystrokeSymbol ifNotNil: [list keyPress: keystrokeSymbol].
|
|
96 |
window children add: list
|
|
97 |
!
|
|
98 |
|
|
99 |
multiListMorph: listSymbol selection: selectionSymbol listSelection: listSelectionSymbol menu: menuSymbol
|
|
100 |
| list |
|
|
101 |
list := builder pluggableMultiSelectionListSpec new.
|
|
102 |
list
|
|
103 |
model: tool;
|
|
104 |
list: listSymbol;
|
|
105 |
getIndex: selectionSymbol;
|
|
106 |
setIndex: (selectionSymbol, ':') asSymbol;
|
|
107 |
getSelectionList: listSelectionSymbol;
|
|
108 |
setSelectionList: (listSelectionSymbol, 'put:') asSymbol;
|
|
109 |
frame: currentFrame.
|
|
110 |
menuSymbol ifNotNil: [list menu: menuSymbol].
|
|
111 |
window children add: list
|
|
112 |
!
|
|
113 |
|
|
114 |
textMorph: aSymbol
|
|
115 |
| text |
|
|
116 |
text := builder pluggableTextSpec new.
|
|
117 |
text
|
|
118 |
model: tool;
|
|
119 |
getText: aSymbol;
|
|
120 |
setText: (aSymbol, ':') asSymbol;
|
|
121 |
frame: currentFrame.
|
|
122 |
window children add: text
|
|
123 |
!
|
|
124 |
|
|
125 |
treeMorph: listSymbol
|
|
126 |
^ self
|
|
127 |
treeMorph: (listSymbol, 'Tree') asSymbol
|
|
128 |
selection: (listSymbol, 'SelectionWrapper') asSymbol
|
|
129 |
menu: (listSymbol, 'TreeMenu:') asSymbol
|
|
130 |
!
|
|
131 |
|
|
132 |
treeMorph: listSymbol selection: selectionSymbol menu: menuSymbol
|
|
133 |
self notYetImplemented
|
|
134 |
!
|
|
135 |
|
|
136 |
treeOrListMorph: listSymbol
|
|
137 |
^ self listMorph: listSymbol
|
|
138 |
! !
|
|
139 |
|
|
140 |
!MCToolWindowBuilder class methodsFor:'documentation'!
|
|
141 |
|
|
142 |
version
|
596
|
143 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCToolWindowBuilder.st,v 1.2 2012-09-11 21:14:34 cg Exp $'
|
130
|
144 |
! !
|