Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » ContentAssist: additional Info
ContentAssist: additional Info [message #460253] Mon, 18 December 2006 15:10 Go to next message
Eclipse UserFriend
Originally posted by: febro.gmx.net

Hi,

I'm working an ContentAssistance and the main part - showing the proposals -
works good, but now I want to show additional information about the selected
element - like in the standar java editor, when you select an element in the
proposal list, a second popup with the corresponding "javadoc" is shown...
how to do this?

i already tried the code below, but it doens't work (the proposal list is
shown correctly, but no additional infos). Any hints?

thx!
Felix
ContextInformation ci = new ContextInformation("1", "2");

completion.add(new CompletionProposal(text, currentText.documentOffset,
currentText.text.length(), text.length(), null, name, ci,
element.getDescription()));
Re: ContentAssist: additional Info [message #460315 is a reply to message #460253] Tue, 19 December 2006 13:43 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
Felix brossmann wrote:

>Hi,
>
>I'm working an ContentAssistance and the main part - showing the proposals -
>works good, but now I want to show additional information about the selected
>element - like in the standar java editor, when you select an element in the
>proposal list, a second popup with the corresponding "javadoc" is shown...
>how to do this?
>
>i already tried the code below, but it doens't work (the proposal list is
>shown correctly, but no additional infos). Any hints?
>
>
See ICompletionProposal.getAdditionalProposalInfo()

Dani

>thx!
>Felix
>ContextInformation ci = new ContextInformation("1", "2");
>
>completion.add(new CompletionProposal(text, currentText.documentOffset,
>currentText.text.length(), text.length(), null, name, ci,
>element.getDescription()));
>
>
>
>
>
>
Re: ContentAssist: additional Info [message #460332 is a reply to message #460315] Wed, 20 December 2006 07:56 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: febro.gmx.net

> >I'm working an ContentAssistance and the main part - showing the
> >proposals -

> >works good, but now I want to show additional information about the
> >selected

> >element - like in the standar java editor, when you select an element in
> >the

> >proposal list, a second popup with the corresponding "javadoc" is
> >shown...

> >how to do this?

> >

> >i already tried the code below, but it doens't work (the proposal list is

> >shown correctly, but no additional infos). Any hints?

> >

> >

> See ICompletionProposal.getAdditionalProposalInfo()



Thanks, but that doesn't help... I use this constructor:

completion.add(new CompletionProposal(text, currentText.documentOffset,

currentText.text.length(), text.length(), null, name, null,

element.getDescription()));



The last parameter sets the description.



How can I *show* the description? Do I have to code this manually?



I use a

public class TagContentAssistProcessor implements

IContentAssistProcessor



In the method "public ICompletionProposal[]

computeCompletionProposals(ITextViewer viewer, int offset)", an array is

built (using the constructor I wrote earlier) and returned. That's what

I do. The proposal-list is shown, but not the additional information...



This is a snippet from my "getContentAssistant"-method... Do I have to

set some flags here? I haven't found anything interesting in

"ContentAssistant", so I don't think so...



ContentAssistant assistant = new ContentAssistant();

assistant.setContentAssistProcessor(new

TagContentAssistProcessor(getXMLTagScanner()),

XMLPartitionScanner.XML_TAG);

assistant.enableAutoActivation(true);

assistant.setAutoActivationDelay(500);



assistant.setProposalPopupOrientation(IContentAssistant.CONT EXT_INFO_BEL

OW);



assistant.setContextInformationPopupOrientation(IContentAssi stant.CONTEX

T_INFO_ABOVE);

return assistant;





Felix
Re: ContentAssist: additional Info [message #460339 is a reply to message #460332] Wed, 20 December 2006 12:14 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
Felix brossmann wrote:

>>>I'm working an ContentAssistance and the main part - showing the
>>>proposals -
>>>
>>>
>
>
>
>>>works good, but now I want to show additional information about the
>>>selected
>>>
>>>
>
>
>
>>>element - like in the standar java editor, when you select an element in
>>>the
>>>
>>>
>
>
>
>>>proposal list, a second popup with the corresponding "javadoc" is
>>>shown...
>>>
>>>
>
>
>
>>>how to do this?
>>>
>>>
>
>
>
>
>
>
>>>i already tried the code below, but it doens't work (the proposal list is
>>>
>>>
>
>
>
>>>shown correctly, but no additional infos). Any hints?
>>>
>>>
>
>
>
>
>
>
>
>
>
>>See ICompletionProposal.getAdditionalProposalInfo()
>>
>>
>
>
>
>Thanks, but that doesn't help... I use this constructor:
>
>completion.add(new CompletionProposal(text, currentText.documentOffset,
>
>currentText.text.length(), text.length(), null, name, null,
>
>element.getDescription()));
>
>
>
>The last parameter sets the description.
>
>
>
>How can I *show* the description? Do I have to code this manually?
>
>
No, the additional info should appear automatically after a short
time-out. If that doesn't work for you simply file a bug report against
Platform Text with steps (best is your code - at least the one that does
code assist).

Dani

>
>
>I use a
>
>public class TagContentAssistProcessor implements
>
>IContentAssistProcessor
>
>
>
>In the method "public ICompletionProposal[]
>
>computeCompletionProposals(ITextViewer viewer, int offset)", an array is
>
>built (using the constructor I wrote earlier) and returned. That's what
>
>I do. The proposal-list is shown, but not the additional information...
>
>
>
>This is a snippet from my "getContentAssistant"-method... Do I have to
>
>set some flags here? I haven't found anything interesting in
>
>"ContentAssistant", so I don't think so...
>
>
>
>ContentAssistant assistant = new ContentAssistant();
>
>assistant.setContentAssistProcessor(new
>
>TagContentAssistProcessor(getXMLTagScanner()),
>
> XMLPartitionScanner.XML_TAG);
>
>assistant.enableAutoActivation(true);
>
> assistant.setAutoActivationDelay(500);
>
>
>
> assistant.setProposalPopupOrientation(IContentAssistant.CONT EXT_INFO_BEL
>
>OW);
>
>
>
> assistant.setContextInformationPopupOrientation(IContentAssi stant.CONTEX
>
>T_INFO_ABOVE);
>
> return assistant;
>
>
>
>
>
>Felix
>
>
>
>
Re: ContentAssist: additional Info [message #461760 is a reply to message #460339] Tue, 16 January 2007 13:42 Go to previous message
Eclipse UserFriend
Originally posted by: febro.gmx.net

ok I got it:

the following line had to be added:

assistant.setInformationControlCreator(getInformationControl Creator(sourceViewer));


"Daniel Megert" <daniel_megert@ch.ibm.com> schrieb im Newsbeitrag
news:emb9fd$m6r$1@utils.eclipse.org...
> Felix brossmann wrote:
>
>>>>I'm working an ContentAssistance and the main part - showing the
>>>>proposals -
>>>>
>>
>>
>>>>works good, but now I want to show additional information about the
>>>>selected
>>>>
>>
>>
>>>>element - like in the standar java editor, when you select an element in
>>>>the
>>>>
>>
>>
>>>>proposal list, a second popup with the corresponding "javadoc" is
>>>>shown...
>>>>
>>
>>
>>>>how to do this?
>>>>
>>
>>
>>
>>
>>>>i already tried the code below, but it doens't work (the proposal list
>>>>is
>>>>
>>
>>
>>>>shown correctly, but no additional infos). Any hints?
>>>>
>>
>>
>>
>>
>>
>>
>>>See ICompletionProposal.getAdditionalProposalInfo()
>>>
>>
>>
>>
>>Thanks, but that doesn't help... I use this constructor:
>>
>>completion.add(new CompletionProposal(text, currentText.documentOffset,
>>
>>currentText.text.length(), text.length(), null, name, null,
>>
>>element.getDescription()));
>>
>>
>>
>>The last parameter sets the description.
>>
>>
>>
>>How can I *show* the description? Do I have to code this manually?
>>
> No, the additional info should appear automatically after a short
> time-out. If that doesn't work for you simply file a bug report against
> Platform Text with steps (best is your code - at least the one that does
> code assist).
>
> Dani
>
>>
>>
>>I use a
>>
>>public class TagContentAssistProcessor implements
>>
>>IContentAssistProcessor
>>
>>
>>
>>In the method "public ICompletionProposal[]
>>
>>computeCompletionProposals(ITextViewer viewer, int offset)", an array is
>>
>>built (using the constructor I wrote earlier) and returned. That's what
>>
>>I do. The proposal-list is shown, but not the additional information...
>>
>>
>>
>>This is a snippet from my "getContentAssistant"-method... Do I have to
>>
>>set some flags here? I haven't found anything interesting in
>>
>>"ContentAssistant", so I don't think so...
>>
>>
>>
>>ContentAssistant assistant = new ContentAssistant();
>>
>>assistant.setContentAssistProcessor(new
>>
>>TagContentAssistProcessor(getXMLTagScanner()),
>>
>> XMLPartitionScanner.XML_TAG);
>>
>>assistant.enableAutoActivation(true);
>>
>> assistant.setAutoActivationDelay(500);
>>
>>
>>
>> assistant.setProposalPopupOrientation(IContentAssistant.CONT EXT_INFO_BEL
>>
>>OW);
>>
>>
>>
>> assistant.setContextInformationPopupOrientation(IContentAssi stant.CONTEX
>>
>>T_INFO_ABOVE);
>>
>> return assistant;
>>
>>
>>
>>
>>
>>Felix
>>
>>
>>
Previous Topic:How to use ILazyContentProvider with the Virtual table.
Next Topic:Open, close and editing events
Goto Forum:
  


Current Time: Thu Apr 25 14:39:45 GMT 2024

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

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

Back to the top