HTML Formatting in Editor ContentAssit [message #299866] |
Mon, 27 February 2006 11:37 |
Eclipse User |
|
|
|
Originally posted by: ahmedlazreg.free.fr
Hi,
I have added content assist to my Editor (I'm writing an ASM editor plugin).
I have added some context info using the second constructor of completion
proposal.
public CompletionProposal(String replacementString, int replacementOffset,
int replacementLength, int cursorPosition, Image image, String
displayString, IContextInformation contextInformation, String
additionalProposalInfo)
My info ares stored in the "AdditionnalProposalInfo " (the last param).
They appear correctely in a little window at the right of the selected word
in the proposal list.
My question is : How can I have html formtting of this info ? I tried by
adding html formatting tags but it does not work. The tags are drawn as
normal text.
What I want is to have info window like JDT one, with the keyword written in
bold and its description in normal text.
Any help ?
Best regards
|
|
|
Re: HTML Formatting in Editor ContentAssit [message #299871 is a reply to message #299866] |
Mon, 27 February 2006 13:33 |
Tom Hofmann Messages: 770 Registered: July 2009 |
Senior Member |
|
|
Have your proposals implement ICompletionProposalExtension3 and
implement getInformationControlCreator().
-tom
Ahmed LAZREG wrote:
> Hi,
> I have added content assist to my Editor (I'm writing an ASM editor plugin).
> I have added some context info using the second constructor of completion
> proposal.
>
> public CompletionProposal(String replacementString, int replacementOffset,
> int replacementLength, int cursorPosition, Image image, String
> displayString, IContextInformation contextInformation, String
> additionalProposalInfo)
> My info ares stored in the "AdditionnalProposalInfo " (the last param).
> They appear correctely in a little window at the right of the selected word
> in the proposal list.
> My question is : How can I have html formtting of this info ? I tried by
> adding html formatting tags but it does not work. The tags are drawn as
> normal text.
> What I want is to have info window like JDT one, with the keyword written in
> bold and its description in normal text.
> Any help ?
> Best regards
>
>
|
|
|
|
Re: HTML Formatting in Editor ContentAssit [message #299877 is a reply to message #299873] |
Mon, 27 February 2006 15:21 |
Eclipse User |
|
|
|
Originally posted by: ahmedlazreg.free.fr
Ah ... ok I see. if understand correctely what you mean ....
in the ContentAssistCreator, my code look a bit like this
public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer,
int offset) {
ICompletionProposal[] result;
String currWord = MPASMTextHoover.getLeftWordPart(viewer.getDocument(),
offset);
List ret= new LinkedList();
for (int i = 0; i < MPASMCodeScanner.fgOpcodes.length; i++) {
if (MPASMCodeScanner.fgOpcodes[i].startsWith(currWord.toLowerCa se()))
ret.add(new CompletionProposal(MPASMCodeScanner.fgOpcodes[i],
offset-currWord.length(), currWord.length(),
MPASMCodeScanner.fgOpcodes[i].length(),
PlatformUI.getWorkbench().getSharedImages().getImage(IShared Images.IMG_OBJS_INFO_TSK),
MPASMCodeScanner.fgOpcodes[i], null, "INFO : " +
MPASMCodeScanner.fgOpcodes[i] ));
}
.....
}
instead of " ICompletionProposal[] result; " I have to write a thing like
" ICompletionProposalExtension3[] result; "
and I have to develop a class that implement the
ICompletionProposalExtension3 and
instead of using the CompletionProposal constructor in the line
.... ret.add(new CompletionProposal(MPASMCodeScanner.fgOpcodes[i],
I will have to use the NewClass that implements the
ICompletionProposalExtension3 interface.
And this NewClass have to retrun a IInformationControl capable of displaying
HTML.
Is that Correct ?
Best regards
A.Lazreg
instead
"Tom Eicher" <eclipse@tom.eicher.name> a
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03865 seconds