platform-ui-home/R3_1/undo-redo-proposal/undo-redo support.html

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (view) (download) (as text)

1 : nick 1.2 <html xmlns:v="urn:schemas-microsoft-com:vml"
2 :     xmlns:o="urn:schemas-microsoft-com:office:office"
3 : nick 1.1 xmlns:w="urn:schemas-microsoft-com:office:word"
4 : nick 1.2 xmlns:st1="urn:schemas-microsoft-com:office:smarttags"
5 : nick 1.1 xmlns="http://www.w3.org/TR/REC-html40">
6 :    
7 :     <head>
8 :     <meta http-equiv=Content-Type content="text/html; charset=windows-1252">
9 :     <meta name=ProgId content=Word.Document>
10 :     <meta name=Generator content="Microsoft Word 10">
11 :     <meta name=Originator content="Microsoft Word 10">
12 :     <link rel=File-List href="undo-redo%20support_files/filelist.xml">
13 :     <title>Undo/redo support in Eclipse</title>
14 : nick 1.2 <o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
15 :     name="date"/>
16 : nick 1.1 <!--[if gte mso 9]><xml>
17 :     <o:DocumentProperties>
18 :     <o:Author>IBM_USER</o:Author>
19 :     <o:LastAuthor>IBM_USER</o:LastAuthor>
20 :     <o:Revision>2</o:Revision>
21 : nick 1.2 <o:TotalTime>4237</o:TotalTime>
22 : nick 1.1 <o:LastPrinted>2004-11-08T17:14:00Z</o:LastPrinted>
23 : nick 1.2 <o:Created>2004-11-09T19:14:00Z</o:Created>
24 :     <o:LastSaved>2004-11-09T19:14:00Z</o:LastSaved>
25 : nick 1.1 <o:Pages>1</o:Pages>
26 : nick 1.2 <o:Words>6221</o:Words>
27 :     <o:Characters>35461</o:Characters>
28 : nick 1.1 <o:Company>IBM</o:Company>
29 : nick 1.2 <o:Lines>295</o:Lines>
30 :     <o:Paragraphs>83</o:Paragraphs>
31 :     <o:CharactersWithSpaces>41599</o:CharactersWithSpaces>
32 : nick 1.1 <o:Version>10.6626</o:Version>
33 :     </o:DocumentProperties>
34 :     </xml><![endif]--><!--[if gte mso 9]><xml>
35 :     <w:WordDocument>
36 :     <w:SpellingState>Clean</w:SpellingState>
37 :     <w:Compatibility>
38 :     <w:BreakWrappedTables/>
39 :     <w:SnapToGridInCell/>
40 :     <w:WrapTextWithPunct/>
41 :     <w:UseAsianBreakRules/>
42 :     </w:Compatibility>
43 :     <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
44 :     </w:WordDocument>
45 : nick 1.2 </xml><![endif]--><!--[if !mso]><object
46 :     classid="clsid:38481807-CA0E-42D2-BF39-B33AF135CC4D" id=ieooui></object>
47 :     <style>
48 :     st1\:*{behavior:url(#ieooui) }
49 :     </style>
50 :     <![endif]-->
51 : nick 1.1 <style>
52 :     <!--
53 :     /* Font Definitions */
54 :     @font-face
55 :     {font-family:Wingdings;
56 :     panose-1:5 0 0 0 0 0 0 0 0 0;
57 :     mso-font-charset:2;
58 :     mso-generic-font-family:auto;
59 :     mso-font-pitch:variable;
60 :     mso-font-signature:0 268435456 0 0 -2147483648 0;}
61 :     /* Style Definitions */
62 :     p.MsoNormal, li.MsoNormal, div.MsoNormal
63 :     {mso-style-parent:"";
64 :     margin:0in;
65 :     margin-bottom:.0001pt;
66 :     mso-pagination:widow-orphan;
67 :     font-size:12.0pt;
68 :     font-family:"Times New Roman";
69 :     mso-fareast-font-family:"Times New Roman";}
70 :     h1
71 :     {mso-style-next:Normal;
72 :     margin-top:12.0pt;
73 :     margin-right:0in;
74 :     margin-bottom:3.0pt;
75 :     margin-left:0in;
76 :     mso-pagination:widow-orphan;
77 :     page-break-after:avoid;
78 :     mso-outline-level:1;
79 :     font-size:16.0pt;
80 :     font-family:Arial;
81 :     mso-font-kerning:16.0pt;}
82 :     h2
83 :     {mso-style-next:Normal;
84 :     margin-top:12.0pt;
85 :     margin-right:0in;
86 :     margin-bottom:3.0pt;
87 :     margin-left:0in;
88 :     mso-pagination:widow-orphan;
89 :     page-break-after:avoid;
90 :     mso-outline-level:2;
91 :     font-size:14.0pt;
92 :     font-family:Arial;
93 :     font-style:italic;}
94 :     h3
95 :     {mso-style-next:Normal;
96 :     margin-top:12.0pt;
97 :     margin-right:0in;
98 :     margin-bottom:3.0pt;
99 :     margin-left:0in;
100 :     mso-pagination:widow-orphan;
101 :     page-break-after:avoid;
102 :     mso-outline-level:3;
103 :     font-size:13.0pt;
104 :     font-family:Arial;}
105 :     h4
106 :     {mso-style-next:Normal;
107 :     margin-top:12.0pt;
108 :     margin-right:0in;
109 :     margin-bottom:3.0pt;
110 :     margin-left:0in;
111 :     mso-pagination:widow-orphan;
112 :     page-break-after:avoid;
113 :     mso-outline-level:4;
114 :     font-size:14.0pt;
115 :     font-family:"Times New Roman";}
116 :     h5
117 :     {mso-style-next:Normal;
118 :     margin-top:12.0pt;
119 :     margin-right:0in;
120 :     margin-bottom:3.0pt;
121 :     margin-left:0in;
122 :     mso-pagination:widow-orphan;
123 :     mso-outline-level:5;
124 :     font-size:13.0pt;
125 :     font-family:"Times New Roman";
126 :     font-style:italic;}
127 :     p.MsoFootnoteText, li.MsoFootnoteText, div.MsoFootnoteText
128 :     {mso-style-noshow:yes;
129 :     margin:0in;
130 :     margin-bottom:.0001pt;
131 :     mso-pagination:widow-orphan;
132 :     font-size:10.0pt;
133 :     font-family:"Times New Roman";
134 :     mso-fareast-font-family:"Times New Roman";}
135 :     span.MsoFootnoteReference
136 :     {mso-style-noshow:yes;
137 :     vertical-align:super;}
138 :     p.MsoBodyText2, li.MsoBodyText2, div.MsoBodyText2
139 :     {margin-top:0in;
140 :     margin-right:0in;
141 :     margin-bottom:6.0pt;
142 :     margin-left:0in;
143 :     line-height:200%;
144 :     mso-pagination:widow-orphan;
145 :     font-size:12.0pt;
146 :     font-family:"Times New Roman";
147 :     mso-fareast-font-family:"Times New Roman";}
148 : nick 1.2 a:link, span.MsoHyperlink
149 :     {color:#0000EE;
150 :     text-decoration:underline;
151 :     text-underline:single;}
152 :     a:visited, span.MsoHyperlinkFollowed
153 :     {color:purple;
154 :     text-decoration:underline;
155 :     text-underline:single;}
156 : nick 1.1 span.SpellE
157 :     {mso-style-name:"";
158 :     mso-spl-e:yes;}
159 :     @page Section1
160 :     {size:8.5in 11.0in;
161 :     margin:1.0in .75in .5in 1.0in;
162 :     mso-header-margin:.5in;
163 :     mso-footer-margin:.5in;
164 :     mso-paper-source:0;}
165 :     div.Section1
166 :     {page:Section1;}
167 :     /* List Definitions */
168 :     @list l0
169 :     {mso-list-id:-132;
170 :     mso-list-type:simple;
171 :     mso-list-template-ids:-446383164;}
172 :     @list l0:level1
173 :     {mso-level-tab-stop:1.25in;
174 :     mso-level-number-position:left;
175 :     margin-left:1.25in;
176 :     text-indent:-.25in;}
177 :     @list l1
178 :     {mso-list-id:-131;
179 :     mso-list-type:simple;
180 :     mso-list-template-ids:1534092348;}
181 :     @list l1:level1
182 :     {mso-level-tab-stop:1.0in;
183 :     mso-level-number-position:left;
184 :     margin-left:1.0in;
185 :     text-indent:-.25in;}
186 :     @list l2
187 :     {mso-list-id:-130;
188 :     mso-list-type:simple;
189 :     mso-list-template-ids:710070486;}
190 :     @list l2:level1
191 :     {mso-level-tab-stop:.75in;
192 :     mso-level-number-position:left;
193 :     margin-left:.75in;
194 :     text-indent:-.25in;}
195 :     @list l3
196 :     {mso-list-id:-129;
197 :     mso-list-type:simple;
198 :     mso-list-template-ids:682940366;}
199 :     @list l3:level1
200 :     {mso-level-tab-stop:.5in;
201 :     mso-level-number-position:left;
202 :     text-indent:-.25in;}
203 :     @list l4
204 :     {mso-list-id:-128;
205 :     mso-list-type:simple;
206 :     mso-list-template-ids:949130314;}
207 :     @list l4:level1
208 :     {mso-level-number-format:bullet;
209 :     mso-level-text:\F0B7;
210 :     mso-level-tab-stop:1.25in;
211 :     mso-level-number-position:left;
212 :     margin-left:1.25in;
213 :     text-indent:-.25in;
214 :     font-family:Symbol;}
215 :     @list l5
216 :     {mso-list-id:-127;
217 :     mso-list-type:simple;
218 :     mso-list-template-ids:-1842289842;}
219 :     @list l5:level1
220 :     {mso-level-number-format:bullet;
221 :     mso-level-text:\F0B7;
222 :     mso-level-tab-stop:1.0in;
223 :     mso-level-number-position:left;
224 :     margin-left:1.0in;
225 :     text-indent:-.25in;
226 :     font-family:Symbol;}
227 :     @list l6
228 :     {mso-list-id:-126;
229 :     mso-list-type:simple;
230 :     mso-list-template-ids:819084850;}
231 :     @list l6:level1
232 :     {mso-level-number-format:bullet;
233 :     mso-level-text:\F0B7;
234 :     mso-level-tab-stop:.75in;
235 :     mso-level-number-position:left;
236 :     margin-left:.75in;
237 :     text-indent:-.25in;
238 :     font-family:Symbol;}
239 :     @list l7
240 :     {mso-list-id:-125;
241 :     mso-list-type:simple;
242 :     mso-list-template-ids:-676417338;}
243 :     @list l7:level1
244 :     {mso-level-number-format:bullet;
245 :     mso-level-text:\F0B7;
246 :     mso-level-tab-stop:.5in;
247 :     mso-level-number-position:left;
248 :     text-indent:-.25in;
249 :     font-family:Symbol;}
250 :     @list l8
251 :     {mso-list-id:-120;
252 :     mso-list-type:simple;
253 :     mso-list-template-ids:1291634668;}
254 :     @list l8:level1
255 :     {mso-level-tab-stop:.25in;
256 :     mso-level-number-position:left;
257 :     margin-left:.25in;
258 :     text-indent:-.25in;}
259 :     @list l9
260 :     {mso-list-id:-119;
261 :     mso-list-type:simple;
262 :     mso-list-template-ids:964484384;}
263 :     @list l9:level1
264 :     {mso-level-number-format:bullet;
265 :     mso-level-text:\F0B7;
266 :     mso-level-tab-stop:.25in;
267 :     mso-level-number-position:left;
268 :     margin-left:.25in;
269 :     text-indent:-.25in;
270 :     font-family:Symbol;}
271 :     @list l10
272 :     {mso-list-id:172575666;
273 :     mso-list-type:hybrid;
274 :     mso-list-template-ids:1725869360 67698703 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
275 :     @list l10:level1
276 :     {mso-level-tab-stop:.5in;
277 :     mso-level-number-position:left;
278 :     text-indent:-.25in;}
279 :     @list l10:level2
280 :     {mso-level-number-format:bullet;
281 :     mso-level-text:o;
282 :     mso-level-tab-stop:1.0in;
283 :     mso-level-number-position:left;
284 :     text-indent:-.25in;
285 :     font-family:"Courier New";}
286 :     @list l10:level3
287 :     {mso-level-number-format:bullet;
288 :     mso-level-text:\F0A7;
289 :     mso-level-tab-stop:1.5in;
290 :     mso-level-number-position:left;
291 :     text-indent:-.25in;
292 :     font-family:Wingdings;}
293 :     @list l10:level4
294 :     {mso-level-number-format:bullet;
295 :     mso-level-text:\F0B7;
296 :     mso-level-tab-stop:2.0in;
297 :     mso-level-number-position:left;
298 :     text-indent:-.25in;
299 :     font-family:Symbol;}
300 :     @list l11
301 :     {mso-list-id:190000114;
302 :     mso-list-type:hybrid;
303 :     mso-list-template-ids:1560301118 423934604 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
304 :     @list l11:level1
305 :     {mso-level-start-at:0;
306 :     mso-level-number-format:bullet;
307 :     mso-level-text:-;
308 :     mso-level-tab-stop:.5in;
309 :     mso-level-number-position:left;
310 :     text-indent:-.25in;
311 :     font-family:Arial;
312 :     mso-fareast-font-family:"Times New Roman";}
313 :     @list l12
314 :     {mso-list-id:215170042;
315 :     mso-list-type:hybrid;
316 :     mso-list-template-ids:1511950680 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
317 :     @list l12:level1
318 :     {mso-level-tab-stop:.5in;
319 :     mso-level-number-position:left;
320 :     text-indent:-.25in;}
321 :     @list l13
322 :     {mso-list-id:359431469;
323 :     mso-list-type:hybrid;
324 :     mso-list-template-ids:84734878 67698689 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
325 :     @list l13:level1
326 :     {mso-level-number-format:bullet;
327 :     mso-level-text:\F0B7;
328 :     mso-level-tab-stop:.5in;
329 :     mso-level-number-position:left;
330 :     text-indent:-.25in;
331 :     font-family:Symbol;}
332 :     @list l14
333 :     {mso-list-id:458649110;
334 :     mso-list-type:hybrid;
335 :     mso-list-template-ids:-38738056 423934604 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
336 :     @list l14:level1
337 :     {mso-level-start-at:0;
338 :     mso-level-number-format:bullet;
339 :     mso-level-text:-;
340 :     mso-level-tab-stop:1.0in;
341 :     mso-level-number-position:left;
342 :     margin-left:1.0in;
343 :     text-indent:-.25in;
344 :     font-family:Arial;
345 :     mso-fareast-font-family:"Times New Roman";}
346 :     @list l15
347 :     {mso-list-id:547566703;
348 :     mso-list-type:hybrid;
349 :     mso-list-template-ids:1798573620 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
350 :     @list l15:level1
351 :     {mso-level-tab-stop:.5in;
352 :     mso-level-number-position:left;
353 :     text-indent:-.25in;}
354 :     @list l16
355 :     {mso-list-id:752435528;
356 :     mso-list-type:hybrid;
357 :     mso-list-template-ids:968014730 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
358 :     @list l16:level1
359 :     {mso-level-tab-stop:.5in;
360 :     mso-level-number-position:left;
361 :     text-indent:-.25in;}
362 :     @list l17
363 :     {mso-list-id:1072436292;
364 :     mso-list-type:hybrid;
365 :     mso-list-template-ids:1681550614 423934604 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
366 :     @list l17:level1
367 :     {mso-level-start-at:0;
368 :     mso-level-number-format:bullet;
369 :     mso-level-text:-;
370 :     mso-level-tab-stop:.75in;
371 :     mso-level-number-position:left;
372 :     margin-left:.75in;
373 :     text-indent:-.25in;
374 :     font-family:Arial;
375 :     mso-fareast-font-family:"Times New Roman";}
376 :     @list l17:level2
377 :     {mso-level-number-format:bullet;
378 :     mso-level-text:o;
379 :     mso-level-tab-stop:1.25in;
380 :     mso-level-number-position:left;
381 :     margin-left:1.25in;
382 :     text-indent:-.25in;
383 :     font-family:"Courier New";}
384 :     @list l18
385 :     {mso-list-id:1209411371;
386 :     mso-list-type:hybrid;
387 :     mso-list-template-ids:-1603923158 67698689 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
388 :     @list l18:level1
389 :     {mso-level-number-format:bullet;
390 :     mso-level-text:\F0B7;
391 :     mso-level-tab-stop:.75in;
392 :     mso-level-number-position:left;
393 :     margin-left:.75in;
394 :     text-indent:-.25in;
395 :     font-family:Symbol;}
396 :     @list l19
397 :     {mso-list-id:1432318865;
398 :     mso-list-type:hybrid;
399 :     mso-list-template-ids:2137158298 423934604 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
400 :     @list l19:level1
401 :     {mso-level-start-at:0;
402 :     mso-level-number-format:bullet;
403 :     mso-level-text:-;
404 :     mso-level-tab-stop:.5in;
405 :     mso-level-number-position:left;
406 :     text-indent:-.25in;
407 :     font-family:Arial;
408 :     mso-fareast-font-family:"Times New Roman";}
409 :     @list l20
410 :     {mso-list-id:1611356098;
411 :     mso-list-type:hybrid;
412 :     mso-list-template-ids:-854709908 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
413 :     @list l20:level1
414 :     {mso-level-tab-stop:.5in;
415 :     mso-level-number-position:left;
416 :     text-indent:-.25in;}
417 :     @list l21
418 :     {mso-list-id:1614744623;
419 :     mso-list-type:hybrid;
420 :     mso-list-template-ids:-1496942198 423934604 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
421 :     @list l21:level1
422 :     {mso-level-start-at:0;
423 :     mso-level-number-format:bullet;
424 :     mso-level-text:-;
425 :     mso-level-tab-stop:.5in;
426 :     mso-level-number-position:left;
427 :     text-indent:-.25in;
428 :     font-family:Arial;
429 :     mso-fareast-font-family:"Times New Roman";}
430 :     @list l21:level2
431 :     {mso-level-number-format:bullet;
432 :     mso-level-text:o;
433 :     mso-level-tab-stop:1.0in;
434 :     mso-level-number-position:left;
435 :     text-indent:-.25in;
436 :     font-family:"Courier New";}
437 :     @list l21:level3
438 :     {mso-level-number-format:bullet;
439 :     mso-level-text:\F0A7;
440 :     mso-level-tab-stop:1.5in;
441 :     mso-level-number-position:left;
442 :     text-indent:-.25in;
443 :     font-family:Wingdings;}
444 :     @list l21:level4
445 :     {mso-level-number-format:bullet;
446 :     mso-level-text:\F0B7;
447 :     mso-level-tab-stop:2.0in;
448 :     mso-level-number-position:left;
449 :     text-indent:-.25in;
450 :     font-family:Symbol;}
451 :     @list l22
452 :     {mso-list-id:1693457207;
453 :     mso-list-type:hybrid;
454 :     mso-list-template-ids:-1668623746 67698703 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
455 :     @list l22:level1
456 :     {mso-level-tab-stop:.5in;
457 :     mso-level-number-position:left;
458 :     text-indent:-.25in;}
459 :     @list l22:level2
460 :     {mso-level-number-format:bullet;
461 :     mso-level-text:o;
462 :     mso-level-tab-stop:1.0in;
463 :     mso-level-number-position:left;
464 :     text-indent:-.25in;
465 :     font-family:"Courier New";}
466 :     @list l22:level3
467 :     {mso-level-number-format:bullet;
468 :     mso-level-text:\F0A7;
469 :     mso-level-tab-stop:1.5in;
470 :     mso-level-number-position:left;
471 :     text-indent:-.25in;
472 :     font-family:Wingdings;}
473 :     @list l22:level4
474 :     {mso-level-number-format:bullet;
475 :     mso-level-text:\F0B7;
476 :     mso-level-tab-stop:2.0in;
477 :     mso-level-number-position:left;
478 :     text-indent:-.25in;
479 :     font-family:Symbol;}
480 :     @list l23
481 :     {mso-list-id:1731031428;
482 :     mso-list-type:hybrid;
483 :     mso-list-template-ids:1886447558 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
484 :     @list l23:level1
485 :     {mso-level-tab-stop:39.0pt;
486 :     mso-level-number-position:left;
487 :     margin-left:39.0pt;
488 :     text-indent:-.25in;}
489 :     @list l24
490 :     {mso-list-id:1832519519;
491 :     mso-list-type:hybrid;
492 :     mso-list-template-ids:-658358596 423934604 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
493 :     @list l24:level1
494 :     {mso-level-start-at:0;
495 :     mso-level-number-format:bullet;
496 :     mso-level-text:-;
497 :     mso-level-tab-stop:.5in;
498 :     mso-level-number-position:left;
499 :     text-indent:-.25in;
500 :     font-family:Arial;
501 :     mso-fareast-font-family:"Times New Roman";}
502 :     @list l25
503 :     {mso-list-id:1853185266;
504 :     mso-list-type:hybrid;
505 :     mso-list-template-ids:403894856 423934604 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
506 :     @list l25:level1
507 :     {mso-level-start-at:0;
508 :     mso-level-number-format:bullet;
509 :     mso-level-text:-;
510 :     mso-level-tab-stop:.5in;
511 :     mso-level-number-position:left;
512 :     text-indent:-.25in;
513 :     font-family:Arial;
514 :     mso-fareast-font-family:"Times New Roman";}
515 :     @list l25:level2
516 :     {mso-level-number-format:bullet;
517 :     mso-level-text:o;
518 :     mso-level-tab-stop:1.0in;
519 :     mso-level-number-position:left;
520 :     text-indent:-.25in;
521 :     font-family:"Courier New";}
522 :     @list l26
523 :     {mso-list-id:1938905931;
524 :     mso-list-type:hybrid;
525 :     mso-list-template-ids:1084264292 423934604 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
526 :     @list l26:level1
527 :     {mso-level-start-at:0;
528 :     mso-level-number-format:bullet;
529 :     mso-level-text:-;
530 :     mso-level-tab-stop:.5in;
531 :     mso-level-number-position:left;
532 :     text-indent:-.25in;
533 :     font-family:Arial;
534 :     mso-fareast-font-family:"Times New Roman";}
535 :     ol
536 :     {margin-bottom:0in;}
537 :     ul
538 :     {margin-bottom:0in;}
539 :     -->
540 :     </style>
541 :     <!--[if gte mso 10]>
542 :     <style>
543 :     /* Style Definitions */
544 :     table.MsoNormalTable
545 :     {mso-style-name:"Table Normal";
546 :     mso-tstyle-rowband-size:0;
547 :     mso-tstyle-colband-size:0;
548 :     mso-style-noshow:yes;
549 :     mso-style-parent:"";
550 :     mso-padding-alt:0in 5.4pt 0in 5.4pt;
551 :     mso-para-margin:0in;
552 :     mso-para-margin-bottom:.0001pt;
553 :     mso-pagination:widow-orphan;
554 :     font-size:10.0pt;
555 :     font-family:"Times New Roman";}
556 :     </style>
557 :     <![endif]-->
558 :     </head>
559 :    
560 : nick 1.2 <body lang=EN-US link="#0000EE" vlink=purple style='tab-interval:.5in'>
561 : nick 1.1
562 :     <div class=Section1>
563 :    
564 :     <h1>Generalized Undo Support in Eclipse</h1>
565 :    
566 : nick 1.2 <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Last
567 :     updated:<span style='mso-spacerun:yes'>  </span></span><st1:date Month="11"
568 :     Day="9" Year="2004"><span style='font-size:10.0pt;font-family:Arial'>Nov 9,
569 :     2004</span></st1:date><span style='font-size:10.0pt;font-family:Arial'><o:p></o:p></span></p>
570 :    
571 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Status:<span
572 :     style='mso-spacerun:yes'>  </span>Under investigation (see bug </span><a
573 :     href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=37716">37716</a>)<span
574 :     style='font-size:10.0pt;font-family:Arial'><o:p></o:p></span></p>
575 :    
576 : nick 1.1 <h2>Problem Description<o:p></o:p></h2>
577 :    
578 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>In R3.0.1
579 :     of the Eclipse SDK, there is no generalized support for undoing user actions.<span
580 :     style='mso-spacerun:yes'>  </span>Each plug-in is left to implement its own
581 :     strategy for undo, if at all.<span style='mso-spacerun:yes'>  </span>This
582 :     approach can cause many general problems as independently developed plug-ins implement
583 :     their own undo strategies:<o:p></o:p></span></p>
584 :    
585 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
586 :    
587 :     <p class=MsoNormal style='margin-left:.5in;text-indent:-.25in;mso-list:l21 level1 lfo1;
588 :     tab-stops:list .5in'><![if !supportLists]><span style='font-size:10.0pt;
589 :     font-family:Arial;mso-fareast-font-family:Arial'><span style='mso-list:Ignore'>-<span
590 :     style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
591 :     </span></span></span><![endif]><span style='font-size:10.0pt;font-family:Arial'>Undo
592 :     and redo actions appear in different menus.<o:p></o:p></span></p>
593 :    
594 :     <p class=MsoNormal style='margin-left:.5in;text-indent:-.25in;mso-list:l21 level1 lfo1;
595 :     tab-stops:list .5in'><![if !supportLists]><span style='font-size:10.0pt;
596 :     font-family:Arial;mso-fareast-font-family:Arial'><span style='mso-list:Ignore'>-<span
597 :     style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
598 :     </span></span></span><![endif]><span style='font-size:10.0pt;font-family:Arial'>Undo
599 :     and redo implementations can have different semantics.<span
600 :     style='mso-spacerun:yes'>  </span>Different approaches to undo by different
601 :     plug-ins may confuse the user if they choose different semantics.<span
602 :     style='mso-spacerun:yes'>  </span>For example:<o:p></o:p></span></p>
603 :    
604 :     <p class=MsoNormal style='margin-left:1.0in;text-indent:-.25in;mso-list:l21 level2 lfo1;
605 :     tab-stops:list 1.0in'><![if !supportLists]><span style='font-size:10.0pt;
606 :     font-family:"Courier New";mso-fareast-font-family:"Courier New"'><span
607 :     style='mso-list:Ignore'>o<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
608 :     </span></span></span><![endif]><span style='font-size:10.0pt;font-family:Arial'>Is
609 : nick 1.2 undo strictly linear?<o:p></o:p></span></p>
610 : nick 1.1
611 :     <p class=MsoNormal style='margin-left:1.0in;text-indent:-.25in;mso-list:l21 level2 lfo1;
612 :     tab-stops:list 1.0in'><![if !supportLists]><span style='font-size:10.0pt;
613 :     font-family:"Courier New";mso-fareast-font-family:"Courier New"'><span
614 :     style='mso-list:Ignore'>o<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
615 :     </span></span></span><![endif]><span style='font-size:10.0pt;font-family:Arial'>If
616 :     it is not linear, what techniques are used to undo an operation?<span
617 :     style='mso-spacerun:yes'>  </span>Implementation models for non-linear undo (rollback
618 :     and perform the history again, dynamic reversal) can affect the user outcome.<o:p></o:p></span></p>
619 :    
620 :     <p class=MsoNormal style='margin-left:1.0in;text-indent:-.25in;mso-list:l21 level2 lfo1;
621 :     tab-stops:list 1.0in'><![if !supportLists]><span style='font-size:10.0pt;
622 :     font-family:"Courier New";mso-fareast-font-family:"Courier New"'><span
623 :     style='mso-list:Ignore'>o<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
624 :     </span></span></span><![endif]><span style='font-size:10.0pt;font-family:Arial'>What
625 :     is the scope of an undo?<span style='mso-spacerun:yes'>  </span>Is it global to
626 :     the system?<span style='mso-spacerun:yes'>  </span>Is it local to the
627 :     window?<span style='mso-spacerun:yes'>  </span>Is it model-dependent?<span
628 :     style='mso-spacerun:yes'>  </span><o:p></o:p></span></p>
629 :    
630 :     <p class=MsoNormal style='margin-left:.5in;text-indent:-.25in;mso-list:l21 level1 lfo1;
631 :     tab-stops:list .5in'><![if !supportLists]><span style='font-size:10.0pt;
632 :     font-family:Arial;mso-fareast-font-family:Arial'><span style='mso-list:Ignore'>-<span
633 :     style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
634 :     </span></span></span><![endif]><span style='font-size:10.0pt;font-family:Arial'>Plug-ins
635 :     that want to add undo support may have to choose between different undo
636 :     strategies and implementations provided by their required plug-ins, or worse
637 :     yet, implement yet another strategy.<o:p></o:p></span></p>
638 :    
639 :     <h3>Challenges with generalized undo support<o:p></o:p></h3>
640 :    
641 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>While
642 :     implementation of a centralized undo mechanism should be straightforward, it
643 :     has not been provided in previous releases due to problems in defining the
644 :     proper undo semantics across different plug-ins.<span
645 : nick 1.2 style='mso-spacerun:yes'>   </span>The challenge in defining consistent, predictable
646 :     undo semantics can best be understood by looking at the two different undo
647 :     models provided in the R3.0.1 release of the base Eclipse SDK.<span
648 : nick 1.1 style='mso-spacerun:yes'>  </span><o:p></o:p></span></p>
649 :    
650 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
651 :    
652 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>The SDK
653 :     currently contains two undo implementations and user commands:<o:p></o:p></span></p>
654 :    
655 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
656 :    
657 :     <p class=MsoNormal style='margin-left:.5in;text-indent:-.25in;mso-list:l26 level1 lfo2;
658 :     tab-stops:list .5in'><![if !supportLists]><span style='font-size:10.0pt;
659 :     font-family:Arial;mso-fareast-font-family:Arial'><span style='mso-list:Ignore'>-<span
660 :     style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
661 :     </span></span></span><![endif]><span style='font-size:10.0pt;font-family:Arial'>Text
662 :     undo (Edit&gt;Undo) provides a linear undo model for text-level
663 :     operations.<span style='mso-spacerun:yes'>  </span>That is, textual insert/replace/delete
664 :     operations can be undone in the reverse order in which they are applied.<span
665 :     style='mso-spacerun:yes'>  </span><o:p></o:p></span></p>
666 :    
667 :     <p class=MsoNormal style='margin-left:.5in;text-indent:-.25in;mso-list:l21 level1 lfo1;
668 :     tab-stops:list .5in'><![if !supportLists]><span style='font-size:10.0pt;
669 :     font-family:Arial;mso-fareast-font-family:Arial'><span style='mso-list:Ignore'>-<span
670 :     style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
671 :     </span></span></span><![endif]><span class=SpellE><span style='font-size:10.0pt;
672 :     font-family:Arial'>Refactoring</span></span><span style='font-size:10.0pt;
673 :     font-family:Arial'> undo (<span class=SpellE>Refactor</span>&gt;Undo) allows an
674 :     undo of the last <span class=SpellE>refactoring</span> operation, but only when
675 :     the workspace has not been otherwise modified since the last <span
676 :     class=SpellE>refactoring</span>.<o:p></o:p></span></p>
677 :    
678 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
679 :    
680 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>In
681 :     discussing the appropriate semantics for workbench undo, it is useful to
682 :     introduce terminology that is independent of any particular implementation for
683 :     undo support.<o:p></o:p></span></p>
684 :    
685 :     <h3>Undo contexts </h3>
686 :    
687 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Undo
688 :     implementations must provide a history of operations performed by the user and
689 :     some knowledge of the “context” for these operations.<span
690 :     style='mso-spacerun:yes'>  </span>For example, the text editor undo operates
691 :     within the context of a single document, while <span class=SpellE>refactoring</span>
692 :     undo operates within the context of some workspace resources.<span
693 :     style='mso-spacerun:yes'>   </span><o:p></o:p></span></p>
694 :    
695 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
696 :    
697 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>The context
698 : nick 1.2 for an operation helps determine where the undo for that operation is
699 :     available.<span style='mso-spacerun:yes'>  </span>When the contexts for different
700 :     operations are completely separate, the semantics for undoing an operation from
701 :     either context are easily understood.<span style='mso-spacerun:yes'> 
702 :     </span>Undoing an operation from one context does not affect the operation
703 :     history from the other context. <o:p></o:p></span></p>
704 : nick 1.1
705 :     <h3>Undo scopes </h3>
706 :    
707 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Even when
708 :     completely separate undo contexts exist, the scope of the operation history and
709 :     resulting undo operation must be defined.<span style='mso-spacerun:yes'> 
710 :     </span>There are a few different alternatives:<o:p></o:p></span></p>
711 :    
712 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
713 :    
714 :     <p class=MsoNormal style='margin-left:.5in;text-indent:-.25in;mso-list:l21 level1 lfo1;
715 :     tab-stops:list .5in'><![if !supportLists]><span style='font-size:10.0pt;
716 :     font-family:Arial;mso-fareast-font-family:Arial'><span style='mso-list:Ignore'>-<span
717 :     style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
718 :     </span></span></span><![endif]><span style='font-size:10.0pt;font-family:Arial'>The
719 :     UI that manipulates each separate undo context provides its own undo command.<span
720 :     style='mso-spacerun:yes'>  </span>This is done in R3.0.1 with Edit&gt;Undo and <span
721 :     class=SpellE>Refactoring</span>&gt;Undo.<span style='mso-spacerun:yes'> 
722 :     </span>This does not scale well, but makes it clear which context is to be
723 :     undone by forcing the user to explicitly choose the context for the undo.<span
724 :     style='mso-spacerun:yes'>  </span>We call this an <b style='mso-bidi-font-weight:
725 :     normal'>explicit local undo scope</b>.<o:p></o:p></span></p>
726 :    
727 :     <p class=MsoNormal style='margin-left:.5in;text-indent:-.25in;mso-list:l21 level1 lfo1;
728 :     tab-stops:list .5in'><![if !supportLists]><span style='font-size:10.0pt;
729 :     font-family:Arial;mso-fareast-font-family:Arial'><span style='mso-list:Ignore'>-<span
730 :     style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
731 :     </span></span></span><![endif]><span style='font-size:10.0pt;font-family:Arial'>A
732 :     unified undo command exists and its meaning is interpreted according to some
733 :     current context (such as the active part or the currently edited model).<span
734 :     style='mso-spacerun:yes'>  </span>The unified command only ever operates on the
735 :     current context.<span style='mso-spacerun:yes'>  </span>This is analogous to
736 :     retargeted global actions in the Eclipse workbench.<span
737 :     style='mso-spacerun:yes'>  </span>We call this <b style='mso-bidi-font-weight:
738 :     normal'>implicit local undo scope</b>.<o:p></o:p></span></p>
739 :    
740 :     <p class=MsoNormal style='margin-left:.5in;text-indent:-.25in;mso-list:l21 level1 lfo1;
741 :     tab-stops:list .5in'><![if !supportLists]><span style='font-size:10.0pt;
742 :     font-family:Arial;mso-fareast-font-family:Arial'><span style='mso-list:Ignore'>-<span
743 :     style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
744 :     </span></span></span><![endif]><span style='font-size:10.0pt;font-family:Arial'>A
745 :     unified undo command exists and its meaning is global for all operations
746 :     performed in the system.<span style='mso-spacerun:yes'>  </span>The history
747 :     list and default operation to be undone have no relationship to the user’s
748 :     current context.<span style='mso-spacerun:yes'>  </span>We call this <b
749 :     style='mso-bidi-font-weight:normal'>global undo scope</b>.<o:p></o:p></span></p>
750 :    
751 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
752 :    
753 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>The
754 :     appropriate scope to be used depends on what the user is doing.<span
755 :     style='mso-spacerun:yes'>  </span>When the operations performed by a user are sequential
756 :     steps in a larger task, a global scope may be appropriate.<span
757 :     style='mso-spacerun:yes'>  </span>When a user is performing separate tasks
758 :     while working in separate views, a more localized scope is appropriate.<span
759 :     style='mso-spacerun:yes'>  </span>The decision is largely subjective and often
760 :     cannot be predicted by the system. <a style='mso-footnote-id:ftn1' href="#_ftn1"
761 :     name="_ftnref1" title=""><span class=MsoFootnoteReference><span
762 :     style='mso-special-character:footnote'><![if !supportFootnotes]><span
763 :     class=MsoFootnoteReference><span style='font-size:10.0pt;font-family:Arial;
764 :     mso-fareast-font-family:"Times New Roman";mso-ansi-language:EN-US;mso-fareast-language:
765 :     EN-US;mso-bidi-language:AR-SA'>[1]</span></span><![endif]></span></span></a><o:p></o:p></span></p>
766 :    
767 :     <h3>Shared undo contexts<o:p></o:p></h3>
768 :    
769 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Unfortunately,
770 :     the SDK model for undo is more complicated.<span style='mso-spacerun:yes'> 
771 :     </span>The contexts for edit and <span class=SpellE>refactoring</span> undo are
772 :     not completely separate.<span style='mso-spacerun:yes'>  </span>The user can
773 :     trigger <span class=SpellE>refactoring</span> changes from the editor
774 :     itself.<span style='mso-spacerun:yes'>  </span>These changes can manipulate
775 :     both the document being edited and other workspace resources.<span
776 :     style='mso-spacerun:yes'>  </span>Further, these changes occur alongside
777 :     localized text editing changes, creating an operation history with multiple
778 :     contexts that are initiated from a single part.<span style='mso-spacerun:yes'> 
779 :     </span><o:p></o:p></span></p>
780 :    
781 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
782 :    
783 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Even when a
784 :     local undo scope is employed, there are different possibilities for
785 :     interpreting “undo” when a <span class=SpellE>refactoring</span> operation is
786 :     triggered from an editor:<o:p></o:p></span></p>
787 :    
788 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
789 :    
790 :     <ol style='margin-top:0in' start=1 type=1>
791 :     <li class=MsoNormal style='mso-list:l22 level1 lfo3;tab-stops:list .5in'><span
792 :     style='font-size:10.0pt;font-family:Arial'>Edit&gt;Undo causes reversal of
793 :     the <span class=SpellE>refactoring</span> operation that was triggered
794 :     inside the editor.<o:p></o:p></span></li>
795 :     <li class=MsoNormal style='mso-list:l22 level1 lfo3;tab-stops:list .5in'><span
796 :     style='font-size:10.0pt;font-family:Arial'>Edit&gt;Undo causes reversal of
797 :     only the editor’s text-related changes that were caused by the <span
798 :     class=SpellE>refactoring</span> operation.<span style='mso-spacerun:yes'> 
799 :     </span>Thus, the text editing caused by the <span class=SpellE>refactor</span>
800 :     is undone, but the <span class=SpellE>refactor</span> itself is not undone
801 :     (this happens in R3.0.1).<o:p></o:p></span></li>
802 :     <li class=MsoNormal style='mso-list:l22 level1 lfo3;tab-stops:list .5in'><span
803 :     style='font-size:10.0pt;font-family:Arial'>Edit&gt;Undo is unaware of the <span
804 :     class=SpellE>refactoring</span> operation since it affected a context
805 :     larger than the editor itself.<span style='mso-spacerun:yes'>  </span>The
806 :     text operation that occurred before the <span class=SpellE>refactor</span>
807 :     is undone. <o:p></o:p></span></li>
808 :     </ol>
809 :    
810 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
811 :    
812 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Examining
813 :     scenarios and the desired behavior shows that any one (or more) of the three
814 :     alternatives are desirable at different times, depending on what the user is
815 : nick 1.2 trying to achieve.<span style='mso-spacerun:yes'>  </span>Appendix A collects
816 :     various <span class=SpellE>refactoring</span> and edit scenarios to help
817 :     demonstrate the challenge.<o:p></o:p></span></p>
818 : nick 1.1
819 :     <h3>Linear vs. selective undo<o:p></o:p></h3>
820 :    
821 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>The
822 :     appearance of a simple Edit&gt;Undo command in the UI typically implies a
823 :     linear undo.<span style='mso-spacerun:yes'>  </span>That is, the most recent operation
824 :     executed is undone.<span style='mso-spacerun:yes'>  </span>Descriptive undo
825 :     labels (such as “Undo Typing” or “Undo Rename”) help to remind the user of the
826 :     last “undoable” operation.<o:p></o:p></span></p>
827 :    
828 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
829 :    
830 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>As we’ve
831 :     shown in discussing scopes and contexts, a strictly linear global undo is not
832 :     the ideal behavior when working across contexts.<span
833 :     style='mso-spacerun:yes'>  </span>Once an attempt is made to choose the
834 :     “appropriate” operation to be undone in the user’s current context, it’s
835 :     possible that the chosen operation is not the most recently executed operation.<span
836 :     style='mso-spacerun:yes'>  </span>Decisions must be made about how to handle
837 :     more recently executed operations.<span style='mso-spacerun:yes'>  </span>A
838 :     strictly linear model would force more recent operations to be undone before
839 :     allowing the chosen operation to be undone.<o:p></o:p></span></p>
840 :    
841 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><span
842 :     style='mso-spacerun:yes'> </span><o:p></o:p></span></p>
843 :    
844 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>In a
845 :     selective undo approach, users are given an opportunity to view the history
846 :     list and select the operation to be undone.<span style='mso-spacerun:yes'> 
847 :     </span>Operations that can be undone in the current state of the application
848 :     are available for undo at any time, even if there are more recent operations in
849 :     the history.<span style='mso-spacerun:yes'>  </span><o:p></o:p></span></p>
850 :    
851 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
852 :    
853 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>The
854 :     workbench support should minimally be a hybrid of these approaches.<span
855 :     style='mso-spacerun:yes'>  </span>When the operation appropriate for one
856 :     context is not the most recently executed one, then the user (by prompt or by
857 :     preference) should have input into the decision to roll back any more recent operations
858 :     or perform the undo selectively and retain the rest of the history list.<o:p></o:p></span></p>
859 :    
860 :     <h2>Proposed Undo Support<o:p></o:p></h2>
861 :    
862 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>While the
863 :     discussion and scenarios surrounding scopes and contexts have focused on the
864 :     “hard cases,” it should be realized that most users will seek out “undo” in the
865 :     simple cases.<span style='mso-spacerun:yes'>  </span>Single context, strictly
866 :     linear undo, particularly in text editing, is provided in most popular
867 :     applications.<span style='mso-spacerun:yes'>  </span>The availability of a more
868 :     selective undo for the “hard cases” should not hinder the expected behavior of
869 :     the simple cases. <o:p></o:p></span></p>
870 :    
871 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
872 :    
873 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Support for
874 :     undo should be “pay as you go,” in terms of efficiency, burden on the user, and
875 :     burden on the implementer.<span style='mso-spacerun:yes'>  </span>Validation of
876 :     operations in the history list against the current state of the application
877 :     should be on demand, rather than forcing operation objects to watch the current
878 :     state of the application and react to changes (even when the user might never
879 :     choose “undo.”)<o:p></o:p></span></p>
880 :    
881 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
882 :    
883 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Undo
884 :     support should not assume the presence of a user interface.<span
885 :     style='mso-spacerun:yes'>  </span>The operations history and associated
886 :     interfaces can be defined independent of the UI.<o:p></o:p></span></p>
887 :    
888 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
889 :    
890 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>With these
891 :     goals in mind, the following implementation is proposed:<o:p></o:p></span></p>
892 :    
893 :     <h3>Operations Framework</h3>
894 :    
895 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>A framework
896 :     for defining executable, undoable operations (<span class=SpellE>IOperation</span>)
897 :     will be provided in a core package, <span class=SpellE>org.eclipse.core.operations</span>.<span
898 :     style='mso-spacerun:yes'>  </span>As actions are run, an object describing the
899 :     operation to be performed is created, executed, and added to an operations history
900 :     (<span class=SpellE>IOperationHistory</span>).<span style='mso-spacerun:yes'> 
901 :     </span>Operations which are comprised of distinct steps are represented as
902 :     compound operations.<span style='mso-spacerun:yes'>  </span>Compound operations
903 : nick 1.2 must be executed as a unit, and can never be partially undone.<span
904 :     style='mso-spacerun:yes'>  </span><o:p></o:p></span></p>
905 : nick 1.1
906 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
907 :    
908 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Operations
909 :     can be assigned one or more contexts (<span class=SpellE>IOperationContext</span>)
910 :     to which they apply.<span style='mso-spacerun:yes'>  </span>The interface for operation
911 :     contexts is left very general so that operation implementers may choose the
912 :     appropriate representation for their contexts.<span style='mso-spacerun:yes'> 
913 :     </span>In some cases, a part-oriented context may be appropriate (an editor’s
914 :     undo context is the editor part itself).<span style='mso-spacerun:yes'> 
915 :     </span>In other cases, a model object may serve as the context (the navigator’s
916 :     context is the workspace). The interface leaves this to the discretion of the
917 :     implementer and requires only that equality of contexts can be
918 :     established.<span style='mso-spacerun:yes'>  </span>User-appropriate labels and
919 :     descriptions for operation contexts are required so that any filtered operation
920 :     history views can appropriately label the contexts that are filtering the view.<o:p></o:p></span></p>
921 :    
922 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
923 :    
924 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Contexts
925 :     can be assigned in multiple ways:<o:p></o:p></span></p>
926 :    
927 :     <p class=MsoNormal style='margin-left:39.0pt;text-indent:-.25in;mso-list:l23 level1 lfo24;
928 :     tab-stops:list 39.0pt'><![if !supportLists]><span style='font-size:10.0pt;
929 :     font-family:Arial;mso-fareast-font-family:Arial'><span style='mso-list:Ignore'>1.<span
930 :     style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><![endif]><span
931 :     style='font-size:10.0pt;font-family:Arial'>When the triggering object knows the
932 :     context of the operation, the context can be assigned up front.<span
933 :     style='mso-spacerun:yes'>  </span>For example, text operations are triggered by
934 :     typing in the editor, and the editor can assign its context to the operation
935 :     before adding it to the history.<span style='mso-spacerun:yes'>  </span><o:p></o:p></span></p>
936 :    
937 :     <p class=MsoNormal style='margin-left:39.0pt;text-indent:-.25in;mso-list:l23 level1 lfo24;
938 :     tab-stops:list 39.0pt'><![if !supportLists]><span style='font-size:10.0pt;
939 :     font-family:Arial;mso-fareast-font-family:Arial'><span style='mso-list:Ignore'>2.<span
940 :     style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><![endif]><span
941 :     style='font-size:10.0pt;font-family:Arial'>Depending on the structure of the
942 :     code, the object that creates the operation object may not know what context is
943 :     appropriate, or if other contexts should be included.<span
944 :     style='mso-spacerun:yes'>  </span>In these cases, a listener can be added to
945 :     the operations history.<span style='mso-spacerun:yes'>  </span>When an operation
946 :     is added to the history, listeners can decide if their context should be added
947 :     to the operation.<span style='mso-spacerun:yes'>  </span><o:p></o:p></span></p>
948 :    
949 :     <p class=MsoNormal style='margin-left:21.0pt'><span style='font-size:10.0pt;
950 :     font-family:Arial'><o:p>&nbsp;</o:p></span></p>
951 :    
952 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Representing
953 :     the contexts for an operation as a collection (empty graph) assumes that there
954 :     is no inherent relationship between operation contexts.<span
955 :     style='mso-spacerun:yes'>  </span>This allows the most flexibility in defining
956 :     contexts.<span style='mso-spacerun:yes'>   </span>For example, an editor may perform
957 :     an operation that affects both the editor’s document and the workspace at
958 :     large.<span style='mso-spacerun:yes'>  </span>These will be considered two
959 :     independent contexts and assigned to the operation.<span
960 :     style='mso-spacerun:yes'>  </span>One could argue that the context for the
961 :     document is simply a refinement of the workspace context, and that a
962 :     hierarchical relationship between those contexts should exist.<span
963 :     style='mso-spacerun:yes'>  </span>Without more use cases, we avoid establishing
964 :     any relationship between contexts at this time<o:p></o:p></span></p>
965 :    
966 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
967 :    
968 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Operation contexts
969 :     that are used when manipulating well-known models should be accessible by
970 :     API.<span style='mso-spacerun:yes'>  </span>This can be done in multiple ways:<o:p></o:p></span></p>
971 :    
972 :     <ol style='margin-top:0in' start=1 type=1>
973 :     <li class=MsoNormal style='mso-list:l20 level1 lfo25;tab-stops:list .5in'><span
974 :     style='font-size:10.0pt;font-family:Arial'>API for obtaining a context can
975 :     be added in the same place where the associated model can be
976 :     obtained.<span style='mso-spacerun:yes'>  </span>For example, an editor
977 :     can provide both the document and the context for performing operations on
978 :     the document as API.<o:p></o:p></span></li>
979 :     <li class=MsoNormal style='mso-list:l20 level1 lfo25;tab-stops:list .5in'><span
980 :     style='font-size:10.0pt;font-family:Arial'>Contexts that are related
981 :     directly to certain preexisting platform objects can be obtained using an
982 :     adapter on that object.<span style='mso-spacerun:yes'>  </span>For
983 :     example, the workbench could add an operation context adapter factory for
984 :     the workspace.<span style='mso-spacerun:yes'>  </span>Clients could
985 :     retrieve this adapter using context=<span class=SpellE>workspace.getAdapter</span>(<span
986 :     class=SpellE>IOperationContext.class</span>);<o:p></o:p></span></li>
987 :     </ol>
988 :    
989 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
990 :    
991 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>The
992 :     following interfaces represent the operation, the operation history, and the operation
993 :     context.<o:p></o:p></span></p>
994 :    
995 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
996 :    
997 : nick 1.2 <p class=MsoNormal style='tab-stops:.5in 189.0pt'><span style='font-size:10.0pt;
998 :     font-family:Arial'>public interface <span class=SpellE>IOperation</span> {<o:p></o:p></span></p>
999 : nick 1.1
1000 : nick 1.2 <p class=MsoNormal style='tab-stops:.5in 189.0pt'><span style='font-size:10.0pt;
1001 :     font-family:Arial'>void <span class=SpellE>addContext</span>(<span
1002 : nick 1.1 class=SpellE>IOperationContext</span>);<span style='mso-tab-count:1'>           </span>//
1003 :     add the context to the operation’s contexts<o:p></o:p></span></p>
1004 :    
1005 :     <p class=MsoNormal style='tab-stops:.5in 189.0pt'><span class=SpellE><span
1006 : nick 1.2 style='font-size:10.0pt;font-family:Arial'>boolean</span></span><span
1007 : nick 1.1 style='font-size:10.0pt;font-family:Arial'> <span class=SpellE>hasContext</span>(<span
1008 :     class=SpellE>IOperationContext</span>);<span style='mso-tab-count:1'>     </span>//answer
1009 :     whether the receiver’s contexts contain the context<o:p></o:p></span></p>
1010 :    
1011 :     <p class=MsoNormal style='tab-stops:.5in 189.0pt'><span style='font-size:10.0pt;
1012 : nick 1.2 font-family:Arial'>List <span class=SpellE>getContexts</span>();<span
1013 :     style='mso-tab-count:1'>                                    </span>// answer
1014 :     the list of contexts assigned to the receiver.<o:p></o:p></span></p>
1015 : nick 1.1
1016 :     <p class=MsoNormal style='tab-stops:.5in 189.0pt'><span class=SpellE><span
1017 :     style='font-size:10.0pt;font-family:Arial'>IStatus</span></span><span
1018 : nick 1.2 style='font-size:10.0pt;font-family:Arial'> <span class=SpellE>canExecute</span>();<span
1019 : nick 1.1 style='mso-tab-count:1'>                                </span>// answer whether
1020 :     the receiver can be executed<o:p></o:p></span></p>
1021 :    
1022 :     <p class=MsoNormal style='tab-stops:.5in 189.0pt'><span class=SpellE><span
1023 :     style='font-size:10.0pt;font-family:Arial'>IStatus</span></span><span
1024 : nick 1.2 style='font-size:10.0pt;font-family:Arial'> <span class=SpellE>canRedo</span>();<span
1025 : nick 1.1 style='mso-tab-count:1'>                                    </span>// answer
1026 :     whether the receiver can be redone<o:p></o:p></span></p>
1027 :    
1028 :     <p class=MsoNormal style='tab-stops:.5in 189.0pt'><span class=SpellE><span
1029 :     style='font-size:10.0pt;font-family:Arial'>IStatus</span></span><span
1030 : nick 1.2 style='font-size:10.0pt;font-family:Arial'> <span class=SpellE>canUndo</span>();<span
1031 : nick 1.1 style='mso-tab-count:1'>                                    </span>// answer
1032 :     whether the receiver can be undone<o:p></o:p></span></p>
1033 :    
1034 : nick 1.2 <p class=MsoNormal style='tab-stops:.5in 189.0pt'><span style='font-size:10.0pt;
1035 :     font-family:Arial'>void execute(<span class=SpellE>IProgressMonitor</span>);<span
1036 : nick 1.1 style='mso-tab-count:1'>                  </span>// execute the operation <o:p></o:p></span></p>
1037 :    
1038 : nick 1.2 <p class=MsoNormal style='tab-stops:.5in 189.0pt'><span style='font-size:10.0pt;
1039 :     font-family:Arial'>void redo(<span class=SpellE>IProgressMonitor</span>);<span
1040 : nick 1.1 style='mso-tab-count:1'>                       </span>// redo the operation<o:p></o:p></span></p>
1041 :    
1042 : nick 1.2 <p class=MsoNormal style='tab-stops:.5in 189.0pt'><span style='font-size:10.0pt;
1043 :     font-family:Arial'>void undo(<span class=SpellE>IProgressMonitor</span>);<span
1044 : nick 1.1 style='mso-tab-count:1'>                      </span>// undo the operation<o:p></o:p></span></p>
1045 :    
1046 : nick 1.2 <p class=MsoNormal style='tab-stops:.5in 189.0pt'><span style='font-size:10.0pt;
1047 :     font-family:Arial'>void dispose();<span style='mso-tab-count:1'>                                          </span>//
1048 :     the operation is no longer needed<o:p></o:p></span></p>
1049 : nick 1.1
1050 :     <p class=MsoNormal style='tab-stops:.5in 189.0pt'><span style='font-size:10.0pt;
1051 : nick 1.2 font-family:Arial'>String <span class=SpellE>getLabel</span>();<span
1052 :     style='mso-tab-count:1'>                                      </span>// provide
1053 :     a label to name this operation for the user<o:p></o:p></span></p>
1054 : nick 1.1
1055 :     <p class=MsoNormal style='tab-stops:.5in 189.0pt'><span style='font-size:10.0pt;
1056 : nick 1.2 font-family:Arial'>String <span class=SpellE>getDescription</span>();<span
1057 :     style='mso-tab-count:1'>                              </span>// provide a
1058 :     description of this operation for the user<o:p></o:p></span></p>
1059 : nick 1.1
1060 :     <p class=MsoNormal style='tab-stops:.5in 189.0pt'><span style='font-size:10.0pt;
1061 :     font-family:Arial'>}<o:p></o:p></span></p>
1062 :    
1063 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><span
1064 :     style='mso-tab-count:1'>            </span><o:p></o:p></span></p>
1065 :    
1066 :     <p class=MsoNormal style='tab-stops:.5in .75in 207.0pt 3.5in 297.0pt 4.75in'><span
1067 : nick 1.2 style='font-size:10.0pt;font-family:Arial'>public interface <span class=SpellE>IOperationHistory</span>
1068 : nick 1.1 {<o:p></o:p></span></p>
1069 :    
1070 :     <p class=MsoNormal style='tab-stops:.5in .75in 207.0pt 3.5in 297.0pt 4.75in'><span
1071 : nick 1.2 style='font-size:10.0pt;font-family:Arial'>void add(<span class=SpellE>IOperation</span>);<span
1072 : nick 1.1 style='mso-tab-count:1'>                                        </span>// add
1073 :     the specified operation to the history<o:p></o:p></span></p>
1074 :    
1075 :     <p class=MsoNormal style='tab-stops:.5in .75in 207.0pt 3.5in 297.0pt 4.75in'><span
1076 : nick 1.2 style='font-size:10.0pt;font-family:Arial'>void redo(<span class=SpellE>IOperationContext</span>,
1077 : nick 1.1 <span class=SpellE>IProgressMonitor</span>);<o:p></o:p></span></p>
1078 :    
1079 :     <p class=MsoNormal style='tab-stops:.5in .75in 207.0pt 3.5in 297.0pt 4.75in'><span
1080 :     style='font-size:10.0pt;font-family:Arial'><span style='mso-tab-count:1'>            </span>//
1081 :     perform the redo operation for the given context<o:p></o:p></span></p>
1082 :    
1083 :     <p class=MsoNormal style='tab-stops:.5in .75in 207.0pt 3.5in 297.0pt 4.75in'><span
1084 : nick 1.2 style='font-size:10.0pt;font-family:Arial'>void undo(<span class=SpellE>IOperationContext</span>,
1085 : nick 1.1 <span class=SpellE>IProgressMonitor</span>);<o:p></o:p></span></p>
1086 :    
1087 :     <p class=MsoNormal style='tab-stops:.5in .75in 207.0pt 3.5in 297.0pt 4.75in'><span
1088 :     style='font-size:10.0pt;font-family:Arial'><span style='mso-tab-count:1'>            </span>//
1089 :     perform the undo operation appropriate for the given context.<o:p></o:p></span></p>
1090 :    
1091 :     <p class=MsoNormal style='tab-stops:.5in .75in 207.0pt 3.5in 297.0pt 4.75in'><span
1092 :     class=SpellE><span style='font-size:10.0pt;font-family:Arial'>IStatus</span></span><span
1093 : nick 1.2 style='font-size:10.0pt;font-family:Arial'> <span class=SpellE>canRedoIn</span>(<span
1094 : nick 1.1 class=SpellE>IOperationContext</span>);<span style='mso-tab-count:1'>              </span>//
1095 :     answer whether redo is available in the given context<o:p></o:p></span></p>
1096 :    
1097 :     <p class=MsoNormal style='tab-stops:.5in .75in 207.0pt 3.5in 297.0pt 4.75in'><span
1098 :     class=SpellE><span style='font-size:10.0pt;font-family:Arial'>IStatus</span></span><span
1099 : nick 1.2 style='font-size:10.0pt;font-family:Arial'> <span class=SpellE>canUndoIn</span>(<span
1100 : nick 1.1 class=SpellE>IOperationContext</span>);<span style='mso-tab-count:1'>              </span>//
1101 :     answer whether undo is available in the given context<o:p></o:p></span></p>
1102 :    
1103 :     <p class=MsoNormal style='tab-stops:.5in .75in 207.0pt 3.5in 297.0pt 4.75in'><span
1104 : nick 1.2 style='font-size:10.0pt;font-family:Arial'>void <span class=SpellE>addOperationHistoryListener</span>(<span
1105 : nick 1.1 class=SpellE>IOperationHistoryListener</span>);<o:p></o:p></span></p>
1106 :    
1107 :     <p class=MsoNormal style='tab-stops:.5in .75in 207.0pt 3.5in 297.0pt 4.75in'><span
1108 :     style='font-size:10.0pt;font-family:Arial'><span style='mso-tab-count:1'>            </span>//
1109 :     add a listener for changes to the operation history<o:p></o:p></span></p>
1110 :    
1111 :     <p class=MsoNormal style='tab-stops:.5in .75in 207.0pt 3.5in 297.0pt 4.75in'><span
1112 : nick 1.2 style='font-size:10.0pt;font-family:Arial'>void <span class=SpellE>removeOperationHistoryListener</span>(<span
1113 : nick 1.1 class=SpellE>IOperationHistoryListener</span>);<o:p></o:p></span></p>
1114 :    
1115 :     <p class=MsoNormal style='tab-stops:.5in .75in 207.0pt 3.5in 297.0pt 4.75in'><span
1116 :     style='font-size:10.0pt;font-family:Arial'><span style='mso-tab-count:1'>            </span>//
1117 :     remove the specified history listener from the receiver.<o:p></o:p></span></p>
1118 :    
1119 :     <p class=MsoNormal style='tab-stops:.5in .75in 207.0pt 3.5in 297.0pt 4.75in'><span
1120 :     class=SpellE><span style='font-size:10.0pt;font-family:Arial'>IOperation</span></span><span
1121 : nick 1.2 style='font-size:10.0pt;font-family:Arial'> <span class=SpellE>getRedoFor</span>(<span
1122 : nick 1.1 class=SpellE>IOperationContext</span>);<span style='mso-tab-count:1'>        </span>//
1123 :     get the redo operation for the given context<o:p></o:p></span></p>
1124 :    
1125 :     <p class=MsoNormal style='tab-stops:.5in .75in 207.0pt 3.5in 297.0pt 4.75in'><span
1126 :     class=SpellE><span style='font-size:10.0pt;font-family:Arial'>IOperation</span></span><span
1127 : nick 1.2 style='font-size:10.0pt;font-family:Arial'> [] <span class=SpellE>getRedoHistoryFor</span>(<span
1128 : nick 1.1 class=SpellE>IOperationContext</span>);<span style='mso-spacerun:yes'>  </span>//
1129 :     answer the redo history list for the given context<o:p></o:p></span></p>
1130 :    
1131 :     <p class=MsoNormal style='tab-stops:.5in .75in 207.0pt 3.5in 297.0pt 4.75in'><span
1132 :     class=SpellE><span style='font-size:10.0pt;font-family:Arial'>IOperation</span></span><span
1133 : nick 1.2 style='font-size:10.0pt;font-family:Arial'> <span class=SpellE>getUndoFor</span>(<span
1134 : nick 1.1 class=SpellE>IOperationContext</span>);<span style='mso-tab-count:1'>        </span>//
1135 :     answer the undo operation for the given context<o:p></o:p></span></p>
1136 :    
1137 :     <p class=MsoNormal style='tab-stops:.5in .75in 207.0pt 3.5in 297.0pt 4.75in'><span
1138 :     class=SpellE><span style='font-size:10.0pt;font-family:Arial'>IOperation</span></span><span
1139 : nick 1.2 style='font-size:10.0pt;font-family:Arial'> [] <span class=SpellE>getUndoHistoryFor</span>(<span
1140 : nick 1.1 class=SpellE>IOperationContext</span>);<span style='mso-spacerun:yes'>  </span>//
1141 :     answer the undo history list for the given context<o:p></o:p></span></p>
1142 :    
1143 :     <p class=MsoNormal style='tab-stops:.5in .75in 207.0pt 3.5in 297.0pt 4.75in'><span
1144 : nick 1.2 style='font-size:10.0pt;font-family:Arial'>void <span class=SpellE>disposeAll</span>(<span
1145 : nick 1.1 class=SpellE>IOperationContext</span>);<o:p></o:p></span></p>
1146 :    
1147 :     <p class=MsoNormal style='tab-stops:.5in .75in 207.0pt 3.5in 297.0pt 4.75in'><span
1148 :     style='font-size:10.0pt;font-family:Arial'><span style='mso-tab-count:1'>            </span>//
1149 :     Remove all operations that have only the specified context.<span
1150 :     style='mso-spacerun:yes'>  </span>Implementers must<o:p></o:p></span></p>
1151 :    
1152 :     <p class=MsoNormal style='tab-stops:.5in .75in 207.0pt 3.5in 297.0pt 4.75in'><span
1153 :     style='font-size:10.0pt;font-family:Arial'><span style='mso-tab-count:1'>            </span>//
1154 :     determine how to handle operations that have additional contexts.<o:p></o:p></span></p>
1155 :    
1156 :     <p class=MsoNormal style='tab-stops:.5in .75in 207.0pt 3.5in 297.0pt 4.75in'><span
1157 : nick 1.2 style='font-size:10.0pt;font-family:Arial'>void <span class=SpellE>setLimit</span>(<span
1158 : nick 1.1 class=SpellE>int</span>);<o:p></o:p></span></p>
1159 :    
1160 :     <p class=MsoNormal style='tab-stops:.5in .75in 207.0pt 3.5in 297.0pt 4.75in'><span
1161 :     style='font-size:10.0pt;font-family:Arial'><span style='mso-tab-count:1'>            </span>//
1162 :     set a limit on the operation history.<span style='mso-spacerun:yes'> 
1163 :     </span>When the limit is reached, the oldest operation <o:p></o:p></span></p>
1164 :    
1165 :     <p class=MsoNormal style='tab-stops:.5in .75in 207.0pt 3.5in 297.0pt 4.75in'><span
1166 :     style='font-size:10.0pt;font-family:Arial'><span style='mso-tab-count:1'>            </span>//
1167 :     will be disposed to make room for new operations.<o:p></o:p></span></p>
1168 :    
1169 :     <p class=MsoNormal style='tab-stops:.75in 207.0pt'><span style='font-size:10.0pt;
1170 :     font-family:Arial'>}<o:p></o:p></span></p>
1171 :    
1172 :     <p class=MsoNormal style='tab-stops:.75in 207.0pt'><span style='font-size:10.0pt;
1173 :     font-family:Arial'><o:p>&nbsp;</o:p></span></p>
1174 :    
1175 : nick 1.2 <p class=MsoNormal style='tab-stops:207.0pt'><span style='font-size:10.0pt;
1176 :     font-family:Arial'>public interface <span class=SpellE>IOperationHistoryListener</span>
1177 : nick 1.1 {<o:p></o:p></span></p>
1178 :    
1179 : nick 1.2 <p class=MsoNormal style='tab-stops:207.0pt'><span style='font-size:10.0pt;
1180 :     font-family:Arial'>void <span class=SpellE>operationAdded</span>(<span
1181 : nick 1.1 class=SpellE>IOperation</span>);<span style='mso-tab-count:1'>                      </span>//
1182 :     an operation has been added to the history<o:p></o:p></span></p>
1183 :    
1184 : nick 1.2 <p class=MsoNormal style='tab-stops:207.0pt'><span style='font-size:10.0pt;
1185 :     font-family:Arial'>void <span class=SpellE>aboutToUndo</span>(<span
1186 : nick 1.1 class=SpellE>IOperation</span>);<span style='mso-tab-count:1'>                          </span>//
1187 :     the operation is about to be undone<o:p></o:p></span></p>
1188 :    
1189 : nick 1.2 <p class=MsoNormal style='tab-stops:207.0pt'><span style='font-size:10.0pt;
1190 :     font-family:Arial'>void undone(<span class=SpellE>IOperation</span>);<span
1191 : nick 1.1 style='mso-tab-count:1'>                                  </span>// the
1192 :     operation was undone<o:p></o:p></span></p>
1193 :    
1194 : nick 1.2 <p class=MsoNormal style='tab-stops:207.0pt'><span style='font-size:10.0pt;
1195 :     font-family:Arial'>void <span class=SpellE>aboutToRedo</span>(<span
1196 : nick 1.1 class=SpellE>IOperation</span>);<span style='mso-tab-count:1'>                          </span>//
1197 :     the operation is about to be redone<o:p></o:p></span></p>
1198 :    
1199 : nick 1.2 <p class=MsoNormal style='tab-stops:207.0pt'><span style='font-size:10.0pt;
1200 :     font-family:Arial'>void redone(<span class=SpellE>IOperation</span>);<span
1201 : nick 1.1 style='mso-tab-count:1'>                                   </span>// the
1202 :     operation was redone<o:p></o:p></span></p>
1203 :    
1204 :     <p class=MsoNormal style='tab-stops:207.0pt'><span style='font-size:10.0pt;
1205 :     font-family:Arial'>}<o:p></o:p></span></p>
1206 :    
1207 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
1208 :    
1209 : nick 1.2 <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>public
1210 : nick 1.1 interface <span class=SpellE>IOperationContext</span> {<o:p></o:p></span></p>
1211 :    
1212 :     <p class=MsoNormal><span class=SpellE><span style='font-size:10.0pt;font-family:
1213 :     Arial'>IOperationApproval</span></span><span style='font-size:10.0pt;
1214 : nick 1.2 font-family:Arial'> <span class=SpellE>getOperationApproval</span>();<o:p></o:p></span></p>
1215 : nick 1.1
1216 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>String <span
1217 : nick 1.2 class=SpellE>getDescription</span>();<o:p></o:p></span></p>
1218 : nick 1.1
1219 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>String <span
1220 : nick 1.2 class=SpellE>getLabel</span>();<o:p></o:p></span></p>
1221 : nick 1.1
1222 : nick 1.2 <p class=MsoNormal><span class=SpellE><span style='font-size:10.0pt;font-family:
1223 :     Arial'>boolean</span></span><span style='font-size:10.0pt;font-family:Arial'>
1224 :     equals(<span class=SpellE>IOperationContext</span>);<o:p></o:p></span></p>
1225 : nick 1.1
1226 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>}<o:p></o:p></span></p>
1227 :    
1228 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
1229 :    
1230 : nick 1.2 <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>public
1231 : nick 1.1 interface <span class=SpellE>IOperationApproval</span> {<o:p></o:p></span></p>
1232 :    
1233 : nick 1.2 <p class=MsoNormal><span class=SpellE><span style='font-size:10.0pt;font-family:
1234 :     Arial'>boolean</span></span><span style='font-size:10.0pt;font-family:Arial'> <span
1235 :     class=SpellE>proceedUndoing</span>(<span class=SpellE>IOperation</span>);<o:p></o:p></span></p>
1236 :    
1237 :     <p class=MsoNormal><span class=SpellE><span style='font-size:10.0pt;font-family:
1238 :     Arial'>boolean</span></span><span style='font-size:10.0pt;font-family:Arial'> <span
1239 :     class=SpellE>proceedRedoing</span>(<span class=SpellE>IOperation</span>);<o:p></o:p></span></p>
1240 : nick 1.1
1241 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>}<o:p></o:p></span></p>
1242 :    
1243 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
1244 :    
1245 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
1246 :    
1247 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>An
1248 :     operation is responsible for validating its ability to execute and undo against
1249 :     the current state of the application.<span style='mso-spacerun:yes'> 
1250 :     </span>Validation may be requested even when an operation is not the most
1251 :     recently executed operation (or most recently undone operation).<span
1252 :     style='mso-spacerun:yes'>  </span>This is important since operations in
1253 :     unrelated contexts may coexist in the same history unaware of one another’s
1254 :     existence.<span style='mso-spacerun:yes'>  </span><o:p></o:p></span></p>
1255 :    
1256 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
1257 :    
1258 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>As
1259 :     operations are executed, they are added to the operation history.<span
1260 :     style='mso-spacerun:yes'>  </span>Note that the operation history does not necessarily
1261 :     perform the initial execution, but rather assumes the operation is already
1262 :     executed before it is added to the history.<span style='mso-spacerun:yes'> 
1263 :     </span>This is necessary for text editing operations, where the operations are
1264 :     happening as the user types and the recording/batching of operations for the
1265 :     history occur afterwards.<span style='mso-spacerun:yes'>  </span><o:p></o:p></span></p>
1266 :    
1267 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
1268 :    
1269 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>The operation
1270 :     history is responsible for implementing the application’s undo model, and the
1271 :     decisions about handling multiple contexts.<span style='mso-spacerun:yes'> 
1272 :     </span>If an application chooses to implement a strictly linear, global undo,
1273 :     then its implementation of <span class=SpellE>IOperationHistory</span> can
1274 :     ensure that requests to perform undo or redo in a particular context will fail
1275 :     if the most recent operation does not have that context.<o:p></o:p></span></p>
1276 :    
1277 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
1278 :    
1279 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>More
1280 :     flexible undo models may be implemented with the assistance of the <span
1281 :     class=SpellE>IOperationApproval</span> that is assigned to an operation context.<span
1282 :     style='mso-spacerun:yes'>  </span>This interface allows other contexts to be
1283 :     consulted when an operation is to be executed or undone.<span
1284 :     style='mso-spacerun:yes'>  </span>The undo model defined by the operation
1285 :     history determines when to consult the <span class=SpellE>IOperationApproval</span>.<span
1286 :     style='mso-spacerun:yes'>  </span>Possible implementations will be discussed in
1287 :     more detail in the workbench scenarios.<span style='mso-spacerun:yes'>  </span><o:p></o:p></span></p>
1288 :    
1289 :     <h3>Workbench Undo Semantics</h3>
1290 :    
1291 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>The
1292 :     workbench will adopt a hybrid undo approach that allows selective undo across
1293 :     multiple contexts.<span style='mso-spacerun:yes'>  </span>The workbench will
1294 :     allow undo/redo of any valid operation in the history, <i style='mso-bidi-font-style:
1295 :     normal'>as long as there are no more recent operations in the history that
1296 :     share a context with the operation to be executed.</i><span
1297 :     style='mso-spacerun:yes'>  </span><span style='mso-spacerun:yes'> </span>If the
1298 :     operation to be undone/redone has contexts that are also present in operations appearing
1299 :     later in the history, then the <span class=SpellE>IOperationApproval</span> for
1300 :     the contexts that have the conflicts will be consulted.<span
1301 :     style='mso-spacerun:yes'>  </span><o:p></o:p></span></p>
1302 :    
1303 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
1304 :    
1305 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>A concrete
1306 :     example will help explain this.<span style='mso-spacerun:yes'>  </span><o:p></o:p></span></p>
1307 :    
1308 :     <p class=MsoNormal style='margin-left:.5in;text-indent:-.25in;mso-list:l21 level1 lfo1;
1309 :     tab-stops:list .5in'><![if !supportLists]><span style='font-size:10.0pt;
1310 :     font-family:Arial;mso-fareast-font-family:Arial'><span style='mso-list:Ignore'>-<span
1311 :     style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1312 :     </span></span></span><![endif]><span style='font-size:10.0pt;font-family:Arial'>The
1313 :     user makes local edits in editor A.<o:p></o:p></span></p>
1314 :    
1315 :     <p class=MsoNormal style='margin-left:.5in;text-indent:-.25in;mso-list:l21 level1 lfo1;
1316 :     tab-stops:list .5in'><![if !supportLists]><span style='font-size:10.0pt;
1317 :     font-family:Arial;mso-fareast-font-family:Arial'><span style='mso-list:Ignore'>-<span
1318 :     style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1319 :     </span></span></span><![endif]><span style='font-size:10.0pt;font-family:Arial'>The
1320 :     user initiates a <span class=SpellE>refactoring</span> operation whose context
1321 :     is “A” and “workspace.”<o:p></o:p></span></p>
1322 :    
1323 :     <p class=MsoNormal style='margin-left:.5in;text-indent:-.25in;mso-list:l21 level1 lfo1;
1324 :     tab-stops:list .5in'><![if !supportLists]><span style='font-size:10.0pt;
1325 :     font-family:Arial;mso-fareast-font-family:Arial'><span style='mso-list:Ignore'>-<span
1326 :     style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1327 :     </span></span></span><![endif]><span style='font-size:10.0pt;font-family:Arial'>The
1328 :     user makes additional local edits to editor A.<o:p></o:p></span></p>
1329 :    
1330 :     <p class=MsoNormal style='margin-left:.5in;text-indent:-.25in;mso-list:l21 level1 lfo1;
1331 :     tab-stops:list .5in'><![if !supportLists]><span style='font-size:10.0pt;
1332 :     font-family:Arial;mso-fareast-font-family:Arial'><span style='mso-list:Ignore'>-<span
1333 :     style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1334 :     </span></span></span><![endif]><span style='font-size:10.0pt;font-family:Arial'>The
1335 :     user goes to the navigator and selects Undo.<o:p></o:p></span></p>
1336 :    
1337 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
1338 :    
1339 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>In the
1340 :     proposed implementation, the navigator would request an undo for the context
1341 :     “workspace.”<span style='mso-spacerun:yes'>  </span>The <span class=SpellE>refactoring</span>
1342 :     operation triggered in the editor is the most recent operation that has the
1343 :     workspace context, but it also contains context “A.”<span
1344 :     style='mso-spacerun:yes'>  </span>Since subsequent operations in the history
1345 : nick 1.2 also have context “A,”, the <span class=SpellE>IOperationApproval</span> for
1346 :     context “A” is consulted as to whether the undo should proceed.<span
1347 :     style='mso-spacerun:yes'>  </span>The <span class=SpellE>IOperationApproval</span>
1348 :     <span style='mso-spacerun:yes'> </span>supplied by context “A” could do one of
1349 :     the following:<o:p></o:p></span></p>
1350 : nick 1.1
1351 :     <p class=MsoNormal style='margin-left:.5in;text-indent:-.25in;mso-list:l21 level1 lfo1;
1352 :     tab-stops:list .5in'><![if !supportLists]><span style='font-size:10.0pt;
1353 :     font-family:Arial;mso-fareast-font-family:Arial'><span style='mso-list:Ignore'>-<span
1354 :     style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1355 : nick 1.2 </span></span></span><![endif]><span style='font-size:10.0pt;font-family:Arial'>allow
1356 :     the undo to proceed, leaving the local changes to “A” in the undo history.<o:p></o:p></span></p>
1357 : nick 1.1
1358 :     <p class=MsoNormal style='margin-left:.5in;text-indent:-.25in;mso-list:l21 level1 lfo1;
1359 :     tab-stops:list .5in'><![if !supportLists]><span style='font-size:10.0pt;
1360 :     font-family:Arial;mso-fareast-font-family:Arial'><span style='mso-list:Ignore'>-<span
1361 :     style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1362 : nick 1.2 </span></span></span><![endif]><span style='font-size:10.0pt;font-family:Arial'>quietly
1363 :     undo the subsequent local changes to “A” and then allow the original undo to
1364 :     proceed.<o:p></o:p></span></p>
1365 : nick 1.1
1366 :     <p class=MsoNormal style='margin-left:.5in;text-indent:-.25in;mso-list:l21 level1 lfo1;
1367 :     tab-stops:list .5in'><![if !supportLists]><span style='font-size:10.0pt;
1368 :     font-family:Arial;mso-fareast-font-family:Arial'><span style='mso-list:Ignore'>-<span
1369 :     style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1370 : nick 1.2 </span></span></span><![endif]><span style='font-size:10.0pt;font-family:Arial'>switch
1371 :     to the editor and non-quietly undo the local changes to “A” before allowing the
1372 :     original undo to proceed.<o:p></o:p></span></p>
1373 : nick 1.1
1374 :     <p class=MsoNormal style='margin-left:.5in;text-indent:-.25in;mso-list:l21 level1 lfo1;
1375 :     tab-stops:list .5in'><![if !supportLists]><span style='font-size:10.0pt;
1376 :     font-family:Arial;mso-fareast-font-family:Arial'><span style='mso-list:Ignore'>-<span
1377 :     style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1378 : nick 1.2 </span></span></span><![endif]><span style='font-size:10.0pt;font-family:Arial'>prompt
1379 :     the user for the preferred action.<o:p></o:p></span></p>
1380 : nick 1.1
1381 :     <p class=MsoNormal style='margin-left:.5in;text-indent:-.25in;mso-list:l21 level1 lfo1;
1382 :     tab-stops:list .5in'><![if !supportLists]><span style='font-size:10.0pt;
1383 :     font-family:Arial;mso-fareast-font-family:Arial'><span style='mso-list:Ignore'>-<span
1384 :     style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1385 : nick 1.2 </span></span></span><![endif]><span style='font-size:10.0pt;font-family:Arial'>provide
1386 :     a user preference that drives the behavior of the scenario.<o:p></o:p></span></p>
1387 : nick 1.1
1388 :     <h4>Workbench IDE undo contexts<o:p></o:p></h4>
1389 :    
1390 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
1391 :    
1392 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>To support
1393 :     the existing workbench undo scenarios, there will be two kinds of contexts
1394 :     defined in the workbench IDE.<span style='mso-spacerun:yes'>  </span><o:p></o:p></span></p>
1395 :    
1396 :     <ol style='margin-top:0in' start=1 type=1>
1397 :     <li class=MsoNormal style='mso-list:l10 level1 lfo26;tab-stops:list .5in'><span
1398 :     style='font-size:10.0pt;font-family:Arial'>The “workspace” context will be
1399 :     used to represent changes that affect resources in the workspace.<span
1400 :     style='mso-spacerun:yes'>  </span><span class=SpellE>Refactoring</span>
1401 :     operations will use this context.<span style='mso-spacerun:yes'> 
1402 :     </span>Additional actions that affect the workspace (such as delete and
1403 :     create resources) would use this context.<span style='mso-spacerun:yes'> 
1404 :     </span>Views that manipulate the workspace, such as the navigator and
1405 : nick 1.2 package explorer, will use this context when creating operations and
1406 :     querying for the current “undo operation.”<span style='mso-spacerun:yes'> 
1407 : nick 1.1 </span>Views or editors that may be affected by workspace operations can
1408 :     add a listener to the operation history and add their context as needed to
1409 :     operations that have been added to the history.<span
1410 :     style='mso-spacerun:yes'>  </span><span style='mso-spacerun:yes'> </span>The
1411 :     workspace context implementation is not defined at this time, but it
1412 :     should be accessible by API.<span style='mso-spacerun:yes'>  </span><o:p></o:p></span></li>
1413 :     <li class=MsoNormal style='mso-list:l10 level1 lfo26;tab-stops:list .5in'><span
1414 :     style='font-size:10.0pt;font-family:Arial'>Editors will define a context
1415 :     that represents their particular editing session.<span
1416 :     style='mso-spacerun:yes'>  </span><span style='mso-spacerun:yes'> </span>That
1417 :     is, the context will be unique per editor, but editors may in fact share
1418 :     the context implementation class.<span style='mso-spacerun:yes'> 
1419 :     </span>Workspace-affecting operations, such as <span class=SpellE>refactoring</span>
1420 :     operations, that are triggered from an editor will be considered to occur
1421 :     in the context of both the editor and the workspace.<span
1422 :     style='mso-spacerun:yes'>  </span>This allows <span class=SpellE>refactoring</span>
1423 :     operations to coexist with text editing operations in the editor’s operation
1424 :     history and also be accessible from the operation history of other views
1425 :     that support the workspace context, such as the navigator. The editor’s
1426 :     context can be added using the listener as described above.<o:p></o:p></span></li>
1427 :     </ol>
1428 :    
1429 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
1430 :    
1431 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Further
1432 :     definition of contexts and the supported operations are required:<o:p></o:p></span></p>
1433 :    
1434 :     <p class=MsoNormal style='margin-left:.5in;text-indent:-.25in;mso-list:l21 level1 lfo1;
1435 :     tab-stops:list .5in'><![if !supportLists]><span style='font-size:10.0pt;
1436 :     font-family:Arial;mso-fareast-font-family:Arial'><span style='mso-list:Ignore'>-<span
1437 :     style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1438 :     </span></span></span><![endif]><span style='font-size:10.0pt;font-family:Arial'>The
1439 :     complete set of workspace operations (besides <span class=SpellE>refactoring</span>)
1440 :     that should be undoable must be defined.<o:p></o:p></span></p>
1441 :    
1442 :     <p class=MsoNormal style='margin-left:.5in;text-indent:-.25in;mso-list:l21 level1 lfo1;
1443 :     tab-stops:list .5in'><![if !supportLists]><span style='font-size:10.0pt;
1444 :     font-family:Arial;mso-fareast-font-family:Arial'><span style='mso-list:Ignore'>-<span
1445 :     style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1446 :     </span></span></span><![endif]><span style='font-size:10.0pt;font-family:Arial'>Any
1447 :     additional contexts required by the SDK (Team?<span style='mso-spacerun:yes'> 
1448 : nick 1.2 </span>Debug?) must be defined.<o:p></o:p></span></p>
1449 : nick 1.1
1450 :     <p class=MsoNormal style='margin-left:.5in;text-indent:-.25in;mso-list:l21 level1 lfo1;
1451 :     tab-stops:list .5in'><![if !supportLists]><span style='font-size:10.0pt;
1452 :     font-family:Arial;mso-fareast-font-family:Arial'><span style='mso-list:Ignore'>-<span
1453 :     style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1454 :     </span></span></span><![endif]><span style='font-size:10.0pt;font-family:Arial'>The
1455 :     operation contexts for the major views in the SDK must be defined.<o:p></o:p></span></p>
1456 :    
1457 :     <p class=MsoNormal style='margin-left:.5in;text-indent:-.25in;mso-list:l21 level1 lfo1;
1458 :     tab-stops:list .5in'><![if !supportLists]><span style='font-size:10.0pt;
1459 :     font-family:Arial;mso-fareast-font-family:Arial'><span style='mso-list:Ignore'>-<span
1460 :     style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1461 :     </span></span></span><![endif]><span style='font-size:10.0pt;font-family:Arial'>The
1462 :     semantics for assigning multiple contexts must be defined.<span
1463 :     style='mso-spacerun:yes'>  </span>For example, do <span class=SpellE>refactoring</span>
1464 :     operations that affect an open editor (but were triggered elsewhere) carry the
1465 :     context of that editor? <span style='mso-spacerun:yes'> </span>Should the
1466 :     editor decide this by listening for new operations that are added to the
1467 :     history? <o:p></o:p></span></p>
1468 :    
1469 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
1470 :    
1471 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>The
1472 :     following are working assumptions about the undo operations:<o:p></o:p></span></p>
1473 :    
1474 :     <p class=MsoNormal style='margin-left:.5in;text-indent:-.25in;mso-list:l21 level1 lfo1;
1475 :     tab-stops:list .5in'><![if !supportLists]><span style='font-size:10.0pt;
1476 :     font-family:Arial;mso-fareast-font-family:Arial'><span style='mso-list:Ignore'>-<span
1477 :     style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1478 :     </span></span></span><![endif]><span style='font-size:10.0pt;font-family:Arial'>There
1479 :     is no relationship between a perspective and an operation context, since
1480 :     switching perspectives will change the active part, and thus may or may not
1481 :     affect the current context.<o:p></o:p></span></p>
1482 :    
1483 :     <p class=MsoNormal style='margin-left:.5in;text-indent:-.25in;mso-list:l21 level1 lfo1;
1484 :     tab-stops:list .5in'><![if !supportLists]><span style='font-size:10.0pt;
1485 :     font-family:Arial;mso-fareast-font-family:Arial'><span style='mso-list:Ignore'>-<span
1486 :     style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1487 :     </span></span></span><![endif]><span style='font-size:10.0pt;font-family:Arial'>Actions
1488 :     that only change the presentation in the workbench (open a view, switch
1489 :     perspectives, change the sort order) are not considered to be operations since
1490 :     they are<span style='mso-spacerun:yes'>  </span>easily undone and redone
1491 :     through the same window mechanics.<o:p></o:p></span></p>
1492 :    
1493 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
1494 :    
1495 :     <h4>Workbench UI for Undo/Redo<o:p></o:p></h4>
1496 :    
1497 :     <h5>Minimal support</h5>
1498 :    
1499 : nick 1.2 <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>The Edit&gt;Undo
1500 :     and Edit&gt;Redo commands should be retargeted by most of the major views (list
1501 :     of views TBD).<span style='mso-spacerun:yes'>  </span>If a view retargets
1502 :     Undo/Redo, then it knows what operation contexts it supports, and it uses these
1503 :     contexts to retrieve the available undo operation.<o:p></o:p></span></p>
1504 : nick 1.1
1505 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
1506 :    
1507 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Edit&gt;Undo
1508 :     is enabled based on the active part.<span style='mso-spacerun:yes'>  </span><o:p></o:p></span></p>
1509 :    
1510 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><span
1511 :     style='mso-tab-count:1'>            </span><span class=SpellE>IStatus</span>
1512 : nick 1.2 status = <span class=SpellE>operationHistory.canUndoIn</span>(<span
1513 :     class=SpellE>myContext</span>);<o:p></o:p></span></p>
1514 : nick 1.1
1515 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><span
1516 :     style='mso-tab-count:1'>            </span>// up to the active part to define
1517 :     behavior for anything between OK and FATAL.<o:p></o:p></span></p>
1518 :    
1519 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
1520 :    
1521 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>The label
1522 :     for the undo action should be appended with a description of the operation.<o:p></o:p></span></p>
1523 :    
1524 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><span
1525 : nick 1.2 style='mso-tab-count:1'>            </span><span class=SpellE>operationToUndo</span>
1526 :     = <span class=SpellE>operationHistory.getUndoFor</span>(<span class=SpellE>myContext</span>);<o:p></o:p></span></p>
1527 : nick 1.1
1528 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><span
1529 : nick 1.2 style='mso-tab-count:1'>            </span>label = “Undo “+ <span class=SpellE>operationToUndo.label</span>();<o:p></o:p></span></p>
1530 : nick 1.1
1531 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
1532 :    
1533 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Undo and
1534 :     Redo on the toolbar include a drop down that shows the operation history.<span
1535 :     style='mso-spacerun:yes'>  </span>This history depends on the current part’s
1536 :     context.<o:p></o:p></span></p>
1537 :    
1538 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><span
1539 : nick 1.2 style='mso-tab-count:1'>            </span><span class=SpellE>operationHistory.getUndoHistoryFor</span>(<span
1540 : nick 1.1 class=SpellE>myContext</span>);<o:p></o:p></span></p>
1541 :    
1542 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>The drop
1543 :     down permits range selection of operations from the top down (see MS Word and
1544 :     other applications).<span style='mso-spacerun:yes'>  </span>This UI implies a
1545 :     linear undo within any particular set of contexts.<o:p></o:p></span></p>
1546 :    
1547 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
1548 :    
1549 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>The UI for
1550 :     handling special cases should be determined.<span style='mso-spacerun:yes'> 
1551 :     </span>Consider the following scenarios:<o:p></o:p></span></p>
1552 :    
1553 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
1554 :    
1555 :     <p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span
1556 :     style='font-size:10.0pt;font-family:Arial'>Scenario #1:</span></b><span
1557 :     style='font-size:10.0pt;font-family:Arial'><span style='mso-spacerun:yes'> 
1558 :     </span>Mixed contexts in an editor, undo from another view<o:p></o:p></span></p>
1559 :    
1560 :     <p class=MsoNormal style='margin-left:.5in;text-indent:-.25in;mso-list:l21 level1 lfo1;
1561 :     tab-stops:list .5in'><![if !supportLists]><span style='font-size:10.0pt;
1562 :     font-family:Arial;mso-fareast-font-family:Arial'><span style='mso-list:Ignore'>-<span
1563 :     style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1564 :     </span></span></span><![endif]><span style='font-size:10.0pt;font-family:Arial'>The
1565 :     user makes local edits in editor A.<o:p></o:p></span></p>
1566 :    
1567 :     <p class=MsoNormal style='margin-left:.5in;text-indent:-.25in;mso-list:l21 level1 lfo1;
1568 :     tab-stops:list .5in'><![if !supportLists]><span style='font-size:10.0pt;
1569 :     font-family:Arial;mso-fareast-font-family:Arial'><span style='mso-list:Ignore'>-<span
1570 :     style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1571 :     </span></span></span><![endif]><span style='font-size:10.0pt;font-family:Arial'>The
1572 :     user initiates a <span class=SpellE>refactoring</span> operation whose context
1573 :     is “A” and “workspace.”<o:p></o:p></span></p>
1574 :    
1575 :     <p class=MsoNormal style='margin-left:.5in;text-indent:-.25in;mso-list:l21 level1 lfo1;
1576 :     tab-stops:list .5in'><![if !supportLists]><span style='font-size:10.0pt;
1577 :     font-family:Arial;mso-fareast-font-family:Arial'><span style='mso-list:Ignore'>-<span
1578 :     style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1579 :     </span></span></span><![endif]><span style='font-size:10.0pt;font-family:Arial'>The
1580 :     user makes additional local edits to editor A.<o:p></o:p></span></p>
1581 :    
1582 :     <p class=MsoNormal style='margin-left:.5in;text-indent:-.25in;mso-list:l21 level1 lfo1;
1583 :     tab-stops:list .5in'><![if !supportLists]><span style='font-size:10.0pt;
1584 :     font-family:Arial;mso-fareast-font-family:Arial'><span style='mso-list:Ignore'>-<span
1585 :     style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1586 :     </span></span></span><![endif]><span style='font-size:10.0pt;font-family:Arial'>The
1587 :     user goes to the navigator and selects Undo.<o:p></o:p></span></p>
1588 :    
1589 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
1590 :    
1591 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>The <span
1592 :     class=SpellE>IOperationApproval</span> for the editor’s context can implement
1593 :     UI for handling this case if desired.<span style='mso-spacerun:yes'> 
1594 :     </span>Possible options include:<o:p></o:p></span></p>
1595 :    
1596 :     <p class=MsoNormal style='margin-left:.5in;text-indent:-.25in;mso-list:l21 level1 lfo1;
1597 :     tab-stops:list .5in'><![if !supportLists]><span style='font-size:10.0pt;
1598 :     font-family:Arial;mso-fareast-font-family:Arial'><span style='mso-list:Ignore'>-<span
1599 :     style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1600 :     </span></span></span><![endif]><span style='font-size:10.0pt;font-family:Arial'>warn
1601 :     the user about the local changes in A and ask whether to undo them or leave
1602 :     them<o:p></o:p></span></p>
1603 :    
1604 :     <p class=MsoNormal style='margin-left:.5in;text-indent:-.25in;mso-list:l21 level1 lfo1;
1605 :     tab-stops:list .5in'><![if !supportLists]><span style='font-size:10.0pt;
1606 :     font-family:Arial;mso-fareast-font-family:Arial'><span style='mso-list:Ignore'>-<span
1607 :     style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1608 : nick 1.2 </span></span></span><![endif]><span style='font-size:10.0pt;font-family:Arial'>provide
1609 :     a user preference that drives the behavior of the scenario.<o:p></o:p></span></p>
1610 : nick 1.1
1611 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
1612 :    
1613 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>The exact
1614 :     solution will be prototyped and may involve both a first-time prompt and
1615 :     subsequent preference (“Don’t ask me again”).<o:p></o:p></span></p>
1616 :    
1617 :     <p class=MsoNormal><o:p>&nbsp;</o:p></p>
1618 :    
1619 :     <p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span
1620 :     style='font-size:10.0pt;font-family:Arial'>Scenario #2</span></b><span
1621 :     style='font-size:10.0pt;font-family:Arial'>:<span style='mso-spacerun:yes'> 
1622 : nick 1.2 </span>Editor undo triggers a non-local operation<o:p></o:p></span></p>
1623 : nick 1.1
1624 :     <p class=MsoNormal style='margin-left:.5in;text-indent:-.25in;mso-list:l21 level1 lfo1;
1625 :     tab-stops:list .5in'><![if !supportLists]><span style='font-size:10.0pt;
1626 :     font-family:Arial;mso-fareast-font-family:Arial'><span style='mso-list:Ignore'>-<span
1627 :     style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1628 :     </span></span></span><![endif]><span style='font-size:10.0pt;font-family:Arial'>The
1629 :     user makes local edits in editor A.<o:p></o:p></span></p>
1630 :    
1631 :     <p class=MsoNormal style='margin-left:.5in;text-indent:-.25in;mso-list:l21 level1 lfo1;
1632 :     tab-stops:list .5in'><![if !supportLists]><span style='font-size:10.0pt;
1633 :     font-family:Arial;mso-fareast-font-family:Arial'><span style='mso-list:Ignore'>-<span
1634 :     style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1635 :     </span></span></span><![endif]><span style='font-size:10.0pt;font-family:Arial'>The
1636 :     user initiates a <span class=SpellE>refactoring</span> operation whose context
1637 :     is “A” and “workspace.”<o:p></o:p></span></p>
1638 :    
1639 :     <p class=MsoNormal style='margin-left:.5in;text-indent:-.25in;mso-list:l21 level1 lfo1;
1640 :     tab-stops:list .5in'><![if !supportLists]><span style='font-size:10.0pt;
1641 :     font-family:Arial;mso-fareast-font-family:Arial'><span style='mso-list:Ignore'>-<span
1642 :     style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1643 :     </span></span></span><![endif]><span style='font-size:10.0pt;font-family:Arial'>The
1644 :     user makes additional local edits to editor A.<o:p></o:p></span></p>
1645 :    
1646 :     <p class=MsoNormal style='margin-left:.5in;text-indent:-.25in;mso-list:l21 level1 lfo1;
1647 :     tab-stops:list .5in'><![if !supportLists]><span style='font-size:10.0pt;
1648 :     font-family:Arial;mso-fareast-font-family:Arial'><span style='mso-list:Ignore'>-<span
1649 :     style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1650 :     </span></span></span><![endif]><span style='font-size:10.0pt;font-family:Arial'>The
1651 :     user selects undo repeatedly from the editor<o:p></o:p></span></p>
1652 :    
1653 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
1654 :    
1655 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Most operations
1656 :     in the editor’s context affect only the editor.<span style='mso-spacerun:yes'> 
1657 :     </span>The <span class=SpellE>refactoring</span> operation affects not only the
1658 :     editor, but other objects in the workspace.<span style='mso-spacerun:yes'> 
1659 :     </span>It might surprise the user for the <span class=SpellE>refactoring</span>
1660 :     to be undone.<span style='mso-spacerun:yes'>  </span>The editor could implement
1661 :     a warning dialog when it detects that the proposed undo operation has
1662 :     additional contexts.<span style='mso-spacerun:yes'>  </span><o:p></o:p></span></p>
1663 :    
1664 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
1665 :    
1666 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>If the <span
1667 :     class=SpellE>refactoring</span> had been triggered elsewhere (say, editor “B”
1668 :     or the navigator), but resulted in changes to editor “A,” it is even more
1669 :     important that the user be warned about the operation invoked by the undo
1670 :     command.<span style='mso-spacerun:yes'>  </span><o:p></o:p></span></p>
1671 :    
1672 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
1673 :    
1674 : nick 1.2 <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>The<span
1675 :     style='mso-spacerun:yes'>  </span>solution for this scenario will be prototyped
1676 :     and may involve both a warning and subsequent preference.<span
1677 : nick 1.1 style='mso-spacerun:yes'>  </span>For example, a prompt could provide the label
1678 :     and description of the operation and warn that it affects other views.<span
1679 :     style='mso-spacerun:yes'>  </span>The user could choose whether to proceed, and
1680 :     the choice could be remembered in a preference.<o:p></o:p></span></p>
1681 :    
1682 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
1683 :    
1684 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>It appears
1685 :     that the proposed framework allows detection of these cases and hooks for
1686 :     supplying the necessary UI.<o:p></o:p></span></p>
1687 :    
1688 :     <h5>Advanced support</h5>
1689 :    
1690 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>More
1691 :     selective undo approaches can be supported by the framework, but the ability to
1692 :     support them in the workbench depends upon the implementation of the individual
1693 :     operations and their ability to be undone independently.<span
1694 :     style='mso-spacerun:yes'>  </span>The priority is TBD.<span
1695 :     style='mso-spacerun:yes'>  </span>Ideas include:<o:p></o:p></span></p>
1696 :    
1697 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
1698 :    
1699 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Additional menu
1700 :     commands show the operation history.<o:p></o:p></span></p>
1701 :    
1702 :     <p class=MsoNormal style='text-indent:.5in'><span style='font-size:10.0pt;
1703 :     font-family:Arial'>Edit&gt;Undo… shows the undo operation history based on the
1704 :     active part’s context.<o:p></o:p></span></p>
1705 :    
1706 :     <p class=MsoNormal style='text-indent:.5in'><span style='font-size:10.0pt;
1707 :     font-family:Arial'>Edit&gt;Redo… shows the redo operation history based on the
1708 :     active part’s context.<o:p></o:p></span></p>
1709 :    
1710 :     <p class=MsoNormal style='text-indent:.5in'><span style='font-size:10.0pt;
1711 :     font-family:Arial'><span style='mso-tab-count:1'>            </span><span
1712 : nick 1.2 class=SpellE>operationHistory.getUndoHistoryFor</span>(<span class=SpellE>myContext</span>);<o:p></o:p></span></p>
1713 : nick 1.1
1714 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
1715 :    
1716 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>The operation
1717 :     history can be shown in a view or dialog.<span style='mso-spacerun:yes'> 
1718 :     </span>Operations that are valid can be selected (one at a time) and undone (or
1719 :     redone) regardless of sequential order.<span style='mso-spacerun:yes'>  </span>Multiple
1720 :     selections are not allowed since the validation state for an operation might
1721 :     change as other operations are undone.<o:p></o:p></span></p>
1722 :    
1723 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
1724 :    
1725 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>The operation
1726 :     history view could allow changing of the filtering.<span
1727 :     style='mso-spacerun:yes'>  </span>While the default filtering could depend on
1728 :     the active part’s context, the user could be shown the available contexts and
1729 :     choose one or more contexts (or none at all) that affect the filtering of the
1730 :     list.<span style='mso-spacerun:yes'>  </span><o:p></o:p></span></p>
1731 :    
1732 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
1733 :    
1734 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Note that
1735 :     the UI for the advanced cases can be implemented independently from the operations,
1736 :     and may be useful for testing the framework.<o:p></o:p></span></p>
1737 :    
1738 :     <h3>Compatibility Issues</h3>
1739 :    
1740 :     <h4><span class=SpellE>JFace</span> Text</h4>
1741 :    
1742 :     <p class=MsoNormal><span class=SpellE><span style='font-size:10.0pt;font-family:
1743 : nick 1.2 Arial'>JFace</span></span><span style='font-size:10.0pt;font-family:Arial'> text
1744 :     currently has API for retrieving an <span class=SpellE>IUndoManager</span> from
1745 :     a text viewer.<span style='mso-spacerun:yes'>  </span>The undo manager is
1746 : nick 1.1 connected to a text viewer and watches the changes that happen in the
1747 :     viewer.<span style='mso-spacerun:yes'>  </span>As editing actions occurs,
1748 :     commands (<span class=SpellE>TextCommand</span>) are created and then
1749 :     “committed” to a command stack.<span style='mso-spacerun:yes'>  </span><o:p></o:p></span></p>
1750 :    
1751 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
1752 :    
1753 :     <p class=MsoNormal><span class=SpellE><span style='font-size:10.0pt;font-family:
1754 :     Arial'>TextCommand</span></span><span style='font-size:10.0pt;font-family:Arial'>
1755 :     could be changed to implement <span class=SpellE>IOperation</span>.<span
1756 :     style='mso-spacerun:yes'>  </span>The mapping from <span class=SpellE>IOperation</span>
1757 :     to <span class=SpellE>TextCommand</span> protocol is straightforward.<span
1758 :     style='mso-spacerun:yes'>  </span>Currently the <span class=SpellE>TextCommand</span>
1759 : nick 1.2 directly pushes itself onto a local command stack of a viewer when a set of pending
1760 :     changes are committed.<span style='mso-spacerun:yes'>  </span>Instead, it would
1761 :     need to set its context to one appropriate for the text viewer and add itself
1762 :     to the workbench operation history.<span style='mso-spacerun:yes'>  </span><span
1763 :     style='mso-spacerun:yes'> </span><o:p></o:p></span></p>
1764 : nick 1.1
1765 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
1766 :    
1767 :     <p class=MsoNormal><span class=SpellE><span style='font-size:10.0pt;font-family:
1768 :     Arial'>IUndoManager</span></span><span style='font-size:10.0pt;font-family:
1769 :     Arial'> API could be mapped as follows:<o:p></o:p></span></p>
1770 :    
1771 : nick 1.2 <p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span
1772 :     style='font-size:10.0pt;font-family:Arial'>connect(<span class=SpellE>ITextViewer</span>)
1773 :     <o:p></o:p></span></b></p>
1774 : nick 1.1
1775 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Creates a
1776 :     context (<span class=SpellE>myContext</span>) appropriate for representing this
1777 :     document’s operations<o:p></o:p></span></p>
1778 :    
1779 : nick 1.2 <p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span
1780 :     style='font-size:10.0pt;font-family:Arial'>disconnect(<span class=SpellE>ITextViewer</span>)
1781 :     <o:p></o:p></span></b></p>
1782 : nick 1.1
1783 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Performs
1784 :     necessary disconnect behavior and clears the operation history of operations involving
1785 :     the viewer.<o:p></o:p></span></p>
1786 :    
1787 :     <p class=MsoNormal style='margin-left:.5in'><span class=SpellE><span
1788 : nick 1.2 style='font-size:10.0pt;font-family:Arial'>operationHistory.disposeAll</span></span><span
1789 :     style='font-size:10.0pt;font-family:Arial'>(<span class=SpellE>myContext</span>);<o:p></o:p></span></p>
1790 :    
1791 :     <p class=MsoNormal><span class=SpellE><b style='mso-bidi-font-weight:normal'><span
1792 :     style='font-size:10.0pt;font-family:Arial'>beginCompoundChange</span></b></span><b
1793 :     style='mso-bidi-font-weight:normal'><span style='font-size:10.0pt;font-family:
1794 :     Arial'>() <o:p></o:p></span></b></p>
1795 : nick 1.1
1796 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Creates a <span
1797 :     class=SpellE>CompoundOperation</span> and stores subsequent <span class=SpellE>TextCommands</span>
1798 :     in this operation.<o:p></o:p></span></p>
1799 :    
1800 : nick 1.2 <p class=MsoNormal><span class=SpellE><b style='mso-bidi-font-weight:normal'><span
1801 :     style='font-size:10.0pt;font-family:Arial'>endCompoundChange</span></b></span><b
1802 : nick 1.1 style='mso-bidi-font-weight:normal'><span style='font-size:10.0pt;font-family:
1803 :     Arial'><o:p></o:p></span></b></p>
1804 :    
1805 : nick 1.2 <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Adds the current
1806 :     compound operation to the operation history.<o:p></o:p></span></p>
1807 : nick 1.1
1808 : nick 1.2 <p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span
1809 :     style='font-size:10.0pt;font-family:Arial'>reset()<o:p></o:p></span></b></p>
1810 : nick 1.1
1811 : nick 1.2 <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Clears the operation
1812 :     history of operations involving the viewer.<o:p></o:p></span></p>
1813 : nick 1.1
1814 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><span
1815 : nick 1.2 style='mso-tab-count:1'>            </span><span class=SpellE>operationHistory.disposeAll</span>(<span
1816 : nick 1.1 class=SpellE>myContext</span>);<o:p></o:p></span></p>
1817 :    
1818 : nick 1.2 <p class=MsoNormal><span class=SpellE><b style='mso-bidi-font-weight:normal'><span
1819 :     style='font-size:10.0pt;font-family:Arial'>setMaximumUndoLevel</span></b></span><b
1820 : nick 1.1 style='mso-bidi-font-weight:normal'><span style='font-size:10.0pt;font-family:
1821 : nick 1.2 Arial'>(<span class=SpellE>int</span>) – TBD<o:p></o:p></span></b></p>
1822 : nick 1.1
1823 : nick 1.2 <p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span
1824 :     style='font-size:10.0pt;font-family:Arial'>undoable() <o:p></o:p></span></b></p>
1825 : nick 1.1
1826 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Maps as
1827 :     follows:<o:p></o:p></span></p>
1828 :    
1829 : nick 1.2 <p class=MsoNormal style='text-indent:.5in'><span style='font-size:10.0pt;
1830 :     font-family:Arial'>status = <span class=SpellE>operationHistory.canUndoIn</span>(<span
1831 : nick 1.1 class=SpellE>myContext</span>);<o:p></o:p></span></p>
1832 :    
1833 : nick 1.2 <p class=MsoNormal style='text-indent:.5in'><span style='font-size:10.0pt;
1834 :     font-family:Arial'>return <span class=SpellE>status.isOK</span>();<span
1835 : nick 1.1 style='mso-spacerun:yes'>  </span>// may require further checking of other
1836 :     cases<o:p></o:p></span></p>
1837 :    
1838 : nick 1.2 <p class=MsoNormal><span class=SpellE><b style='mso-bidi-font-weight:normal'><span
1839 :     style='font-size:10.0pt;font-family:Arial'>redoable</span></b></span><b
1840 :     style='mso-bidi-font-weight:normal'><span style='font-size:10.0pt;font-family:
1841 :     Arial'>() <o:p></o:p></span></b></p>
1842 : nick 1.1
1843 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Maps as
1844 :     follows:<o:p></o:p></span></p>
1845 :    
1846 : nick 1.2 <p class=MsoNormal style='text-indent:.5in'><span style='font-size:10.0pt;
1847 :     font-family:Arial'>status = <span class=SpellE>operationHistory.canRedoIn</span>(<span
1848 : nick 1.1 class=SpellE>myContext</span>);<o:p></o:p></span></p>
1849 :    
1850 : nick 1.2 <p class=MsoNormal style='text-indent:.5in'><span style='font-size:10.0pt;
1851 :     font-family:Arial'>return <span class=SpellE>status.isOK</span>();<span
1852 : nick 1.1 style='mso-spacerun:yes'>  </span>// may require further checking of other
1853 :     cases<o:p></o:p></span></p>
1854 :    
1855 : nick 1.2 <p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span
1856 :     style='font-size:10.0pt;font-family:Arial'>undo()<o:p></o:p></span></b></p>
1857 : nick 1.1
1858 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Use <span
1859 : nick 1.2 class=SpellE>operationHistory.performUndoFor</span>(<span class=SpellE>myContext</span>)
1860 :     instead of managing its own stack.<o:p></o:p></span></p>
1861 : nick 1.1
1862 : nick 1.2 <p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span
1863 :     style='font-size:10.0pt;font-family:Arial'>redo()<o:p></o:p></span></b></p>
1864 : nick 1.1
1865 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Use <span
1866 : nick 1.2 class=SpellE>operationHistory.performRedoFor</span>(<span class=SpellE>myContext</span>)
1867 :     instead of managing its own stack.<o:p></o:p></span></p>
1868 : nick 1.1
1869 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
1870 :    
1871 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>The <span
1872 :     class=SpellE>TextCommand</span> class is private, so no API mapping is
1873 :     discussed here.<span style='mso-spacerun:yes'>  </span>However, its protocol is
1874 :     very similar to <span class=SpellE>IOperation</span> and the
1875 :     reimplementation/mapping is straightforward.<o:p></o:p></span></p>
1876 :    
1877 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
1878 :    
1879 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Issues:<span
1880 :     style='mso-spacerun:yes'>  </span><o:p></o:p></span></p>
1881 :    
1882 :     <p class=MsoNormal style='margin-left:.5in;text-indent:-.25in;mso-list:l21 level1 lfo1;
1883 :     tab-stops:list .5in'><![if !supportLists]><span style='font-size:10.0pt;
1884 :     font-family:Arial;mso-fareast-font-family:Arial'><span style='mso-list:Ignore'>-<span
1885 :     style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1886 :     </span></span></span><![endif]><span style='font-size:10.0pt;font-family:Arial'>As
1887 :     discussed throughout this document, additional operations (such as compound operations
1888 :     or <span class=SpellE>refactoring</span> operations) might appear in the text
1889 :     viewer’s context, and therefore in its <span class=SpellE>IUndoManager</span>.<span
1890 :     style='mso-spacerun:yes'>  </span>The implementation should be checked for any
1891 :     assumptions that the current operation is a <span class=SpellE>TextCommand</span>.<o:p></o:p></span></p>
1892 :    
1893 :     <p class=MsoNormal style='margin-left:.5in;text-indent:-.25in;mso-list:l21 level1 lfo1;
1894 :     tab-stops:list .5in'><![if !supportLists]><span style='font-size:10.0pt;
1895 :     font-family:Arial;mso-fareast-font-family:Arial'><span style='mso-list:Ignore'>-<span
1896 :     style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1897 :     </span></span></span><![endif]><span class=SpellE><span style='font-size:10.0pt;
1898 :     font-family:Arial'>IUndoManager</span></span><span style='font-size:10.0pt;
1899 :     font-family:Arial'> currently keeps a local history limit.<span
1900 :     style='mso-spacerun:yes'>  </span>How do we handle this?<o:p></o:p></span></p>
1901 :    
1902 :     <p class=MsoNormal style='margin-left:.75in;text-indent:-.25in;mso-list:l17 level1 lfo20;
1903 :     tab-stops:list .75in'><![if !supportLists]><span style='font-size:10.0pt;
1904 :     font-family:Arial;mso-fareast-font-family:Arial'><span style='mso-list:Ignore'>-<span
1905 :     style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1906 :     </span></span></span><![endif]><span style='font-size:10.0pt;font-family:Arial'>allow
1907 :     local history limits per context (seems complicated)<o:p></o:p></span></p>
1908 :    
1909 :     <p class=MsoNormal style='margin-left:.75in;text-indent:-.25in;mso-list:l17 level1 lfo20;
1910 :     tab-stops:list .75in'><![if !supportLists]><span style='font-size:10.0pt;
1911 :     font-family:Arial;mso-fareast-font-family:Arial'><span style='mso-list:Ignore'>-<span
1912 :     style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1913 :     </span></span></span><![endif]><span style='font-size:10.0pt;font-family:Arial'>ignore
1914 :     this part of the API in the new world<o:p></o:p></span></p>
1915 :    
1916 :     <p class=MsoNormal style='margin-left:.75in;text-indent:-.25in;mso-list:l17 level1 lfo20;
1917 :     tab-stops:list .75in'><![if !supportLists]><span style='font-size:10.0pt;
1918 :     font-family:Arial;mso-fareast-font-family:Arial'><span style='mso-list:Ignore'>-<span
1919 :     style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1920 :     </span></span></span><![endif]><span style='font-size:10.0pt;font-family:Arial'>decide
1921 :     how to affect the global history limit based on the local limit<o:p></o:p></span></p>
1922 :    
1923 :     <h4><span class=SpellE>Refactoring</span> </h4>
1924 :    
1925 :     <p class=MsoNormal><span class=SpellE><span style='font-size:10.0pt;font-family:
1926 :     Arial'>Refactoring</span></span><span style='font-size:10.0pt;font-family:Arial'>
1927 : nick 1.2 undo is currently implemented with change objects,<span
1928 :     style='mso-spacerun:yes'>  </span>Change objects record workspace changes
1929 :     initiated by <span class=SpellE>refactoring</span> operations.<span
1930 : nick 1.1 style='mso-spacerun:yes'>  </span>When a <span class=SpellE>refactoring</span>
1931 :     change is performed, it can optionally return another change that could be used
1932 :     to undo the change just executed.<span style='mso-spacerun:yes'>  </span>The
1933 :     undo change is placed in <span class=SpellE>refactoring’s</span> <span
1934 :     class=SpellE>IUndoManager</span>.<span style='mso-spacerun:yes'> 
1935 :     </span>Changes can be performed, but any undo or redo causes a new change to be
1936 :     created vs. having each change know how to undo and redo itself. <o:p></o:p></span></p>
1937 :    
1938 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
1939 :    
1940 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>While this
1941 :     approach simplifies the protocol for an operation, it has not been used in the
1942 :     proposed framework for several reasons:<o:p></o:p></span></p>
1943 :    
1944 :     <ol style='margin-top:0in' start=1 type=1>
1945 :     <li class=MsoNormal style='mso-list:l12 level1 lfo27;tab-stops:list .5in'><span
1946 :     style='font-size:10.0pt;font-family:Arial'>It is not compatible with the
1947 :     implementation used by text, EMF, or GEF. <o:p></o:p></span></li>
1948 :     <li class=MsoNormal style='mso-list:l12 level1 lfo27;tab-stops:list .5in'><span
1949 :     style='font-size:10.0pt;font-family:Arial'>It causes additional operations
1950 :     to be created before an undo is ever requested.<span
1951 :     style='mso-spacerun:yes'>  </span>This violates the goal of “pay as you
1952 :     go.”<o:p></o:p></span></li>
1953 :     </ol>
1954 :    
1955 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
1956 :    
1957 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Additional
1958 :     protocol is provided for initializing data needed to do a live validation for
1959 :     execution.<span style='mso-spacerun:yes'>  </span>Validation can be done with
1960 :     this cached information or on the fly.<o:p></o:p></span></p>
1961 :    
1962 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
1963 :    
1964 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Protocol is
1965 : nick 1.2 also provided to return the object modified by a change (<span class=SpellE>getModifiedElement</span>()).<o:p></o:p></span></p>
1966 : nick 1.1
1967 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
1968 :    
1969 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>The Change
1970 :     API could be mapped as follows.<span style='mso-spacerun:yes'>  </span>Note
1971 :     that much of the protocol could be provided in an abstract “<span class=SpellE>RefactoringOperation</span>”
1972 :     or perhaps in a more generic “<span class=SpellE>WorkspaceOperation</span>.”<span
1973 :     style='mso-spacerun:yes'>  </span>However we do not promote these concepts to
1974 :     the framework since different kinds of operations have different needs for
1975 :     caching model objects, validation state, etc.<span style='mso-spacerun:yes'> 
1976 :     </span><o:p></o:p></span></p>
1977 :    
1978 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
1979 :    
1980 : nick 1.2 <p class=MsoNormal><span class=SpellE><b style='mso-bidi-font-weight:normal'><span
1981 :     style='font-size:10.0pt;font-family:Arial'>getModifiedElement</span></b></span><b
1982 :     style='mso-bidi-font-weight:normal'><span style='font-size:10.0pt;font-family:
1983 :     Arial'>() <o:p></o:p></span></b></p>
1984 :    
1985 :     <p class=MsoNormal><span class=SpellE><b style='mso-bidi-font-weight:normal'><span
1986 :     style='font-size:10.0pt;font-family:Arial'>getAdapter</span></b></span><b
1987 :     style='mso-bidi-font-weight:normal'><span style='font-size:10.0pt;font-family:
1988 :     Arial'>(Class)<o:p></o:p></span></b></p>
1989 : nick 1.1
1990 :     <p class=MsoNormal><span class=SpellE><span style='font-size:10.0pt;font-family:
1991 :     Arial'>Refactoring</span></span><span style='font-size:10.0pt;font-family:Arial'>
1992 :     changes need to know which model element is modified by the change.<span
1993 :     style='mso-spacerun:yes'>  </span>They must also implement <span class=SpellE>IAdaptable</span>.<span
1994 :     style='mso-spacerun:yes'>  </span>This protocol can be provided in an abstract <span
1995 :     class=SpellE>RefactoringOperation</span> and interpreted by individual
1996 :     subclasses as done today.<span style='mso-spacerun:yes'>  </span>This protocol
1997 :     might in fact be suitable for all workspace-affecting operations.<span
1998 :     style='mso-spacerun:yes'>  </span><o:p></o:p></span></p>
1999 :    
2000 : nick 1.2 <p class=MsoNormal><span class=SpellE><b style='mso-bidi-font-weight:normal'><span
2001 :     style='font-size:10.0pt;font-family:Arial'>getParent</span></b></span><b
2002 : nick 1.1 style='mso-bidi-font-weight:normal'><span style='font-size:10.0pt;font-family:
2003 : nick 1.2 Arial'>()<o:p></o:p></span></b></p>
2004 :    
2005 :     <p class=MsoNormal><span class=SpellE><b style='mso-bidi-font-weight:normal'><span
2006 :     style='font-size:10.0pt;font-family:Arial'>setParent</span></b></span><b
2007 :     style='mso-bidi-font-weight:normal'><span style='font-size:10.0pt;font-family:
2008 :     Arial'>(Change)<o:p></o:p></span></b></p>
2009 :    
2010 :     <p class=MsoNormal><span class=SpellE><b style='mso-bidi-font-weight:normal'><span
2011 :     style='font-size:10.0pt;font-family:Arial'>isEnabled</span></b></span><b
2012 :     style='mso-bidi-font-weight:normal'><span style='font-size:10.0pt;font-family:
2013 :     Arial'>()<o:p></o:p></span></b></p>
2014 :    
2015 :     <p class=MsoNormal><span class=SpellE><b style='mso-bidi-font-weight:normal'><span
2016 :     style='font-size:10.0pt;font-family:Arial'>setEnabled</span></b></span><b
2017 :     style='mso-bidi-font-weight:normal'><span style='font-size:10.0pt;font-family:
2018 :     Arial'>(<span class=SpellE>boolean</span>)<o:p></o:p></span></b></p>
2019 : nick 1.1
2020 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>The
2021 :     associated fields and protocol can be defined in an abstract class. <o:p></o:p></span></p>
2022 :    
2023 : nick 1.2 <p class=MsoNormal><span class=SpellE><b style='mso-bidi-font-weight:normal'><span
2024 :     style='font-size:10.0pt;font-family:Arial'>initializeValidationData</span></b></span><b
2025 : nick 1.1 style='mso-bidi-font-weight:normal'><span style='font-size:10.0pt;font-family:
2026 : nick 1.2 Arial'>(</span></b><span class=SpellE><span style='font-size:10.0pt;font-family:
2027 :     Arial'>IProgressMonitor</span></span><b style='mso-bidi-font-weight:normal'><span
2028 :     style='font-size:10.0pt;font-family:Arial'>)<o:p></o:p></span></b></p>
2029 : nick 1.1
2030 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>This hook
2031 :     allows changes to cache local validation data, or to hook up listeners to the
2032 :     model and listen for changes that may invalidate the change.<span
2033 :     style='mso-spacerun:yes'>  </span>This protocol could be provided in the
2034 :     abstract <span class=SpellE>refactoring</span> class. <o:p></o:p></span></p>
2035 :    
2036 : nick 1.2 <p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span
2037 :     style='font-size:10.0pt;font-family:Arial'>dispose()<o:p></o:p></span></b></p>
2038 :    
2039 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Maps
2040 :     directly.<o:p></o:p></span></p>
2041 :    
2042 :     <p class=MsoNormal><span class=SpellE><b style='mso-bidi-font-weight:normal'><span
2043 :     style='font-size:10.0pt;font-family:Arial'>getName</span></b></span><b
2044 : nick 1.1 style='mso-bidi-font-weight:normal'><span style='font-size:10.0pt;font-family:
2045 : nick 1.2 Arial'>()<o:p></o:p></span></b></p>
2046 : nick 1.1
2047 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Maps to <span
2048 :     class=SpellE>operation.getLabel</span><o:p></o:p></span></p>
2049 :    
2050 : nick 1.2 <p class=MsoNormal><span class=SpellE><b style='mso-bidi-font-weight:normal'><span
2051 :     style='font-size:10.0pt;font-family:Arial'>isValid</span></b></span><b
2052 : nick 1.1 style='mso-bidi-font-weight:normal'><span style='font-size:10.0pt;font-family:
2053 : nick 1.2 Arial'>(<span class=SpellE>IProgressMonitor</span>)<o:p></o:p></span></b></p>
2054 : nick 1.1
2055 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Maps to <span
2056 : nick 1.2 class=SpellE>canUndo</span>(), <span class=SpellE>canRedo</span>(), and <span
2057 :     class=SpellE>canExecute</span>().<span style='mso-spacerun:yes'>  </span>See
2058 :     discussion below.<o:p></o:p></span></p>
2059 : nick 1.1
2060 : nick 1.2 <p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span
2061 :     style='font-size:10.0pt;font-family:Arial'>perform(<span class=SpellE>IProgressMonitor</span>)<o:p></o:p></span></b></p>
2062 : nick 1.1
2063 : nick 1.2 <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Maps to undo(<span
2064 :     class=SpellE>IProgressMonitor</span>), redo(<span class=SpellE>IProgressMonitor</span>)
2065 :     and <span class=SpellE>canExecute</span>(<span class=SpellE>IProgressMonitor</span>).<span
2066 :     style='mso-spacerun:yes'>  </span>See discussion below.<o:p></o:p></span></p>
2067 : nick 1.1
2068 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
2069 :    
2070 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Issues<o:p></o:p></span></p>
2071 :    
2072 :     <p class=MsoNormal style='margin-left:.75in;text-indent:-.25in;mso-list:l17 level1 lfo20;
2073 :     tab-stops:list .75in'><![if !supportLists]><span style='font-size:10.0pt;
2074 :     font-family:Arial;mso-fareast-font-family:Arial'><span style='mso-list:Ignore'>-<span
2075 :     style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
2076 :     </span></span></span><![endif]><span class=SpellE><span style='font-size:10.0pt;
2077 :     font-family:Arial'>Refactoring</span></span><span style='font-size:10.0pt;
2078 : nick 1.2 font-family:Arial'> change objects do not support direct undo() or redo().<span
2079 :     style='mso-spacerun:yes'>  </span>Rather, a change that supports undo() returns
2080 :     a new change that “undoes” it whenever it is executed.<span
2081 :     style='mso-spacerun:yes'>  </span>The code for <span class=SpellE>refactoring</span>
2082 :     changes would have to be <span class=SpellE>refactored</span> in one of these
2083 :     ways:<o:p></o:p></span></p>
2084 : nick 1.1
2085 :     <p class=MsoNormal style='margin-left:1.25in;text-indent:-.25in;mso-list:l17 level2 lfo20;
2086 :     tab-stops:list 1.25in'><![if !supportLists]><span style='font-size:10.0pt;
2087 :     font-family:"Courier New";mso-fareast-font-family:"Courier New"'><span
2088 :     style='mso-list:Ignore'>o<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
2089 :     </span></span></span><![endif]><span style='font-size:10.0pt;font-family:Arial'>Eliminate
2090 : nick 1.2 the creation of the undo change and move this work into an undo() method.<o:p></o:p></span></p>
2091 : nick 1.1
2092 :     <p class=MsoNormal style='margin-left:1.25in;text-indent:-.25in;mso-list:l17 level2 lfo20;
2093 :     tab-stops:list 1.25in'><![if !supportLists]><span style='font-size:10.0pt;
2094 :     font-family:"Courier New";mso-fareast-font-family:"Courier New"'><span
2095 :     style='mso-list:Ignore'>o<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
2096 :     </span></span></span><![endif]><span style='font-size:10.0pt;font-family:Arial'>Continue
2097 :     to create the undo change when performing a change, but instead of returning
2098 :     it, cache it in the change itself.<span style='mso-spacerun:yes'>  </span>Undo
2099 :     protocol checks for the presence of this change and uses it for any undo
2100 :     validation or execution requests.<o:p></o:p></span></p>
2101 :    
2102 :     <p class=MsoNormal style='margin-left:.75in;text-indent:-.25in;mso-list:l17 level1 lfo20;
2103 :     tab-stops:list .75in'><![if !supportLists]><span style='font-size:10.0pt;
2104 :     font-family:Arial;mso-fareast-font-family:Arial'><span style='mso-list:Ignore'>-<span
2105 :     style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
2106 :     </span></span></span><![endif]><span style='font-size:10.0pt;font-family:Arial'>Validation
2107 :     of <span class=SpellE>refactoring</span> changes is assumed to be expensive, so
2108 :     a progress monitor is provided in validation protocol.<span
2109 :     style='mso-spacerun:yes'>  </span>This concept is not promoted to the framework
2110 :     since validity is checked when building the undo menu command.<span
2111 :     style='mso-spacerun:yes'>  </span>Is the progress monitor absolutely necessary
2112 :     for validation vs. execution?<o:p></o:p></span></p>
2113 :    
2114 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><span
2115 :     style='mso-spacerun:yes'> </span><o:p></o:p></span></p>
2116 :    
2117 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>It is
2118 :     likely that many views and editors in the workbench IDE will be aware of this special
2119 : nick 1.2 kind of <span class=SpellE>IOperation</span>.<span style='mso-spacerun:yes'> 
2120 :     </span>An additional interface, <span class=SpellE>IWorkspaceOperation</span>,
2121 : nick 1.1 may evolve as <span class=SpellE>refactoring</span> changes are adapted to the
2122 :     new operations framework.<span style='mso-spacerun:yes'>  </span>Patterns
2123 :     surrounding the workspace operation will develop, particularly involving
2124 :     operation contexts.<span style='mso-spacerun:yes'>  </span>For example, views
2125 :     and editors (such as text editors) that are workspace-aware could listen to the
2126 :     operations history.<span style='mso-spacerun:yes'>  </span>As new workspace
2127 :     operations are added to the history, the modified element can be queried by the
2128 :     listener.<span style='mso-spacerun:yes'>  </span>The listener can add its
2129 :     operation context to the operation if desired.<span style='mso-spacerun:yes'> 
2130 :     </span><o:p></o:p></span></p>
2131 :    
2132 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
2133 :    
2134 :     <h4>GEF</h4>
2135 :    
2136 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>GEF
2137 :     supplies a Command framework and a <span class=SpellE>CommandStack</span> which
2138 :     manages an internal undo and redo stack.<span style='mso-spacerun:yes'> 
2139 :     </span>Commands are pushed onto the stack when they are executed by the stack.<span
2140 :     style='mso-spacerun:yes'>  </span>Most GEF command protocol can be mapped to
2141 :     the proposed operation protocol.<span style='mso-spacerun:yes'>  </span>The GEF
2142 :     commands are very similar to <span class=SpellE>IOperation</span> without the
2143 :     notion of contexts.<span style='mso-spacerun:yes'>  </span><o:p></o:p></span></p>
2144 :    
2145 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
2146 :    
2147 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Issues for
2148 :     GEF arise in the differences between <span class=SpellE>GEF’s</span> command
2149 :     stack and the proposed operation history.<span style='mso-spacerun:yes'> 
2150 :     </span>We assume that GEF intends for GEF commands to coexist with other
2151 :     workbench operations in a shared undo history.<span style='mso-spacerun:yes'> 
2152 :     </span>If so, then the command stack must be replaced by the operation
2153 :     history.<span style='mso-spacerun:yes'>  </span>Issues include:<o:p></o:p></span></p>
2154 :    
2155 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
2156 :    
2157 : nick 1.2 <p class=MsoNormal><span class=SpellE><b style='mso-bidi-font-weight:normal'><span
2158 :     style='font-size:10.0pt;font-family:Arial'>isDirty</span></b></span><b
2159 :     style='mso-bidi-font-weight:normal'><span style='font-size:10.0pt;font-family:
2160 :     Arial'>()<o:p></o:p></span></b></p>
2161 :    
2162 :     <p class=MsoNormal><span class=SpellE><b style='mso-bidi-font-weight:normal'><span
2163 :     style='font-size:10.0pt;font-family:Arial'>markSaveLocation</span></b></span><b
2164 :     style='mso-bidi-font-weight:normal'><span style='font-size:10.0pt;font-family:
2165 :     Arial'>()<o:p></o:p></span></b></p>
2166 : nick 1.1
2167 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>GEF
2168 :     supports a marker (<span class=SpellE>saveLocation</span>) that becomes dirty
2169 :     if any commands are added after the mark is made.<span
2170 :     style='mso-spacerun:yes'>  </span>If this concept is still needed in light of
2171 :     the new framework, then GEF might have to mark the location inside its own
2172 :     commands or using a dummy marker command.<o:p></o:p></span></p>
2173 :    
2174 : nick 1.2 <p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span
2175 :     style='font-size:10.0pt;font-family:Arial'>execute(Command)<o:p></o:p></span></b></p>
2176 : nick 1.1
2177 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>The GEF
2178 :     command stack executes commands on behalf of the client and adds them to the
2179 :     stack, while the operation history does not do the execution on behalf of the
2180 :     client.<span style='mso-spacerun:yes'>  </span>GEF clients that create GEF
2181 : nick 1.2 commands would alter the pattern “<span class=SpellE>commandStack.execute</span>(<span
2182 :     class=SpellE>someCommand</span>)” to instead use “<span class=SpellE>someCommand.execute</span>(null);
2183 :     <span class=SpellE>operationHistory.add</span>(<span class=SpellE>someCommand</span>)”<span
2184 :     style='mso-spacerun:yes'>  </span><o:p></o:p></span></p>
2185 :    
2186 :     <p class=MsoNormal><span class=SpellE><b style='mso-bidi-font-weight:normal'><span
2187 :     style='font-size:10.0pt;font-family:Arial'>addCommandStackListener</span></b></span><b
2188 : nick 1.1 style='mso-bidi-font-weight:normal'><span style='font-size:10.0pt;font-family:
2189 : nick 1.2 Arial'>(<span class=SpellE>CommandStackListener</span>)<o:p></o:p></span></b></p>
2190 : nick 1.1
2191 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>GEF is
2192 :     evolving its <span class=SpellE>CommandListener</span> interface in R3.1 to
2193 :     include additional notification.<span style='mso-spacerun:yes'>  </span>This
2194 :     must be reconciled with the proposed support in <span class=SpellE>IOperationHistoryListener</span>
2195 :     and the ability to further validate commands using <span class=SpellE>IOperationApproval</span>.<span
2196 :     style='mso-spacerun:yes'>  </span><o:p></o:p></span></p>
2197 :    
2198 :     <h4>EMF/WTP</h4>
2199 :    
2200 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>The EMF
2201 :     command framework is very similar to the GEF support and has similar issues to
2202 :     those described above.<span style='mso-spacerun:yes'>  </span>Additional issues
2203 :     arise for:<o:p></o:p></span></p>
2204 :    
2205 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
2206 :    
2207 : nick 1.2 <p class=MsoNormal><span class=SpellE><b style='mso-bidi-font-weight:normal'><span
2208 :     style='font-size:10.0pt;font-family:Arial'>getResult</span></b></span><b
2209 :     style='mso-bidi-font-weight:normal'><span style='font-size:10.0pt;font-family:
2210 :     Arial'>();<o:p></o:p></span></b></p>
2211 : nick 1.1
2212 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>This method
2213 :     answers the result of command execution when the command is in certain
2214 :     states.<span style='mso-spacerun:yes'>  </span>Since clients can execute an
2215 :     operation explicitly in the framework, EMF code could query the result after
2216 :     execution and store it in an EMF abstract operation.<span
2217 :     style='mso-spacerun:yes'>  </span>This protocol could then be provided in the
2218 :     EMF operations.<o:p></o:p></span></p>
2219 :    
2220 : nick 1.2 <p class=MsoNormal><span class=SpellE><b style='mso-bidi-font-weight:normal'><span
2221 :     style='font-size:10.0pt;font-family:Arial'>getAffectedObjects</span></b></span><b
2222 :     style='mso-bidi-font-weight:normal'><span style='font-size:10.0pt;font-family:
2223 :     Arial'>();<o:p></o:p></span></b></p>
2224 : nick 1.1
2225 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>This method
2226 :     is used to highlight the appropriate objects in a view to show what the EMF command
2227 :     did.<span style='mso-spacerun:yes'>  </span><span
2228 :     style='mso-spacerun:yes'>  </span>It is not clear that this will be generally necessary.<span
2229 :     style='mso-spacerun:yes'>  </span>This protocol could be added in an EMF
2230 :     operation abstract class.<o:p></o:p></span></p>
2231 :    
2232 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
2233 :    
2234 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>As
2235 :     discussed with <span class=SpellE>refactoring</span> changes, an abstract class
2236 :     providing the mapped protocol will likely evolve, along with usage patterns for
2237 :     listening for new EMF operations and assigning appropriate operation contexts. <o:p></o:p></span></p>
2238 :    
2239 :     <b><span style='font-size:16.0pt;font-family:Arial;mso-fareast-font-family:
2240 :     "Times New Roman";mso-font-kerning:16.0pt;mso-ansi-language:EN-US;mso-fareast-language:
2241 :     EN-US;mso-bidi-language:AR-SA'><br clear=all style='page-break-before:always'>
2242 :     </span></b>
2243 :    
2244 :     <h1>Appendix A:<span style='mso-spacerun:yes'>  </span>Workbench Undo Scenarios<span
2245 :     style='font-size:10.0pt'><o:p></o:p></span></h1>
2246 :    
2247 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>The
2248 :     following scenarios were used while discussing possible designs for a common
2249 :     undo framework.<span style='mso-spacerun:yes'>  </span><span
2250 :     style='mso-spacerun:yes'> </span>Most of these scenarios involve conflicting
2251 :     contexts or scopes.<span style='mso-spacerun:yes'>  </span>These scenarios,
2252 :     involving mixed text edits and <span class=SpellE>refactoring</span>
2253 :     operations, have complicated previous efforts to define a common undo
2254 :     framework.<span style='mso-spacerun:yes'>  </span><o:p></o:p></span></p>
2255 :    
2256 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
2257 :    
2258 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>The
2259 :     scenarios assume that an integrated undo in the workbench should present a
2260 :     common “Undo” command rather than the separate commands employed today, and
2261 :     that the “Undo” command is descriptive enough to imply the operation that will
2262 :     take place.<o:p></o:p></span></p>
2263 :    
2264 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
2265 :    
2266 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>For each
2267 :     scenario described, we attempt to describe the desired outcome, the outcome in
2268 :     R3.0.1 where applicable, and any interesting alternative outcomes. <o:p></o:p></span></p>
2269 :    
2270 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
2271 :    
2272 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Note that
2273 :     some scenarios involve nearly the same user interactions, but are different in
2274 :     desired outcome based on what the user was trying to accomplish while
2275 :     performing the operations.<span style='mso-spacerun:yes'>  </span>Specific user
2276 :     intent is described in order to clarify the scenario.<o:p></o:p></span></p>
2277 :    
2278 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
2279 :    
2280 :     <p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span
2281 :     style='font-size:10.0pt;font-family:Arial'>Scenario #1:</span></b><span
2282 :     style='font-size:10.0pt;font-family:Arial'><span style='mso-spacerun:yes'> 
2283 :     </span>User is editing source file “A.”<span style='mso-spacerun:yes'> 
2284 :     </span>While editing the document, some interrupt occurs causing the user to go
2285 :     to the navigator and <span class=SpellE>refactor</span> some code unrelated to
2286 :     A.<span style='mso-spacerun:yes'>  </span>When the <span class=SpellE>refactoring</span>
2287 :     is complete, the user returns to the editor on “A” and notices a typo.<span
2288 :     style='mso-spacerun:yes'>  </span>The user selects Edit&gt;Undo.<o:p></o:p></span></p>
2289 :    
2290 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><span
2291 :     style='mso-tab-count:1'>            </span><o:p></o:p></span></p>
2292 :    
2293 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Desired
2294 :     Outcome:<span style='mso-spacerun:yes'>  </span>The last text editing operation
2295 :     made before the unrelated <span class=SpellE>refactoring</span> operation is
2296 :     undone.<span style='mso-spacerun:yes'>  </span>The typo is corrected.<span
2297 :     style='mso-spacerun:yes'>  </span>The undo command was described as “undo
2298 :     typing”<o:p></o:p></span></p>
2299 :    
2300 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
2301 :    
2302 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>R3.0.1
2303 :     Outcome:<span style='mso-spacerun:yes'>  </span>Desired Outcome.<o:p></o:p></span></p>
2304 :    
2305 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
2306 :    
2307 : nick 1.2 <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Proposal
2308 :     Outcome:<span style='mso-spacerun:yes'>  </span>Desired Outcome.<span
2309 : nick 1.1 style='mso-spacerun:yes'>  </span>(Unrelated <span class=SpellE>refactoring</span>
2310 :     operation did not have the editor’s context).<span style='mso-spacerun:yes'> 
2311 :     </span><o:p></o:p></span></p>
2312 :    
2313 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
2314 :    
2315 :     <p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span
2316 :     style='font-size:10.0pt;font-family:Arial'>Scenario #2:</span></b><span
2317 :     style='font-size:10.0pt;font-family:Arial'><span style='mso-spacerun:yes'> 
2318 :     </span>User is editing source file “A.”<span style='mso-spacerun:yes'> 
2319 :     </span>While editing the document, some interrupt occurs causing the user to go
2320 :     to the navigator and <span class=SpellE>refactor</span> some code.<span
2321 :     style='mso-spacerun:yes'>  </span>The <span class=SpellE>refactoring</span>
2322 :     operation updates references to the <span class=SpellE>refactored</span> code
2323 :     in file “A.”<span style='mso-spacerun:yes'>  </span>When the <span
2324 :     class=SpellE>refactoring</span> is complete, the user returns to the editor on
2325 :     “A” and notices a typo.<span style='mso-spacerun:yes'>  </span>The user selects
2326 :     Edit&gt;Undo.<o:p></o:p></span></p>
2327 :    
2328 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><span
2329 :     style='mso-tab-count:1'>            </span><o:p></o:p></span></p>
2330 :    
2331 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Desired
2332 :     Outcome:<span style='mso-spacerun:yes'>  </span>This scenario depends largely
2333 :     on the user’s intent.<span style='mso-spacerun:yes'>  </span>If the typo was in
2334 :     a location completely unrelated to the <span class=SpellE>refactor</span>, the
2335 :     user expects the last text editing operation made before the <span
2336 :     class=SpellE>refactoring</span> operation to be undone, correcting the
2337 :     typo.<span style='mso-spacerun:yes'>  </span><o:p></o:p></span></p>
2338 :    
2339 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
2340 :    
2341 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>R3.0.1
2342 :     Outcome:<span style='mso-spacerun:yes'>  </span>The text edit caused by the <span
2343 :     class=SpellE>refactoring</span> operation is undone, but the <span
2344 :     class=SpellE>refactoring</span> itself is not undone.<span
2345 :     style='mso-spacerun:yes'>  </span>The typo remains until the user invokes
2346 :     subsequent “Undo.”<o:p></o:p></span></p>
2347 :    
2348 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
2349 :    
2350 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Proposal
2351 :     Outcome:<span style='mso-spacerun:yes'>  </span>This outcome can be implemented
2352 :     in different ways.<span style='mso-spacerun:yes'>  </span>If the <span
2353 :     class=SpellE>refactoring</span> operation command is assigned the context for
2354 :     “A,” since A was affected, then the <span class=SpellE>refactoring</span>
2355 :     operation would be undone before the typo.<span style='mso-spacerun:yes'> 
2356 :     </span>However, the editor could notice that the operation has multiple contexts
2357 :     and prompt the user with an operation history.<span style='mso-spacerun:yes'>  
2358 :     </span><o:p></o:p></span></p>
2359 :    
2360 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
2361 :    
2362 :     <p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span
2363 :     style='font-size:10.0pt;font-family:Arial'>Scenario #3:</span></b><span
2364 :     style='font-size:10.0pt;font-family:Arial'><span style='mso-spacerun:yes'> 
2365 :     </span>User is editing source file “A.”<span style='mso-spacerun:yes'> 
2366 :     </span>While editing the document, some interrupt occurs causing the user to go
2367 :     to the navigator and <span class=SpellE>refactor</span> some code.<span
2368 :     style='mso-spacerun:yes'>  </span>The <span class=SpellE>refactoring</span>
2369 :     operation updates references to the <span class=SpellE>refactored</span> code
2370 :     in file “A.”<span style='mso-spacerun:yes'>  </span>When the <span
2371 :     class=SpellE>refactoring</span> is complete, the user recalls making a typo
2372 :     just before the <span class=SpellE>refactor</span>.<span
2373 :     style='mso-spacerun:yes'>  </span>The user returns to the editor on “A” and
2374 :     looks for the typo.<span style='mso-spacerun:yes'>  </span>It is not there, as
2375 :     it has been replaced with new code due to the <span class=SpellE>refactoring</span>
2376 :     operation. The user selects Edit&gt;Undo.<o:p></o:p></span></p>
2377 :    
2378 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><span
2379 :     style='mso-tab-count:1'>            </span><o:p></o:p></span></p>
2380 :    
2381 : nick 1.2 <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Desired
2382 :     Outcome:<span style='mso-spacerun:yes'>  </span>At this point, the user needs
2383 :     information that helps explain the disappearance of the typo.<span
2384 : nick 1.1 style='mso-spacerun:yes'>  </span>In this case, there are two helpful options:<o:p></o:p></span></p>
2385 :    
2386 :     <ol style='margin-top:0in' start=1 type=1>
2387 :     <li class=MsoNormal style='mso-list:l16 level1 lfo5;tab-stops:list .5in'><span
2388 :     style='font-size:10.0pt;font-family:Arial'>The last performed <span
2389 :     class=SpellE>refactoring</span> operation is undone.<span
2390 :     style='mso-spacerun:yes'>  </span>This returns the user to the typo, in
2391 :     effect showing why the typo had disappeared.<span
2392 :     style='mso-spacerun:yes'>  </span>The user then selects “Redo,” having
2393 :     been satisfied that the typo was corrected by the <span class=SpellE>refactoring</span>
2394 :     operation.<span style='mso-spacerun:yes'>  </span>This operation is
2395 : nick 1.2 somewhat “heavyweight,” but one could argue that it’s the more expected
2396 :     outcome.<o:p></o:p></span></li>
2397 : nick 1.1 <li class=MsoNormal style='mso-list:l16 level1 lfo5;tab-stops:list .5in'><span
2398 :     style='font-size:10.0pt;font-family:Arial'>The text edit caused by the <span
2399 :     class=SpellE>refactoring</span> is undone, exposing the typo and, in
2400 :     effect, showing why it’s gone.<span style='mso-spacerun:yes'>  </span>The
2401 :     user then selects “Redo,” having been satisfied that the typo was already
2402 :     corrected by the <span class=SpellE>refactoring</span> operation. <span
2403 :     style='mso-spacerun:yes'> </span>This is a “lighter weight” solution but
2404 :     perhaps more confusing.<o:p></o:p></span></li>
2405 :     </ol>
2406 :    
2407 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><span
2408 :     style='mso-spacerun:yes'> </span><o:p></o:p></span></p>
2409 :    
2410 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>R3.0.1
2411 :     Outcome:<span style='mso-spacerun:yes'>  </span>Desired Outcome #2.<o:p></o:p></span></p>
2412 :    
2413 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
2414 :    
2415 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Proposal
2416 :     outcome:<span style='mso-spacerun:yes'>  </span>Desired Outcome #1.<span
2417 :     style='mso-spacerun:yes'>  </span>This scenario is the same as scenario #2
2418 :     except for user intent, so the UI could present similar choices as described
2419 :     above.<span style='mso-spacerun:yes'>  </span><o:p></o:p></span></p>
2420 :    
2421 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
2422 :    
2423 :     <p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span
2424 :     style='font-size:10.0pt;font-family:Arial'>Scenario #4:</span></b><span
2425 :     style='font-size:10.0pt;font-family:Arial'><span style='mso-spacerun:yes'> 
2426 :     </span>User is editing source file “A” and considers renaming a method in
2427 :     “A.”<span style='mso-spacerun:yes'>  </span>While typing a new name for the
2428 :     method, the user realizes that a <span class=SpellE>refactoring</span>
2429 :     operation will simplify the editing process.<span style='mso-spacerun:yes'> 
2430 :     </span>The user chooses “<span class=SpellE>Refactor</span>&gt;Rename” to
2431 :     rename the method.<span style='mso-spacerun:yes'>  </span>The <span
2432 :     class=SpellE>refactor</span> causes references to be updated in other
2433 :     files.<span style='mso-spacerun:yes'>  </span>The user then decides that the
2434 : nick 1.2 rename was not appropriate.<span style='mso-spacerun:yes'>  </span>The user selects
2435 :     Edit&gt;Undo.<o:p></o:p></span></p>
2436 : nick 1.1
2437 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><span
2438 :     style='mso-tab-count:1'>            </span><o:p></o:p></span></p>
2439 :    
2440 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Desired
2441 :     Outcome:<span style='mso-spacerun:yes'>  </span>The <span class=SpellE>refactoring</span>
2442 :     operation is undone, updating all of the references. The user is returned to
2443 :     the typing state before the <span class=SpellE>refactor</span>.<span
2444 :     style='mso-spacerun:yes'>  </span>Selecting another Edit&gt;Undo will undo the
2445 :     typing of the new name and return to the old name. <o:p></o:p></span></p>
2446 :    
2447 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><span
2448 :     style='mso-spacerun:yes'> </span><o:p></o:p></span></p>
2449 :    
2450 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>R3.0.1
2451 :     Outcome:<span style='mso-spacerun:yes'>  </span>The text edit implied by the <span
2452 :     class=SpellE>refactoring</span> operation is undone, and the user is returned
2453 :     to the typing state before the <span class=SpellE>refactor</span>.<span
2454 :     style='mso-spacerun:yes'>  </span>However, the <span class=SpellE>refactoring</span>
2455 :     itself is not undone.<span style='mso-spacerun:yes'>  </span>This is undoable
2456 :     from a separate <span class=SpellE>Refactor</span>&gt;Undo.<o:p></o:p></span></p>
2457 :    
2458 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
2459 :    
2460 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Proposal
2461 :     outcome:<span style='mso-spacerun:yes'>  </span>Desired Outcome.<span
2462 :     style='mso-spacerun:yes'>  </span>A user prompt or verification may occur as
2463 :     discussed in other scenarios.<o:p></o:p></span></p>
2464 :    
2465 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
2466 :    
2467 :     <p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span
2468 :     style='font-size:10.0pt;font-family:Arial'>Scenario #5:</span></b><span
2469 :     style='font-size:10.0pt;font-family:Arial'><span style='mso-spacerun:yes'> 
2470 :     </span>User is editing source file “A” and considers renaming a method in
2471 :     “A.”<span style='mso-spacerun:yes'>  </span>The user decides that a <span
2472 :     class=SpellE>refactoring</span> operation is in order.<span
2473 :     style='mso-spacerun:yes'>  </span>The user chooses “<span class=SpellE>Refactor</span>&gt;Rename”
2474 :     to rename the method.<span style='mso-spacerun:yes'>  </span>The <span
2475 :     class=SpellE>refactor</span> causes references to be updated in other
2476 :     files.<span style='mso-spacerun:yes'>  </span>The user then makes additional
2477 :     edits to the <span class=SpellE>javadoc</span> for the renamed method and
2478 :     realizes that the rename was not appropriate.<span style='mso-spacerun:yes'> 
2479 :     </span>The user selects Edit&gt;Undo.<o:p></o:p></span></p>
2480 :    
2481 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><span
2482 :     style='mso-tab-count:1'>            </span><o:p></o:p></span></p>
2483 :    
2484 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Desired
2485 :     Outcome:<span style='mso-spacerun:yes'>  </span>The most recent editing changes
2486 :     to the <span class=SpellE>javadoc</span> are undone.<span
2487 : nick 1.2 style='mso-spacerun:yes'>  </span>The user can continue selecting “Undo” until
2488 :     the <span class=SpellE>refactoring</span> operation is undone, updating all of
2489 :     the references. <o:p></o:p></span></p>
2490 : nick 1.1
2491 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
2492 :    
2493 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>R3.0.1
2494 :     Outcome:<span style='mso-spacerun:yes'>  </span>The most recent editing changes
2495 :     to the <span class=SpellE>javadoc</span> are undone.<span
2496 :     style='mso-spacerun:yes'>  </span>The user can continue selecting “Undo” until
2497 :     the text edit implied by the <span class=SpellE>refactoring</span> operation is
2498 :     undone.<span style='mso-spacerun:yes'>  </span>However, the <span class=SpellE>refactoring</span>
2499 :     itself is not undone.<span style='mso-spacerun:yes'>  </span>This is undoable
2500 :     from a separate <span class=SpellE>Refactor</span>&gt;Undo.<o:p></o:p></span></p>
2501 :    
2502 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
2503 :    
2504 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Proposal
2505 :     outcome:<span style='mso-spacerun:yes'>  </span>Desired Outcome.<o:p></o:p></span></p>
2506 :    
2507 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
2508 :    
2509 :     <p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span
2510 :     style='font-size:10.0pt;font-family:Arial'>Scenario #6:</span></b><span
2511 :     style='font-size:10.0pt;font-family:Arial'><span style='mso-spacerun:yes'> 
2512 :     </span>User is editing source file “A” and considers renaming a method in
2513 :     “A.”<span style='mso-spacerun:yes'>  </span>The user decides that a <span
2514 :     class=SpellE>refactoring</span> operation is in order.<span
2515 :     style='mso-spacerun:yes'>  </span>The user chooses “<span class=SpellE>Refactor</span>&gt;Rename”
2516 :     to rename the method.<span style='mso-spacerun:yes'>  </span>The <span
2517 :     class=SpellE>refactor</span> causes references to be updated in other
2518 :     files.<span style='mso-spacerun:yes'>  </span>The user then proceeds to edit <span
2519 :     class=SpellE>javadoc</span> in another part of the file, unrelated to
2520 :     change.<span style='mso-spacerun:yes'>  </span>The user realizes the <span
2521 :     class=SpellE>refactor</span> was not appropriate, and not wanting to undo the
2522 :     edits to the <span class=SpellE>javadoc</span>, selects the navigator view, and
2523 :     selects Edit&gt;Undo, assuming that the navigator undo won’t affect local edit
2524 :     changes.<o:p></o:p></span></p>
2525 :    
2526 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><span
2527 :     style='mso-tab-count:1'>            </span><o:p></o:p></span></p>
2528 :    
2529 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Desired
2530 :     Outcome:<span style='mso-spacerun:yes'>  </span>The <span class=SpellE>refactoring</span>
2531 :     operation is undone, but the changes to the <span class=SpellE>javadoc</span>
2532 :     made afterward are not undone.<span style='mso-spacerun:yes'>  </span>The local
2533 :     changes to file “A” could only be undone while inside editor A.<o:p></o:p></span></p>
2534 :    
2535 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
2536 :    
2537 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>R3.0.1
2538 :     Outcome:<span style='mso-spacerun:yes'>  </span>The <span class=SpellE>refactoring</span>
2539 :     operation is undone, and the most recent changes to the file are lost.<o:p></o:p></span></p>
2540 :    
2541 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
2542 :    
2543 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Proposal
2544 :     outcome:<span style='mso-spacerun:yes'>  </span>This can be implemented in
2545 :     different ways with <span class=SpellE>IOperationApproval</span>.<span
2546 :     style='mso-spacerun:yes'>  </span>The operation history would notice that the
2547 : nick 1.2 chosen operation has context “A” and that later changes for “A” are in the
2548 :     history.<span style='mso-spacerun:yes'>  </span>The <span class=SpellE>IOperationApproval</span>
2549 :     assigned to context “A” could prompt the user as to whether to undo the more
2550 :     recent changes in “A.”<o:p></o:p></span></p>
2551 : nick 1.1
2552 :     <p class=MsoNormal style='text-align:justify'><span style='font-size:10.0pt;
2553 :     font-family:Arial'><o:p>&nbsp;</o:p></span></p>
2554 :    
2555 :     </div>
2556 :    
2557 :     <div style='mso-element:footnote-list'><![if !supportFootnotes]><br clear=all>
2558 :    
2559 :     <hr align=left size=1 width="33%">
2560 :    
2561 :     <![endif]>
2562 :    
2563 :     <div style='mso-element:footnote' id=ftn1>
2564 :    
2565 :     <p class=MsoNormal><a style='mso-footnote-id:ftn1' href="#_ftnref1" name="_ftn1"
2566 :     title=""><span class=MsoFootnoteReference><span style='mso-special-character:
2567 :     footnote'><![if !supportFootnotes]><span class=MsoFootnoteReference><span
2568 :     style='font-size:12.0pt;font-family:"Times New Roman";mso-fareast-font-family:
2569 :     "Times New Roman";mso-ansi-language:EN-US;mso-fareast-language:EN-US;
2570 :     mso-bidi-language:AR-SA'>[1]</span></span><![endif]></span></span></a> <span
2571 :     style='font-size:10.0pt;font-family:Arial'>Literature addressing multi-user
2572 :     undo [<span class=SpellE>Abowd</span> &amp; Dix] addresses similar scoping
2573 :     issues in a multi-user model.<span style='mso-spacerun:yes'> 
2574 :     </span>Collaborating users may expect a global undo scope while users working
2575 :     in separate contexts may not.<span style='mso-spacerun:yes'>  </span>Users may
2576 : nick 1.2 be moving between collaboration and separation in a single work session, and the
2577 :     system cannot detect which is the case.<span style='mso-spacerun:yes'> 
2578 : nick 1.1 </span>Undo implementations in these systems typically keep track of the user
2579 :     who initiated the operation within a global history and filter the history
2580 :     appropriately.<span style='mso-spacerun:yes'>  </span>Potential conflicts are
2581 :     brought to the attention of the user(s).<o:p></o:p></span></p>
2582 :    
2583 :     <p class=MsoFootnoteText><o:p>&nbsp;</o:p></p>
2584 :    
2585 :     </div>
2586 :    
2587 :     </div>
2588 :    
2589 :     </body>
2590 :    
2591 :     </html>