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