Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Template engine can't see my pagesAfterTemplateSelectionProvide class


>>I do notice that  getCreatedPages is called, but not createAdditionalPages which the comments imply would get called first to construct them.

createAdditionalPages constructs pages from a selection which will come before the template generated wizard pages and after the template selection from project wizard.
This API is provided so that the templates can be driven by any custom defined wizard, which might want that behaviour. CDT New project model wizard doesn't require this behaviour, so the "createAdditionalPages" never gets called.

>>I can handle it either way. Is that right?
getCreatedPages will provide the additional pages, which will come after the template generated pages. So you should implement only getCreatedPages to get the desired behaviour.


Regards,
-Bala

PS: When I first implemented Template Engine as a stand alone plugin, I designed it to be very generic, so that any wizard can drive it. Doug and community wanted it to be part of cdt core and cdt core ui, so we provided integration of templates into new project model in 4.0. So we just limited to adding new wizard pages after the template generated pages.

The abstract wizard 'TemplateChoiceWizard.java' is an example, which can be used to generated your custom defined wizard. That has got few ambitious things such as add extra wizard pages before and after template generated pages, create pages between the template selection and template generated pages etc., Most of the base code for this additional functionality is there, which require some additional work and testing to make it fully working, and also all this stuff needs to be documented. If there is interest in community to drive template engine from custom wizard (non-CDT new project model wizard), then we can discuss it under a bugzilla. Depending on the interest and timelines, it can be made into a new release.




Beth Tibbitts <tibbitts@xxxxxxxxxx>
Sent by: cdt-dev-bounces@xxxxxxxxxxx

28/09/2007 18:20

Please respond to
"CDT General developers list." <cdt-dev@xxxxxxxxxxx>

To
"CDT General developers list." <cdt-dev@xxxxxxxxxxx>
cc
Subject
Re: [cdt-dev] Template engine can't see my        pagesAfterTemplateSelectionProvide class





Great! That works; my class is now getting called.  will have to actually
put in a page there now. :)
I do notice that  getCreatedPages is called, but not createAdditionalPages
which the comments imply would get called first to construct them.
I can handle it either way.
Is that right?


...Beth

Beth Tibbitts  (859) 243-4981  (TL 545-4981)
High Productivity Tools / Parallel Tools  http://eclipse.org/ptp
IBM T.J.Watson Research Center
Mailing Address:  IBM Corp., 455 Park Place, Lexington, KY 40511


                                                                         
            bala.torati@symbi                                            
            an.com                                                        
            Sent by:                                                   To
            cdt-dev-bounces@e         "CDT General developers list."      
            clipse.org                <cdt-dev@xxxxxxxxxxx>              
                                                                       cc
                                                                         
            09/28/2007 12:44                                      Subject
            PM                        Re: [cdt-dev] Template engine can't
                                      see my                              
                                      pagesAfterTemplateSelectionProvide  
            Please respond to         class                              
              "CDT General                                                
            developers list."                                            
            <cdt-dev@eclipse.                                            
                  org>                                                    
                                                                         
                                                                         





Hi Beth,

I have attached a fix for this problem, not using the reflection API
directly. Originally it was implemented in the "Eclipse way" to create the
executable class using ExtensionRegistry, when I implemented it as a
standalone plugin. But during the integration of TE into new project model,
and the seperation of core and ui parts of the TE resulted in calling the
Reflection API directly. I fixed this problem now with the following patch.
Did you open a defect for this issue? If not, please ask a committer to
apply this patch, if you found it's ok.



Regards,
-Bala


                                                                         
Beth Tibbitts                                                            
<tibbitts@xxxxxxxxxx>                                                    
Sent by:                                                               To
cdt-dev-bounces@xxxxxxxxxxx          cdt-dev@xxxxxxxxxxx                  
                                                                       cc
                                                                         
28/09/2007 12:30                                                  Subject
                                     [cdt-dev] Template engine can't see  
                                     my                                  
     Please respond to               pagesAfterTemplateSelectionProvide  
  "CDT General developers            class                                
           list."                                                        
   <cdt-dev@xxxxxxxxxxx>                                                  
                                                                         
                                                                         
                                                                         
                                                                         
                                                                         






I'm getting a ClassNotFoundException when the template engine tries to load
my  pagesAfterTemplateSelectionProvider class.
The class is indeed there.

java.lang.ClassNotFoundException:
org.eclipse.ptp.pldt.wizards.wizardPages.MPIPageProvider
    ....
    at org.eclipse.cdt.ui.templateengine.Template.getExtraCreatedPages(
Template.java:147)

<template
          filterPattern=" "
          id="org.eclipse.ptp.pldt.projects.MPIhelloWorldCProject"
          location="templates/MPIhelloWorldCproject/template.xml"
          pagesAfterTemplateSelectionProvider=
"org.eclipse.ptp.pldt.wizards.wizardPages.MPIPageProvider"
          projectType=."org.eclipse.cdt.build.core.buildArtefactType.exe"
>
    </template>

in Template.java it's using Class.forName instead of the eclipse class
loader

//e.g.
pagesProvider="org.eclipse.ptp.pldt.wizards.wizardPages.MPIPageProvider";
Class clazz = Class.forName(pagesProvider);
instead of something like.

ExtensionRegistry.createExecutableExtension()




Have you been able to get this to work using a class in another project
from template engine, as the pagesAfterTemplateSelectionProvider class?

Are these changes what you were talking about that will be coming in 4.0.2?



...Beth

Beth Tibbitts  (859) 243-4981  (TL 545-4981)
High Productivity Tools / Parallel Tools  http://eclipse.org/ptp
IBM T.J.Watson Research Center
Mailing Address:  IBM Corp., 455 Park Place, Lexington, KY 40511

_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev



Taking our world with us...
Make sure you visit the Symbian Smartphone Show, 16-17 October 2007, Excel,
London
smartphoneshow.com


**********************************************************************
Symbian Software Ltd is a company registered in England and Wales with
registered number 4190020 and registered office at 2-6 Boundary Row,
Southwark, London, SE1 8HP, UK. This message is intended only for use by
the named addressee and may contain privileged and/or confidential
information. If you are not the named addressee you should not disseminate,
copy or take any action in reliance on it. If you have received this
message in error please notify postmaster@xxxxxxxxxxx and delete the
message and any attachments accompanying it immediately. Neither Symbian
nor any of its Affiliates accepts liability for any corruption,
interception, amendment, tampering or viruses occurring to this message in
transit or for any message sent by its employees which is not in compliance
with Symbian corporate policy.
**********************************************************************(See
attached file: fix_template_extrapages.txt.zip)
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev


[attachment "fix_template_extrapages.txt.zip" deleted by Bala Torati/UK/Symbian] _______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev


Back to the top