Using e4view still requires class to be IViewPart [message #1755606] |
Mon, 06 March 2017 05:10  |
Eclipse User |
|
|
|
I read Contribute e4 Views into the IDE and tried to put this in my application.
My extension looks like this:
<extension
point="org.eclipse.ui.views">
<e4view
class="com.mycompany.myplugin.views.MyView"
id="com.mycompany.myplugin.views.my"
name="My view"
restorable="true">
</e4view>
</extension>
My view part is as simple as it can get:
public class MyView {
@PostConstruct
public void createControl(Composite parent) {}
@Focus
public void setFocus() {}
}
However, I still get a ClassCastException that my "MyView" can't be cast to "IViewPart". I am using Neon.2 (4.6.2). Is this a bug or am I missing something?
For now, I still use DIViewPart from e4.compat instead.
|
|
|
|
|
|
Re: Using e4view still requires class to be IViewPart [message #1755611 is a reply to message #1755610] |
Mon, 06 March 2017 05:35  |
Eclipse User |
|
|
|
No, it is not. I had some leftover navigatorContent definition in the plugin.xml because this once was a CNF view and I want to transform it into a view which is usable with E4, I removed this, but I still get the exception. As I stated, when I use DIViewPart and embed it as an E3 view, I don't get the exception.
EDIT: Just for kicks, I changed the view's id to "com.mycompany.myplugin.views.my1". Now, I get another exception - the view appears, but inside, I get a red error marker stating: "Could not create the view: com.mycompany.myplugin.views.my".
I grep'd through my whole code base but can't see anywhere the view is used twice.
EDIT 2: I now cleaned the runtime workspace and it suddenly works.
EDIT 3: It works now, but my menu contributions don't appear. When using the old "view" and DIViewPart, they DO appear.
[Updated on: Mon, 06 March 2017 05:48] by Moderator
|
|
|
Powered by
FUDForum. Page generated in 0.06817 seconds