How to batch multiple changes to a document so that it can be undone with a single undo ? [message #319876] |
Wed, 05 September 2007 02:02  |
Eclipse User |
|
|
|
This is a multi-part message in MIME format.
------=_NextPart_000_006D_01C7EF93.1CBFA0A0
Content-Type: multipart/alternative;
boundary="----=_NextPart_001_006E_01C7EF93.1CBFA0A0"
------=_NextPart_001_006E_01C7EF93.1CBFA0A0
Content-Type: text/plain;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
BlankHi,
In my plug-in I have to edit the same IDocument (in an editor), on =
several places.
My problem is that I can't find a way to do my changes to the document, =
so that the user could undo them with a single undo command.
Is there any way to do this?
If there is, where can I find an examples?
Right now I create a ReplaceEdit for each change, add them to a =
MultiTextEdit object and finally call the apply method of this object to =
do the actual change to the document.
The apply method does take a "style" parameter, but no matter how I set =
it, the result is the same.
Thanks in advance
Kristof
------=_NextPart_001_006E_01C7EF93.1CBFA0A0
Content-Type: text/html;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE id=3DridTitle>Blank</TITLE>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dwindows-1252"><BASE=20
href=3D"file://C:\Program Files\Common Files\Microsoft =
Shared\Stationery\">
<STYLE>BODY {
MARGIN-TOP: 25px; FONT-SIZE: 10pt; MARGIN-LEFT: 25px; COLOR: #000000; =
FONT-FAMILY: Arial, Helvetica
}
P.msoNormal {
MARGIN-TOP: 0px; FONT-SIZE: 10pt; MARGIN-LEFT: 0px; COLOR: #ffffcc; =
FONT-FAMILY: Helvetica, "Times New Roman"
}
LI.msoNormal {
MARGIN-TOP: 0px; FONT-SIZE: 10pt; MARGIN-LEFT: 0px; COLOR: #ffffcc; =
FONT-FAMILY: Helvetica, "Times New Roman"
}
</STYLE>
<META content=3D"MSHTML 6.00.2800.1597" name=3DGENERATOR></HEAD>
<BODY id=3DridBody bgColor=3D#ffffff=20
background=3Dcid:006801c7ef82$59354a00$e3c66b9f@eemea.ericsson.se>
<DIV>Hi,</DIV>
<DIV> </DIV>
<DIV>In my plug-in I have to edit the same IDocument (in an editor), on =
several=20
places.</DIV>
<DIV>My problem is that I can't find a way to do my changes to the =
document, so=20
that the user could undo them with a single undo command.</DIV>
<DIV> </DIV>
<DIV>Is there any way to do this?</DIV>
<DIV>If there is, where can I find an examples?</DIV>
<DIV> </DIV>
<DIV>Right now I create a ReplaceEdit for each change, add them to a=20
MultiTextEdit object and finally call the apply method of this object to =
do the=20
actual change to the document.</DIV>
<DIV>The apply method does take a "style" parameter, but no matter how I =
set it,=20
the result is the same.</DIV>
<DIV> </DIV>
<DIV>Thanks in advance</DIV>
<DIV> </DIV>
<DIV>Kristof</DIV>
<DIV> </DIV></BODY></HTML>
------=_NextPart_001_006E_01C7EF93.1CBFA0A0--
------=_NextPart_000_006D_01C7EF93.1CBFA0A0
Content-Type: image/gif;
name="Blank Bkgrd.gif"
Content-Transfer-Encoding: base64
Content-ID: <006801c7ef82$59354a00$e3c66b9f@eemea.ericsson.se>
R0lGODlhLQAtAID/AP////f39ywAAAAALQAtAEACcAxup8vtvxKQsFon6d02 898pGkgiYoCm6sq2
7iqWcmzOsmeXeA7uPJd5CYdD2g9oPF58ygqz+XhCG9JpJGmlYrPXGlfr/Yo/ VW45e7amp2tou/lW
xo/zX513z+Vt+1n/tiX2pxP4NUhy2FM4xtjIUQAAOw==
------=_NextPart_000_006D_01C7EF93.1CBFA0A0--
|
|
|
|
|
|
Re: How to batch multiple changes to a document so that it can be undone with a single undo ? [message #319939 is a reply to message #319909] |
Thu, 06 September 2007 05:24  |
Eclipse User |
|
|
|
Thanky this fully solved my problem.
Kristof
"Daniel Megert" <daniel_megert@ch.ibm.com> wrote in message
news:fbmkmt$hqo$1@build.eclipse.org...
> Kristof Szabados wrote:
>
> > Hi,
> >
> > In my plug-in I have to edit the same IDocument (in an editor), on
> > several places.
> > My problem is that I can't find a way to do my changes to the
> > document, so that the user could undo them with a single undo command.
> >
> > Is there any way to do this?
> > If there is, where can I find an examples?
> >
> > Right now I create a ReplaceEdit for each change, add them to a
> > MultiTextEdit object and finally call the apply method of this object
> > to do the actual change to the document.
> > The apply method does take a "style" parameter, but no matter how I
> > set it, the result is the same.
>
> This should work. If it doesn't please file a bug report against
> Platform Text with steps / test case to reproduce. You could also try
> the RewriteSessionEditProcessor.
>
> Dani
>
> >
> > Thanks in advance
> >
> > Kristof
> >
|
|
|
Powered by
FUDForum. Page generated in 0.03686 seconds