Re: Project Template Wizards

Vitezslav Stejskal <[email protected]> Fri, 15 Aug 2003 15:01:22 +0200
Newsgroups gmane.comp.java.netbeans.modules.projects.devel
Message-ID <[email protected]>
Hi Joe,

Joe Warzecha wrote:

>I have some questions regarding project template wizards.
>
>I created a nature that extends the java nature. I created
>a wizard for creating this project and expected the java
>"Specify Java Package Roots" panel to get displayed, but
>it didn't. It appears it does not because there is no
>'templateWizardIterator' defined for the java nature. 
>I checked the projects.netbeans.org website but cannot
>figure out how to specify that I want the java project
>iterator (the one that will display the "Specify Java
>Package Roots") to get used before my iterator. How do
>I do this?
>  
>
I am sorry, but this is not supported at the moment. We used to support 
iterators on natures, but we dropped it, because caused more harm then 
good. Usually people wanted to write their own wizard for their type of 
project and didn't want to get panels specified on the natures their 
project depends on. IMO it's your case as well, you don't want to get 
whole iterator of java nature, but just the 'Specify Java Package Roots' 
panel. Specifying wizards on natures was basicall get all or nothing 
scenario and people tend to choose nothing in this case and reimplement 
the common parts again. I know this is not ideal, but I don't have 
better suggestion now.

>Additionally, on the first wizard panel (the one where
>the user specifies the name and location of the project),
>the Finish button is enabled. I don't want it enabled.
>How can I disable it?
>  
>
Eh, unfortunately you can't. At least until we will have new Wizards API 
from core team. The problem here is that panels can't dynamically change 
the enabled/disabled state of buttons - the Finish button is enabled 
when the panel is instanceof WizardDescriptor.FinishPanel :-(. Anyway we 
would need to extend contract of WizardDescriptor.Iterator and allow it 
to say that it contains some mandatory panels which must be shown.

-vita

P.S.: Also ccing Jirka Rechtacek who works on Wizards API.