Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » EditorPart failed with E4(An editor part that works fine in version 3 fails under the E4 compatibility layer)
icon3.gif  EditorPart failed with E4 [message #1460898] Tue, 04 November 2014 02:33 Go to next message
Gary Bradshaw is currently offline Gary BradshawFriend
Messages: 4
Registered: November 2014
Junior Member
I had an IDE editor plugin that I couldn't get working with Eclipse 4.2 or 4.4, even though it was working fine with 3.1, 3.7, and 3.8. The problem was that when I closed a "dirty" editor I got the workbench's "File has been updated..." dialog, but pressing any dialog button hung the whole workbench.

I searched the forums and Bugzilla, but my answer was only found in a recommendation in a plugin tutorial. It said something like "We recommend that the setFocus() method of the EditorPart set the focus to the Composite that it was passed in the createPartControl() method." My editor was setting the focus to an internal AWT Canvas component: when I changed it to the supplied Composite, it worked.

I hope this can save someone else some frustration.
Re: EditorPart failed with E4 [message #1461505 is a reply to message #1460898] Tue, 04 November 2014 16:28 Go to previous messageGo to next message
Eclipse UserFriend
Sounds like you were calling out to an AWT components from the SWT thread which will usually lead to such a deadlock. You have to use
SwingUtilities.invokeLater()
or something similar.

Setting the focus to the composite as you've done is the right thing to do. You could also track the widget with active focus within the AWT side and give it the focus too (within an invokeLater of course!).

Brian.

[Updated on: Tue, 04 November 2014 16:29] by Moderator

Report message to a moderator

Re: EditorPart failed with E4 [message #1461673 is a reply to message #1461505] Tue, 04 November 2014 20:36 Go to previous message
Gary Bradshaw is currently offline Gary BradshawFriend
Messages: 4
Registered: November 2014
Junior Member
Thanks for the reply, Brian. I'm not using any swing classes, but it's the workbench calling my setFocus() method, not me, so I have no idea what thread it might be on. It might not even be the SWT thread.
Previous Topic:Eclipse 3.x Bridge Cannot Be Installed with e4 Tools
Next Topic:HandledMenuItem / HandledToolItem from fragment always disabled
Goto Forum:
  


Current Time: Tue Mar 19 11:52:53 GMT 2024

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

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

Back to the top