Marcelo Vanzin | 2 Sep 2003 06:54
Picon
Picon

Re: ProjectViewer - finding the current project and all projects.

Mike Atkinson wrote:
> I've looked at those classes, but hoped there was some example code I 
> could copy/modify.
> I wish to use PV information, but not be dependent on it (as it is not 
> in the core) so will have to
> use reflection, which complicates things.

	If you want some example code, I can send to your e-mail (or, 
optionally, wait until I put it in CVS).

	About the dependency, there are two options:

	(i) you don't need to use reflection, but you have to do some "tricks" 
in your classes to "fool" the class loader. If you look at 
projectviewer.action.LaunchBrowserAction, that's what I did to use 
InfoViewer but not depend on it, without using reflection: all 
references to classes that may not be available must be in a method 
that's only called if the classes are not available. (It doesn't need to 
be in a separate class as in my example, a separate method will do fine.)

	(ii) wait till I update CVS with my changes. This way you'll just have 
to set some properties in your plugin's property file to add 
listeners/etc to ProjectViewer. There's also an example plugin (that I 
use for debugging) if you need an example.

-- 
Marcelo Vanzin
marcelo.vanzin <at> poli.usp.br
"Life is too short to drink cheap beer"

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
--

-- 
-----------------------------------------------
jEdit Developers' List
jEdit-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jedit-devel


Gmane