Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsNon-undoable document edits
https://www.eclipse.org/forums/index.php/mv/msg/110051/336253/#msg_336253
Originally posted by: jcarroll.us.ibm.com
Hello,
I have a RCP app which uses a customised TextEditor for editing
certain types of files. For some calls I make to Document.replace() I
would like to make this text replacement non-undoable.
I have tried using an extension of AbstractOperation to execute my
non-undoable text replacement within the document and then made the
AbstractOperation return false for canUndo(), but I can still right
click within the TextEditor and select "Undo Typing" which undoes my
text replacement which is not what I want.
So is there a way for me to call Document.replace() to replace text
which can not be undone via the global undo/redo mechanism?
thanks,
John.]]>2009-06-03T17:14:55-00:00Re: Non-undoable document edits
https://www.eclipse.org/forums/index.php/mv/msg/110051/336300/#msg_336300
> Hello,
>
> I have a RCP app which uses a customised TextEditor for editing
> certain types of files. For some calls I make to Document.replace() I
> would like to make this text replacement non-undoable.
Try to get the document undo manager via:
org.eclipse.text.undo.DocumentUndoManagerRegistry.getDocumen tUndoManager(IDocument)
and then call reset() on it.
Dani
>
> I have tried using an extension of AbstractOperation to execute my
> non-undoable text replacement within the document and then made the
> AbstractOperation return false for canUndo(), but I can still right
> click within the TextEditor and select "Undo Typing" which undoes my
> text replacement which is not what I want.
>
> So is there a way for me to call Document.replace() to replace text
> which can not be undone via the global undo/redo mechanism?
>
> thanks,
>
> John.]]>Dani Megert2009-06-05T14:48:41-00:00Re: Non-undoable document edits
https://www.eclipse.org/forums/index.php/mv/msg/110051/336381/#msg_336381
Originally posted by: jcarroll.us.ibm.com
That works great, thanks very much!
John.
> John Carroll wrote:
>> Hello,
>>
>> I have a RCP app which uses a customised TextEditor for editing
>> certain types of files. For some calls I make to Document.replace() I
>> would like to make this text replacement non-undoable.
> Try to get the document undo manager via:
> org.eclipse.text.undo.DocumentUndoManagerRegistry.getDocumen tUndoManager(IDocument)
>
> and then call reset() on it.
>
> Dani
>>
>> I have tried using an extension of AbstractOperation to execute my
>> non-undoable text replacement within the document and then made the
>> AbstractOperation return false for canUndo(), but I can still right
>> click within the TextEditor and select "Undo Typing" which undoes my
>> text replacement which is not what I want.
>>
>> So is there a way for me to call Document.replace() to replace text
>> which can not be undone via the global undo/redo mechanism?
>>
>> thanks,
>>
>> John.]]>2009-06-10T02:05:36-00:00Re: Non-undoable document edits
https://www.eclipse.org/forums/index.php/mv/msg/110051/336383/#msg_336383
Originally posted by: jcarroll.us.ibm.com
That works great, thanks very much!
John.
> John Carroll wrote:
>> Hello,
>>
>> I have a RCP app which uses a customised TextEditor for editing
>> certain types of files. For some calls I make to Document.replace() I
>> would like to make this text replacement non-undoable.
> Try to get the document undo manager via:
> org.eclipse.text.undo.DocumentUndoManagerRegistry.getDocumen tUndoManager(IDocument)
>
> and then call reset() on it.
>
> Dani
>>
>> I have tried using an extension of AbstractOperation to execute my
>> non-undoable text replacement within the document and then made the
>> AbstractOperation return false for canUndo(), but I can still right
>> click within the TextEditor and select "Undo Typing" which undoes my
>> text replacement which is not what I want.
>>
>> So is there a way for me to call Document.replace() to replace text
>> which can not be undone via the global undo/redo mechanism?
>>
>> thanks,
>>
>> John.]]>2009-06-10T02:15:35-00:00Re: Non-undoable document edits
https://www.eclipse.org/forums/index.php/mv/msg/110051/336385/#msg_336385
Originally posted by: jcarroll.us.ibm.com
That works great, thanks very much!
John.
> John Carroll wrote:
>> Hello,
>>
>> I have a RCP app which uses a customised TextEditor for editing
>> certain types of files. For some calls I make to Document.replace() I
>> would like to make this text replacement non-undoable.
> Try to get the document undo manager via:
> org.eclipse.text.undo.DocumentUndoManagerRegistry.getDocumen tUndoManager(IDocument)
>
> and then call reset() on it.
>
> Dani
>>
>> I have tried using an extension of AbstractOperation to execute my
>> non-undoable text replacement within the document and then made the
>> AbstractOperation return false for canUndo(), but I can still right
>> click within the TextEditor and select "Undo Typing" which undoes my
>> text replacement which is not what I want.
>>
>> So is there a way for me to call Document.replace() to replace text
>> which can not be undone via the global undo/redo mechanism?
>>
>> thanks,
>>
>> John.]]>2009-06-10T02:16:14-00:00