|
Re: CustomCompletionProposal [message #693642 is a reply to message #691353] |
Wed, 06 July 2011 23:37 |
|
On 7/1/2011 5:37 AM, MarcoGT wrote:
> The context is "attribute value proposals" but for some values I need to
> have a different image describing the suggestion...is it possible?
Where are you stuck doing this?
> If I do
>
> proposal = new CustomCompletionProposal(...)
>
>
> I can of course pass only one image...
Yes, you get one image to use for each proposal.
> 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.
I think you're going to have to restate this, as I'm unsure exactly what
you're asking.
--
Nitin Dahyabhai
Eclipse WTP Source Editing and JSDT
IBM Rational
_
Nitin Dahyabhai
Eclipse Web Tools Platform
|
|
|
Re: CustomCompletionProposal [message #693732 is a reply to message #693642] |
Thu, 07 July 2011 05:55 |
MarcoGT Messages: 77 Registered: May 2011 |
Member |
|
|
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 06:23] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03965 seconds