Eclipse Plugin API: how can I add javadoc support for specific platform plugins? - api

using Eclipse 3.4 Ganymede and I cannot find the way to add javadoc support for all platform plugin apis, but specifically to JFace e Ui Forms packages.
Opening the property panel of any jar linked to the library named "plug-in dependecies" I receive the following message into the "Javadoc location" node:
The current class path entry belongs to container 'Plug-in Dependencies'
wich does not allow user modifications to Javadoc locations in its entries"...
what does it mean, that I must re-build Eclipse with some wired javadoc location?

If you have the eclipse SDK "classic", "RCP/Plugin" or "Modeling" installed, that means sources for the eclipse plugins are included.
While it is true you cannot setup Javadoc for those plugins, you still access to that documentation since the sources are here, fully "Java-documented".
If there are no sources, you still can import all eclipse plugins with their sources in a dedicated workspace.
alt text http://www.vogella.de/articles/EclipseCodeAccess/images/eclipsesource30.gif

I'm using eclipse 3.4.2 with visual editor 1.4.0.
For some reason, my eclipse doesn't find the swt javadocs by default and the "import plugins method" does not work.
But I found a work arround:
Project Properties -> Java Build Path -> Libraries -> Add External Jar
add /plugins/org.eclipse.swt.gtk.linux.x86_64.3.4.1.v3452b.jar
edit the "source attachment" to org.eclipse.swt.gtk.linux.x86_64.source_3.4.1.v3452b.jar
Press ok. Note, that you are now using swt "twice" :O)
If it is still not working, go to the same dialog, remove the "Standard Widget Toolkit (SWT)" and press ok. Return to the dialog and add it again with the button "Add Library" -> SWT -> IDE Platform. Press ok. Close all Visual Editors. And go to Project -> Clean...
Now you the Javadocs are displayed directly in Eclipse and Visual Editor still works.

Related

How can I add gradle support to an existing intellij project?

I have an intellij project that has gradle files in it(build.gradle, settings.gradle, etc.) and I have the project working in intellij. The issue is that intellij can't find any 3rd party libraries so I need to link the gradle project to it. How can I do this to an existing intellij project or at least be able to resolve 3rd party libraries so that the classes don't show up as red in the editor?
I'm on version 2016.1.2 145.972
You can click on the "+" symbol on the Gradle tool window and attach the project. If you don't see the window, use View | Tool Windows | Gradle to bring it up. (Or use the square icon on bottom left). You may then have to click the refresh icon to bring in the dependancies (in case IntelliJ didn't do it).
Refer: https://www.jetbrains.com/help/idea/2016.1/working-with-gradle-projects.html
Alternately, you could just re-import the project freshly using gradle.
Import Existing Project -> Import project from External model -> Gradle

guice-assistedinject.jar in Eclipse target platform but not addable in plug-in's dependencies

I'm developing an Eclipse RCP application with Eclipse 4.4 Luna M5 and I'm using Guice 3.0.
So I added guice.jar to my target platform and for every plug-in I'm developing I can add bundle com.google.inject to the plug-in's dependencies using the plug-in manifest editor of Eclipse. So far, everything works fine.
Now the problem: I want to use guice assisted injects (#Assisted).
So I added guice-assistedinject.jar to my target platform. (I'm using a .target file = Eclipse Target definition file).
In then "Content" tab of the .target file editor Eclipse correctly shows me the fragment bundle com.google.inject.assistinject 3.0 from guice-assistedinject.jar, but I cannot add this bundle or an exported package of this bundle to the dependencies of the plug-in projects I'm developing.
When I press "Add" in the plug-in manifest editor, com.google.inject.assistedinject is not in the list of addable dependencies? What's wrong?
Here my comment as answer again:
OK, found the solution: it's a PDE problem, see accepted answer in Eclipse OSGi bundle reqiure another bundle's fragment
After changing the manifest of my guice-3.0.jar in the target platform like described in the link above, I needed to do the following:
Reload the target platform (Windows -> Preferences -> Plug-in development -> Target platform) and restart eclipse.
Remove the bundle com.google.inject from the required bundles of my plug-in.
Add all needed com.google.inject packages to "imported packages" of my plug-in. Now in the list of packages I can see com.google.inject.assistedinject.Assisted and import it!

How to import and run existing plugins from intellij community edition repo

I'm trying to import and run the IntelliJ git4idea (Git Integration) plugin in order to play around and contribute some of my own code.
I've pulled the Intellij community edition from the github repo, and imported the git4idea plugin as a project. I'm running the Intellij community edition
My main issue is this:
After importing all the modules, the git4idea module comes up as a general module type, and not a plugin module type.
This means that when trying to create a new run\debug configuration, I get [none] under "Use classpath of module", instead of of the ability to select the git4idea plugin. This obviously results in a "Run configuration error: no plugin module specified for configuration".
So the question is -
How can I change the general type of imported "git4idea" to plugin type?
Or better yet, what are the steps required in order to import and build/debug/run a plugin from the Intellij community edition repo?
I was able to solve this by manually reordering file directories, sorting out dependencies and editing the .iml file. The type of plugin is defined by changing type="JAVA_MODULE" to type="PLUGIN_MODULE".
...
This is the answer given by Dmitry Jemerov on the official Jetbrains plugin development forum:
The easiest answer to this is "don't". The IntelliJ IDEA Community
Edition project is set up to be developed as a whole, and the
dependencies are set up accordingly. If you want to hack on the Git
plugin, you simply run IDEA using the provided run configuration, it
runs with all plugins enabled, and you simply make whatever changes
you need and test them using the main run configuration.
If you really want, you can set up a new plugin module and point it to
the source code of the git4idea plugin inside the IntelliJ IDEA
Community Edition Git checkout. This is not too hard, but it's
something you'll need to do from scratch, and you can't use the
existing .iml file.
I had the same no plugin module specified for configuration issue. To work around it, instead of importing, I created a new plugin project and used the existing code directory.
when you import the intelij plugin projects
You should run the 'runIde' task in gradle.
Step-by-step instruction
Build your IDEA plugin (usually done with gradle build).
Start Intellij IDEA.
If you have any project opened, go to menu "File->Close all projects" to return to Intellij IDEA startup screen.
Install the plugin you've just built: on the left side of the "Welcome to Intellij IDEA" startup screen go to "Plugins", then click "gear" icon on the right side, it's located to the right of "Marketplace" and "Installed". From the pop-up menu select "Install Plugin from Disk...", navigate to plugin file (usually in build folder) and click "Ignore and continue" when you see the warning message saying something about signature.
Restart Intellij IDEA.
Open the folder with your IDEA plugin.
Wait until IDEA imported your Gradle project.
Put breakpoints inside your plugin code so you can debug it.
Go to menu "Run->Edit configurations".
In the "Run/Debug Configurations" window on the left side click "+".
Select "Gradle" from the pop-up menu.
On the right side change "Name" to "gradle-run-ide" (without quotes).
On the right side under "Run", inside "Tasks and arguments" field enter runIde ("i" must be capital, other letters small).
Click "OK" to save changes.
Go to menu "Run->Debug 'gradle-run-ide'".
A new, black-colored IDEA window should appear.
In this black-colored IDEA window do whatever you need to do in order to invoke methods of your plugin. When you invoke them, the first IDEA window should stop you on breakpoints you set previously.
Happy debugging.
After changing type="JAVA_MODULE" to type="PLUGIN_MODULE" in *.iml file I was getting following error -
Error running 'IdeaPlugin': Wrong SDK type for plugin module
To fix this go to -
Module Settings -> Platform settings -> SDKs.
Click on Add new SDK
Select Intellij Platform plugin SDK
For home directory select your Inetllij installation dir
Select JAVA SDK you want to use with it.
Once this is added got to Module Settings again
Module Settings -> Project settings -> project.
In Project SDK change the JAVA sdk to the SDK we just added in the above steps.
Run/Debug you plugin now.

Eclipse plugin development - extending ADT, how to make the plugin import existing project as library

I am developing an Eclipse plugin extending ADT (Android development tools).
I'd like to know how to make the plugin has the functions, "import an existing project as library" when the plugin is installed, and "when creating a project from my plugin, the library is automatically being referenced".
As far as I know, if you want to make an existing project as a library, you have to import it into your workspace and then Properties -> Android -> Library -> "is Library". Then Android tool will update the .properties file as "android.library=true"
Then in the project that is using the library, Properties -> Android -> Library and then Add the library you just set. Then Android tool will update the .properties file as android.library.reference.1=..\\theLibrary.
But how can I do this automatically in my plugin?
How do I do "import a project as a library", "update android project properties file" in plugin?
I was thinking about extension point. But I don't know how to add an extension point to import a project and to manipulate Android tool.
Please help.

New>Generic problem in Eclipse Helios no other attributes

When I am trying to use eclipse Helios for plug-in development,I am not getting any attributes beside generic in any new RCL option. I have gone through net and found to download the source code but there is no way to append the same in Helios. Please suggest
You can install Eclipse RCP Plug-in Developer Resources via Eclipse update site
The shortest way to do it is:
Download the helios version for RCP developers from the eclipse web site.
Open target platform from the preferences menu.
Click "add" to add a new target platform.
"Nothing" is chosen for default target platform creation. Click next
On the new window click on the locations tab.. Click add , on the pop up window click directory and browse the plugin directory of eclipse for RCP developers (This version of helios includes the necessary plugin sources inside) and click finish
On the "implicit dependencies" tab show all the plugins added (choose all plugins)
and then click finish and close the wizard window.
Finally choose the new target platform configuration you have just created.
Now you can see all the new attributes beside generics (related to the plugin)
Download the SDK plugins from:
http://download.eclipse.org/eclipse/updates/4.3/