AutoActivation doesn't work

Post a reply

Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:
BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON
Topic review
   

Expand view Topic review: AutoActivation doesn't work

Re: AutoActivation doesn't work

Post by as3boyan » Thu Sep 19, 2013 9:52 pm

Wow! I didn't knew that it works this way(And modified AutoComplete code to get "." working). This is very cool! Thank you very much!

Now I think I should add some more rules :)

It seems like I don't need to override isValidChar, because that will change position of caret passed to my completion impl.(I override getCompletionImpl()). Works perfectly!

Re: AutoActivation doesn't work

Post by robert » Wed Sep 18, 2013 12:14 pm

In your CompletionProvider, have you called setAutoActivationRules() to add "." to the list of characters to auto-complete after? By default auto-completion only occurs after letters. Note you'll also have to override isValidChar() (assuming you're using DefaultCompletionProvider) to add '.' as an acceptable identifier character.

java code:

DefaultCompletionProvider provider = new DefaultCompletionProvider() {
@Override
protected boolean isValidChar(char ch) {
return ch=='.' || super.isValidChar(ch);
}
});
provider.setAutoActivationRules(true, ".");

AutoActivation doesn't work

Post by as3boyan » Mon Sep 16, 2013 8:47 pm

AutoCompletion ac = new AutoCompletion(provider);
ac.setAutoActivationDelay(100);
ac.setAutoActivationEnabled(true);

I tried in sample, but it doesn't work. is it works?
It would be cool to have autocomplete on ".".

Top