Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » hard to extend templates view
hard to extend templates view [message #500825] Sun, 29 November 2009 11:57 Go to next message
Piotr Maj is currently offline Piotr Maj
Messages: 19
Registered: July 2009
Location: Warsaw, Poland
Junior Member

Hi,

I'm woking on plugin which makes it easy to share code templates via
public templates repository. To make long story short please take a look
at 1.5 minute screencast demonstrating what I mean:

http://jcake.com/screencasts/petr-demo/petr-demo-final.mov
Update site for 3.5.0+: http://jcake.com/petr

Plugin works but there is one problem with it. I've added two popup menu
actions to Templates View but I had to use Java reflection to get references
to template store (for import command) and tree viewer (for getting selected
items).

http://github.com/veryangryant/PETR/blob/master/com.jcake.ec lipse.petr/src/com/jcake/eclipse/petr/internal/handlers/Expo rtToRemoteRepositoryHandler.java#getTemplatePageViewer
http://github.com/veryangryant/PETR/blob/master/com.jcake.ec lipse.petr/src/com/jcake/eclipse/petr/internal/handlers/Impo rtFromPublicRepository.java#getTemplateStore

because I could not find any better way to obtain reference to Java
Template store and items currently seleted in the view.

This could be easily fixed (probably without breaking and API in any
way) by making getTemplateStore() and getSelectedTemplates() methods
from class AbstractTemplatesPage public, and the part of
AbstractTemplatesPage contract. The first is now protected, the second
is private which makes it very hard to extend this view in portable way.

The question is: is there a better way to obtain TemplateStore and list
of selected items from templates page?

best regards,
--
piotr maj
jcake software
Re: hard to extend templates view [message #500898 is a reply to message #500825] Mon, 30 November 2009 08:25 Go to previous messageGo to next message
Dani Megert is currently offline Dani Megert
Messages: 3801
Registered: July 2009
Senior Member
Piotr Maj wrote:
> Hi,
>
> I'm woking on plugin which makes it easy to share code templates via
> public templates repository. To make long story short please take a look
> at 1.5 minute screencast demonstrating what I mean:
>
> http://jcake.com/screencasts/petr-demo/petr-demo-final.mov
> Update site for 3.5.0+: http://jcake.com/petr
>
....
> The question is: is there a better way to obtain TemplateStore and list
> of selected items from templates page?
>
I suggest you file an enhancement request against JDT Text and if
possible attach a patch.

Dani
> best regards,
>
Re: hard to extend templates view [message #500910 is a reply to message #500898] Mon, 30 November 2009 09:31 Go to previous message
Piotr Maj is currently offline Piotr Maj
Messages: 19
Registered: July 2009
Location: Warsaw, Poland
Junior Member

On 2009-11-30, Daniel Megert <daniel_megert@ch.ibm.com> wrote:
>> The question is: is there a better way to obtain TemplateStore and list
>> of selected items from templates page?
>>
> I suggest you file an enhancement request against JDT Text and if
> possible attach a patch.

done: https://bugs.eclipse.org/bugs/show_bug.cgi?id=296439

--
piotr maj
jcake software
Previous Topic:How to contribute UNDO/REDO actions into properties view from active editor
Next Topic:How to log UI freezes
Goto Forum:
  


Current Time: Tue Sep 16 17:49:47 GMT 2014

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

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