[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.newcomer] Accessing fragment from host plugin

I'm sure I'm missing something obvious here, but I just can't figure out what it is. I'm trying to use a plugin fragment to provide optional functionality, which is one of the envisioned uses of plugin fragments according to everything I've read about them. I have a package in my host plugin, and have the same package in my fragment. I have defined an abstract class in my host plugin, and defined a concrete subclass in my fragment. The subclass in the fragment resolves it's superclass just fine, without having to import or qualify the name or anything, since both the superclass and the subclass are in the same package.

My problem appears when I try to access the concrete subclass, defined in the fragment, from within my host plugin. When I try to do so, compilation fails because the name of my subclass can't be resolved, with or without imports or qualification.

It seems obvious to me why this happens -- the host plugin knows nothing about it's fragment after all. However, based on what I've read, it seems like code contained in a fragment ought to be accessible from within the host. In particular, if a fragment is to provide optional functionality to a host plugin, then its code must somehow be accessible from the host plugin.

Anyway, if anyone can help me out with what I'm doing wrong, or correct me if I'm making bad assumptions, please respond. In a sentence, my question would be "How do I make a class defined in a plugin fragment visible to a class in the fragment's host plugin"? Thanks in advance.

Tony