Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [recommenders-dev] [DISCUSS] Solution about snipmatch's search result display module

Hi,

> So, we want to change current solution. But, do we *have to* extend JDT's content assist ? Is it the *only* solution?

maybe I confused you guys more than I helped. Let me try to sort out things that may have made a wrong impression ;)

JFace has a basic content assist framework that provides base implementations for all aspects of code completion.
This framework is extended by JDT with many features. But to be clear, I'm not advocating for using JDT's content assist completely but a very small subset of their system, namely, org.eclipse.jdt.internal.ui.text.template.contentassist.TemplateProposal and its related classes. The content assist popup etc. still needs to be written by ourselves. We may integrate the org.eclipse.jface.text.contentassist.ContentAssistant but we may not have to!

From my view point it's all not that complicated ;)

We need:
* a popup text widget that consumes user input and triggers search  (already there)
* a popup that display search results (for a given search input) in a table below with some minimal highlighting
* a class that creates TemplateProposal from SnipMatch's code snippets.
* proposal preview popup (this is what we might reuse form JDT here)

All in all, I'm speaking about, say 10 classes, just to give you a feeling of the overall complexity I expect.
 
I've unfortunately no time until Wednesday. But then I can take a look on the content assist thing.

An idea on how to continue:
Chen, can you look into how to create a JFace TableViewer popup with changing contents, i.e, a TableViewer in Shell object that get's triggered instead of snipmatch's current completion popups? It should take the code snippets data structure we already have and display the summary in it. If you progress fast you can look into http://wiki.eclipse.org/JFaceSnippets#Snippet010OwnerDraw .  OwnerDraw is needed to render the variables in the proposal's display text properly.

From this, it should actually be a small step to replace the current popup code. Adding a listener to the TableViewer to respond to selection changes, to "return pressed", and one to the window for "escape pressed" and "that's it" - in a basic version - in theory. You know that in theory there is no difference between theory and reality, right? :-)

Best wishes from Washington.




On 25.03.2012, at 00:15, Chen Cheng wrote:

If possible, we can choose re-build a fast enough, JDT content assist similar search result component, rather than re-use JDT's content assist mechanism. During my survey job, i found JDT's content assist is really not so applicable with SnipMatch's scene here. It will be so hard if we force to fit into JDT content assist, or even can not find a clear solution.

Marcel might be on his flight now, let's wait for his voices.

2012/3/25 Doug Wightman <douglasw@xxxxxxxxx>
I'm okay with any stable solution. Marcel?


On Saturday, March 24, 2012, Chen Cheng <chengchendoc@xxxxxxxxx> wrote:
> Hi all,
> Wait a minute, the current problem is:
> 1. Current display solution is not fast enough, with flicker etc
> 2. There is something wrong with the search result canvas' display place.
> So, we want to change current solution. But, do we *have to* extend JDT's content assist ? Is it the *only* solution?
> Is it OK if we can fix current problems ? OR if we can supply a solution looks *similar* with content assist, does it make sense ? 
>
> 2012/3/24 Marcel Bruch <bruch@xxxxxxxxxxxxxxxxxx>
>>
>> Are you aware how e.g.  swt templates work? Is their proposal a mechanism not okay?
>> _______________________________________________
>> recommenders-dev mailing list
>> recommenders-dev@xxxxxxxxxxx
>> http://dev.eclipse.org/mailman/listinfo/recommenders-dev
>>
>
>
>
> --
> Best Regards From Cheng Chen [chengchendoc@xxxxxxxxx]
>

_______________________________________________
recommenders-dev mailing list
recommenders-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/recommenders-dev




--
Best Regards From Cheng Chen [chengchendoc@xxxxxxxxx]
_______________________________________________
recommenders-dev mailing list
recommenders-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/recommenders-dev

Thanks,
Marcel



Back to the top