Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Content Proposal description with HTML render
Content Proposal description with HTML render [message #332802] Mon, 10 November 2008 15:18 Go to next message
Jean-François  Garreau is currently offline Jean-François GarreauFriend
Messages: 5
Registered: July 2009
Junior Member
Hello, I have a problem using the IContentProposalProvider. I don't how to
have html render in description area...


That I want to do is like content assit we have in eclipse when pressed
CTRL+Space.

* I want to have icon (I understand how to do this -> redefine the label
provider)
* I want a more presized description -> the getDescription method of
IContentProposal is good but I want a description like we have in javaDoc
view with html content... (here is my problem) Despite I use <B> or <BR>
... etc, I have "<B>" ... show in the description area.
* I want that a click on description focus me on this area (not close it).

I don't if I'm right to use Content Proposal...?

Here an example of the code I use :

char[] autoActivationCharacters = new char[] { '#', '(' };
KeyStroke keyStroke;
try {
keyStroke = KeyStroke.getInstance("Ctrl+Space");

IContentProposalProvider proposalProvider = new
IContentProposalProvider() {
private String[] values = { "abc", "toto", "titi", "tata",
"tutu" };

public IContentProposal[] getProposals(String contents,
int position) {
IContentProposal[] proposals = new IContentProposal[values.length];
for (int i = 0; i < values.length; i++) {
final String val = values[i];
proposals[i] = new IContentProposal() {
public String getContent() {
return val;
}

public String getLabel() {
return "A label " + val;
}

public String getDescription() {
return MessageFormat.format(
"{0} this is an <b>example</b> ",
new Object[] { val });
}

public int getCursorPosition() {
return val.length();
}
};
}
return proposals;
}
};

ContentProposalAdapter adapter = new ContentProposalAdapter(text,
new TextContentAdapter(),
proposalProvider, keyStroke, autoActivationCharacters);

} catch (ParseException e) {
e.printStackTrace();
}



When I launch my application in description, I just have "toto this is an
<b>example</b>" ...

Could someone help me ?
Re: Content Proposal description with HTML render [message #332804 is a reply to message #332802] Mon, 10 November 2008 15:36 Go to previous message
Remy Suen is currently offline Remy SuenFriend
Messages: 462
Registered: July 2009
Senior Member
Jean-François Garreau wrote:
> * I want a more presized description -> the getDescription method of
> IContentProposal is good but I want a description like we have in
> javaDoc view with html content... (here is my problem) Despite I use <B>
> or <BR> .. etc, I have "<B>" ... show in the description area.

The popup just uses a regular SWT Text control so I doubt that this is
possible.

> * I want that a click on description focus me on this area (not close
it).

I don't think this is configurable.

I think you need to file enhancement requests.

Remy
Previous Topic:Expressions View
Next Topic:Avaiability of org.eclipse.update.*
Goto Forum:
  


Current Time: Tue May 07 12:40:41 GMT 2024

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

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

Back to the top