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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (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 : sfranklin 1.3 <o:Revision>7</o:Revision>
21 :     <o:TotalTime>4518</o:TotalTime>
22 : nick 1.1 <o:LastPrinted>2004-11-08T17:14:00Z</o:LastPrinted>
23 : sfranklin 1.3 <o:Created>2004-12-20T21:30:00Z</o:Created>
24 :     <o:LastSaved>2004-12-20T21:50:00Z</o:LastSaved>
25 : nick 1.1 <o:Pages>1</o:Pages>
26 : sfranklin 1.3 <o:Words>6341</o:Words>
27 :     <o:Characters>36147</o:Characters>
28 : nick 1.1 <o:Company>IBM</o:Company>
29 : sfranklin 1.3 <o:Lines>301</o:Lines>
30 :     <o:Paragraphs>84</o:Paragraphs>
31 :     <o:CharactersWithSpaces>42404</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:Compatibility>
37 :     <w:BreakWrappedTables/>
38 :     <w:SnapToGridInCell/>
39 :     <w:WrapTextWithPunct/>
40 :     <w:UseAsianBreakRules/>
41 :     </w:Compatibility>
42 :     <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
43 :     </w:WordDocument>
44 : nick 1.2 </xml><![endif]--><!--[if !mso]><object
45 :     classid="clsid:38481807-CA0E-42D2-BF39-B33AF135CC4D" id=ieooui></object>
46 :     <style>
47 :     st1\:*{behavior:url(#ieooui) }
48 :     </style>
49 :     <![endif]-->
50 : nick 1.1 <style>
51 :     <!--
52 :     /* Font Definitions */
53 :     @font-face
54 :     {font-family:Wingdings;
55 :     panose-1:5 0 0 0 0 0 0 0 0 0;
56 :     mso-font-charset:2;
57 :     mso-generic-font-family:auto;
58 :     mso-font-pitch:variable;
59 :     mso-font-signature:0 268435456 0 0 -2147483648 0;}
60 :     /* Style Definitions */
61 :     p.MsoNormal, li.MsoNormal, div.MsoNormal
62 :     {mso-style-parent:"";
63 :     margin:0in;
64 :     margin-bottom:.0001pt;
65 :     mso-pagination:widow-orphan;
66 :     font-size:12.0pt;
67 :     font-family:"Times New Roman";
68 :     mso-fareast-font-family:"Times New Roman";}
69 :     h1
70 :     {mso-style-next:Normal;
71 :     margin-top:12.0pt;
72 :     margin-right:0in;
73 :     margin-bottom:3.0pt;
74 :     margin-left:0in;
75 :     mso-pagination:widow-orphan;
76 :     page-break-after:avoid;
77 :     mso-outline-level:1;
78 :     font-size:16.0pt;
79 :     font-family:Arial;
80 :     mso-font-kerning:16.0pt;}
81 :     h2
82 :     {mso-style-next:Normal;
83 :     margin-top:12.0pt;
84 :     margin-right:0in;
85 :     margin-bottom:3.0pt;
86 :     margin-left:0in;
87 :     mso-pagination:widow-orphan;
88 :     page-break-after:avoid;
89 :     mso-outline-level:2;
90 :     font-size:14.0pt;
91 :     font-family:Arial;
92 :     font-style:italic;}
93 :     h3
94 :     {mso-style-next:Normal;
95 :     margin-top:12.0pt;
96 :     margin-right:0in;
97 :     margin-bottom:3.0pt;
98 :     margin-left:0in;
99 :     mso-pagination:widow-orphan;
100 :     page-break-after:avoid;
101 :     mso-outline-level:3;
102 :     font-size:13.0pt;
103 :     font-family:Arial;}
104 :     h4
105 :     {mso-style-next:Normal;
106 :     margin-top:12.0pt;
107 :     margin-right:0in;
108 :     margin-bottom:3.0pt;
109 :     margin-left:0in;
110 :     mso-pagination:widow-orphan;
111 :     page-break-after:avoid;
112 :     mso-outline-level:4;
113 :     font-size:14.0pt;
114 :     font-family:"Times New Roman";}
115 :     h5
116 :     {mso-style-next:Normal;
117 :     margin-top:12.0pt;
118 :     margin-right:0in;
119 :     margin-bottom:3.0pt;
120 :     margin-left:0in;
121 :     mso-pagination:widow-orphan;
122 :     mso-outline-level:5;
123 :     font-size:13.0pt;
124 :     font-family:"Times New Roman";
125 :     font-style:italic;}
126 :     p.MsoFootnoteText, li.MsoFootnoteText, div.MsoFootnoteText
127 :     {mso-style-noshow:yes;
128 :     margin:0in;
129 :     margin-bottom:.0001pt;
130 :     mso-pagination:widow-orphan;
131 :     font-size:10.0pt;
132 :     font-family:"Times New Roman";
133 :     mso-fareast-font-family:"Times New Roman";}
134 :     span.MsoFootnoteReference
135 :     {mso-style-noshow:yes;
136 :     vertical-align:super;}
137 :     p.MsoBodyText2, li.MsoBodyText2, div.MsoBodyText2
138 :     {margin-top:0in;
139 :     margin-right:0in;
140 :     margin-bottom:6.0pt;
141 :     margin-left:0in;
142 :     line-height:200%;
143 :     mso-pagination:widow-orphan;
144 :     font-size:12.0pt;
145 :     font-family:"Times New Roman";
146 :     mso-fareast-font-family:"Times New Roman";}
147 : nick 1.2 a:link, span.MsoHyperlink
148 :     {color:#0000EE;
149 :     text-decoration:underline;
150 :     text-underline:single;}
151 :     a:visited, span.MsoHyperlinkFollowed
152 :     {color:purple;
153 :     text-decoration:underline;
154 :     text-underline:single;}
155 : sfranklin 1.3 code
156 :     {font-family:"Courier New";
157 :     mso-ascii-font-family:"Courier New";
158 :     mso-fareast-font-family:"Times New Roman";
159 :     mso-hansi-font-family:"Courier New";
160 :     mso-bidi-font-family:"Courier New";}
161 :     pre
162 :     {margin:0in;
163 :     margin-bottom:.0001pt;
164 :     mso-pagination:widow-orphan;
165 :     font-size:10.0pt;
166 :     font-family:"Courier New";
167 :     mso-fareast-font-family:"Times New Roman";}
168 : nick 1.1 @page Section1
169 :     {size:8.5in 11.0in;
170 :     margin:1.0in .75in .5in 1.0in;
171 :     mso-header-margin:.5in;
172 :     mso-footer-margin:.5in;
173 :     mso-paper-source:0;}
174 :     div.Section1
175 :     {page:Section1;}
176 :     /* List Definitions */
177 :     @list l0
178 : sfranklin 1.3 {mso-list-id:306130254;
179 :     mso-list-template-ids:-1505884488;}
180 : nick 1.1 @list l0:level1
181 : sfranklin 1.3 {mso-level-number-format:bullet;
182 :     mso-level-text:\F0B7;
183 :     mso-level-tab-stop:.5in;
184 : nick 1.1 mso-level-number-position:left;
185 : sfranklin 1.3 text-indent:-.25in;
186 :     mso-ansi-font-size:10.0pt;
187 :     font-family:Symbol;}
188 : nick 1.1 @list l1
189 : sfranklin 1.3 {mso-list-id:322004125;
190 :     mso-list-template-ids:933166844;}
191 :     @list l2
192 :     {mso-list-id:347761159;
193 :     mso-list-type:hybrid;
194 :     mso-list-template-ids:-1680017606 67698689 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
195 :     @list l2:level1
196 :     {mso-level-number-format:bullet;
197 :     mso-level-text:\F0B7;
198 :     mso-level-tab-stop:.5in;
199 :     mso-level-number-position:left;
200 :     text-indent:-.25in;
201 :     font-family:Symbol;}
202 :     @list l2:level2
203 : nick 1.1 {mso-level-tab-stop:1.0in;
204 :     mso-level-number-position:left;
205 :     text-indent:-.25in;}
206 : sfranklin 1.3 @list l2:level3
207 :     {mso-level-tab-stop:1.5in;
208 : nick 1.1 mso-level-number-position:left;
209 :     text-indent:-.25in;}
210 : sfranklin 1.3 @list l2:level4
211 :     {mso-level-tab-stop:2.0in;
212 : nick 1.1 mso-level-number-position:left;
213 :     text-indent:-.25in;}
214 : sfranklin 1.3 @list l2:level5
215 :     {mso-level-tab-stop:2.5in;
216 : nick 1.1 mso-level-number-position:left;
217 : sfranklin 1.3 text-indent:-.25in;}
218 :     @list l2:level6
219 :     {mso-level-tab-stop:3.0in;
220 : nick 1.1 mso-level-number-position:left;
221 : sfranklin 1.3 text-indent:-.25in;}
222 :     @list l2:level7
223 :     {mso-level-tab-stop:3.5in;
224 : nick 1.1 mso-level-number-position:left;
225 : sfranklin 1.3 text-indent:-.25in;}
226 :     @list l2:level8
227 :     {mso-level-tab-stop:4.0in;
228 : nick 1.1 mso-level-number-position:left;
229 : sfranklin 1.3 text-indent:-.25in;}
230 :     @list l2:level9
231 :     {mso-level-tab-stop:4.5in;
232 : nick 1.1 mso-level-number-position:left;
233 :     text-indent:-.25in;}
234 : sfranklin 1.3 @list l3
235 :     {mso-list-id:604456885;
236 : nick 1.1 mso-list-type:hybrid;
237 : sfranklin 1.3 mso-list-template-ids:1734899956 67698703 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
238 :     @list l3:level1
239 : nick 1.1 {mso-level-tab-stop:.5in;
240 :     mso-level-number-position:left;
241 :     text-indent:-.25in;}
242 : sfranklin 1.3 @list l3:level2
243 : nick 1.1 {mso-level-number-format:bullet;
244 :     mso-level-text:o;
245 :     mso-level-tab-stop:1.0in;
246 :     mso-level-number-position:left;
247 :     text-indent:-.25in;
248 :     font-family:"Courier New";}
249 : sfranklin 1.3 @list l3:level3
250 : nick 1.1 {mso-level-number-format:bullet;
251 :     mso-level-text:\F0A7;
252 :     mso-level-tab-stop:1.5in;
253 :     mso-level-number-position:left;
254 :     text-indent:-.25in;
255 :     font-family:Wingdings;}
256 : sfranklin 1.3 @list l3:level4
257 : nick 1.1 {mso-level-number-format:bullet;
258 :     mso-level-text:\F0B7;
259 :     mso-level-tab-stop:2.0in;
260 :     mso-level-number-position:left;
261 :     text-indent:-.25in;
262 :     font-family:Symbol;}
263 : sfranklin 1.3 @list l3:level5
264 :     {mso-level-tab-stop:2.5in;
265 :     mso-level-number-position:left;
266 :     text-indent:-.25in;}
267 :     @list l3:level6
268 :     {mso-level-tab-stop:3.0in;
269 :     mso-level-number-position:left;
270 :     text-indent:-.25in;}
271 :     @list l3:level7
272 :     {mso-level-tab-stop:3.5in;
273 :     mso-level-number-position:left;
274 :     text-indent:-.25in;}
275 :     @list l3:level8
276 :     {mso-level-tab-stop:4.0in;
277 :     mso-level-number-position:left;
278 :     text-indent:-.25in;}
279 :     @list l3:level9
280 :     {mso-level-tab-stop:4.5in;
281 :     mso-level-number-position:left;
282 :     text-indent:-.25in;}
283 :     @list l4
284 :     {mso-list-id:798038152;
285 : nick 1.1 mso-list-type:hybrid;
286 : sfranklin 1.3 mso-list-template-ids:-2087438622 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
287 :     @list l4:level1
288 :     {mso-level-tab-stop:39.0pt;
289 :     mso-level-number-position:left;
290 :     margin-left:39.0pt;
291 :     text-indent:-.25in;}
292 :     @list l4:level2
293 :     {mso-level-tab-stop:1.0in;
294 :     mso-level-number-position:left;
295 :     text-indent:-.25in;}
296 :     @list l4:level3
297 :     {mso-level-tab-stop:1.5in;
298 :     mso-level-number-position:left;
299 :     text-indent:-.25in;}
300 :     @list l4:level4
301 :     {mso-level-tab-stop:2.0in;
302 :     mso-level-number-position:left;
303 :     text-indent:-.25in;}
304 :     @list l4:level5
305 :     {mso-level-tab-stop:2.5in;
306 :     mso-level-number-position:left;
307 :     text-indent:-.25in;}
308 :     @list l4:level6
309 :     {mso-level-tab-stop:3.0in;
310 :     mso-level-number-position:left;
311 :     text-indent:-.25in;}
312 :     @list l4:level7
313 :     {mso-level-tab-stop:3.5in;
314 :     mso-level-number-position:left;
315 :     text-indent:-.25in;}
316 :     @list l4:level8
317 :     {mso-level-tab-stop:4.0in;
318 :     mso-level-number-position:left;
319 :     text-indent:-.25in;}
320 :     @list l4:level9
321 :     {mso-level-tab-stop:4.5in;
322 : nick 1.1 mso-level-number-position:left;
323 : sfranklin 1.3 text-indent:-.25in;}
324 :     @list l5
325 :     {mso-list-id:1085106306;
326 : nick 1.1 mso-list-type:hybrid;
327 : sfranklin 1.3 mso-list-template-ids:1015583604 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
328 :     @list l5:level1
329 : nick 1.1 {mso-level-tab-stop:.5in;
330 :     mso-level-number-position:left;
331 :     text-indent:-.25in;}
332 : sfranklin 1.3 @list l5:level2
333 :     {mso-level-tab-stop:1.0in;
334 :     mso-level-number-position:left;
335 :     text-indent:-.25in;}
336 :     @list l5:level3
337 :     {mso-level-tab-stop:1.5in;
338 :     mso-level-number-position:left;
339 :     text-indent:-.25in;}
340 :     @list l5:level4
341 :     {mso-level-tab-stop:2.0in;
342 :     mso-level-number-position:left;
343 :     text-indent:-.25in;}
344 :     @list l5:level5
345 :     {mso-level-tab-stop:2.5in;
346 :     mso-level-number-position:left;
347 :     text-indent:-.25in;}
348 :     @list l5:level6
349 :     {mso-level-tab-stop:3.0in;
350 :     mso-level-number-position:left;
351 :     text-indent:-.25in;}
352 :     @list l5:level7
353 :     {mso-level-tab-stop:3.5in;
354 :     mso-level-number-position:left;
355 :     text-indent:-.25in;}
356 :     @list l5:level8
357 :     {mso-level-tab-stop:4.0in;
358 :     mso-level-number-position:left;
359 :     text-indent:-.25in;}
360 :     @list l5:level9
361 :     {mso-level-tab-stop:4.5in;
362 :     mso-level-number-position:left;
363 :     text-indent:-.25in;}
364 :     @list l6
365 :     {mso-list-id:1478297229;
366 : nick 1.1 mso-list-type:hybrid;
367 : sfranklin 1.3 mso-list-template-ids:-438127954 67698689 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
368 :     @list l6:level1
369 : nick 1.1 {mso-level-number-format:bullet;
370 :     mso-level-text:\F0B7;
371 :     mso-level-tab-stop:.5in;
372 :     mso-level-number-position:left;
373 :     text-indent:-.25in;
374 :     font-family:Symbol;}
375 : sfranklin 1.3 @list l6:level2
376 :     {mso-level-tab-stop:1.0in;
377 :     mso-level-number-position:left;
378 :     text-indent:-.25in;}
379 :     @list l6:level3
380 :     {mso-level-tab-stop:1.5in;
381 : nick 1.1 mso-level-number-position:left;
382 : sfranklin 1.3 text-indent:-.25in;}
383 :     @list l6:level4
384 :     {mso-level-tab-stop:2.0in;
385 : nick 1.1 mso-level-number-position:left;
386 :     text-indent:-.25in;}
387 : sfranklin 1.3 @list l6:level5
388 :     {mso-level-tab-stop:2.5in;
389 : nick 1.1 mso-level-number-position:left;
390 :     text-indent:-.25in;}
391 : sfranklin 1.3 @list l6:level6
392 :     {mso-level-tab-stop:3.0in;
393 : nick 1.1 mso-level-number-position:left;
394 : sfranklin 1.3 text-indent:-.25in;}
395 :     @list l6:level7
396 :     {mso-level-tab-stop:3.5in;
397 : nick 1.1 mso-level-number-position:left;
398 : sfranklin 1.3 text-indent:-.25in;}
399 :     @list l6:level8
400 :     {mso-level-tab-stop:4.0in;
401 : nick 1.1 mso-level-number-position:left;
402 : sfranklin 1.3 text-indent:-.25in;}
403 :     @list l6:level9
404 :     {mso-level-tab-stop:4.5in;
405 : nick 1.1 mso-level-number-position:left;
406 : sfranklin 1.3 text-indent:-.25in;}
407 :     @list l7
408 :     {mso-list-id:1644238654;
409 :     mso-list-template-ids:-1891084734;}
410 :     @list l8
411 :     {mso-list-id:1723091313;
412 : nick 1.1 mso-list-type:hybrid;
413 : sfranklin 1.3 mso-list-template-ids:-1797201838 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
414 :     @list l8:level1
415 : nick 1.1 {mso-level-tab-stop:.5in;
416 :     mso-level-number-position:left;
417 :     text-indent:-.25in;}
418 : sfranklin 1.3 @list l8:level2
419 :     {mso-level-tab-stop:1.0in;
420 : nick 1.1 mso-level-number-position:left;
421 : sfranklin 1.3 text-indent:-.25in;}
422 :     @list l8:level3
423 :     {mso-level-tab-stop:1.5in;
424 : nick 1.1 mso-level-number-position:left;
425 : sfranklin 1.3 text-indent:-.25in;}
426 :     @list l8:level4
427 :     {mso-level-tab-stop:2.0in;
428 : nick 1.1 mso-level-number-position:left;
429 : sfranklin 1.3 text-indent:-.25in;}
430 :     @list l8:level5
431 :     {mso-level-tab-stop:2.5in;
432 : nick 1.1 mso-level-number-position:left;
433 : sfranklin 1.3 text-indent:-.25in;}
434 :     @list l8:level6
435 :     {mso-level-tab-stop:3.0in;
436 : nick 1.1 mso-level-number-position:left;
437 :     text-indent:-.25in;}
438 : sfranklin 1.3 @list l8:level7
439 :     {mso-level-tab-stop:3.5in;
440 : nick 1.1 mso-level-number-position:left;
441 : sfranklin 1.3 text-indent:-.25in;}
442 :     @list l8:level8
443 :     {mso-level-tab-stop:4.0in;
444 : nick 1.1 mso-level-number-position:left;
445 : sfranklin 1.3 text-indent:-.25in;}
446 :     @list l8:level9
447 :     {mso-level-tab-stop:4.5in;
448 : nick 1.1 mso-level-number-position:left;
449 : sfranklin 1.3 text-indent:-.25in;}
450 :     @list l9
451 : nick 1.1 {mso-list-id:1731031428;
452 :     mso-list-type:hybrid;
453 :     mso-list-template-ids:1886447558 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
454 : sfranklin 1.3 @list l9:level1
455 : nick 1.1 {mso-level-tab-stop:39.0pt;
456 :     mso-level-number-position:left;
457 :     margin-left:39.0pt;
458 :     text-indent:-.25in;}
459 : sfranklin 1.3 @list l9:level2
460 :     {mso-level-tab-stop:1.0in;
461 :     mso-level-number-position:left;
462 :     text-indent:-.25in;}
463 :     @list l9:level3
464 :     {mso-level-tab-stop:1.5in;
465 :     mso-level-number-position:left;
466 :     text-indent:-.25in;}
467 :     @list l9:level4
468 :     {mso-level-tab-stop:2.0in;
469 :     mso-level-number-position:left;
470 :     text-indent:-.25in;}
471 :     @list l9:level5
472 :     {mso-level-tab-stop:2.5in;
473 :     mso-level-number-position:left;
474 :     text-indent:-.25in;}
475 :     @list l9:level6
476 :     {mso-level-tab-stop:3.0in;
477 :     mso-level-number-position:left;
478 :     text-indent:-.25in;}
479 :     @list l9:level7
480 :     {mso-level-tab-stop:3.5in;
481 :     mso-level-number-position:left;
482 :     text-indent:-.25in;}
483 :     @list l9:level8
484 :     {mso-level-tab-stop:4.0in;
485 : nick 1.1 mso-level-number-position:left;
486 : sfranklin 1.3 text-indent:-.25in;}
487 :     @list l9:level9
488 :     {mso-level-tab-stop:4.5in;
489 : nick 1.1 mso-level-number-position:left;
490 : sfranklin 1.3 text-indent:-.25in;}
491 :     @list l10
492 :     {mso-list-id:1830093817;
493 :     mso-list-template-ids:672403872;}
494 :     @list l11
495 :     {mso-list-id:1943487606;
496 :     mso-list-template-ids:1313531012;}
497 :     @list l11:level1
498 : nick 1.1 {mso-level-number-format:bullet;
499 : sfranklin 1.3 mso-level-text:\F0B7;
500 : nick 1.1 mso-level-tab-stop:.5in;
501 :     mso-level-number-position:left;
502 :     text-indent:-.25in;
503 : sfranklin 1.3 mso-ansi-font-size:10.0pt;
504 :     font-family:Symbol;}
505 : nick 1.1 ol
506 :     {margin-bottom:0in;}
507 :     ul
508 :     {margin-bottom:0in;}
509 :     -->
510 :     </style>
511 :     <!--[if gte mso 10]>
512 :     <style>
513 :     /* Style Definitions */
514 :     table.MsoNormalTable
515 :     {mso-style-name:"Table Normal";
516 :     mso-tstyle-rowband-size:0;
517 :     mso-tstyle-colband-size:0;
518 :     mso-style-noshow:yes;
519 :     mso-style-parent:"";
520 :     mso-padding-alt:0in 5.4pt 0in 5.4pt;
521 :     mso-para-margin:0in;
522 :     mso-para-margin-bottom:.0001pt;
523 :     mso-pagination:widow-orphan;
524 :     font-size:10.0pt;
525 :     font-family:"Times New Roman";}
526 :     </style>
527 :     <![endif]-->
528 :     </head>
529 :    
530 : nick 1.2 <body lang=EN-US link="#0000EE" vlink=purple style='tab-interval:.5in'>
531 : nick 1.1
532 :     <div class=Section1>
533 :    
534 :     <h1>Generalized Undo Support in Eclipse</h1>
535 :    
536 : nick 1.2 <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Last
537 : sfranklin 1.3 updated:<span style='mso-spacerun:yes'>  </span></span><st1:date Month="12"
538 :     Day="17" Year="2004"><span style='font-size:10.0pt;font-family:Arial'>Dec. 17,
539 : nick 1.2 2004</span></st1:date><span style='font-size:10.0pt;font-family:Arial'><o:p></o:p></span></p>
540 :    
541 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Status:<span
542 : sfranklin 1.3 style='mso-spacerun:yes'>  </span>Proposal <o:p></o:p></span></p>
543 :    
544 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>(see also </span><a
545 : nick 1.2 href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=37716">37716</a>)<span
546 :     style='font-size:10.0pt;font-family:Arial'><o:p></o:p></span></p>
547 :    
548 : sfranklin 1.3 <h2>Problem Description</h2>
549 : nick 1.1
550 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>In R3.0.1
551 : sfranklin 1.3 of the Eclipse SDK, there is no generalized support for undoing user
552 :     actions.<span style='mso-spacerun:yes'>  </span>Each plug-in is left to
553 :     implement its own strategy for undo, if at all.<span style='mso-spacerun:yes'> 
554 :     </span>This approach can cause problems for both Eclipse users and plug-in
555 :     developers:<o:p></o:p></span></p>
556 :    
557 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><span
558 :     style='mso-spacerun:yes'> </span><o:p></o:p></span></p>
559 :    
560 :     <ul style='margin-top:0in' type=disc>
561 :     <li class=MsoNormal style='mso-list:l2 level1 lfo3;tab-stops:list .5in'><span
562 :     style='font-size:10.0pt;font-family:Arial'>Undo and redo actions appear in
563 :     different menus, causing user confusion and UI clutter<o:p></o:p></span></li>
564 :     <li class=MsoNormal style='mso-list:l2 level1 lfo3;tab-stops:list .5in'><span
565 :     style='font-size:10.0pt;font-family:Arial'>Undo and redo implementations
566 :     may have different semantics.<o:p></o:p></span></li>
567 :     <li class=MsoNormal style='mso-list:l2 level1 lfo3;tab-stops:list .5in'><span
568 :     style='font-size:10.0pt;font-family:Arial'>Plug-ins that depend on other
569 :     plug-ins which implement their own undo strategy are forced to choose
570 :     between different implementations and possibly write integration code to
571 :     allow the different frameworks to coexist.<o:p></o:p></span></li>
572 :     </ul>
573 : nick 1.1
574 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
575 :    
576 : sfranklin 1.3 <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Further,
577 :     the meaning of undo can be very different depending on what the user is
578 :     doing.<span style='mso-spacerun:yes'>  </span>The most common type of undo is
579 :     text undo.<span style='mso-spacerun:yes'>  </span>The user can undo lightweight
580 :     edit operations such as inserting, replacing, or deleting text.<span
581 :     style='mso-spacerun:yes'>  </span>Other types of undo may involve more complex,
582 :     heavyweight operations that affect an underlying model of many elements.<span
583 :     style='mso-spacerun:yes'>  </span>For example, the JDT refactoring support
584 :     provides undo support for refactoring operations that involve many Java
585 :     elements at different levels, such as Java packages, compilation units,
586 :     classes, and methods.<o:p></o:p></span></p>
587 :    
588 :     <h2>Operations Framework</h2>
589 : nick 1.1
590 : sfranklin 1.3 <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>The
591 :     proposed framework defines an interface for describing work, called an
592 :     “operation” (IOperation), that can be executed, undone, and redone.<span
593 :     style='mso-spacerun:yes'>  </span>Operations are created, executed, and added
594 :     to an operations history (IOperationHistory).<span style='mso-spacerun:yes'> 
595 :     </span>Operations which are comprised of distinct steps are represented as
596 :     compound operations.<span style='mso-spacerun:yes'>  </span>Compound operations
597 :     must be executed, undone, or redone as a unit, and can never be partially
598 :     undone.<span style='mso-spacerun:yes'>  </span><o:p></o:p></span></p>
599 : nick 1.1
600 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
601 :    
602 : sfranklin 1.3 <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Operations
603 :     can be assigned one or more contexts (IOperationContext) to which they
604 :     apply.<span style='mso-spacerun:yes'>  </span>An operation<span
605 :     style='mso-spacerun:yes'>  </span>context describes the context in which the
606 :     user is working when an operation is performed, undone, or redone.<span
607 :     style='mso-spacerun:yes'>  </span>Contexts can be used by workbench parts to
608 :     filter the operations history, so that only those operations that have been
609 :     assigned the part’s context are available for undo/redo when that part is
610 :     active.<o:p></o:p></span></p>
611 : nick 1.1
612 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
613 :    
614 : sfranklin 1.3 <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>The
615 :     interface for operation contexts is left very general so that operation
616 :     implementers may choose the appropriate representation for their contexts.<span
617 :     style='mso-spacerun:yes'>  </span>In some cases, a part-oriented context may be
618 :     appropriate. For example, a text editor’s context is related to the editor
619 :     itself and its life-cycle is similar to that of the editor.<span
620 :     style='mso-spacerun:yes'>  </span>The navigator’s context is closely related to
621 :     the workspace model objects, and the context related to the workspace has a
622 :     life cycle to similar to that of the workspace itself.<o:p></o:p></span></p>
623 :    
624 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
625 : nick 1.1
626 : sfranklin 1.3 <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Contexts
627 :     can be assigned to operations in multiple ways:<o:p></o:p></span></p>
628 : nick 1.1
629 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
630 :    
631 : sfranklin 1.3 <p class=MsoNormal style='margin-left:39.0pt;text-indent:-.25in;mso-list:l9 level1 lfo5;
632 :     tab-stops:list 39.0pt'><![if !supportLists]><span style='font-size:10.0pt;
633 :     font-family:Arial;mso-fareast-font-family:Arial'><span style='mso-list:Ignore'>1.<span
634 :     style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><![endif]><span
635 :     style='font-size:10.0pt;font-family:Arial'>The context can be assigned
636 :     initially when the operation is created.<span style='mso-spacerun:yes'> 
637 :     </span>For example, text operations are triggered by typing in the editor, and
638 :     the editor can assign its context to the operation before adding it to the
639 :     history.<span style='mso-spacerun:yes'>  </span><o:p></o:p></span></p>
640 :    
641 :     <p class=MsoNormal style='margin-left:39.0pt;text-indent:-.25in;mso-list:l9 level1 lfo5;
642 :     tab-stops:list 39.0pt'><![if !supportLists]><span style='font-size:10.0pt;
643 :     font-family:Arial;mso-fareast-font-family:Arial'><span style='mso-list:Ignore'>2.<span
644 :     style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><![endif]><span
645 :     style='font-size:10.0pt;font-family:Arial'>A listener interface on the
646 :     operations history allows listeners to detect when an operation is added to the
647 :     history.<span style='mso-spacerun:yes'>  </span>Listeners can decide if their
648 :     context should be added to the operation.<span style='mso-spacerun:yes'> 
649 : nick 1.1 </span><o:p></o:p></span></p>
650 :    
651 : sfranklin 1.3 <p class=MsoNormal style='margin-left:21.0pt'><span style='font-size:10.0pt;
652 :     font-family:Arial'><o:p>&nbsp;</o:p></span></p>
653 :    
654 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>An
655 :     operation may have more than one context.<span style='mso-spacerun:yes'> 
656 :     </span>For example, an operation may affect many elements in the workspace,
657 :     including one that is currently open in an editor.<span
658 :     style='mso-spacerun:yes'>  </span>That operation could be assigned two
659 :     independent contexts, so that it can be undone from both the editor and the
660 :     view manipulating the model.<span style='mso-spacerun:yes'>   </span><o:p></o:p></span></p>
661 :    
662 : nick 1.1 <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
663 :    
664 : sfranklin 1.3 <h2>Levels of Integration and Migration</h2>
665 :    
666 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Many
667 :     plug-ins have already invested heavily in building objects that describe
668 :     undoable user commands or operations.<span style='mso-spacerun:yes'>  </span>It
669 :     is not expected that all plug-ins will adopt the framework completely, given
670 :     the individual schedules and other constraints for each plug-in.<span
671 :     style='mso-spacerun:yes'>  </span>However, the integration can be achieved in
672 :     phases that will immediately provide value to dependent plug-ins.<span
673 :     style='mso-spacerun:yes'>  </span>The following adoption strategy is strongly
674 :     encouraged:<o:p></o:p></span></p>
675 : nick 1.1
676 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
677 :    
678 :     <ol style='margin-top:0in' start=1 type=1>
679 : sfranklin 1.3 <li class=MsoNormal style='mso-list:l8 level1 lfo8;tab-stops:list .5in'><span
680 :     style='font-size:10.0pt;font-family:Arial'>Existing command/undo
681 :     frameworks can implement the IOperation interface on their existing
682 :     command objects, while still maintaining their individual strategies for
683 :     managing undo stacks or histories.<span style='mso-spacerun:yes'> 
684 :     </span>If there is a substantial investment in an existing model-based
685 :     operation or command framework, wrappers could be used to map IOperation
686 :     protocol to the existing protocol.<span style='mso-spacerun:yes'> 
687 :     </span>The commands/operations need not be assigned a context or added to
688 :     a common operation history.<span style='mso-spacerun:yes'>  </span>This
689 :     level of integration allows command hierarchies built in different
690 :     frameworks to be treated the same by plug-ins that depend upon these different
691 :     frameworks.<span style='mso-spacerun:yes'>  </span>Clients of existing
692 :     command frameworks may then use the workbench operation history, assign
693 :     contexts to operations as needed, and even add operations to the history,
694 :     while still using commands built on earlier frameworks.<o:p></o:p></span></li>
695 :     <li class=MsoNormal style='mso-list:l8 level1 lfo8;tab-stops:list .5in'><span
696 :     style='font-size:10.0pt;font-family:Arial'>Existing command/undo
697 :     frameworks may use the listener interfaces provided by the operations
698 :     history to listen for operations that are of interest.<span
699 :     style='mso-spacerun:yes'>  </span>These commands may be wrapped or
700 :     otherwise recorded so that they can be undone from privately maintained
701 :     undo implementations.<span style='mso-spacerun:yes'>  </span>This level of
702 :     integration allows views and editors to appear more tightly integrated
703 :     with the operations framework, since workbench operations of interest can
704 :     be undone or redone from private undo implementations.<o:p></o:p></span></li>
705 :     <li class=MsoNormal style='mso-list:l8 level1 lfo8;tab-stops:list .5in'><span
706 :     style='font-size:10.0pt;font-family:Arial'>Full integration is achieved by
707 :     using the workbench operation history to record the undo and redo history
708 :     as operations occur.<span style='mso-spacerun:yes'>  </span>Once all
709 :     plug-ins share an operation history, clients will be able to use unified
710 :     listeners and handlers to track execution of operations, undo, and redo
711 :     them.<span style='mso-spacerun:yes'>  </span><o:p></o:p></span></li>
712 : nick 1.1 </ol>
713 :    
714 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
715 :    
716 : sfranklin 1.3 <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Framework
717 :     interfaces will be defined in the org.eclipse.core.operations package.<span
718 :     style='mso-spacerun:yes'>  </span>This package will be contained in a plug-in
719 :     that has no dependencies on the Eclipse runtime, so that raw JFace users may
720 :     make use of it.<span style='mso-spacerun:yes'>  </span>(The exact plug-in
721 :     containing the framework package is not defined at this time, as these packages
722 :     may be combined with other packages that provide similar headless
723 :     infrastructure.)<o:p></o:p></span></p>
724 :    
725 :     <h2>Framework interfaces</h2>
726 :    
727 :     <h3>IOperation</h3>
728 :    
729 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>IOperation
730 :     defines an operation that can be executed, undone, and redone.<span
731 :     style='mso-spacerun:yes'>  </span>Operations typically have fully defined parameters.
732 :     That is, they are usually created after the user has been queried for any input
733 :     needed to define the operation.<o:p></o:p></span></p>
734 : nick 1.1
735 : sfranklin 1.3 <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
736 : nick 1.1
737 : sfranklin 1.3 <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Operations
738 :     determine their ability to execute, undo, or redo according to the current
739 :     state of the application. They do not make decisions about their validity based
740 :     on where they occur in the operation history. That is left to the particular
741 :     operation history.<o:p></o:p></span></p>
742 : nick 1.1
743 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
744 :    
745 : sfranklin 1.3 <pre>public void addContext(IOperationContext context)</pre>
746 :    
747 :     <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>Add
748 :     the specified context to the operation. If the context is already present, do
749 :     not add it again. <o:p></o:p></span></p>
750 :    
751 :     <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Parameters:</span></b><span
752 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
753 :    
754 :     <p class=MsoNormal style='margin-left:.5in'><code><span style='font-size:10.0pt'>context</span></code><span
755 :     style='font-size:10.0pt'> - - the context to be added<o:p></o:p></span></p>
756 :    
757 :     <pre><a name="removeContext(org.eclipse.core.operation"></a>public void removeContext(IOperationContext context)</pre>
758 : nick 1.1
759 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>Remove
760 :     the specified context from the operation. This method has no effect if the
761 :     context is not present. <o:p></o:p></span></p>
762 :    
763 :     <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Parameters:</span></b><span
764 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
765 : nick 1.1
766 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><code><span style='font-size:10.0pt'>context</span></code><span
767 :     style='font-size:10.0pt'> - - the context to be removed<o:p></o:p></span></p>
768 : nick 1.1
769 : sfranklin 1.3 <pre><a name="hasContext(org.eclipse.core.operations.I"></a>public boolean <b>hasContext</b>(IOperationContext context)</pre>
770 : nick 1.1
771 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>Returns
772 :     whether the operation has the specified context. <o:p></o:p></span></p>
773 : nick 1.1
774 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Parameters:</span></b><span
775 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
776 : nick 1.1
777 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><code><span style='font-size:10.0pt'>context</span></code><span
778 :     style='font-size:10.0pt'> - - the context in question <o:p></o:p></span></p>
779 : nick 1.1
780 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Returns:</span></b><span
781 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
782 : nick 1.1
783 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><code><span style='font-size:10.0pt'>true</span></code><span
784 :     style='font-size:10.0pt'> if the context is present, </span><code><span
785 :     style='font-size:10.0pt'>false</span></code><span style='font-size:10.0pt'> if
786 :     it is not.<o:p></o:p></span></p>
787 : nick 1.1
788 : sfranklin 1.3 <pre><a name="getContexts()"></a>public IOperationContext [] <b>getContexts</b>()</pre>
789 : nick 1.1
790 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>Returns
791 :     the array of contexts that have been assigned to the operation. <o:p></o:p></span></p>
792 : nick 1.1
793 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Returns:</span></b><span
794 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
795 : nick 1.1
796 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>the
797 :     array of contexts<o:p></o:p></span></p>
798 : nick 1.1
799 : sfranklin 1.3 <pre><a name="canExecute()"></a>public boolean <b>canExecute</b>()</pre>
800 : nick 1.1
801 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>Returns
802 :     whether the operation can be executed in its current state. <o:p></o:p></span></p>
803 : nick 1.1
804 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Returns:</span></b><span
805 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
806 : nick 1.1
807 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><code><span style='font-size:10.0pt'>true</span></code><span
808 :     style='font-size:10.0pt'> if the operation can be executed; </span><code><span
809 :     style='font-size:10.0pt'>false</span></code><span style='font-size:10.0pt'>
810 :     otherwise.<o:p></o:p></span></p>
811 : nick 1.1
812 : sfranklin 1.3 <pre><a name="canRedo()"></a>public boolean <b>canRedo</b>()</pre>
813 : nick 1.1
814 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>Returns
815 :     whether the operation can be redone in its current state. <o:p></o:p></span></p>
816 : nick 1.1
817 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Returns:</span></b><span
818 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
819 : nick 1.1
820 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><code><span style='font-size:10.0pt'>true</span></code><span
821 :     style='font-size:10.0pt'> if the operation can be redone; </span><code><span
822 :     style='font-size:10.0pt'>false</span></code><span style='font-size:10.0pt'>
823 :     otherwise.<o:p></o:p></span></p>
824 : nick 1.1
825 : sfranklin 1.3 <pre><a name="canUndo()"></a>public boolean <b>canUndo</b>()</pre>
826 : nick 1.1
827 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>Returns
828 :     whether the operation can be undone in its current state. <o:p></o:p></span></p>
829 : nick 1.1
830 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Returns:</span></b><span
831 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
832 : nick 1.1
833 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><code><span style='font-size:10.0pt'>true</span></code><span
834 :     style='font-size:10.0pt'> if the operation can be undone; </span><code><span
835 :     style='font-size:10.0pt'>false</span></code><span style='font-size:10.0pt'>
836 :     otherwise.<o:p></o:p></span></p>
837 : nick 1.1
838 : sfranklin 1.3 <pre><a name="execute(org.eclipse.core.runtime.IProgre"></a>public org.eclipse.core.runtime.IStatus <b>execute</b>(org.eclipse.core.runtime.IProgressMonitor&nbsp;monitor)</pre>
839 : nick 1.1
840 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>Execute
841 :     the operation. This method should only be called the first time that an
842 :     operation is executed. <o:p></o:p></span></p>
843 : nick 1.1
844 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Parameters:</span></b><span
845 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
846 : nick 1.1
847 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><code><span style='font-size:10.0pt'>monitor</span></code><span
848 :     style='font-size:10.0pt'> - <o:p></o:p></span></p>
849 : nick 1.1
850 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Returns:</span></b><span
851 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
852 : nick 1.1
853 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>the
854 :     IStatus of the execution. The status severity should be set to </span><code><span
855 :     style='font-size:10.0pt'>OK</span></code><span style='font-size:10.0pt'> if the
856 :     operation was successful, and </span><code><span style='font-size:10.0pt'>ERROR</span></code><span
857 :     style='font-size:10.0pt'> if it was not. Any other status is assumed to
858 :     represent an incompletion of the execution.<o:p></o:p></span></p>
859 : nick 1.1
860 : sfranklin 1.3 <pre><a name="redo(org.eclipse.core.runtime.IProgressM"></a>public org.eclipse.core.runtime.IStatus <b>redo</b>(org.eclipse.core.runtime.IProgressMonitor&nbsp;monitor)</pre>
861 : nick 1.1
862 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>Redo
863 :     the operation. This method should only be called after an operation has been
864 :     undone. <o:p></o:p></span></p>
865 : nick 1.1
866 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Parameters:</span></b><span
867 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
868 : nick 1.1
869 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><code><span style='font-size:10.0pt'>monitor</span></code><span
870 :     style='font-size:10.0pt'> - <o:p></o:p></span></p>
871 : nick 1.1
872 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Returns:</span></b><span
873 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
874 : nick 1.1
875 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>the
876 :     IStatus of the redo. The status severity should be set to </span><code><span
877 :     style='font-size:10.0pt'>OK</span></code><span style='font-size:10.0pt'> if the
878 :     redo was successful, and </span><code><span style='font-size:10.0pt'>ERROR</span></code><span
879 :     style='font-size:10.0pt'> if it was not. Any other status is assumed to
880 :     represent an incompletion of the redo.<o:p></o:p></span></p>
881 : nick 1.1
882 : sfranklin 1.3 <pre>public org.eclipse.core.runtime.IStatus <b>undo</b>(org.eclipse.core.runtime.IProgressMonitor&nbsp;monitor)</pre>
883 : nick 1.1
884 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>Undo
885 :     the operation. This method should only be called after an operation has been
886 :     executed. <o:p></o:p></span></p>
887 : nick 1.1
888 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Parameters:</span></b><span
889 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
890 : nick 1.1
891 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><code><span style='font-size:10.0pt'>monitor</span></code><span
892 :     style='font-size:10.0pt'> - <o:p></o:p></span></p>
893 : nick 1.1
894 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Returns:</span></b><span
895 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
896 : nick 1.1
897 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>the
898 :     IStatus of the undo. The status severity should be set to </span><code><span
899 :     style='font-size:10.0pt'>OK</span></code><span style='font-size:10.0pt'> if the
900 :     redo was successful, and </span><code><span style='font-size:10.0pt'>ERROR</span></code><span
901 :     style='font-size:10.0pt'> if it was not. Any other status is assumed to
902 :     represent an incompletion of the undo.<o:p></o:p></span></p>
903 : nick 1.1
904 : sfranklin 1.3 <pre>public void <b>dispose</b>()</pre>
905 : nick 1.1
906 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>Dispose
907 :     of the operation. This method is used when the operation is no longer kept in
908 :     the history. Implementers of this method typically unregister any listeners. <o:p></o:p></span></p>
909 : nick 1.1
910 : sfranklin 1.3 <pre>public java.lang.String <b>getLabel</b>()</pre>
911 : nick 1.1
912 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>Return
913 :     the label that should be used to show the name of the operation to the user.
914 :     This label is typically appended to the &quot;Undo&quot; or &quot;Redo&quot;
915 :     menu entry. <o:p></o:p></span></p>
916 : nick 1.1
917 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Returns:</span></b><span
918 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
919 : nick 1.1
920 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>the
921 :     label<o:p></o:p></span></p>
922 : nick 1.1
923 : sfranklin 1.3 <pre>public java.lang.String <b>getDescription</b>()</pre>
924 : nick 1.1
925 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>Return
926 :     the description that should be used to further describe this operation to the
927 :     user. The description is used in history lists when the user requests more
928 :     information about an operation. <o:p></o:p></span></p>
929 : nick 1.1
930 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Returns:</span></b><span
931 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
932 : nick 1.1
933 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>the
934 :     description<o:p></o:p></span></p>
935 : nick 1.2
936 : sfranklin 1.3 <h3>IOperationHistory</h3>
937 : nick 1.1
938 : sfranklin 1.3 <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>IOperationHistory
939 :     tracks a history of operations that can be undone or redone. Operations are
940 :     added to the history once they have been initially executed. Clients may choose
941 :     whether to have the operations history perform the initial execution or simply
942 :     add the operation to the history. Once operations are added to the history, the
943 :     methods canRedo() and canUndo() are used to determine whether there is an
944 :     operation available for undo and redo in a given operation context.<span
945 :     style='mso-spacerun:yes'>  </span>The context-based protocol implies that there
946 :     is only one operation that can be undone or redone at a given time in a given
947 :     context. This is typical of a linear undo model, when only the most recently
948 :     executed operation is available for undo. When this protocol is used, a linear
949 :     model is enforced by the history. It is up to clients to determine how to
950 :     maintain a history that is invalid or stale. For example, when the most recent
951 :     operation for a context cannot be performed, clients may wish to flush the
952 :     history for that context.<o:p></o:p></span></p>
953 : nick 1.1
954 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
955 :    
956 : sfranklin 1.3 <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Additional
957 :     protocol allows direct undo and redo of a specified operation, regardless of
958 :     its position in the history. When a more flexible undo model is supported,
959 :     these methods can be implemented to undo and redo directly specified
960 :     operations. If an implementer of IOperationHistory does not allow direct undo
961 :     and redo, these methods can return a status indicating that it is not allowed.<o:p></o:p></span></p>
962 :    
963 : nick 1.1 <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
964 :    
965 : sfranklin 1.3 <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Listeners
966 :     (IOperationHistoryListener) can listen for notifications about changes in the
967 :     history (operations added or removed), and for notification before and after
968 :     any operation is executed, undone or redone. Notification of operation
969 :     execution only occurs when clients direct the history to execute the operation.
970 :     If the operation is added after it is executed, there can be no notification of
971 :     its execution.<o:p></o:p></span></p>
972 : nick 1.1
973 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
974 :    
975 : sfranklin 1.3 <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>IOperationApprover
976 :     defines an interface for approving an undo or redo before it occurs. This is
977 :     useful for injecting policy-decisions into the model - whether direct undo and
978 :     redo are supported, or warning the user about certain kinds of operations. It
979 :     can also be used when objects have state related to the operation and need to
980 :     determine whether an undo or redo will cause any conflicts with their local
981 :     state.<o:p></o:p></span></p>
982 : nick 1.1
983 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
984 :    
985 : sfranklin 1.3 <pre>public void <b>add</b>(IOperation operation)</pre>
986 :    
987 :     <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>Add
988 :     the specified operation to the history without executing it. The operation
989 :     should have already been executed by the time it is added to the history.
990 :     Listeners will be notified that the operation was added to the history. <o:p></o:p></span></p>
991 :    
992 :     <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Parameters:</span></b><span
993 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
994 :    
995 :     <p class=MsoNormal style='margin-left:.5in'><code><span style='font-size:10.0pt'>operation</span></code><span
996 :     style='font-size:10.0pt'> - - the operation to be added to the history<o:p></o:p></span></p>
997 :    
998 :     <pre>public org.eclipse.core.runtime.IStatus <b>execute</b>(IOperation operation,</pre><pre><span style='mso-spacerun:yes'>                                                </span>org.eclipse.core.runtime.IProgressMonitor&nbsp;monitor)</pre>
999 :    
1000 :     <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>Execute
1001 :     the specified operation and add it to the operations history if successful. This
1002 :     method is used by clients who wish operation history listeners to receive
1003 :     notifications before and after the execution of the operation. Listeners will
1004 :     be notified before ( </span><code><span style='font-size:10.0pt'>aboutToExecute</span></code><span
1005 :     style='font-size:10.0pt'>) and after (</span><code><span style='font-size:10.0pt'>done</span></code><span
1006 :     style='font-size:10.0pt'> or </span><code><span style='font-size:10.0pt'>operationNotOK</span></code><span
1007 :     style='font-size:10.0pt'>). If the operation successfully executes, an
1008 :     additional notification that the operation has been added to the history (</span><code><span
1009 :     style='font-size:10.0pt'>operationAdded</span></code><span style='font-size:
1010 :     10.0pt'>) will be sent. <o:p></o:p></span></p>
1011 :    
1012 :     <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Parameters:</span></b><span
1013 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
1014 :    
1015 :     <p class=MsoNormal style='margin-left:.5in'><code><span style='font-size:10.0pt'>operation</span></code><span
1016 :     style='font-size:10.0pt'> - - the operation to be executed and then added to
1017 :     the history <o:p></o:p></span></p>
1018 :    
1019 :     <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Returns:</span></b><span
1020 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
1021 :    
1022 :     <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>the
1023 :     IStatus indicating whether the execution succeeded. The severity code in the
1024 :     returned status describes whether the operation succeeded and whether it was
1025 :     added to the history. </span><code><span style='font-size:10.0pt'>OK</span></code><span
1026 :     style='font-size:10.0pt'> severity indicates that the execute operation was
1027 :     successful and that the operation has been added to the history. Listeners will
1028 :     receive the </span><code><span style='font-size:10.0pt'>done</span></code><span
1029 :     style='font-size:10.0pt'> notification. </span><code><span style='font-size:
1030 :     10.0pt'>CANCEL</span></code><span style='font-size:10.0pt'> severity indicates
1031 :     that the user cancelled the operation and that the operation was not added to
1032 :     the history. </span><code><span style='font-size:10.0pt'>ERROR</span></code><span
1033 :     style='font-size:10.0pt'> severity indicates that the operation did not
1034 :     successfully execute and that it was not added to the history. Any other
1035 :     severity code is not specifically interpreted by the history, and the operation
1036 :     will not be added to the history. For all severities other than </span><code><span
1037 :     style='font-size:10.0pt'>OK</span></code><span style='font-size:10.0pt'>,
1038 :     listeners will receive the </span><code><span style='font-size:10.0pt'>operationNotOK</span></code><span
1039 :     style='font-size:10.0pt'> notification instead of the </span><code><span
1040 :     style='font-size:10.0pt'>done</span></code><span style='font-size:10.0pt'>
1041 :     notification.<o:p></o:p></span></p>
1042 : nick 1.1
1043 : sfranklin 1.3 <pre>public void <b>remove</b>(IOperation operation)</pre>
1044 :    
1045 :     <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>Remove
1046 :     the specified operation from the history. Listeners will be notified of the
1047 :     removal of the operation. This method is used by clients who want to flush a
1048 :     particular subset of the history. <o:p></o:p></span></p>
1049 :    
1050 :     <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Parameters:</span></b><span
1051 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
1052 :    
1053 :     <p class=MsoNormal style='margin-left:.5in'><code><span style='font-size:10.0pt'>operation</span></code><span
1054 :     style='font-size:10.0pt'> - - the operation to be removed from the history<o:p></o:p></span></p>
1055 :    
1056 :     <pre>public org.eclipse.core.runtime.IStatus <b>redo</b>(IOperationContext&nbsp;context,</pre><pre><span style='mso-spacerun:yes'>                                             </span>org.eclipse.core.runtime.IProgressMonitor&nbsp;monitor)</pre>
1057 :    
1058 :     <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>Redo
1059 :     the most recently undone operation in the given context <o:p></o:p></span></p>
1060 :    
1061 :     <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Parameters:</span></b><span
1062 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
1063 :    
1064 :     <p class=MsoNormal style='margin-left:.5in'><code><span style='font-size:10.0pt'>context</span></code><span
1065 :     style='font-size:10.0pt'> - - the context to be redone, or null if the context
1066 :     does not matter <o:p></o:p></span></p>
1067 :    
1068 :     <p class=MsoNormal style='margin-left:.5in'><code><span style='font-size:10.0pt'>monitor</span></code><span
1069 :     style='font-size:10.0pt'> - - the progress monitor to be used for the redo, or
1070 :     null if no progress monitor is provided. <o:p></o:p></span></p>
1071 :    
1072 :     <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Returns:</span></b><span
1073 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
1074 :    
1075 :     <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>the
1076 :     IStatus indicating whether the redo succeeded. The severity code in the
1077 :     returned status describes whether the operation succeeded and whether it
1078 :     remains in the history. </span><code><span style='font-size:10.0pt'>OK</span></code><span
1079 :     style='font-size:10.0pt'> severity indicates that the redo operation was
1080 :     successful and that the operation has been placed on the undo history.
1081 :     Listeners will receive the </span><code><span style='font-size:10.0pt'>redone</span></code><span
1082 :     style='font-size:10.0pt'> notification. </span><code><span style='font-size:
1083 :     10.0pt'>CANCEL</span></code><span style='font-size:10.0pt'> severity indicates
1084 :     that the user cancelled the operation and that the operation remains in the
1085 :     redo history. </span><code><span style='font-size:10.0pt'>ERROR</span></code><span
1086 :     style='font-size:10.0pt'> severity indicates that the operation could not
1087 :     successfully be redone and that it has been removed from the history. Listeners
1088 :     will also be notified that the operation was removed. Any other severity code
1089 :     is not specifically interpreted by the history, and is simply passed back to
1090 :     the caller. For all severities other than </span><code><span style='font-size:
1091 :     10.0pt'>OK</span></code><span style='font-size:10.0pt'>, listeners will receive
1092 :     the </span><code><span style='font-size:10.0pt'>operationNotOK</span></code><span
1093 :     style='font-size:10.0pt'> notification instead of the </span><code><span
1094 :     style='font-size:10.0pt'>redone</span></code><span style='font-size:10.0pt'>
1095 :     notification.<o:p></o:p></span></p>
1096 :    
1097 :     <pre>public org.eclipse.core.runtime.IStatus <b>redoOperation</b>(IOperation operation,</pre><pre><span style='mso-spacerun:yes'>                                                      </span>org.eclipse.core.runtime.IProgressMonitor&nbsp;monitor)</pre>
1098 :    
1099 :     <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>Redo
1100 :     the specified operation <o:p></o:p></span></p>
1101 :    
1102 :     <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Parameters:</span></b><span
1103 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
1104 :    
1105 :     <p class=MsoNormal style='margin-left:.5in'><code><span style='font-size:10.0pt'>operation</span></code><span
1106 :     style='font-size:10.0pt'> - - the operation to be redone <o:p></o:p></span></p>
1107 : nick 1.1
1108 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><code><span style='font-size:10.0pt'>monitor</span></code><span
1109 :     style='font-size:10.0pt'> - - the progress monitor to be used for the redo, or
1110 :     null if no progress monitor is provided <o:p></o:p></span></p>
1111 : nick 1.1
1112 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Returns:</span></b><span
1113 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
1114 : nick 1.1
1115 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>the
1116 :     IStatus indicating whether the redo succeeded. The severity code in the
1117 :     returned status describes whether the operation succeeded and whether it
1118 :     remains in the history. </span><code><span style='font-size:10.0pt'>OK</span></code><span
1119 :     style='font-size:10.0pt'> severity indicates that the redo operation was
1120 :     successful and that the operation has been placed on the undo history.
1121 :     Listeners will receive the </span><code><span style='font-size:10.0pt'>redone</span></code><span
1122 :     style='font-size:10.0pt'> notification. </span><code><span style='font-size:
1123 :     10.0pt'>CANCEL</span></code><span style='font-size:10.0pt'> severity indicates
1124 :     that the user cancelled the operation and that the operation remains in the
1125 :     redo history. </span><code><span style='font-size:10.0pt'>ERROR</span></code><span
1126 :     style='font-size:10.0pt'> severity indicates that the operation could not
1127 :     successfully be redone. The operation will remain at its current location in
1128 :     the history, and callers must explicitly remove it if desired. Any other
1129 :     severity code is not interpreted by the history, and is simply passed back to
1130 :     the caller. For all severities other than </span><code><span style='font-size:
1131 :     10.0pt'>OK</span></code><span style='font-size:10.0pt'>, listeners will receive
1132 :     the </span><code><span style='font-size:10.0pt'>operationNotOK</span></code><span
1133 :     style='font-size:10.0pt'> notification instead of the </span><code><span
1134 :     style='font-size:10.0pt'>redone</span></code><span style='font-size:10.0pt'>
1135 :     notification.<o:p></o:p></span></p>
1136 : nick 1.1
1137 : sfranklin 1.3 <pre>public org.eclipse.core.runtime.IStatus <b>undo</b>(IOperationContext&nbsp; context,</pre><pre><span style='mso-spacerun:yes'>                                             </span>org.eclipse.core.runtime.IProgressMonitor&nbsp;monitor)</pre>
1138 : nick 1.1
1139 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>Undo
1140 :     the most recently undone operation in the given context <o:p></o:p></span></p>
1141 : nick 1.1
1142 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Parameters:</span></b><span
1143 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
1144 : nick 1.1
1145 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><code><span style='font-size:10.0pt'>context</span></code><span
1146 :     style='font-size:10.0pt'> - - the context to be undone, or null if the context
1147 :     does not matter <o:p></o:p></span></p>
1148 : nick 1.1
1149 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><code><span style='font-size:10.0pt'>monitor</span></code><span
1150 :     style='font-size:10.0pt'> - - the progress monitor to be used for the undo, or
1151 :     null if no progress monitor is provided. <o:p></o:p></span></p>
1152 : nick 1.1
1153 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Returns:</span></b><span
1154 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
1155 : nick 1.1
1156 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>the
1157 :     IStatus indicating whether the undo succeeded. The severity code in the
1158 :     returned status describes whether the operation succeeded and whether it
1159 :     remains in the history. </span><code><span style='font-size:10.0pt'>OK</span></code><span
1160 :     style='font-size:10.0pt'> severity indicates that the undo operation was
1161 :     successful and that the operation has been placed on the redo history.
1162 :     Listeners will receive the </span><code><span style='font-size:10.0pt'>undone</span></code><span
1163 :     style='font-size:10.0pt'> notification. </span><code><span style='font-size:
1164 :     10.0pt'>CANCEL</span></code><span style='font-size:10.0pt'> severity indicates
1165 :     that the user cancelled the operation and that the operation remains in the
1166 :     undo history. </span><code><span style='font-size:10.0pt'>ERROR</span></code><span
1167 :     style='font-size:10.0pt'> severity indicates that the operation could not
1168 :     successfully be undone and that it has been removed from the history. Listeners
1169 :     will be notified that the operation was removed. Any other severity code is not
1170 :     interpreted by the history, and is simply passed back to the caller. For all
1171 :     severities other than </span><code><span style='font-size:10.0pt'>OK</span></code><span
1172 :     style='font-size:10.0pt'>, listeners will receive the </span><code><span
1173 :     style='font-size:10.0pt'>operationNotOK</span></code><span style='font-size:
1174 :     10.0pt'> notification instead of the </span><code><span style='font-size:10.0pt'>undone</span></code><span
1175 :     style='font-size:10.0pt'> notification.<o:p></o:p></span></p>
1176 : nick 1.1
1177 : sfranklin 1.3 <pre>public org.eclipse.core.runtime.IStatus <b>undoOperation</b>(IOperation operation,</pre><pre><span style='mso-spacerun:yes'>                                         </span><span style='mso-spacerun:yes'>             </span>org.eclipse.core.runtime.IProgressMonitor&nbsp;monitor)</pre>
1178 : nick 1.1
1179 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>Undo
1180 :     the specified operation <o:p></o:p></span></p>
1181 : nick 1.1
1182 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Parameters:</span></b><span
1183 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
1184 : nick 1.1
1185 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><code><span style='font-size:10.0pt'>operation</span></code><span
1186 :     style='font-size:10.0pt'> - - the operation to be undone <o:p></o:p></span></p>
1187 : nick 1.1
1188 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><code><span style='font-size:10.0pt'>monitor</span></code><span
1189 :     style='font-size:10.0pt'> - - the progress monitor to be used for the undo, or
1190 :     null if no progress monitor is provided <o:p></o:p></span></p>
1191 : nick 1.1
1192 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Returns:</span></b><span
1193 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
1194 : nick 1.1
1195 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>the
1196 :     IStatus indicating whether the undo succeeded. The severity code in the
1197 :     returned status describes whether the operation succeeded and whether it
1198 :     remains in the history. </span><code><span style='font-size:10.0pt'>OK</span></code><span
1199 :     style='font-size:10.0pt'> severity indicates that the undo operation was
1200 :     successful and that the operation has been placed on the redo history.
1201 :     Listeners will receive the </span><code><span style='font-size:10.0pt'>undone</span></code><span
1202 :     style='font-size:10.0pt'> notification. </span><code><span style='font-size:
1203 :     10.0pt'>CANCEL</span></code><span style='font-size:10.0pt'> severity indicates
1204 :     that the user cancelled the operation and that the operation remains in the
1205 :     undo history. </span><code><span style='font-size:10.0pt'>ERROR</span></code><span
1206 :     style='font-size:10.0pt'> severity indicates that the operation could not
1207 :     successfully be undone. The operation will remain at its current location in
1208 :     the history, and callers must explicitly remove it if desired. Any other
1209 :     severity code is not interpreted by the history, and is simply passed back to
1210 :     the caller. For all severities other than </span><code><span style='font-size:
1211 :     10.0pt'>OK</span></code><span style='font-size:10.0pt'>, listeners will receive
1212 :     the </span><code><span style='font-size:10.0pt'>operationNotOK</span></code><span
1213 :     style='font-size:10.0pt'> notification instead of the </span><code><span
1214 :     style='font-size:10.0pt'>undone</span></code><span style='font-size:10.0pt'>
1215 :     notification.<o:p></o:p></span></p>
1216 : nick 1.1
1217 : sfranklin 1.3 <pre>public boolean <b>canRedo</b>(IOperationContext&nbsp; context)</pre>
1218 : nick 1.1
1219 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>Return
1220 :     whether there is a redoable operation available in the given context. <o:p></o:p></span></p>
1221 : nick 1.1
1222 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Parameters:</span></b><span
1223 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
1224 : nick 1.1
1225 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><code><span style='font-size:10.0pt'>context</span></code><span
1226 :     style='font-size:10.0pt'> - - the context to be checked, or null for any
1227 :     context <o:p></o:p></span></p>
1228 : nick 1.1
1229 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Returns:</span></b><span
1230 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
1231 : nick 1.1
1232 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><code><span style='font-size:10.0pt'>true</span></code><span
1233 :     style='font-size:10.0pt'> if there is a redoable operation, </span><code><span
1234 :     style='font-size:10.0pt'>false</span></code><span style='font-size:10.0pt'>
1235 :     otherwise.<o:p></o:p></span></p>
1236 : nick 1.1
1237 : sfranklin 1.3 <pre>public boolean <b>canUndo</b>(IOperationContext&nbsp; context)</pre>
1238 : nick 1.1
1239 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>Return
1240 :     whether there is an undoable operation available in the given context <o:p></o:p></span></p>
1241 : nick 1.1
1242 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Parameters:</span></b><span
1243 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
1244 : nick 1.1
1245 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><code><span style='font-size:10.0pt'>context</span></code><span
1246 :     style='font-size:10.0pt'> - - the context to be checked, or null to represent
1247 :     any context <o:p></o:p></span></p>
1248 : nick 1.1
1249 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Returns:</span></b><span
1250 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
1251 : nick 1.1
1252 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><code><span style='font-size:10.0pt'>true</span></code><span
1253 :     style='font-size:10.0pt'> if there is an undoable operation, </span><code><span
1254 :     style='font-size:10.0pt'>false</span></code><span style='font-size:10.0pt'>
1255 :     otherwise.<o:p></o:p></span></p>
1256 : nick 1.1
1257 : sfranklin 1.3 <pre>public void <b>addOperationApprover</b>(IOperationApprover&nbsp;approver)</pre>
1258 : nick 1.1
1259 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>Add
1260 :     the specified approver to the operation history. <o:p></o:p></span></p>
1261 : nick 1.1
1262 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Parameters:</span></b><span
1263 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
1264 : nick 1.1
1265 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><code><span style='font-size:10.0pt'>approver</span></code><span
1266 :     style='font-size:10.0pt'> - - the IOperationApprover that will be consulted
1267 :     before any operation in the history is undone or redone<o:p></o:p></span></p>
1268 : nick 1.1
1269 : sfranklin 1.3 <pre>public void <b>addOperationHistoryListener</b>(IOperationHistoryListener listener)</pre>
1270 : nick 1.1
1271 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>Add
1272 :     the specified listener to the operation history. <o:p></o:p></span></p>
1273 : nick 1.1
1274 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Parameters:</span></b><span
1275 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
1276 : nick 1.1
1277 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><code><span style='font-size:10.0pt'>listener</span></code><span
1278 :     style='font-size:10.0pt'> - - the IOperationHistoryListener to receive
1279 :     notifications about changes in the history or operations that are executed,
1280 :     undone, or redone<o:p></o:p></span></p>
1281 : nick 1.1
1282 : sfranklin 1.3 <pre>public void <b>removeOperationApprover</b>(IOperationApprover&nbsp; approver)</pre>
1283 : nick 1.1
1284 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>Remove
1285 :     the specified operation approver from the operation history. <o:p></o:p></span></p>
1286 : nick 1.1
1287 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Parameters:</span></b><span
1288 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
1289 : nick 1.1
1290 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><code><span style='font-size:10.0pt'>approver</span></code><span
1291 :     style='font-size:10.0pt'> - - the IOperationApprover to be removed<o:p></o:p></span></p>
1292 : nick 1.1
1293 : sfranklin 1.3 <pre>public void <b>removeOperationHistoryListener</b>(IOperationHistoryListener listener)</pre>
1294 : nick 1.1
1295 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>Remove
1296 :     the specified listener from the operation history. <o:p></o:p></span></p>
1297 : nick 1.1
1298 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Parameters:</span></b><span
1299 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
1300 : nick 1.1
1301 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><code><span style='font-size:10.0pt'>listener</span></code><span
1302 :     style='font-size:10.0pt'> - - The IOperationHistoryListener to be removed<o:p></o:p></span></p>
1303 : nick 1.1
1304 : sfranklin 1.3 <pre>public IOperation <b>getRedoOperation</b>(IOperationContext&nbsp; context)</pre>
1305 : nick 1.1
1306 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>Get
1307 :     the operation that will next be redone in the given context. This method is
1308 :     used to retrieve the label or description as needed for the &quot;Redo&quot;
1309 :     menu. <o:p></o:p></span></p>
1310 : nick 1.1
1311 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Parameters:</span></b><span
1312 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
1313 : nick 1.1
1314 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><code><span style='font-size:10.0pt'>context</span></code><span
1315 :     style='font-size:10.0pt'> - - the context for the redo, or null if the context
1316 :     does not matter <o:p></o:p></span></p>
1317 : nick 1.1
1318 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Returns:</span></b><span
1319 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
1320 : nick 1.1
1321 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>the
1322 :     operation to be redone or </span><code><span style='font-size:10.0pt'>null</span></code><span
1323 :     style='font-size:10.0pt'> if there is no valid operation available.<o:p></o:p></span></p>
1324 : nick 1.1
1325 : sfranklin 1.3 <pre>public IOperation [] <b>getRedoHistory</b>(IOperationContext&nbsp; context)</pre>
1326 : nick 1.1
1327 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>Get
1328 :     the array of operations in the redo history for a given context. The operations
1329 :     are in the order that they would be redone if successive &quot;Redo&quot;
1330 :     commands were invoked. <o:p></o:p></span></p>
1331 : nick 1.1
1332 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Parameters:</span></b><span
1333 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
1334 : nick 1.1
1335 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><code><span style='font-size:10.0pt'>context</span></code><span
1336 :     style='font-size:10.0pt'> - - the context for the redo, or null if the entire
1337 :     history is requested <o:p></o:p></span></p>
1338 : nick 1.1
1339 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Returns:</span></b><span
1340 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
1341 : nick 1.1
1342 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>the
1343 :     array of operations in the history<o:p></o:p></span></p>
1344 : nick 1.1
1345 : sfranklin 1.3 <pre>public IOperation <b>getUndoOperation</b>(IOperationContext&nbsp; context)</pre>
1346 : nick 1.1
1347 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>Get the
1348 :     operation that will next be undone in the given context. This method is used to
1349 :     retrieve the label or description as needed for the &quot;Undo&quot; menu. <o:p></o:p></span></p>
1350 : nick 1.1
1351 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Parameters:</span></b><span
1352 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
1353 : nick 1.1
1354 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><code><span style='font-size:10.0pt'>context</span></code><span
1355 :     style='font-size:10.0pt'> - - the context for the undo, or null if the context
1356 :     does not matter <o:p></o:p></span></p>
1357 : nick 1.1
1358 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Returns:</span></b><span
1359 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
1360 : nick 1.1
1361 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>the operation
1362 :     to be undone or </span><code><span style='font-size:10.0pt'>null</span></code><span
1363 :     style='font-size:10.0pt'> if there is no operation available.<o:p></o:p></span></p>
1364 : nick 1.1
1365 : sfranklin 1.3 <pre>public IOperation [] <b>getUndoHistory</b>(IOperationContext&nbsp; context)</pre>
1366 : nick 1.1
1367 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>Get
1368 :     the array of operations that can be undone in the specified context. The
1369 :     operations are in the order that they would be undone if successive
1370 :     &quot;Undo&quot; commands were invoked. <o:p></o:p></span></p>
1371 : nick 1.1
1372 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Parameters:</span></b><span
1373 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
1374 : nick 1.1
1375 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><code><span style='font-size:10.0pt'>context</span></code><span
1376 :     style='font-size:10.0pt'> - - the context for the undo, or null if the entire
1377 :     history is requested <o:p></o:p></span></p>
1378 : nick 1.1
1379 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Returns:</span></b><span
1380 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
1381 : nick 1.1
1382 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>the
1383 :     array of operations in the history<o:p></o:p></span></p>
1384 : nick 1.1
1385 : sfranklin 1.3 <pre>public void <b>dispose</b>(IOperationContext&nbsp;context,</pre><pre><span style='mso-spacerun:yes'>              </span><span style='mso-spacerun:yes'>      </span>boolean&nbsp;flushUndo,</pre><pre><span style='mso-spacerun:yes'>                    </span>boolean&nbsp;flushRedo)</pre>
1386 : nick 1.1
1387 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>Dispose
1388 :     of the specified context in the history. All operations that have only the
1389 :     given context will be disposed. References to the context in operations that
1390 :     have more than one context will also be removed. <o:p></o:p></span></p>
1391 : nick 1.1
1392 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Parameters:</span></b><span
1393 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
1394 : nick 1.1
1395 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><code><span style='font-size:10.0pt'>context</span></code><span
1396 :     style='font-size:10.0pt'> - - the context to be disposed, or null if all
1397 :     contexts are to be disposed <o:p></o:p></span></p>
1398 : nick 1.1
1399 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><code><span style='font-size:10.0pt'>flushUndo</span></code><span
1400 :     style='font-size:10.0pt'> - - </span><code><span style='font-size:10.0pt'>true</span></code><span
1401 :     style='font-size:10.0pt'> if the context should be flushed from the undo
1402 :     history, </span><code><span style='font-size:10.0pt'>false</span></code><span
1403 :     style='font-size:10.0pt'> if it should not <o:p></o:p></span></p>
1404 : nick 1.1
1405 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><code><span style='font-size:10.0pt'>flushRedo</span></code><span
1406 :     style='font-size:10.0pt'> - - </span><code><span style='font-size:10.0pt'>true</span></code><span
1407 :     style='font-size:10.0pt'> if the context should be flushed from the redo
1408 :     history, </span><code><span style='font-size:10.0pt'>false</span></code><span
1409 :     style='font-size:10.0pt'> if it should not.<o:p></o:p></span></p>
1410 : nick 1.1
1411 : sfranklin 1.3 <pre>public int <b>getLimit</b>()</pre>
1412 : nick 1.1
1413 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>Return
1414 :     the specified limit on the undo and redo history. <o:p></o:p></span></p>
1415 : nick 1.1
1416 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Returns:</span></b><span
1417 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
1418 : nick 1.1
1419 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>limit<o:p></o:p></span></p>
1420 : nick 1.1
1421 : sfranklin 1.3 <pre>public void <b>setLimit</b>(int&nbsp;limit)</pre>
1422 : nick 1.1
1423 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>Set
1424 :     the limit on the undo and redo history. <o:p></o:p></span></p>
1425 : nick 1.1
1426 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Parameters:</span></b><span
1427 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
1428 : nick 1.1
1429 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><code><span style='font-size:10.0pt'>limit</span></code><span
1430 :     style='font-size:10.0pt'> - - the maximum number of operations that should be
1431 :     kept in the history<o:p></o:p></span></p>
1432 : nick 1.1
1433 : sfranklin 1.3 <h3>IOperationContext</h3>
1434 : nick 1.1
1435 : sfranklin 1.3 <pre>public java.lang.String <b>getLabel</b>()</pre>
1436 : nick 1.1
1437 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>Get
1438 :     the label that should be used to describe the context in any views. Contexts may
1439 :     be shown when filtered operation histories are shown to the user. <o:p></o:p></span></p>
1440 : nick 1.1
1441 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Returns:</span></b><span
1442 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
1443 : nick 1.1
1444 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>the
1445 :     label for the context.<o:p></o:p></span></p>
1446 : nick 1.1
1447 : sfranklin 1.3 <pre>public IContextOperationApprover <b>getOperationApprover</b>()</pre>
1448 : nick 1.1
1449 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>Get
1450 :     the operation approver that is used to approve undo or redo operations
1451 :     involving this context. A null context signifies that no special approval is
1452 :     necessary. <o:p></o:p></span></p>
1453 : nick 1.1
1454 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Returns:</span></b><span
1455 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
1456 : nick 1.1
1457 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>the
1458 :     operation approver for the context.<o:p></o:p></span></p>
1459 : nick 1.1
1460 : sfranklin 1.3 <pre>public boolean <b>acceptOperation</b>(IOperation operation)</pre>
1461 : nick 1.1
1462 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>Return
1463 :     a boolean that indicates whether this context should be assigned to the specified
1464 :     operation. This method should be overridden by contexts that have complex rules
1465 :     for whether they should be assigned to an operation. Simple contexts generally
1466 :     answer true. <o:p></o:p></span></p>
1467 : nick 1.1
1468 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Returns:</span></b><span
1469 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
1470 : nick 1.1
1471 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a
1472 :     boolean indicating whether this context should be assigned to the operation.<o:p></o:p></span></p>
1473 : nick 1.1
1474 : sfranklin 1.3 <pre>public boolean <b>equals</b>(IOperationContext&nbsp;context)</pre>
1475 : nick 1.1
1476 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>Return
1477 :     whether this context is equal to the specified context. <o:p></o:p></span></p>
1478 : nick 1.1
1479 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Parameters:</span></b><span
1480 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
1481 : nick 1.1
1482 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><code><span style='font-size:10.0pt'>context</span></code><span
1483 :     style='font-size:10.0pt'> - <o:p></o:p></span></p>
1484 : nick 1.1
1485 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Returns:</span></b><span
1486 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
1487 : nick 1.1
1488 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><code><span style='font-size:10.0pt'>true</span></code><span
1489 :     style='font-size:10.0pt'> if the contexts are equal, </span><code><span
1490 :     style='font-size:10.0pt'>false</span></code><span style='font-size:10.0pt'>
1491 :     otherwise.<o:p></o:p></span></p>
1492 : nick 1.1
1493 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
1494 :    
1495 : sfranklin 1.3 <h3>IOperationApprover</h3>
1496 : nick 1.1
1497 : sfranklin 1.3 <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>IOperationApprover
1498 :     defines an interface for approving the undo or redo of a particular operation
1499 :     within an operation history. Operations that are candidates for undo or redo
1500 :     have already been validated against their current state and according to the
1501 :     rules of the history.<o:p></o:p></span></p>
1502 : nick 1.1
1503 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
1504 :    
1505 : sfranklin 1.3 <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>By the time
1506 :     an IOperationApprover is consulted, the undo has already been requested.
1507 :     Approvers should true if the operation should proceed, and false if it should
1508 :     not. When an operation is rejected, it is expected that the object rejecting
1509 :     the operation has already consulted the user if necessary or otherwise provided
1510 :     any necessary information to the user about the rejection.<o:p></o:p></span></p>
1511 : nick 1.1
1512 : sfranklin 1.3 <pre>public org.eclipse.core.runtime.IStatus <b>proceedUndoing</b>(IOperation operation, IOperationHistory history)</pre>
1513 : nick 1.1
1514 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>Return
1515 :     a status indicating whether the specified operation should be undone. Any
1516 :     status that does not have severity </span><code><span style='font-size:10.0pt'>IStatus.OK</span></code><span
1517 :     style='font-size:10.0pt'> will not be approved. Implementers should not assume
1518 :     that the undo will be performed when the status is </span><code><span
1519 :     style='font-size:10.0pt'>OK</span></code><span style='font-size:10.0pt'>, since
1520 :     other operation approvers can veto the undo. <o:p></o:p></span></p>
1521 : nick 1.1
1522 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Parameters:</span></b><span
1523 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
1524 : nick 1.1
1525 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><code><span style='font-size:10.0pt'>operation</span></code><span
1526 :     style='font-size:10.0pt'> - - the operation to be undone <o:p></o:p></span></p>
1527 : nick 1.1
1528 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><code><span style='font-size:10.0pt'>history</span></code><span
1529 :     style='font-size:10.0pt'> - - the history undoing the operation <o:p></o:p></span></p>
1530 : nick 1.1
1531 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Returns:</span></b><span
1532 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
1533 : nick 1.1
1534 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>the
1535 :     IStatus describing whether the operation is approved. The undo will not proceed
1536 :     if the status severity is not </span><code><span style='font-size:10.0pt'>OK</span></code><span
1537 :     style='font-size:10.0pt'>, and the caller requesting the undo will be returned
1538 :     the status that caused the rejection. Any other status severities will not be
1539 :     interpreted by the history.<o:p></o:p></span></p>
1540 : nick 1.1
1541 : sfranklin 1.3 <pre>public org.eclipse.core.runtime.IStatus <b>proceedRedoing</b>(IOperation operation, IOperationHistory&nbsp;history)</pre>
1542 : nick 1.1
1543 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>Return
1544 :     a status indicating whether the specified operation should be redone. Any
1545 :     status that does not have severity </span><code><span style='font-size:10.0pt'>IStatus.OK</span></code><span
1546 :     style='font-size:10.0pt'> will not be approved. Implementers should not assume
1547 :     that the redo will be performed when the status is </span><code><span
1548 :     style='font-size:10.0pt'>OK</span></code><span style='font-size:10.0pt'>, since
1549 :     other operation approvers may veto the redo. <o:p></o:p></span></p>
1550 : nick 1.1
1551 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Parameters:</span></b><span
1552 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
1553 : nick 1.1
1554 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><code><span style='font-size:10.0pt'>operation</span></code><span
1555 :     style='font-size:10.0pt'> - - the operation to be redone <o:p></o:p></span></p>
1556 : nick 1.1
1557 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><code><span style='font-size:10.0pt'>history</span></code><span
1558 :     style='font-size:10.0pt'> - - the history redoing the operation <o:p></o:p></span></p>
1559 : nick 1.1
1560 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Returns:</span></b><span
1561 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
1562 : nick 1.1
1563 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>the
1564 :     IStatus describing whether the operation is approved. The redo will not proceed
1565 :     if the status severity is no </span><code><span style='font-size:10.0pt'>OK</span></code><span
1566 :     style='font-size:10.0pt'>, and the caller requesting the redo will be returned
1567 :     the status that caused the rejection. Any other status severities will not be
1568 :     interpreted by the history.<o:p></o:p></span></p>
1569 : nick 1.1
1570 : sfranklin 1.3 <h3>IOperationHistoryListener</h3>
1571 : nick 1.1
1572 : sfranklin 1.3 <pre>public void <b>historyNotification</b>(OperationHistoryEvent event)</pre>
1573 : nick 1.1
1574 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>Something
1575 :     of note has happened in the IOperationHistory. Listeners should check the
1576 :     supplied event for details. <o:p></o:p></span></p>
1577 : nick 1.1
1578 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Parameters:</span></b><span
1579 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
1580 : nick 1.2
1581 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><code><span style='font-size:10.0pt'>event</span></code><span
1582 :     style='font-size:10.0pt'> - - the OperationHistoryEvent that describes the
1583 :     particular notification.<o:p></o:p></span></p>
1584 : nick 1.1
1585 : sfranklin 1.3 <h3>OperationHistoryEvent</h3>
1586 : nick 1.1
1587 : sfranklin 1.3 <pre>public IOperationHistory <b>history</b></pre><pre><o:p>&nbsp;</o:p></pre><pre>public IOperation <b>operation</b></pre><pre><o:p>&nbsp;</o:p></pre><pre>public boolean <b>operationAdded</b>()</pre>
1588 : nick 1.1
1589 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>Returns
1590 :     whether or not an operation was added to the history. Listeners typically use
1591 :     this to add their context to a new operation as appropriate or otherwise record
1592 :     the operation. <o:p></o:p></span></p>
1593 : nick 1.1
1594 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Returns:</span></b><span
1595 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
1596 : nick 1.1
1597 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><code><span style='font-size:10.0pt'>true</span></code><span
1598 :     style='font-size:10.0pt'> if an operation has been added, </span><code><span
1599 :     style='font-size:10.0pt'>false</span></code><span style='font-size:10.0pt'> if
1600 :     not.<o:p></o:p></span></p>
1601 : nick 1.1
1602 : sfranklin 1.3 <pre>public boolean <b>operationRemoved</b>()</pre>
1603 : nick 1.1
1604 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>Returns
1605 :     whether or not an operation was removed from the history. Listeners typically
1606 :     remove any record of the operation that they may have kept in their own state. <o:p></o:p></span></p>
1607 : nick 1.1
1608 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Returns:</span></b><span
1609 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
1610 : nick 1.1
1611 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><code><span style='font-size:10.0pt'>true</span></code><span
1612 :     style='font-size:10.0pt'> if an operation has been removed, </span><code><span
1613 :     style='font-size:10.0pt'>false</span></code><span style='font-size:10.0pt'> if
1614 :     not.<o:p></o:p></span></p>
1615 : nick 1.1
1616 : sfranklin 1.3 <pre>public boolean <b>aboutToExecute</b>()</pre>
1617 : nick 1.1
1618 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>Returns
1619 :     whether or not an operation is about to execute. Listeners should prepare for
1620 :     the execution as appropriate. Listeners will receive a done notification if the
1621 :     operation is successful, or an operationNotCompleted notification if the
1622 :     execution is cancelled or otherwise fails. This notification is only received
1623 :     for those operations executed by the operation history. Operations that are
1624 :     added to the history after execution do not trigger these notifications. If the
1625 :     operation successfully executes, clients will also receive a notification that
1626 :     it has been added to the history. <o:p></o:p></span></p>
1627 : nick 1.1
1628 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Returns:</span></b><span
1629 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
1630 : nick 1.1
1631 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><code><span style='font-size:10.0pt'>true</span></code><span
1632 :     style='font-size:10.0pt'> if an operation is about to execute, </span><code><span
1633 :     style='font-size:10.0pt'>false</span></code><span style='font-size:10.0pt'> if
1634 :     not.<o:p></o:p></span></p>
1635 : nick 1.1
1636 : sfranklin 1.3 <pre>public boolean <b>aboutToUndo</b>()</pre>
1637 : nick 1.1
1638 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>Returns
1639 :     whether or not an operation is about to be undone. Listeners should prepare for
1640 :     the undo as appropriate. Listeners will receive an undone notification if the
1641 :     operation is successful, or an operationNotCompleted notification if the undo
1642 :     is cancelled or otherwise fails. <o:p></o:p></span></p>
1643 : nick 1.1
1644 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Returns:</span></b><span
1645 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
1646 : nick 1.1
1647 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><code><span style='font-size:10.0pt'>true</span></code><span
1648 :     style='font-size:10.0pt'> if an operation is about to undo, </span><code><span
1649 :     style='font-size:10.0pt'>false</span></code><span style='font-size:10.0pt'> if
1650 :     not.<o:p></o:p></span></p>
1651 : nick 1.1
1652 : sfranklin 1.3 <pre>public boolean <b>aboutToRedo</b>()</pre>
1653 : nick 1.1
1654 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>Returns
1655 :     whether or not an operation is about to be redone. Listeners should prepare for
1656 :     the redo as appropriate. Listeners will receive a redone notification if the
1657 :     operation is successful, or an operationNotCompleted notification if the redo
1658 :     is cancelled or otherwise fails. <o:p></o:p></span></p>
1659 : nick 1.1
1660 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Returns:</span></b><span
1661 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
1662 : nick 1.1
1663 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><code><span style='font-size:10.0pt'>true</span></code><span
1664 :     style='font-size:10.0pt'> if an operation is about to redo, </span><code><span
1665 :     style='font-size:10.0pt'>false</span></code><span style='font-size:10.0pt'> if
1666 :     not.<o:p></o:p></span></p>
1667 : nick 1.1
1668 : sfranklin 1.3 <pre>public boolean <b>done</b>()</pre>
1669 : nick 1.1
1670 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>Returns
1671 :     whether or not an operation was initially done. Listeners can take appropriate
1672 :     action, such as revealing any relevant state in the UI. This notification is
1673 :     only received for those operations executed by the operation history. Operations
1674 :     that are added to the history after execution do not trigger this notification.
1675 :     Clients will also receive a notification that the operation has been added to
1676 :     the history. <o:p></o:p></span></p>
1677 : nick 1.1
1678 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Returns:</span></b><span
1679 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
1680 : nick 1.1
1681 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><code><span style='font-size:10.0pt'>true</span></code><span
1682 :     style='font-size:10.0pt'> if an operation has been done, </span><code><span
1683 :     style='font-size:10.0pt'>false</span></code><span style='font-size:10.0pt'> if
1684 :     not.<o:p></o:p></span></p>
1685 : nick 1.1
1686 : sfranklin 1.3 <pre>public boolean <b>undone</b>()</pre>
1687 : nick 1.1
1688 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>Returns
1689 :     whether or not an operation was undone. Listeners can take appropriate action,
1690 :     such as revealing any relevant state in the UI. <o:p></o:p></span></p>
1691 : nick 1.1
1692 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Returns:</span></b><span
1693 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
1694 : nick 1.1
1695 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><code><span style='font-size:10.0pt'>true</span></code><span
1696 :     style='font-size:10.0pt'> if an operation has been undone, </span><code><span
1697 :     style='font-size:10.0pt'>false</span></code><span style='font-size:10.0pt'> if
1698 :     not.<o:p></o:p></span></p>
1699 : nick 1.1
1700 : sfranklin 1.3 <pre>public boolean <b>redone</b>()</pre>
1701 : nick 1.1
1702 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>Returns
1703 :     whether or not an operation was redone. Listeners can take appropriate action,
1704 :     such as revealing any relevant state in the UI. <o:p></o:p></span></p>
1705 : nick 1.1
1706 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Returns:</span></b><span
1707 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
1708 : nick 1.1
1709 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><code><span style='font-size:10.0pt'>true</span></code><span
1710 :     style='font-size:10.0pt'> if an operation has been redone, </span><code><span
1711 :     style='font-size:10.0pt'>false</span></code><span style='font-size:10.0pt'> if
1712 :     not.<o:p></o:p></span></p>
1713 : nick 1.1
1714 : sfranklin 1.3 <pre>public boolean <b>operationNotOK</b>()</pre>
1715 : nick 1.1
1716 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>Returns
1717 :     whether or not an operation was attempted and not successful. Listeners
1718 :     typically use this when they have prepared for an execute, undo, or redo, and
1719 :     need to know that the operation did not successfully complete. For example,
1720 :     listeners that turn redraw off before an operation is undone would turn redraw
1721 :     on when the operation completes, or when this notification is received, since
1722 :     there will be no notification of the completion. <o:p></o:p></span></p>
1723 : nick 1.1
1724 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>Returns:</span></b><span
1725 :     style='font-size:10.0pt'> <o:p></o:p></span></p>
1726 : nick 1.1
1727 : sfranklin 1.3 <p class=MsoNormal style='margin-left:.5in'><code><span style='font-size:10.0pt'>true</span></code><span
1728 :     style='font-size:10.0pt'> if an operation has been redone, </span><code><span
1729 :     style='font-size:10.0pt'>false</span></code><span style='font-size:10.0pt'> if
1730 :     not.<o:p></o:p></span></p>
1731 : nick 1.1
1732 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
1733 :    
1734 : sfranklin 1.3 <h2>UI Support Classes<span style='font-size:10.0pt'><o:p></o:p></span></h2>
1735 :    
1736 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Additional support
1737 :     classes will be provided in the package org.eclipse.ui.operations.<span
1738 :     style='mso-spacerun:yes'>  </span>These classes handle policy decisions about
1739 :     the undo model to be used by the workbench.<span style='mso-spacerun:yes'> 
1740 :     </span>Access to the undo and redo commands, as well as the operations history,
1741 :     will be provided through workbench.<o:p></o:p></span></p>
1742 : nick 1.1
1743 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
1744 :    
1745 : sfranklin 1.3 <h3>Workbench Operation History</h3>
1746 :    
1747 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>The
1748 :     workbench will manage a common operation history that can be used by any
1749 :     plug-in to integrate its undo and redo history with the workbench.<span
1750 :     style='mso-spacerun:yes'>  </span>This operation history will be accessible
1751 :     through workbench API, to be determined by M5.<o:p></o:p></span></p>
1752 : nick 1.1
1753 : sfranklin 1.3 <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
1754 : nick 1.1
1755 : sfranklin 1.3 <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Contexts
1756 :     will be defined for text editors (with specialization for source editors) and
1757 :     for the workspace.<span style='mso-spacerun:yes'>  </span>Throughout the
1758 :     development of R3.1, plug-ins will be encouraged to define operations that
1759 :     represent their existing actions or command handlers.<span
1760 :     style='mso-spacerun:yes'>  </span>Additional contexts may be defined by
1761 :     plug-ins.<o:p></o:p></span></p>
1762 : nick 1.1
1763 : sfranklin 1.3 <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
1764 : nick 1.1
1765 : sfranklin 1.3 <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Existing
1766 :     workbench actions will be modified to support undo by mapping existing
1767 :     workbench actions and handlers to operations.<span style='mso-spacerun:yes'> 
1768 :     </span>The operations will be added incrementally once the framework is in
1769 :     place.<span style='mso-spacerun:yes'>  </span><o:p></o:p></span></p>
1770 : nick 1.1
1771 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
1772 :    
1773 : sfranklin 1.3 <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Operations
1774 :     that are assigned the workspace context will implement a subinterface,
1775 :     IWorkspaceOperation.<span style='mso-spacerun:yes'>  </span>IWorkspaceOperation
1776 :     adds protocol to access the model elements manipulated by an operation
1777 :     (getElements()), so that listeners can decide if the workspace operation
1778 :     affects their model.<span style='mso-spacerun:yes'>  </span>This protocol is
1779 :     not generalized to IOperation.<span style='mso-spacerun:yes'>  </span>Prior
1780 :     experience with model-based operation frameworks has shown that there needs to
1781 :     be a very specific contract regarding how and when validation is performed,
1782 :     what underlying model listeners are used to validate the operation, and whether
1783 :     operations history notifications or internal model notifications are used to
1784 :     maintain the validity of the operation and the undo stack.<span
1785 :     style='mso-spacerun:yes'>  </span>These details for IWorkspaceOperation will
1786 :     evolve as more workbench operations are created. <o:p></o:p></span></p>
1787 : nick 1.1
1788 : sfranklin 1.3 <h3>UndoHandler and RedoHandler</h3>
1789 : nick 1.1
1790 : sfranklin 1.3 <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>The
1791 :     Edit&gt;Undo and Edit&gt;Redo commands should be handled by any parts that wish
1792 :     to support undo.<span style='mso-spacerun:yes'>  </span>Common handlers for the
1793 :     undo and redo commands will be provided.<span style='mso-spacerun:yes'> 
1794 :     </span>These handlers can be assigned a context that should be used to filter
1795 :     the undo and redo history.<span style='mso-spacerun:yes'>  </span>The handlers
1796 :     are responsible for the following:<o:p></o:p></span></p>
1797 :    
1798 :     <ul style='margin-top:0in' type=disc>
1799 :     <li class=MsoNormal style='mso-list:l6 level1 lfo11;tab-stops:list .5in'><span
1800 :     style='font-size:10.0pt;font-family:Arial'>Undo and Redo commands will be
1801 :     enabled based on the status of the history.<o:p></o:p></span></li>
1802 :     <li class=MsoNormal style='mso-list:l6 level1 lfo11;tab-stops:list .5in'><span
1803 :     style='font-size:10.0pt;font-family:Arial'>The Undo and Redo commands will
1804 :     be appended with the label of the operation for the handler’s context.<o:p></o:p></span></li>
1805 :     <li class=MsoNormal style='mso-list:l6 level1 lfo11;tab-stops:list .5in'><span
1806 :     style='font-size:10.0pt;font-family:Arial'>The undo and redo history will
1807 :     be flushed for the handler’s context whenever the most recent operation in
1808 :     the history is invalid.<span style='mso-spacerun:yes'>  </span>This
1809 :     aggressive maintenance of the history is the most conservative approach
1810 :     for ensuring that the history contains valid operations, and this strategy
1811 :     may evolve with experience.<o:p></o:p></span></li>
1812 :     </ul>
1813 :    
1814 :     <h3>Undo and Redo Toolbar Items</h3>
1815 :    
1816 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Time
1817 :     permitting, classes that support toolbar dropdown items for undo and redo will
1818 :     be developed.<span style='mso-spacerun:yes'>  </span>These will also be
1819 :     assigned a context.<span style='mso-spacerun:yes'>  </span>By clicking on the
1820 :     drop-down arrow, the user will see the history for that particular
1821 :     context.<span style='mso-spacerun:yes'>  </span>The user will only be able to
1822 :     select a range, starting from the top item, to be undone or redone.<span
1823 :     style='mso-spacerun:yes'>  </span>It is expected that the ability to view the
1824 :     history is more valuable to the user than the ability to multi-select
1825 :     operations for undo.<o:p></o:p></span></p>
1826 : nick 1.1
1827 : sfranklin 1.3 <h3>Operation Approvers</h3>
1828 : nick 1.1
1829 : sfranklin 1.3 <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>The
1830 :     workbench will provide and install an IOperationApprover that consults the
1831 :     contexts of an operation to determine whether undo or redo should proceed.<span
1832 :     style='mso-spacerun:yes'>  </span>The policy is described as follows:<o:p></o:p></span></p>
1833 : nick 1.1
1834 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
1835 :    
1836 : sfranklin 1.3 <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>The
1837 :     workbench will allow undo or redo of any valid operation in the history, <i
1838 :     style='mso-bidi-font-style:normal'>as long as there are no more recent
1839 :     operations in the history that share a context with the operation to be
1840 :     executed.</i> <span style='mso-spacerun:yes'>  </span>If the operation to be
1841 :     undone or redone has contexts that are also present in operations appearing
1842 :     later in the history, then the undo or redo of the operation will not be
1843 :     permitted.<o:p></o:p></span></p>
1844 : nick 1.1
1845 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
1846 :    
1847 : sfranklin 1.3 <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>A concrete
1848 :     example will help explain this.<span style='mso-spacerun:yes'>  </span><o:p></o:p></span></p>
1849 :    
1850 :     <ol style='margin-top:0in' start=1 type=1>
1851 :     <li class=MsoNormal style='mso-list:l3 level1 lfo14;tab-stops:list .5in'><span
1852 :     style='font-size:10.0pt;font-family:Arial'>The user makes local edits in
1853 :     editor A.<o:p></o:p></span></li>
1854 :     <li class=MsoNormal style='mso-list:l3 level1 lfo14;tab-stops:list .5in'><span
1855 :     style='font-size:10.0pt;font-family:Arial'>The user initiates a
1856 :     refactoring operation whose context is “A” and “workspace.”<o:p></o:p></span></li>
1857 :     <li class=MsoNormal style='mso-list:l3 level1 lfo14;tab-stops:list .5in'><span
1858 :     style='font-size:10.0pt;font-family:Arial'>The user makes additional local
1859 :     edits to editor A.<o:p></o:p></span></li>
1860 :     <li class=MsoNormal style='mso-list:l3 level1 lfo14;tab-stops:list .5in'><span
1861 :     style='font-size:10.0pt;font-family:Arial'>The user goes to the navigator
1862 :     and selects Undo.<o:p></o:p></span></li>
1863 :     </ol>
1864 : nick 1.1
1865 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
1866 :    
1867 : sfranklin 1.3 <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>In the proposed
1868 :     implementation, the navigator requests an undo for the workspace context.<span
1869 :     style='mso-spacerun:yes'>  </span>The refactoring operation triggered in the
1870 :     editor is the most recent operation that has the workspace context, but it also
1871 :     contains context “A.”<span style='mso-spacerun:yes'>  </span>Since subsequent
1872 :     operations in the history also have context “A,”, the operation will not be
1873 :     allowed.<span style='mso-spacerun:yes'>  </span>An explanation will be provided
1874 :     to the user after the fact:<span style='mso-spacerun:yes'>  </span>“Cannot undo
1875 :     the refactoring operation because there have been subsequent changes to
1876 :     A.”<span style='mso-spacerun:yes'>  </span><o:p></o:p></span></p>
1877 : nick 1.1
1878 : sfranklin 1.3 <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
1879 :    
1880 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Future
1881 :     releases may warn the user or provide a preference to determine whether the
1882 :     undo should proceed anyway, and whether the subsequent changes to “A” should
1883 :     also be undone, or be flushed from the history. Early prototypes of the
1884 :     framework showed that such warnings interrupt workflow and can be very
1885 :     difficult to understand, so the initial UI will be to prohibit the undo,
1886 :     explaining why.<span style='mso-spacerun:yes'>   </span><o:p></o:p></span></p>
1887 :    
1888 :     <h2>Migration Examples</h2>
1889 : nick 1.1
1890 : sfranklin 1.3 <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>The
1891 :     following examples explain how existing code can be migrated to use the
1892 :     operations framework.<span style='mso-spacerun:yes'>  </span>An early prototype
1893 :     used these techniques to integrate the SDK text editor, refactoring framework,
1894 :     and sample applications into a common undo framework.<span
1895 :     style='mso-spacerun:yes'>  </span></span></p>
1896 :    
1897 :     <h3>Mapping existing actions or command handlers to operations</h3>
1898 :    
1899 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>Converting
1900 :     an existing action to use operations is straightforward, apart from
1901 :     implementing the undo and redo behavior for the action.<span
1902 :     style='mso-spacerun:yes'>  </span>The run() or runWithEvent method inside the
1903 :     action should create an operation, execute it, and add it to the operations
1904 :     history, rather than run the code inside the method.<span
1905 :     style='mso-spacerun:yes'>  </span>The following code shows the existing run()
1906 :     method in the EditorAction of the readme tool example
1907 :     (org.eclipse.ui.examples.readmetool):<o:p></o:p></span></p>
1908 : nick 1.1
1909 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
1910 :    
1911 : sfranklin 1.3 <pre>public void run() {</pre><pre><span style='mso-spacerun:yes'>            </span>String editorName = MessageUtil.getString(&quot;Empty_Editor_Name&quot;); </pre><pre><span style='mso-spacerun:yes'>            </span>if (activeEditor != null)</pre><pre><span style='mso-spacerun:yes'>                </span>editorName = activeEditor.getTitle();</pre><pre><span style='mso-spacerun:yes'>            </span>MessageDialog</pre><pre><span style='mso-spacerun:yes'>                    </span>.openInformation(</pre><pre><span style='mso-spacerun:yes'>                            </span>shell,</pre><pre><span style='mso-spacerun:yes'>                            </span>MessageUtil.getString(&quot;Readme_Editor&quot;), </pre><pre><span style='mso-spacerun:yes'>                            </span>MessageUtil.format(&quot;ReadmeEditorActionExecuted&quot;, </pre><pre><span
1912 :     style='mso-tab-count:4'>                               </span>new Object[] { getText(), editorName })); </pre><pre><span style='mso-spacerun:yes'>        </span>}</pre><pre><span
1913 :     style='font-family:Arial'>Using operations, the run method simplifies:<o:p></o:p></span></pre><pre><span
1914 :     style='font-family:Arial'><o:p>&nbsp;</o:p></span></pre><pre><span style='mso-spacerun:yes'>        </span>public void run() {</pre><pre><span style='mso-spacerun:yes'>            </span>String editorName = MessageUtil.getString(&quot;Empty_Editor_Name&quot;); </pre><pre><span style='mso-spacerun:yes'>  </span><span style='mso-spacerun:yes'>          </span>if (activeEditor != null)</pre><pre><span style='mso-spacerun:yes'>                </span>editorName = activeEditor.getTitle();</pre><pre><span style='mso-spacerun:yes'>            </span>// create the operation</pre><pre><span style='mso-spacerun:yes'>            </span>IOperation operation = new EditorOperation(</pre><pre><span
1915 :     style='mso-tab-count:2'>               </span>getText(),shell, editorName);</pre><pre><span style='mso-spacerun:yes'>            </span>// execute (and add to the history)</pre><pre><span style='mso-spacerun:yes'>            </span>history.execute(operation, null);</pre><pre><span style='mso-spacerun:yes'>        </span>}</pre><pre><span
1916 :     style='font-family:Arial'>The operation encapsulates the old run behavior, as well as the undo and redo for the operation:<o:p></o:p></span></pre><pre><span
1917 :     style='font-family:Arial'><o:p>&nbsp;</o:p></span></pre><pre>class EditorOperation extends AbstractOperation {</pre><pre><span style='mso-spacerun:yes'>        </span>Shell fShell;</pre><pre><span style='mso-spacerun:yes'>        </span>String fEditorName;</pre><pre><span style='mso-spacerun:yes'>        </span>public EditorOperation(String label, Shell shell, String editorName) {</pre><pre><span style='mso-spacerun:yes'>            </span>super(label);</pre><pre><span style='mso-spacerun:yes'>            </span>fShell = shell;</pre><pre><span style='mso-spacerun:yes'>            </span>fEditorName = editorName;</pre><pre><span style='mso-spacerun:yes'>            </span></pre><pre><span style='mso-spacerun:yes'>        </span>}</pre><pre><span style='mso-spacerun:yes'>        </span>public IStatus execute(IProgressMonitor monitor) {</pre><pre><span style='mso-spacerun:yes'>            </span>MessageDialog.openInformation(</pre><pre><span style='mso-spacerun:yes'>                    </span>fShell,</pre><pre><span style='mso-spacerun:yes'>                    </span>MessageUtil.getString(&quot;Readme_Editor&quot;), </pre><pre><span style='mso-spacerun:yes'>                    </span>MessageUtil.format(&quot;ReadmeEditorActionExecuted&quot;, </pre><pre><span
1918 :     style='mso-tab-count:3'>                       </span>new Object[] { getLabel(), fEditorName }));<span style='mso-spacerun:yes'>  </span></pre><pre><span style='mso-spacerun:yes'>            </span>return Status.OK_STATUS;</pre><pre><span style='mso-spacerun:yes'>        </span>}</pre><pre><span style='mso-spacerun:yes'>        </span>public IStatus undo(IProgressMonitor monitor) {</pre><pre><span style='mso-spacerun:yes'>            </span>// implement the undo here</pre><pre><span style='mso-spacerun:yes'>            </span>return Status.OK_STATUS;</pre><pre><span style='mso-spacerun:yes'>        </span>}</pre><pre><span style='mso-spacerun:yes'>        </span>public IStatus redo(IProgressMonitor monitor) {</pre><pre><span style='mso-spacerun:yes'>            </span>// implement the redo here</pre><pre><span style='mso-spacerun:yes'>            </span>return Status.OK_STATUS;</pre><pre><span style='mso-spacerun:yes'>        </span>}</pre><pre><span style='mso-spacerun:yes'>    </span>}</pre><pre><o:p>&nbsp;</o:p></pre><pre><span
1919 :     style='font-family:Arial'>If an IHandler is provided for a command instead of using actions, the execute method of the handler is mapped similarly to the run method in an action:<o:p></o:p></span></pre><pre><span
1920 :     style='font-family:Arial'><o:p>&nbsp;</o:p></span></pre><pre><span style='mso-spacerun:yes'>        </span>public Object execute(Map params) throws ExecutionException {</pre><pre><span style='mso-spacerun:yes'>        </span>try {</pre><pre><span
1921 :     style='mso-tab-count:1'>        </span><span style='mso-spacerun:yes'>    </span>IEditorPart activeEditor = params.get(&quot;ACTIVE_EDITOR&quot;);</pre><pre><span
1922 :     style='mso-tab-count:1'>        </span><span style='mso-spacerun:yes'>    </span>Shell shell = params.get(&quot;SHELL&quot;);</pre><pre><span
1923 :     style='mso-tab-count:1'>        </span><span style='mso-spacerun:yes'>    </span>String label = params.get(&quot;NAME&quot;);</pre><pre><span
1924 :     style='mso-tab-count:1'>        </span><span style='mso-spacerun:yes'>    </span>String editorName = MessageUtil.getString(&quot;Empty_Editor_Name&quot;); </pre><pre><span style='mso-spacerun:yes'>            </span>if (activeEditor != null)</pre><pre><span style='mso-spacerun:yes'>                </span>editorName = activeEditor.getTitle();</pre><pre><span style='mso-spacerun:yes'>            </span>// create the operation</pre><pre><span style='mso-spacerun:yes'>            </span>IOperation operation =new EditorOperation(label, shell, editorName);</pre><pre><o:p>&nbsp;</o:p></pre><pre><span style='mso-spacerun:yes'>            </span>// execute (and add to the history)</pre><pre><span style='mso-spacerun:yes'>            </span>history.execute(operation, null);</pre><pre><span style='mso-spacerun:yes'>        </span>} catch (Exception e) {</pre><pre><span style='mso-spacerun:yes'>            </span>throw new ExecutionException(</pre><pre><span style='mso-spacerun:yes'>                    </span>&quot;While executing the operation, an exception occurred&quot;, e); </pre><pre><span style='mso-spacerun:yes'>        </span>}</pre><pre><span style='mso-spacerun:yes'>        </span>return null;</pre><pre><span style='mso-spacerun:yes'>    </span>}</pre><pre><span
1925 :     style='font-family:Arial'><o:p>&nbsp;</o:p></span></pre><pre><span
1926 :     style='font-family:Arial'>When an action launches a wizard. then the operation is typically created as part of processing the “Finish” button in the wizard.<span style='mso-spacerun:yes'>  </span>Some restructuring may be required.<span style='mso-spacerun:yes'>  </span>For example, wizards are often implemented in hierarchies and make use of convenience methods in the wizard hierarchy.<span style='mso-spacerun:yes'>  </span>Some of these methods may have to move to a corresponding hierarchy of operations.</span> </pre>
1927 :    
1928 :     <h3>Refactoring example:<span style='mso-spacerun:yes'>  </span>mapping
1929 :     existing protocol to IOperation</h3>
1930 :    
1931 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>In the
1932 :     current SDK implementation, org.eclipse.ltk.core.refactoring provides an undo
1933 :     framework for undoing refactoring operations.<span style='mso-spacerun:yes'> 
1934 :     </span>This framework is based on the notion of “Change” objects.<span
1935 :     style='mso-spacerun:yes'>  </span>Change objects that can be undone are
1936 :     responsible for returning the undo version of a change when they are
1937 :     executed.<span style='mso-spacerun:yes'>  </span>An undo stack is maintained by
1938 :     an internal undo manager.<span style='mso-spacerun:yes'>  </span>This undo
1939 :     manager invalidates the history whenever an unknown workspace change
1940 :     occurs.<span style='mso-spacerun:yes'>  </span>Undo-aware objects send signals
1941 :     to the undo manager as they perform operations, so that the undo manager will
1942 :     not invalidate the history.<o:p></o:p></span></p>
1943 : nick 1.1
1944 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
1945 :    
1946 : sfranklin 1.3 <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>A prototype
1947 :     integrated the refactoring change framework with the operations framework as
1948 :     follows:<o:p></o:p></span></p>
1949 : nick 1.1
1950 : sfranklin 1.3 <p class=MsoNormal style='margin-left:39.0pt;text-indent:-.25in;mso-list:l4 level1 lfo16;
1951 :     tab-stops:list 39.0pt'><![if !supportLists]><span style='font-size:10.0pt;
1952 :     font-family:Arial;mso-fareast-font-family:Arial'><span style='mso-list:Ignore'>1.<span
1953 :     style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><![endif]><span
1954 :     style='font-size:10.0pt;font-family:Arial'>The change objects were wrappered
1955 :     with a class that implements IOperation (and IWorkspaceOperation) and maps the
1956 :     operation protocol to the Change protocol.<o:p></o:p></span></p>
1957 :    
1958 :     <p class=MsoNormal style='margin-left:39.0pt;text-indent:-.25in;mso-list:l4 level1 lfo16;
1959 :     tab-stops:list 39.0pt'><![if !supportLists]><span style='font-size:10.0pt;
1960 :     font-family:Arial;mso-fareast-font-family:Arial'><span style='mso-list:Ignore'>2.<span
1961 :     style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><![endif]><span
1962 :     style='font-size:10.0pt;font-family:Arial'>The refactoring undo manager was
1963 :     replaced with an alternate implementation that uses the operations history to
1964 :     maintain the undo and redo history.<o:p></o:p></span></p>
1965 : nick 1.1
1966 : sfranklin 1.3 <p class=MsoNormal style='margin-left:39.0pt;text-indent:-.25in;mso-list:l4 level1 lfo16;
1967 :     tab-stops:list 39.0pt'><![if !supportLists]><span style='font-size:10.0pt;
1968 :     font-family:Arial;mso-fareast-font-family:Arial'><span style='mso-list:Ignore'>3.<span
1969 :     style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><![endif]><span
1970 :     style='font-size:10.0pt;font-family:Arial'>The workspace listener and
1971 :     validation strategy used in the Change framework was maintained since the
1972 :     timing of the notifications was critical.<span style='mso-spacerun:yes'> 
1973 :     </span>Additional integration work could be done to use the operations history
1974 :     listeners for the same purpose, or to change the validation strategy as more
1975 :     workspace operations are supported outside of refactoring.<o:p></o:p></span></p>
1976 : nick 1.1
1977 : sfranklin 1.3 <p class=MsoNormal style='margin-left:39.0pt;text-indent:-.25in;mso-list:l4 level1 lfo16;
1978 :     tab-stops:list 39.0pt'><![if !supportLists]><span style='font-size:10.0pt;
1979 :     font-family:Arial;mso-fareast-font-family:Arial'><span style='mso-list:Ignore'>4.<span
1980 :     style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><![endif]><span
1981 :     style='font-size:10.0pt;font-family:Arial'>Unrelated listeners (such as text
1982 :     editors) listened for new operations being added.<span
1983 :     style='mso-spacerun:yes'>  </span>These listeners could check the elements
1984 :     affected by the workspace operation and determine whether another context
1985 :     should be assigned to the operation.<o:p></o:p></span></p>
1986 : nick 1.1
1987 : sfranklin 1.3 <p class=MsoNormal style='margin-left:39.0pt;text-indent:-.25in;mso-list:l4 level1 lfo16;
1988 :     tab-stops:list 39.0pt'><![if !supportLists]><span style='font-size:10.0pt;
1989 :     font-family:Arial;mso-fareast-font-family:Arial'><span style='mso-list:Ignore'>5.<span
1990 :     style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><![endif]><span
1991 :     style='font-size:10.0pt;font-family:Arial'>Refactoring operations could be
1992 :     undone and redone from any view or editor that installed the undo and redo
1993 :     handlers on the workspace context.<o:p></o:p></span></p>
1994 :    
1995 :     <h3>Text editor example:<span style='mso-spacerun:yes'>  </span>implementing
1996 :     IOperation in preexisting commands</h3>
1997 :    
1998 :     <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>The JFace
1999 :     text framework supports undo and redo of text editing operations.<span
2000 :     style='mso-spacerun:yes'>  </span>This implementation relies on private undo
2001 :     stacks that are maintained by each editor.<span style='mso-spacerun:yes'> 
2002 :     </span>The JFace IUndoManager listens to text changes coming from the
2003 :     underlying widget, and builds a TextCommand for each undoable edit.<span
2004 :     style='mso-spacerun:yes'>  </span><o:p></o:p></span></p>
2005 : nick 1.1
2006 : sfranklin 1.3 <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></p>
2007 : nick 1.1
2008 : sfranklin 1.3 <p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'>A prototype
2009 :     integrated the text undo in JFace with the operations framework as follows:<o:p></o:p></span></p>
2010 : nick 1.1
2011 : sfranklin 1.3 <ol style='margin-top:0in' start=1 type=1>
2012 :     <li class=MsoNormal style='mso-list:l5 level1 lfo19;tab-stops:list .5in'><span
2013 :     style='font-size:10.0pt;font-family:Arial'>The existing TextCommand was
2014 :     altered to implement the IOperation interface.<o:p></o:p></span></li>
2015 :     <li class=MsoNormal style='mso-list:l5 level1 lfo19;tab-stops:list .5in'><span
2016 :     style='font-size:10.0pt;font-family:Arial'>Specialized contexts (one
2017 :     instance for each text editor) are assigned to the operations.<o:p></o:p></span></li>
2018 :     <li class=MsoNormal style='mso-list:l5 level1 lfo19;tab-stops:list .5in'><span
2019 :     style='font-size:10.0pt;font-family:Arial'>The existing UndoManager was
2020 :     replaced with an alternate implementation that added text commands to the
2021 :     operations history instead of a local stack, and used the operation
2022 :     history protocol when handling undo and redo commands.<o:p></o:p></span></li>
2023 :     <li class=MsoNormal style='mso-list:l5 level1 lfo19;tab-stops:list .5in'><span
2024 :     style='font-size:10.0pt;font-family:Arial'>The undo manager installs a
2025 :     listener on the history to monitor new operations that are added to the
2026 :     history.<o:p></o:p></span></li>
2027 :     <li class=MsoNormal style='mso-list:l5 level1 lfo19;tab-stops:list .5in'><span
2028 :     style='font-size:10.0pt;font-family:Arial'>When an “outside” operation is
2029 :     added to the history, the undo manager consults the editor’s operation
2030 :     context to see if the outside operation is relevant.<span
2031 :     style='mso-spacerun:yes'>  </span>The editor context can check the
2032 :     elements affected by workspace operations and add itself to the
2033 :     operation’s context if appropriate.<o:p></o:p></span></li>
2034 :     </ol>
2035 : nick 1.1
2036 : sfranklin 1.3 <p class=MsoNormal style='text-align:justify'><span style='font-size:10.0pt;
2037 :     font-family:Arial'><o:p>&nbsp;</o:p></span></p>
2038 : nick 1.1
2039 :     </div>
2040 :    
2041 :     </body>
2042 :    
2043 :     </html>