[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.platform] Re: Plugin runs when launched from Eclipse, "cycle detected in classpath" with Export Wizard

"Matthew Hall" <matthall@xxxxxxxxxxxxxxxxx> wrote in message 
news:ekl327$ci$1@xxxxxxxxxxxxxxxxxxxx
> 3) Create an extension point in com.name.prod and allow 
> com.name.prod.unit1 and com.name.prod.unit2 to add extensions to that 
> extension point.  I unfortunately can't help you with this one, since 
> writing extension points requires writing an XML DTD, which I've never 
> figured out.

Creating and using an extension point is the correct answer to most of these 
"how do I manage circular plug-in dependencies" problems.  There are special 
cases where things like buddy loading are required, but extension points are 
the 95% case - always take this path first, unless you know that it is 
wrong.

The basic idea of an extension point is that plug-in A defines an interface, 
and plug-in B defines a class that implements it; plug-in B depends on 
plug-in A; and then plug-in A uses 
IConfigurationElement.createExecutableExtension() to load the 
implementation.

You don't really need to know how to write a DTD to write an extension 
point; the PDE wizards, starting from the "Extension Points" tab of the 
plug-in manifest editor, will take care of that for you, at least for simple 
cases.  But anyway it's pretty simple to just find something like what you 
want in another plug-in's plugin.xml and just copy and edit.