Strange "Access restriction" error creating diagram editor code [message #156863] |
Tue, 23 October 2007 21:25 ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Michael Moser![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=mmo%40zurich.ibm.com) Messages: 914 Registered: July 2009 |
Senior Member |
|
|
I have a problem that may or may not be related to GMF (I must admit I
don't even fully understand the error message that I get):
For my to-be graphical editor I wanted a "NoteFigure" (i.e. a sheet with
a bent corner like the one used in many applications for comments or
annotations).
I wanted to spare me having to define my own note figure and so I
searched and found exactly such a figure already present in GMF. I thus
simply defined my notes figure class as follows:
----------------------------------------
package foo.figures;
public class MyNoteFigure
extends org.eclipse.gmf.runtime.diagram.ui.figures.NoteFigure
{
public MyNoteFigure() {
super(1, 1, new org.eclipse.draw2d.geometry.Insets(1,1,1,1));
}
}
----------------------------------------
.... and added this to my "foo" project's source tree. In order to get
this class to compile I also had to add the plugin
"org.eclipse.gmf.runtime.diagram.ui" to the required plug-ins (on the
dependencies-tab when editing in plugin.xml. I also checked the
"reexport this dependency" checkbox on this). This seemed to work, i.e.
the basic project compiles fine.
I then had GMF create me the diagram editor code, i.e. the "foo.diagram"
project, from my foo.gmfgen.
Strange enough (and to me unexplicable so far) the generated project has
a compile error (only this one): In the package foo.diagram.edit.parts
there is a class "ArtifactEditPart" ("Artifact" is one of the graphical
elementsI defined). In that file the import
-------------------------
....
import foo.figures.MyNoteFigure;
....
-------------------------
is marked with an error reading:
Access restriction: The type MyNoteFigure is not accessible due to
restriction on required project foo.
foo.diagram/src/foo/diagram/edit/parts ArtifactEditPart.java line 8
1193171083156 11703452
Why is there this access restriction? I have defined the required plugin
as dependency and I also re-export that dependency. The referenced
org.eclipse.gmf.runtime.diagram.ui.figures.NoteFigure is a public class,
so IMHO there should no problem extending it, either. Or what (possibly
other) access restriction is eclipse talking about here and why? What
exactly is or might be meant here? Any hint or explanation would be
greatly appreciated!
Regards,
Michael
|
|
|
|
Powered by
FUDForum. Page generated in 0.03035 seconds