Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Custom Templates(How access to my custom templates?)
Custom Templates [message #1745393] Mon, 10 October 2016 07:36
Yves LEDUC is currently offline Yves LEDUCFriend
Messages: 56
Registered: May 2015
In the code of my application I want to access the templates created in Algorithmic category preferences of my application (see pictures attachedindex.php/fa/27333/0/).
For this I begin by accessing the templates category Java.Le code:

val = JavaPlugin templates. ^ default.templateStore.templates
val = JavaPlugin template. default.templateStore.findTemplate ^ ( "elseif")

over these lines to check the content of templates and template:

// Display the names of all templates
for (t: 0 .. <templates.length)
System.out.println ( "Template name:" + templates.get (t) .name)
// Display the name of the desired template and code model
System.out.println ( "\ nTemplate \ nname" + + "\ npattern:" + template.pattern)

which gives the following output:

So it works the way I want. It remains for me to do the same for my Algorithmic templates.
To do the same for Algorihtmic in Java instead of the previous paragraph I create the code:

templates = AlgpActivator. ^ default.templateStore.templates
template = AlgpActivator. ^default.templateStore.findTemplate ( "MyTemplate")

But templateStore does not exist for AlgpActivator and accordingly the error below is displayed:

The method or field templateStore is undefined for the kind AlgpActivator.

How to overcome this defect. How to access the templates Algorihtmic category of my application.
Previous Topic:Switching preferences when switching perspective?
Next Topic:CommonNavigator does not refresh when ViewerFilter is present
Goto Forum:

Current Time: Wed Nov 14 13:57:15 GMT 2018

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

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

Back to the top