|
|
|
|
|
|
Re: How to create ToolControl in Eclipse 4.x [message #1067447 is a reply to message #1066739] |
Mon, 08 July 2013 14:24   |
Eclipse User |
|
|
|
Thanks for the ideas. I've got the handler there, and all versions appear to be set to 1.0.0. Nothing appears in the log. >_<
Trying to go step by step from the generated application...
Driving me crazy here. I now have it so the exact same class gets @PostConstruct called correctly when in the same plugin as the sample application, but @PostConstruct is not called when it is loaded from another plugin.
I thought I had it when I noticed that my plugin used Import-Package: javax.inject;bundle-version="1.0.0", and the sample used Require-Bundle: javax.inject;bundle-version="1.0.0". But they now both use the same and it still fails. (cries)
I'm pretty sure it's a version thing, like you say. I started printing PostConstruct.class.hashCode() and they are different. When I get the package and print the details, it is VERY different. I'm really confused now.
This is what I've reduced my class to:
import javax.annotation.PostConstruct;
public class PerspectiveTabs
{
public PerspectiveTabs()
{
System.out.println(getClass().getName()+" - constructor");
System.out.println(" "+PostConstruct.class.getName()+" - "+PostConstruct.class.hashCode());
Package pkg = PostConstruct.class.getPackage();
System.out.println(" Package - "+pkg.getName());
System.out.println(" Implementation - "+pkg.getImplementationTitle()+", "+pkg.getImplementationVendor()+", "+pkg.getImplementationVersion());
System.out.println(" Specification - "+pkg.getSpecificationTitle()+", "+pkg.getSpecificationVendor()+", "+pkg.getSpecificationVersion());
}
@PostConstruct
public void createUI()
{
System.out.println(getClass().getSimpleName()+" - postconstruct");
}
}
And this is the output I get:
com.ibm.openpages.config.ui.e43.ctrl.PerspectiveTabs - constructor
javax.annotation.PostConstruct - 1635287180
Package - javax.annotation
Implementation - null, null, null
Specification - null, null, null
PerspectiveTabs - postconstruct
com.ibm.openpages.config.ui.ctrl.PerspectiveTabs - constructor
javax.annotation.PostConstruct - 2062082543
Package - javax.annotation
Implementation - Java Runtime Environment, Oracle Corporation, 1.7.0_11
Specification - Java Platform API Specification, Oracle Corporation, 1.7
The first is the ToolControl that points to the class declared in the generated sample's plugin (which works). The second is in the identical class in my pre-existing plugin (which doesn't). Am I correct that a different hashCode() on the .class object means they are definitely different classes? Or would the Eclipse plugin model load them uniquely per plugin, and those values can't be compared. But, even if that was the case, why would the package versions be different?
I've gone through their MANIFEST.MF line by line, and all overlaps have the exact same version dependencies.
|
|
|
|
Re: How to create ToolControl in Eclipse 4.x [message #1067643 is a reply to message #1067526] |
Tue, 09 July 2013 15:09   |
Eclipse User |
|
|
|
The program is a shipping product, so there's a lot going on. I can't include all of that here. It works fine on 4.2, I'm just having difficulty getting to work on 4.3.
The core product plugin was "com.ibm.openpages.config.ui", but that had the problem that PostConsturct was not being called. So I generated a new plugin from the template called "com.ibm.openpages.config.ui.e43". I put a ToolControl in this and it successfully called PostConstruct. So I made this the primary plugin and loaded com.ibm.openpages.config.ui as a secondary one, and attempted to load a ToolControl from there. This does not call PostConstruct.
So, in the attached files, the primary_ files are the com.ibm.openpages.config.ui.e43 plugin, from which PostConstruct is called correctly, and the secondary_ files are the com.ibm.openpages.config.ui plugin, from which PostConstuct is not called correctly.
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.29629 seconds