Note that there are some explanatory texts on larger screens.

plurals
  1. POHyperlinking the eclipse console - delayed writes causing BadLocationException?
    primarykey
    data
    text
    <p>I'm writing an eclipse plugin with a hyperlinked console, but I see BadLocationExceptions when creating the hyperlinks. </p> <p>To create the hyperlink, I followed the instructions on the related question <a href="https://stackoverflow.com/questions/591018/how-to-write-a-hyperlink-to-an-eclipse-console-from-a-plugin">How to write a hyperlink to an eclipse console from a plugin</a>.</p> <p><b>Background:</b> The issue appears to be that the underlying document is updated asynchronously to requests that write to the console (e.g. via a MessageOutputStream), so attempting to create a hyperlink immediately after a write won't work because the offset and length indices provided in the request are invalid.</p> <p>To try to fix this, I created a DocumentListener on the underlying document, so I could detect when the console is updated and create the HyperLink at that point. But the listener is provided with events that correspond to bulk updates to the console - so I can't easily detect if the console has been updated yet. The only choice seems to be to search the console document for the string I want to hyperlink, which seems quite inefficient.</p> <p><b>So the question is</b>: when is the correct time to create a HyperLink, after writing to the console? Are there any proven mechanisms that guarantee the underlying document will have been updated when I issue my hyperlink creation request? An example of code that writes to the console then creates a HyperLink would be great.</p> <p>Not sure of the exact version of eclipse (I'm writing this from home before heading into work) - but I do know that I'm using MessageConsole.addHyperlink() to issue the request. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload