Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [udig-devel] Plugins vs Features ... fight!

There is an extension point (check the eclipse help menu) that allows you to process and strip out some of the common org.eclipse.ui extension points using regular expressions.

It is not a common thing to do; indeed I have never done it; but it is an option that some RCP projects use.

Here let me go through the steps...
1. eclipse help
(http://help.eclipse.org/helios/index.jsp)
2. eclipse wiki
(http://wiki.eclipse.org/Main_Page)
3. udig developers guide (on the off chance we took notes)
(http://udig.refractions.net/confluence/display/DEV/Home)

And here is what I found....

1)

http://help.eclipse.org/helios/topic/org.eclipse.platform.doc.isv/reference/extension-points/index.html

http://help.eclipse.org/helios/topic/org.eclipse.platform.doc.isv/reference/extension-points/org_eclipse_ui_activities.html 

2)

http://wiki.eclipse.org/FAQ_What_is_the_purpose_of_activities%3F
http://wiki.eclipse.org/FAQ_How_do_I_add_activities_to_my_plug-in%3F

3)
http://udig.refractions.net/confluence/display/DEV/15+How+to+turn+stuff+off


Best of luck; and if you get a working example add it to the "How to turn stuff off page".

Jody

On Fri, Nov 26, 2010 at 5:40 PM, Devrim Baris Acar <devrimbaris@xxxxxxxxx> wrote:
That was a nice bit of knowledge Jody, thank you.


> - Removing stuff; you can also get a bit fancy and ask the platform to
> ignore parts of the plugin.xml document (this can be used to strip
> menus or views out of another plugin if you consider them off topic
> for the task at hand). Why doesn't skip the classes? Well because you
> may have subclassed them for your own work .. so the normal Java code
> reuse still needs to be respected.

I did not get this paragraph, what do we modify to tell platform that we want to ignore a menu addition from for example from "net.refractions.udig.project.ui" without changing the plugin itself...

Regards,

Devrim Baris Acar



On Sun, Nov 14, 2010 at 03:25, Jody Garnett <jody.garnett@xxxxxxxxx> wrote:
Added to the developers guide:
- http://udig.refractions.net/confluence/display/DEV/Welcome+New+Eclipse+RCP+Developers

Reading through my rant it does not cover anything beyond what is in
the initial tutorials.

Jody

On Sun, Nov 14, 2010 at 11:06 AM, Jody Garnett <jody.garnett@xxxxxxxxx> wrote:
> Hey Joaquín
>
> I am not sure what file I mean; I usually think of these source code
> examples as part of the training course. In the training course people
> go through the steps to create a new product using the wizard in
> eclipse.
>
> Let me look... ..Yep I see
> net.refractions.udig.tutorials.rcp/rcp.product I would open that up
> and hit "run as product".
>
> Since you are new to RCP development let me sort things out a little
> bit... we can add this conversation to the docs when we are done :-)
> I kind of thought this was covered by the initial tutorials we have
> published; but you are correct that adding "just mapping" to an RCP
> application involves applying the concepts which may be new.
>
> How plugins work ...
>
> - Eclipse stuff is grouped into plugs for reuse; the plugin definition
> has a lot of safety/sanity checks included; with the idea that they
> don't want to run or include a plugin that won't work. So they have
> each plugin list what it needs to run; and then the plugin system
> checks all this stuff out; and only if it is good does the plugin get
> loaded - most of this information is in the MANIFEST.MF file (usually
> used to describe a jar in normal java apps).
>
> The name of this plugin system is "OSGi" - Eclipse 2 used to have its
> own but they threw it out and adopted OSGi (and that is the whole
> reason for the Eclipse 3.x series). OSGi started out for like cell
> phones and stuff so it is very good and loading and unloading stuff an
> preventing memory leaks etc... since rebooting a phone is annoying if
> you are expecting a phone call. Indeed OSGi is being used to manage
> server stuff now as well.
>
> - Once the plugin gets loaded the "Platform" reads the "plugin.xml"
> file and "wires" the code into the resulting application.  As a
> developer you can ask the Platform a question (such as what map tools
> are defined) and then do something with the answer - such as as make a
> toolbar for users to select the current map tool.  The eclipse map
> editor does this as a toolbar; if you are embeding your own map may
> wish to go through the list and do something else (like a drop down
> combo box?).
>
> It is important that the wiring of the application is not magic;
> programmers are responsible for asking the Platform questions and
> doing something with the result.
>
> As an example the menus are done by the "org.eclipse.ui" plugin going
> though all the menus defined by all the plugin.xml files and producing
> something at the end of the day. In a similar fashion "org.eclipse.ui"
> goes through and finds all the "views" that a user could add to the
> screen.
>
> How features work....
>
> Above we saw how plugins can be run resulting in an eclipse
> application. For very small projects you may want to do just that ...
> get a pile of plugins together and hit "run".
> When projects get a bit larger it is useful to gather a group of
> plugins together to make this a bit easier to manage.
>
> The idea is that a feature gathers up plugins that together make one
> concept or capability available to the user.
> As a human visible concept features are the subject of update sites,
> or can be reviewed in the help menu if the user wants to know what is
> installed.
>
> How products work ...
>
> Products are just that; something packaged up and ready to go! You can
> actually export them as a stand alone application. You have a couple
> of options when defining a product; you can do so using plugins. Or
> for larger projects that you expect to last a while or get updated you
> should define it using features.
>
> Plugins vs Features fight!
>
> So this is where we get into the thick of it.
> - plugins are going to do their best to run; but will refuse to run if
> not everything they need is available
> - features can be used to gather up plugins into groups for distribution
>
> And who is responsible for making sure that the features actually
> gather plugins into groups that can run?
> You!
>
> How to fix it?
>
> If you go to run and the application won't start; open up your run
> configuration and "validate plugins" - it will list any plugins that
> could not run.
> You will need to see why they could not run (ie what they are missing)
> and make sure to add anything missing to your application.
>
> If you are running as plugins there is a button to add anything
> missing in one easy step.
>
> If you are running as features you will need to sort through what is
> missing and decide what feature to include it in. You may also be able
> to reuse one of the features already defined as part of the eclipse
> platform.
>
>
> What about product?
>
> Product is simply an eclipse rcp app that is ready to go; you can
> define it as a set of plugins (good for small projects) or using
> features.
>
> What about update site?
>
> You can use an update site to publish features for download; since
> features are a group of plugins this is primary the way to distribute
> additional functionality to applications that are in the field. You
> can also of course use it to distribute updates or patches to existing
> features.
>
> What did we miss?
>
> - Fragments are like half a plugin; they are used to patch an existing
> plugin. At a technical level this is done by mixing the plugin.xml
> from both the origional plugin and the fragment together.
> - Removing stuff; you can also get a bit fancy and ask the platform to
> ignore parts of the plugin.xml document (this can be used to strip
> menus or views out of another plugin if you consider them off topic
> for the task at hand). Why doesn't skip the classes? Well because you
> may have subclassed them for your own work .. so the normal Java code
> reuse still needs to be respected.
> - Classloader hell - the OSGi plugin system is mean - it loads plugins
> into different class loaders and only lets you work with code that you
> have explicitly told it you depend on!
> - Execution Environment - OSGi has started talking about the target
> environment and giving it a name (so you can tell the difference
> between Java 5 and Java 6).  This is mostly used so a plugin can say
> it requires Java 6 (so OSGi won't accidentally load it when running on
> an older mac where only Java 5 is available).
>
_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel


_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel



Back to the top