Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » AbstractDocument.replace() throws AssertionFailedException
AbstractDocument.replace() throws AssertionFailedException [message #1749066] Thu, 01 December 2016 09:30 Go to next message
Eclipse UserFriend
Hello all,

I want to change text in a editor after a user typed something in. For this purpose I added a ITextListener to my TextEditor.

When calling the replace method of from the ITextListener's textChanged method I get the exception attached below. Is a there a workaround existing so that I can change the text in an editor based on what a user is typing without using the replace method of the IDocument interface?

Best Regards,

Ralph

==========================

org.eclipse.core.runtime.AssertionFailedException: assertion failed:
at org.eclipse.core.runtime.Assert.isTrue(Assert.java:110)
at org.eclipse.core.runtime.Assert.isTrue(Assert.java:96)
at org.eclipse.ui.internal.texteditor.quickdiff.DocumentLineDiffer.handleAboutToBeChanged(DocumentLineDiffer.java:798)
at org.eclipse.ui.internal.texteditor.quickdiff.DocumentLineDiffer.documentAboutToBeChanged(DocumentLineDiffer.java:767)
at org.eclipse.jface.text.AbstractDocument.fireDocumentAboutToBeChanged(AbstractDocument.java:640)
at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1092)
at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1119)
Re: AbstractDocument.replace() throws AssertionFailedException [message #1749106 is a reply to message #1749066] Thu, 01 December 2016 17:02 Go to previous messageGo to next message
Eclipse UserFriend
You can't change the contents of a document while it's in the middle of firing a change notification. This sounds like the job of an org.eclipse.jface.text.IAutoEditStrategy .
Re: AbstractDocument.replace() throws AssertionFailedException [message #1749126 is a reply to message #1749106] Fri, 02 December 2016 02:46 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

this looks exactly like what I want. For everyone interested, I found this tutorial http://ydtech.blogspot.de/2011/09/eclipse-pde-everything-about-editor_10.html

Thank you!

Ralph
Re: AbstractDocument.replace() throws AssertionFailedException [message #1749672 is a reply to message #1749126] Fri, 09 December 2016 06:21 Go to previous message
Eclipse UserFriend
Hi,

would this work as well?

http://help.eclipse.org/kepler/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fapi%2Forg%2Feclipse%2Fjface%2Ftext%2Flink%2FLinkedModeModel.html

Ralph
Previous Topic:Would it be interesting an Eclipse plugin that allows programmaticaly (not java) to extend Eclipse
Next Topic:Unhandled event loop exception error
Goto Forum:
  


Current Time: Sun Mar 16 22:50:45 EDT 2025

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

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

Back to the top