Intersect with Autocompletion

Questions on using RSyntaxTextArea should go here.

Moderator: robert

Intersect with Autocompletion

Postby Kyrremann » Mon Dec 10, 2012 10:34 pm

I'm working on content assist for my language, and since I need to compute what to display in the content assist menu when a user hit ctrl+space I need some way to intercept it, so I can do my calculation and add my completionProviders before it show. Do you have any good ideas on how to do it?
I've been looking into the AutoCompletion class, but I'm thinking about overriding the keylistener, and instead call AutoCompletion manually with the doCompletino(). Will continue my work tomorrow, but since most of you are from the USA and the timezone doesn't really overlap I thought I could try to see if someone had a tip while I was sleeping :)
My RSytaxTextArea master blogg http://thingmlosf.tumblr.com/ and source code https://github.com/Kyrremann/ThingML
Kyrremann
 
Posts: 14
Joined: Wed May 16, 2012 10:07 pm
Location: Oslo, Norway

Re: Intersect with Autocompletion

Postby Kyrremann » Tue Dec 11, 2012 2:08 pm

Ended up doing this my self and what I did was to intercept the CTRL + SPACE and do the magic I needed and then call on the doCompletions.

Code: Select all
rSyntaxTextArea.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, Event.CTRL_MASK), new ContentAssistAction(this, autoCodeCompletion));
My RSytaxTextArea master blogg http://thingmlosf.tumblr.com/ and source code https://github.com/Kyrremann/ThingML
Kyrremann
 
Posts: 14
Joined: Wed May 16, 2012 10:07 pm
Location: Oslo, Norway

Re: Intersect with Autocompletion

Postby robert » Wed Dec 12, 2012 4:19 am

Glad you found a solution!
User avatar
robert
 
Posts: 774
Joined: Sat May 10, 2008 5:16 pm


Return to Help

Who is online

Users browsing this forum: No registered users and 5 guests

cron