CustomCompletionProposal [message #691353] |
Fri, 01 July 2011 05:37  |
Eclipse User |
|
|
|
Hi all,
in my "extended" content assist I am using my own image to show results inside the box.
The context is "attribute value proposals" but for some values I need to have a different image describing the suggestion...is it possible?
If I do
proposal = new CustomCompletionProposal(...)
I can of course pass only one image...
To provide suggestion I fill proposal object with a for cycle cycling an array containing all my proposals.
I thought it was possible to "update" proposal object doing something proposal += proposal but of course it does not work.
How can I do?
Thanks
Marco
|
|
|
|
Re: CustomCompletionProposal [message #693732 is a reply to message #693642] |
Thu, 07 July 2011 01:55   |
Eclipse User |
|
|
|
Ok, I try to explain better.
I evaluate the context, that means in which tag I am, on which attribute and so on.
I build an XPath expression which gives me back results according to context.
These results are inserted into my CustomCompletionProposal and CustomCompletionProposal can accept one image...in for example from XPath expression I get 10 results, that means that proposals for my context, it is possible to have a different image for each proposal?
So, I have an array containing all my results, using a cycle I fill my object CustomCompletionProposal, but image is the same for each entry, is it possible to have different image for every entry?
I do something like:
for(int i = 0; i < results.length(); i ++) {
proposal = new CustomCompletionProposal("\"" + results[i] + "\"",
contentAssistRequest.getReplacementBeginPosition(),
contentAssistRequest.getReplacementLength(), results[i].length() + 1, myImage,
results[i], contextInformation, info,
XMLRelevanceConstants.R_XML_ATTRIBUTE_VALUE);
}
Array results[] is a String array containing all my results from XPath query that matches context, matchString and so on and so on.
It is similar, not equal, to what has been done for addAttributeNameProposal.
By the way, as far as I know it is not possible to change image for each result...
Hope I explained better 
Thanks
Marco
[Updated on: Thu, 07 July 2011 02:23] by Moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.08943 seconds