Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Contributing content assist to any editor?
Contributing content assist to any editor? [message #335061] Thu, 19 March 2009 21:36 Go to next message
Eclipse UserFriend
Originally posted by: clemens.froglogic.com

Hello.

I want to provide content assist for a specific API, but the user could
potentially use any Eclipse-based editor, and I would like to offer
content assist based on heuristics (file name extension, document
content) in possibly any editor with just one implementation of the
content assist code.

(I imagine that spellcheckers are a somewhat similar case - the
implementor of a spellchecker may not know what type of document the
user is editing, and in what editor, but "tpyo" still looks like a typo!)

Is this possible, while being a "regular" content assist provider?

Should I file a bug for such a feature (configurable content assist
contributors for any text editors)?

Should this is not possible, can I register an action (without being
bound to any editor) which the user binds to a preferred key combination
and which shows the "standard" content assist dialog when triggered?



With best regards

Clemens Anhuth



--
www.froglogic.com - Squish - Multi-Platform GUI Testing
Re: Contributing content assist to any editor? [message #335067 is a reply to message #335061] Fri, 20 March 2009 08:12 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
Clemens Anhuth wrote:
> Hello.
>
> I want to provide content assist for a specific API, but the user
> could potentially use any Eclipse-based editor, and I would like to
> offer content assist based on heuristics (file name extension,
> document content) in possibly any editor with just one implementation
> of the content assist code.
>
> (I imagine that spellcheckers are a somewhat similar case - the
> implementor of a spellchecker may not know what type of document the
> user is editing, and in what editor, but "tpyo" still looks like a typo!)
>
> Is this possible, while being a "regular" content assist provider?
No.
>
> Should I file a bug for such a feature (configurable content assist
> contributors for any text editors)?
Currently each editor decides whether and if yes, how it supports
content assist. Even if we added configurable content assist for all
editors it would have to be an opt-in feature i.e. only those who want
it will get it.
>
> Should this is not possible, can I register an action (without being
> bound to any editor) which the user binds to a preferred key
> combination and which shows the "standard" content assist dialog when
> triggered?
This won't help because as just explained, the concrete editor decides
about content assist support.

Dani
>
>
>
> With best regards
>
> Clemens Anhuth
>
>
>
Re: Contributing content assist to any editor? [message #335070 is a reply to message #335067] Fri, 20 March 2009 10:12 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: clemens.froglogic.com

Daniel Megert wrote:

Hello Daniel.

[...]
>> Should I file a bug for such a feature (configurable content assist
>> contributors for any text editors)?
> Currently each editor decides whether and if yes, how it supports
> content assist. Even if we added configurable content assist for all
> editors it would have to be an opt-in feature i.e. only those who want
> it will get it.

Spell checkers, content assistants, more specialized content assistants
(Mylyn) and template/snippet plugins could be independent of the
individual editor. To be able to share such functionalities across all
editors seems desirable.

(When I use AutoHotkey or any such macro tool to steer Eclipse via
operating system level input events I am already taking control away
from the author of the editor and can implement the above functionality,
but it would not be integrated (well enough) and not be cross-platform.
It would still be my choice however, within the realm of text editors
which deal with text input.)

What is your opinion, am I off base with this? Does it go against
Eclipse design goals or so?



>> Should this is not possible, can I register an action (without being
>> bound to any editor) which the user binds to a preferred key
>> combination and which shows the "standard" content assist dialog when
>> triggered?
> This won't help because as just explained, the concrete editor decides
> about content assist support.

Sorry Daniel, I phrased this badly.

What I meant to ask is if it is possible to use and show the content
assist functionality existing in RCP by myself, without having my own
editor?

If I cannot use the existing content assist functionality I guess I
could write and display my own, but I would still need to be able to
read and modify the editor's text/document. Is this possible in general,
for text editors? Or would I have to resort to sending keyboard events
to the editor to make it insert the desired text piece?

Thank you for your answers, Daniel.



With best regards

Clemens Anhuth
Re: Contributing content assist to any editor? [message #335071 is a reply to message #335070] Fri, 20 March 2009 11:24 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
Clemens Anhuth wrote:
> Daniel Megert wrote:
>
> Hello Daniel.
>
> [...]
>>> Should I file a bug for such a feature (configurable content assist
>>> contributors for any text editors)?
>> Currently each editor decides whether and if yes, how it supports
>> content assist. Even if we added configurable content assist for all
>> editors it would have to be an opt-in feature i.e. only those who
>> want it will get it.
>
> Spell checkers, content assistants, more specialized content
> assistants (Mylyn) and template/snippet plugins could be independent
> of the individual editor. To be able to share such functionalities
> across all editors seems desirable.
>
> (When I use AutoHotkey or any such macro tool to steer Eclipse via
> operating system level input events I am already taking control away
> from the author of the editor and can implement the above
> functionality, but it would not be integrated (well enough) and not be
> cross-platform. It would still be my choice however, within the realm
> of text editors which deal with text input.)
>
> What is your opinion, am I off base with this? Does it go against
> Eclipse design goals or so?
No, I just wanted to tell how it currently is. Those editors that
inherit from the text editor could probably get it for free but not
those that implement their own based on abstract classes.
>
>
>
>>> Should this is not possible, can I register an action (without being
>>> bound to any editor) which the user binds to a preferred key
>>> combination and which shows the "standard" content assist dialog
>>> when triggered?
>> This won't help because as just explained, the concrete editor
>> decides about content assist support.
>
> Sorry Daniel, I phrased this badly.
>
> What I meant to ask is if it is possible to use and show the content
> assist functionality existing in RCP by myself, without having my own
> editor?
You can trigger it but it would show those proposals that the editor
decides to show. What you could do is using the existing content assist
APIs to write your own (additional) content assist that shows your
proposals but they would not appear on Ctrl+Space but on a separate key
binding.

Dani
>
> If I cannot use the existing content assist functionality I guess I
> could write and display my own, but I would still need to be able to
> read and modify the editor's text/document. Is this possible in
> general, for text editors? Or would I have to resort to sending
> keyboard events to the editor to make it insert the desired text piece?
>
> Thank you for your answers, Daniel.
>
>
>
> With best regards
>
> Clemens Anhuth
Re: Contributing content assist to any editor? [message #335081 is a reply to message #335071] Fri, 20 March 2009 16:38 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: clemens.froglogic.com

Daniel Megert wrote:
[...]
>> What I meant to ask is if it is possible to use and show the content
>> assist functionality existing in RCP by myself, without having my own
>> editor?
> You can trigger it but it would show those proposals that the editor
> decides to show. What you could do is using the existing content assist
> APIs to write your own (additional) content assist that shows your
> proposals but they would not appear on Ctrl+Space but on a separate key
> binding.

Hi Dani,

what you describe is what I meant. I just have no idea if the content
assist APIs allows for showing the content assist dialog somewhere
completely unrelated. How would I go about that, would I implement an
invisible dummy editor that has content assist?



With best regards

Clemens Anhuth
Re: Contributing content assist to any editor? [message #335219 is a reply to message #335081] Thu, 26 March 2009 11:14 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
Clemens Anhuth wrote:
> Daniel Megert wrote:
> [...]
>>> What I meant to ask is if it is possible to use and show the content
>>> assist functionality existing in RCP by myself, without having my
>>> own editor?
>> You can trigger it but it would show those proposals that the editor
>> decides to show. What you could do is using the existing content
>> assist APIs to write your own (additional) content assist that shows
>> your proposals but they would not appear on Ctrl+Space but on a
>> separate key binding.
>
> Hi Dani,
>
> what you describe is what I meant. I just have no idea if the content
> assist APIs allows for showing the content assist dialog somewhere
> completely unrelated. How would I go about that, would I implement an
> invisible dummy editor that has content assist?
No, see org.eclipse.jface.text.contentassist.ContentAssistant. You can
simply create a second instance of it and configure it for your viewer.

Dani
>
>
>
> With best regards
>
> Clemens Anhuth
Re: Contributing content assist to any editor? [message #335221 is a reply to message #335219] Thu, 26 March 2009 13:28 Go to previous message
Eclipse UserFriend
Originally posted by: clemens.froglogic.com

Daniel Megert wrote:
> Clemens Anhuth wrote:
>> Daniel Megert wrote:
>> [...]
>>>> What I meant to ask is if it is possible to use and show the content
>>>> assist functionality existing in RCP by myself, without having my
>>>> own editor?
>>> You can trigger it but it would show those proposals that the editor
>>> decides to show. What you could do is using the existing content
>>> assist APIs to write your own (additional) content assist that shows
>>> your proposals but they would not appear on Ctrl+Space but on a
>>> separate key binding.
>>
>> Hi Dani,
>>
>> what you describe is what I meant. I just have no idea if the content
>> assist APIs allows for showing the content assist dialog somewhere
>> completely unrelated. How would I go about that, would I implement an
>> invisible dummy editor that has content assist?
> No, see org.eclipse.jface.text.contentassist.ContentAssistant. You can
> simply create a second instance of it and configure it for your viewer.


Hi Dani,

thank you for your reply. I will have (another) look at it. I saw some
install() and uninstall() methods before, but without further
description in the API docs I was too uncertain of their function and
intended use.



With best regards

Clemens Anhuth
Previous Topic:Re: Active Project Handling - Howto
Next Topic:save us action on editors ...
Goto Forum:
  


Current Time: Fri Apr 26 23:50:57 GMT 2024

Powered by FUDForum. Page generated in 0.03618 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top