Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Batch source modifications
Batch source modifications [message #39134] Mon, 26 May 2003 06:01 Go to next message
Eclipse UserFriend
Originally posted by: scheglov_ke.nlmk.ru

I need to make several modifications of source of ICompilationUnit,
but want to be able to Undo them later as one modification.
Currently I use following method:
ICompilationUnit wc = (ICompilationUnit) getCompilationUnit();
IBuffer buffer = wc.getBuffer();
buffer.replace(start, length, sourcePart);
buffer.replace(start2, length2, sourcePart2);
...etc

How to change this code?


--
SY, Konstantin.
Re: Batch source modifications [message #39289 is a reply to message #39134] Mon, 26 May 2003 08:26 Go to previous messageGo to next message
Eclipse UserFriend
Buffers do not support batching, but maybe you could perform all your
changes on a copy of the buffer contents, and set it all at once.

"Konstantin Scheglov" <scheglov_ke@nlmk.ru> wrote in message
news:15HcA32IDHA.3160@fairy.ao.nlmk...
> I need to make several modifications of source of ICompilationUnit,
> but want to be able to Undo them later as one modification.
> Currently I use following method:
> ICompilationUnit wc = (ICompilationUnit) getCompilationUnit();
> IBuffer buffer = wc.getBuffer();
> buffer.replace(start, length, sourcePart);
> buffer.replace(start2, length2, sourcePart2);
> ...etc
>
> How to change this code?
>
>
> --
> SY, Konstantin.
Re: Batch source modifications [message #39350 is a reply to message #39134] Mon, 26 May 2003 09:09 Go to previous messageGo to next message
Eclipse UserFriend
Hello Konstantin,

there are working copies for ICompilationUnit's
(ICompilationUnit.getWorkingCopy()).
Maybe they will fit your needs.

Michael

"Konstantin Scheglov" <scheglov_ke@nlmk.ru> schrieb im Newsbeitrag
news:15HcA32IDHA.3160@fairy.ao.nlmk...
> I need to make several modifications of source of ICompilationUnit,
> but want to be able to Undo them later as one modification.
> Currently I use following method:
> ICompilationUnit wc = (ICompilationUnit) getCompilationUnit();
> IBuffer buffer = wc.getBuffer();
> buffer.replace(start, length, sourcePart);
> buffer.replace(start2, length2, sourcePart2);
> ...etc
>
> How to change this code?
>
>
> --
> SY, Konstantin.
Re: Batch source modifications [message #39381 is a reply to message #39289] Mon, 26 May 2003 08:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: scheglov_ke.nlmk.ru

Philippe Mulet <philippe_mulet@fr.ibm.com> wrote:

> Buffers do not support batching, but maybe you could perform all your
> changes on a copy of the buffer contents, and set it all at once.
Thanks.
For big files this produces big overhead...
Ok, I think, I can optimize it by finding minimal range...

--
SY, Konstantin.
Re: Batch source modifications [message #40148 is a reply to message #39381] Tue, 27 May 2003 04:30 Go to previous messageGo to next message
Eclipse UserFriend
Maybe you could log a feature request, I know that some buffer
implementation are able to deal with multi-edits, we may want to leverage
this into our API.

"Konstantin Scheglov" <scheglov_ke@nlmk.ru> wrote in message
news:b306PW4IDHA.3160@fairy.ao.nlmk...
> Philippe Mulet <philippe_mulet@fr.ibm.com> wrote:
>
> > Buffers do not support batching, but maybe you could perform all your
> > changes on a copy of the buffer contents, and set it all at once.
> Thanks.
> For big files this produces big overhead...
> Ok, I think, I can optimize it by finding minimal range...
>
> --
> SY, Konstantin.
Re: Batch source modifications [message #40335 is a reply to message #39350] Tue, 27 May 2003 05:04 Go to previous message
Eclipse UserFriend
Originally posted by: scheglov_ke.nlmk.ru

"Michael TДge" <m-taege@t-online.de> wrote:

> there are working copies for ICompilationUnit's
> (ICompilationUnit.getWorkingCopy()).
> Maybe they will fit your needs.
Thank you, I will try.

> Michael

> "Konstantin Scheglov" <scheglov_ke@nlmk.ru> schrieb im Newsbeitrag
> news:15HcA32IDHA.3160@fairy.ao.nlmk...
>> I need to make several modifications of source of ICompilationUnit,
>> but want to be able to Undo them later as one modification.
>> Currently I use following method:
>> ICompilationUnit wc = (ICompilationUnit) getCompilationUnit();
>> IBuffer buffer = wc.getBuffer();
>> buffer.replace(start, length, sourcePart);
>> buffer.replace(start2, length2, sourcePart2);
>> ...etc
>>
>> How to change this code?
>>
>>
>> --
>> SY, Konstantin.



--
SY, Konstantin.
Previous Topic:Microsoft VM Support
Next Topic:IClasspathContainer and ClasspathContainerInitializer help wanted
Goto Forum:
  


Current Time: Sun Jun 22 17:04:53 EDT 2025

Powered by FUDForum. Page generated in 0.13344 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top