Plig-in Development (3.2.2): I get error message sayingr 'CoreException cannot be resolved' yet it [message #609880] |
Mon, 11 February 2008 12:54 |
John Ormerod Messages: 39 Registered: January 2010 |
Member |
|
|
Hello
I hope that I am asking this on the correct forum (so many, so little
time...). If not, grateful for guidance as to where best to ask.
I'm afraid what follows gets a bit involved. I have edited it 4 or 5
times in an attempt to be a clear as I can. Apologies if it is still
confusing.
Plug-in 'org.eclipse.core.runtime' has 'org.eclipse.equinox.common' in
its list of Required Plug-ins. Both have the 'org.eclipse.core.runtime'
package defined as 'visible to downstream plug-ins. My plug-in has
'org.eclipse.core.runtime' in its Required Plug-ins, BUT my import
statements for CoreException and IProgressMonitor say that they cannot
be resolved. Both of these are in fact in the 'equinox.common' plug-in,
but I can't work out why they can't be resolved. Can anyone help?
What is strange, is that the 'cannot be resolved' messages are visible
in a tool-tip for the 'x' in the 'break-point' column against the
'import' statements, but are not shown in the Problems view. Also
strange is that I can see in Resources, that the class files have been
created - I would have expected these errors to prevent this.
Seems like something strange is going on.
Here is the context in which I am using them.
I decided to investigate the Eclipse facilities for doing code
generation from a template. I found a tutorial on IBM's DevWorld from
last year that creates a new template for use when you create a View (
http://www.ibm.com/developerworks/library/os-eclipse-pde/ind ex.html#download
). I thought I was be well away... experience should have told me
otherwise.
Whether using the code I created from following the tutorial, or from
importing all the sample code, I still get the same two error messages
in Problems for the SimpleViewTemplateWizard:
1. The type org.eclipse.core.runtime.CoreException cannot be resolved.
It is indirectly referenced from required .class files
2. same, but for IProgressMonitor.
These error messages are associated to statements in a strange way as
well. The 'cannot be resolved' message are displayed in the Problems
view for the SimpleViewTemplateWizard class, but the 'x' is against the
package declaration. The cause of the errors is the method:
public ITemplateSection[] createTemplateSections() {
return new ITemplateSection[] {new SimpleViewTemplateSection()};
}
It is the SimpleViewTemplateSection class (instantiated in the above
method) that has the offending import statements for CoreException and
IProgressMonitor, that can't be resolved. I would expect these to show
in the Problems view, but they do not.
I did manage to get rid of these errors, by doing something like:
1. remove org.eclipse.core.runtime plug-in from the dependencies
2. add the org.eclipse.equinox.common plug-in to dependencies
3. this resolved the above import errors, but created loads more
4. add the org.eclipse.core.runtime plug-in back
5. I removed the (now redundant) org.eclipse.equinox.common from
dependencies
6. then I did a Clean of my plug-in project and all the errors went away.
I first got these when using 'raw' 3.2.0. So, I went to the update site
and got the latest updates and I am now at 3.2.2. This did not fix anything.
I hope this provides enough info.
Regards, John
--
John Ormerod
john.ormerod@erebor.co.uk
|
|
|
Powered by
FUDForum. Page generated in 0.03782 seconds