Problem with BasicNewProjectResourceWizard [message #325851] |
Thu, 28 February 2008 17:36  |
Eclipse User |
|
|
|
Originally posted by: eclipse-news.rizzoweb.com
I'm trying to extend BasicNewProjectResourceWizard to create customized
projects. I need to add extra validation against the entered project name.
WizardNewProjectCreationPage has the validatePage() method which I could
override in a subclass, but the problem is that
BasicNewProjectResourceWizard assumes its mainPage instance variable
will be set in createNewProject(). If my wizard overrides addPages() to
use my subclass of WizardNewProjectCreationPage then
BasicNewProjectResourceWizard's mainPage is never set, resulting in NPE
in createNewProject().
I tried to hook a modify listener to the Text on the
WizardNewProjectCreationPage but that, too, is inaccessible.
I want to extend BasicNewProjectResourceWizard because of the large
amount of logic and code embedded in it (especially in
createNewProject() which, sadly, is private).
So far, I can not find any workaround to be able to just add some extra
validation around the name. Any ideas?
Aside from work-around ideas, should I enter a bug report about the poor
re-usability of these classes?
Eric
|
|
|
|
Re: Problem with BasicNewProjectResourceWizard [message #332196 is a reply to message #332194] |
Thu, 09 October 2008 07:34  |
Eclipse User |
|
|
|
Guys,
I don't see anything short of pawing through the composite structure to
find the entry field, which wouldn't exactly be API safe for doing
this. It seems to me there though to be a protected method that creates
the main page so you can create a derived main page. I'd open a
bugzilla with a patch for the changes I wanted to see.
Lukas Zapletal wrote:
> Hi Eric,
>
> I am currrently facing the very same problem. I would like to implement a similar Wizard for creating a new project as in BasicNewProjectResourceWizard but I need to customize the new project (adding some natures).
>
> How did you solve this poor design problem?
>
|
|
|
Powered by
FUDForum. Page generated in 0.06888 seconds