0
|
1 |
'From Smalltalk/X, Version:2.6.4 on 27-Apr-1993 at 20:02:12'!
|
|
2 |
|
|
3 |
StandardSystemView subclass:#ProjectView
|
|
4 |
instanceVariableNames:'myProject toggle'
|
|
5 |
classVariableNames:'ActiveProjectView'
|
|
6 |
poolDictionaries:''
|
|
7 |
category:'Interface-Smalltalk'
|
|
8 |
!
|
|
9 |
|
|
10 |
!ProjectView class methodsFor:'instance creation'!
|
|
11 |
|
|
12 |
for:aProject
|
|
13 |
|newView|
|
|
14 |
|
|
15 |
newView := super new.
|
|
16 |
newView setProject:aProject.
|
|
17 |
^ newView
|
|
18 |
|
|
19 |
"ProjectView for:(Project new)"
|
|
20 |
! !
|
|
21 |
|
|
22 |
!ProjectView methodsFor:'private accessing'!
|
|
23 |
|
|
24 |
setProject:aProject
|
|
25 |
|name e|
|
|
26 |
|
|
27 |
name := aProject name.
|
|
28 |
self label:name.
|
|
29 |
self iconName:name.
|
|
30 |
toggle label:'Project: ' , name.
|
|
31 |
toggle resize.
|
|
32 |
myProject := aProject.
|
|
33 |
e := (toggle width @ toggle height).
|
|
34 |
self extent:e.
|
|
35 |
self minExtent:e.
|
|
36 |
self maxExtent:e
|
|
37 |
! !
|
|
38 |
|
|
39 |
!ProjectView methodsFor:'initialization'!
|
|
40 |
|
|
41 |
initialize
|
|
42 |
super initialize.
|
|
43 |
toggle := Toggle in:self.
|
|
44 |
toggle borderWidth:0.
|
|
45 |
toggle pressAction:[self showProject].
|
|
46 |
toggle releaseAction:[self hideProject].
|
|
47 |
toggle middleButtonMenu:(
|
|
48 |
PopUpMenu
|
|
49 |
labels:#('rename'
|
|
50 |
'-'
|
|
51 |
'changes'
|
|
52 |
'-'
|
|
53 |
'show'
|
|
54 |
'hide'
|
|
55 |
'-'
|
|
56 |
'destroy'
|
|
57 |
)
|
|
58 |
selectors:#(renameProject
|
|
59 |
nil
|
|
60 |
browseChanges
|
|
61 |
nil
|
|
62 |
showProject
|
|
63 |
hideProject
|
|
64 |
nil
|
|
65 |
destroy
|
|
66 |
)
|
|
67 |
receiver:self
|
|
68 |
)
|
|
69 |
!
|
|
70 |
|
|
71 |
addToCurrentProject
|
|
72 |
"ignored here"
|
|
73 |
|
|
74 |
^ self
|
|
75 |
! !
|
|
76 |
|
|
77 |
!ProjectView methodsFor:'menu actions'!
|
|
78 |
|
|
79 |
browseChanges
|
|
80 |
ChangeSetBrowser startOn:(myProject changeSet)
|
|
81 |
!
|
|
82 |
|
|
83 |
destroyProject
|
|
84 |
|box|
|
|
85 |
|
|
86 |
box := YesNoBox new.
|
|
87 |
box title:'Destroying a project will discard all changes made
|
|
88 |
for that project and destroy all views opened for it.
|
|
89 |
|
|
90 |
Do you really want to do this ?'.
|
|
91 |
box okText:'yes'.
|
|
92 |
box yesAction:[
|
|
93 |
self doDestroyProject
|
|
94 |
].
|
|
95 |
box showAtPointer
|
|
96 |
!
|
|
97 |
|
|
98 |
showProject
|
|
99 |
ActiveProjectView notNil ifTrue:[
|
|
100 |
ActiveProjectView hideProject
|
|
101 |
].
|
|
102 |
ActiveProjectView := self.
|
|
103 |
|
|
104 |
myProject views notNil ifTrue:[
|
|
105 |
myProject views do:[:aView |
|
|
106 |
aView rerealize
|
|
107 |
]
|
|
108 |
].
|
|
109 |
Project current:myProject.
|
|
110 |
toggle turnOn
|
|
111 |
!
|
|
112 |
|
|
113 |
hideProject
|
|
114 |
myProject views notNil ifTrue:[
|
|
115 |
myProject views do:[:aView |
|
|
116 |
aView unrealize
|
|
117 |
]
|
|
118 |
].
|
|
119 |
ActiveProjectView := nil.
|
|
120 |
toggle turnOff
|
|
121 |
!
|
|
122 |
|
|
123 |
renameProject
|
|
124 |
|box|
|
|
125 |
|
|
126 |
box := EnterBox new.
|
|
127 |
box title:'new name of project:'.
|
|
128 |
box okText:'rename'.
|
|
129 |
box initialText:(myProject name).
|
|
130 |
box action:[:newName |
|
|
131 |
myProject name:newName.
|
|
132 |
self setProject:myProject
|
|
133 |
].
|
|
134 |
box showAtPointer
|
|
135 |
!
|
|
136 |
|
|
137 |
doDestroy
|
|
138 |
self hideProject.
|
|
139 |
|
|
140 |
myProject := nil.
|
|
141 |
super destroy
|
|
142 |
!
|
|
143 |
|
|
144 |
destroy
|
|
145 |
|box|
|
|
146 |
|
|
147 |
box := YesNoBox new.
|
|
148 |
box title:'Destroying a project will discard all changes made
|
|
149 |
for that project and destroy all views opened for it.
|
|
150 |
|
|
151 |
Do you really want to do this ?'.
|
|
152 |
box okText:'yes'.
|
|
153 |
box yesAction:[
|
|
154 |
self doDestroy
|
|
155 |
].
|
|
156 |
box showAtPointer
|
|
157 |
! !
|