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