Community
Participate
Working Groups
I tried to add content assist to an editor and failed miserably until I found an simple example of how to create and configure the ContentAssistAction. This seems to be an integral part of the process so it needs to be mentioned in the doc (obviously not for 3.1 though;-)
which example was that?
I got the example code for the EclipseFAQ book fron John Arthorne. It was much easier to understand than the javaeditor example in dev.eclipse.org.
John, would it be possible to contribute this example to eclipse?
This bug is not so much about improving the example. The problem is that I followed the steps in the ISV doc and didn't get what I expected (i.e. CTRL- Space didn't work). The fact that the example was a bit involved didn't help but I wouldn't even have needed to look at the exampel had the ISV doc been complete. John's example showed how the editor needs to define and register a ContentAssistAction in the createActions method. Perhaps he will give you permission to include the snipet from his example so it can be added to the doc (I think it is unreasonable to ask to include the complete example especially since it may have a copyright associated with the book).
FAQ examples can be found here: http://eclipsefaq.org/chris/faq/samples.html Go to "FAQ recipe and other samples", and grab org.eclipse.faq.examples-src.zip. Unlike the book text, the examples are copyright Chris and I, and distributed under the MIT license... i.e., do whatever you want with them.
Thanks John. This once again confirms that asking a question is not unreasonable most of the times ;-)
Sorry for being so negative. I guess I'm just a half-empty kind'a guy. I must say that I think the HTML editor example from the book is a really good example of how to use code assist. I think it would definitly be a good example to make available. I still think the doc needs to be updated though. It could even have a pointer to the example.
In fact we should make it much simpler and create the action on our side, so that the only thing a client needs to do is - add it to the context menu if desired - link it to the command and action bar if desired (editor action bar contributor) And these two steps should be added to the doc. Time permitting for 3.2.
Fixed doc in HEAD. Filed bug 138370 requesting simpler setup of ContentAssistAction. Available in builds > N20060425-0010.
Verified in I20060512-0010.