From: <net...@us...> - 2003-02-15 13:35:16
|
Update of /cvsroot/cpptool/rfta/src/eclipseplugin/PluginCode In directory sc8-pr-cvs1:/tmp/cvs-serv30700 Added Files: PlugIn-HowTos.txt Log Message: description how to add plugins to eclipse (http links) --- NEW FILE: PlugIn-HowTos.txt --- Your First Plugin: http://www.eclipse.org/articles/Article-Your%20First%20Plug-in/YourFirstPlugin.html Contributing Actions to Eclipse: http://www.eclipse.org/articles/Article-action-contribution/Contributing%20Actions%20to%20the%20Eclipse%20Workbench.html Writing Dialogs: http://www.eclipse.org/articles/Understanding%20Layouts/Understanding%20Layouts.htm Java Native Interface Usage: http://java.sun.com/docs/books/tutorial/native1.1/index.html JNI FAQ: http://www.jguru.com/faq/JNI API Documentation of eclipse: http://dev.eclipse.org:8080/help/ --> See PlugIn development Using Cygwin To Develop Windows JNI Methods: http://www.inonit.com/cygwin/jni/helloWorld/ How to Debug ? Unfortunatly native code is a little bit critical since, the cpp code is running as DLL loaded by the JAVA-VM. If the DLL crashes, the complete JAVA-VM will be destroyed. For this reason "DebugBreak" does also not work at the moment. (It seems for me that java.exe has called some win-api function to redirect this exception handling. Can we change this for debugging ?) At the moment we need a very restrictive catching of all exceptions in C++. A not catched exception means destroying a running exclipse workbench (which is worse of cause). We can throw Java-Exception using the JNI-Interface, so that the Plugin-Code can display error messages to the user. Currently I'm using a simple java/lang/exception to do this. Maybe we introduce a specialized exception class later on. By the way: The Plugin and the DLL are loaded when the user activates a refactoring action the first time. What to do to run the debug mode showing a console: - load the eclipse-plugin project into the workbench (call this debugging workbench) - don't activate the plugin in this workbench ! - enable tracing in the dialog "Run->Run..." preference dialog - Select Menu: "Run->RunAs->Runtime Workbench" (you need to wait now for a couple seconds until a second workbench opens ... this takes up to 10 seconds on my pc) - in the second workbench you can try out the plug in, all java output (system.out.print) can be seen in the console in the debugging workbench. C++ printouts need to be redirected to calls of "system.out.print" routines. Article: http://www.eclipse.org/articles/Article-Your%20First%20Plug-in/YourFirstPlugin.html see chapter "Debugging your plug-in" after Step 7 How to activate C++ Refactoring Menu/Toolbar ? go to menu "Window->Customize Perspective..." enable tree element "Other->C++ Refactoring" |