Non-undoable document edits [message #336253] |
Wed, 03 June 2009 17:14 ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
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.
|
|
|
|
Re: Non-undoable document edits [message #336381 is a reply to message #336300] |
Wed, 10 June 2009 02:05 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
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.
|
|
|
Re: Non-undoable document edits [message #336383 is a reply to message #336300] |
Wed, 10 June 2009 02:15 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
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.
|
|
|
Re: Non-undoable document edits [message #336385 is a reply to message #336300] |
Wed, 10 June 2009 02:16 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
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.
|
|
|
Powered by
FUDForum. Page generated in 0.04611 seconds