How to provide Pluging jar libs for another Plugin?

Hello,

I have a problem with plugin dependencies. I allready found a similar thread http://devnet.jetbrains.com/message/5306354 but this didn't really helped me. And I read the https://confluence.jetbrains.com/display/IDEADEV/IntelliJ+IDEA+Plugin+Structure article but I am still confused.

What I try to do (short version):
Writting a plugin A that provides some SWT libaries for different plattforms in order to use this libs in another plugin B. This might be a stupid question but: Is this possible what I am trying to do or not? And if yes - how can I do it?

What I try to accomplish:

We have a Plugin for Eclpise that use SWT libs to work. We would like to transport this Plugin to IntelliJ aswell.
IntelliJ doesn't provide such SWT libs natively (as far as I know). Due to licens problems, we also can't add the needed SWT libs directly to our Plugin. So the solution was, to write one Plugin that gives support for SWT and let our Plugin use this. I know that you can set dependencies with the <depends> tag in the Plugin.xml. I write a Plugin A that depends on the SWT jar and set the scope to compiled. Then I wrote a Plugin B and set the <depends> Tag to the first Pluging. This works (meaning that IDEA notice that B need A to be loaded) but I cann't use any SWT funktionaltity in Plugin B.

Any solutions?  Thank you :)
PluginB depends on PluginA.jpg

5 comments
Comment actions Permalink

What exactly do you mean by "can't use"? In general, plugin dependencies do work in such a way.

However, note that mixing SWT and Swing UIs in the same application generally does not work, and it's not just a matter of providing the necessary jars. Most likely you'll need to rewrite the UI of your plugin in Swing.

0
Comment actions Permalink

I did managemented to get the Plugins working. Plugin B needs to be an Extension of Plugin A as it seems, and after I fixed that it worked just fine.

However you got a point, embedding SWT in SWING is a huge pain in the ass. The JVM is crashing everytime I minimize a Pluginwindow (due to a thread problem I figured). To get this clear: is it NOT POSSIBLE or just VERY HARD TO DO? If I got a Eclips Plugin, and a Idea Plugin how do I get the same codebase for the GUI? It would makes GUI testing much easier to have the same GUI in both applications. Do you see any other options there (besides rewriting the GUI in SWING)?

Thanks a lot.

0
Comment actions Permalink

I'm not aware of any IntelliJ plugins using SWT for their UI. Given that different IDEs have different sets of controls and different UI conventions, I don't think that having exactly the same UI in multiple IDEs is a worthwhile goal at all.

0
Comment actions Permalink

It's not so much about having the same "look" (this is more like a bonus), but it's much more about having the same Codebase for our UI. This greatly reduce codereplication in our diffrent Plattformversions. If we don't need to rewrite the UI in every diffrent Plattform - this is a worthwhile goal. And that is why I like to integreate SWT in InelliJ.

0
Comment actions Permalink

In my humble opinion, the user experience of people using your plugin matters much more than whether you have the same codebase or not.

0

Please sign in to leave a comment.