Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Open th JavaProjectWizard out of an other Wizard
Open th JavaProjectWizard out of an other Wizard [message #251404] Thu, 14 February 2008 04:49 Go to next message
Eclipse UserFriend
Originally posted by: dennis.dumke.novastor.com

Hello everybody,
I try to open the JavaProjectWizard out of my own wizard. But always if I call the performFinish method from the JavaProjectWizard i get an exception and the method exit without a value. Could someone help me?

My trying:
In try to wrap the JavaProjectWizard and init it in addPages(). And for using the JavaPrjectWizard I get the pointer from the first and second JavaProjectWizard page and add them into my wizard. After all (when the user calls finish by the JavaProjectWizard) I call the performFinish method form the javaProjectWizard. The project is created fine but the wizard doesn’t end .

public class QuickJavaProjectWizard extends Wizard implements INewWizard {



protected JavaProjectWizardFirstPage javafirstpage;
private JavaProjectWizardSecondPage javasecondpage;
private JavaProjectWizard javawizard;


@Override
public boolean performFinish() {
// TODO Auto-generated method stub
if(getContainer().getCurrentPage() != this.mainpage){
boolean tmp = this.javawizard.performFinish();
return tmp;
}
if(getContainer().getCurrentPage().equals(this.mainpage)){
JavaProjectUtils utils = new JavaProjectUtils();
utils.createProject(this.model.projectname, this.model.getWorkspace());
return true;
}
return false;
}



@Override
public void addPages() {
this.mainpage = new QuickJavaProjectWizardMainPage("SelectionPage");
this.mainpage.setTitle("Quick Java Project Wizard");
this.mainpage.setDescription("Wizard for fast Java Project creation");
addPage(this.mainpage);
this.javawizard = new JavaProjectWizard();
this.javawizard.addPages();
IWizardPage[] javapages = this.javawizard.getPages();
this.javafirstpage = (JavaProjectWizardFirstPage)javapages[0];
this.javasecondpage = (JavaProjectWizardSecondPage)javapages[1];
addPage(this.javafirstpage);
addPage(this.javasecondpage);
}

}

--
Dennis Dumke <dennis.dumke@novastor.com>
Re: Open th JavaProjectWizard out of an other Wizard [message #251625 is a reply to message #251404] Mon, 25 February 2008 06:00 Go to previous message
Eclipse UserFriend
Note that all these clases are internal. Since 3.4
NewJavaProjectWizardPageOne and NewJavaProjectWizardPageTwo are public
and it should be simple to recreate the new Java project wizard. There's
also an example in org.eclipse.jdt.ui.tests/examples

If not, file a bug report.

Martin

Dennis Dumke wrote:
> Hello everybody,
> I try to open the JavaProjectWizard out of my own wizard. But always if I call the performFinish method from the JavaProjectWizard i get an exception and the method exit without a value. Could someone help me?
>
> My trying:
> In try to wrap the JavaProjectWizard and init it in addPages(). And for using the JavaPrjectWizard I get the pointer from the first and second JavaProjectWizard page and add them into my wizard. After all (when the user calls finish by the JavaProjectWizard) I call the performFinish method form the javaProjectWizard. The project is created fine but the wizard doesn’t end .
>
> public class QuickJavaProjectWizard extends Wizard implements INewWizard {
>
> …
>
> protected JavaProjectWizardFirstPage javafirstpage;
> private JavaProjectWizardSecondPage javasecondpage;
> private JavaProjectWizard javawizard;
> …
>
> @Override
> public boolean performFinish() {
> // TODO Auto-generated method stub
> if(getContainer().getCurrentPage() != this.mainpage){
> boolean tmp = this.javawizard.performFinish();
> return tmp;
> }
> if(getContainer().getCurrentPage().equals(this.mainpage)){
> JavaProjectUtils utils = new JavaProjectUtils();
> utils.createProject(this.model.projectname, this.model.getWorkspace());
> return true;
> }
> return false;
> }
>
> …
>
> @Override
> public void addPages() {
> this.mainpage = new QuickJavaProjectWizardMainPage("SelectionPage");
> this.mainpage.setTitle("Quick Java Project Wizard");
> this.mainpage.setDescription("Wizard for fast Java Project creation");
> addPage(this.mainpage);
> this.javawizard = new JavaProjectWizard();
> this.javawizard.addPages();
> IWizardPage[] javapages = this.javawizard.getPages();
> this.javafirstpage = (JavaProjectWizardFirstPage)javapages[0];
> this.javasecondpage = (JavaProjectWizardSecondPage)javapages[1];
> addPage(this.javafirstpage);
> addPage(this.javasecondpage);
> }
> …
> }
>
Previous Topic:How to translate a java stack trace into an other language stack trace ?
Next Topic:[refactoring] questions before implementing my own refactor
Goto Forum:
  


Current Time: Wed Apr 23 11:45:18 EDT 2025

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

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

Back to the top