Community
Participate
Working Groups
Our code adds an SWT Link to a dialog. That link invokes the contextual help as follow. Link link = new Link(parent, SWT.NONE); link.setText(Messages.ConflictsPromptDialog_5); link.addListener(SWT.Selection, new Listener() { public void handleEvent(Event event) { PlatformUI.getWorkbench().getHelpSystem().displayHelp(IHelpContextIds.HELP_CONTEXT_HOWTORESOLVECONFLICTS_TUTORIAL); } }); displayHelp is invoked from the UI thread. I'm surprised to see it performs http requests from the UI thread. Shouldn't it be using a separate thread for this? Should we avoid that API? Thanks for tips. at java/net/SocketInputStream.socketRead0(Native Method) at java/net/SocketInputStream.read(SocketInputStream.java:141) at java/io/BufferedInputStream.fill(BufferedInputStream.java:230(Compiled Code)) at java/io/BufferedInputStream.read1(BufferedInputStream.java:270(Compiled Code)) at java/io/BufferedInputStream.read(BufferedInputStream.java:329(Compiled Code)) at sun/net/www/http/HttpClient.parseHTTPHeader(HttpClient.java:688) at sun/net/www/http/HttpClient.parseHTTP(HttpClient.java:633) at sun/net/www/protocol/http/HttpURLConnection.getInputStream(HttpURLConnection.java:1067) at java/net/HttpURLConnection.getResponseCode(HttpURLConnection.java:385) at org/eclipse/help/internal/base/remote/RemoteContextProvider.getContext(RemoteContextProvider.java:57) at org/eclipse/help/internal/context/ContextManager.getContext(ContextManager.java:85) at org/eclipse/help/HelpSystem.getContext(HelpSystem.java:49) at org/eclipse/ui/internal/help/WorkbenchHelpSystem.displayHelp(WorkbenchHelpSystem.java:922)
I notice that remote help is being called and it looks as thought the remote content is being read on the UI thread, which as you say can cause the UI to block waiting for the http request.
Is this API meant to be called from a UI thread or non UI thread? PlatformUI.getWorkbench().getHelpSystem().displayHelp
I think you were calling it correctly, usually it would be called from a UI thread. The problem is that Eclipse should be reading the context help data on a background thread and displaying it in the UI thread, which is not happening.
Fixing this would require changes to the way Platform UI interacts with the help system, allowing the help system to create a context whose evaluation was deferred so the processing could occur on a non UI thread. There is not time to do this work for Eclipse 3.7.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. If the bug is still relevant please remove the stalebug whiteboard tag.