From: Felix B. <bf...@gm...> - 2008-07-25 17:32:22
|
Hi Hongyi, > I like the auto completion functionality in xnap, but the following example > doesn't work for addPreviousWordCompletion() method. > http://xnap-commons.sourceforge.net/tutorial/examples/CompletionExample.java Yes, this example is commented out in CVS head, most likely because it doesn't work perfectly. If you entry another letter after the initial x, the completion dialog shows up. It looks like there is an off-by-one error in the code. > I want to develop an editor, I need the code completion like eclipse, e.g. > when I press CTRL+Space, I will get a list to select. Can xnap achieve this? > If can, who can give me a code snip Feel free to extend or reuse the existing code and fix it, if it makes sense to you. I think the realm of the completion support provided by the XNap Commons library is more geared towards text fields history-type completions. The support of JTextArea seems to not work as well. Also, the CompletionModels only work if the data is available immediately, there is no provision for asynchronously computing possible completions. Felix |