Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Custom Wizard Page Back Button Not Functional(Plugin Development, Custom Wizard)
Custom Wizard Page Back Button Not Functional [message #542738] Fri, 25 June 2010 18:35 Go to next message
David Hober is currently offline David HoberFriend
Messages: 6
Registered: June 2010
Junior Member
Greetings all,

I am working on developing a custom plugin for an organization. Part of the process involves a custom Wizard page.

Here's what I am currently experiencing:
The user goes to create a new project. They select the project type from the project category, and a new project wizard displays. If the user wishes, they can click the "Back" button and select a different project type.

However, clicking the "Back" button does take the user back to the Project selection page, but there is longer a list of project types to select from!

Testing this further, I quickly made a copy of the WizardNewProjectCreationPage class, used my copy as the wizard page to add to my wizard, and sure enough the back button works. I went through and started commenting code out left and right, and the back button still functioned as expected.

My custom WizardPage does extend WizardPage. Everything else is looking great except for this one detail.

At the very least, can someone point me in the direction of which class(es) are responsible for adding this "Back" button to the wizard page, as well as linking this button to the New Project Selection Wizard page?

Thanks :c)
Re: Custom Wizard Page Back Button Not Functional [message #542754 is a reply to message #542738] Fri, 25 June 2010 20:38 Go to previous messageGo to next message
David Hober is currently offline David HoberFriend
Messages: 6
Registered: June 2010
Junior Member
To further aid anyone who feels so kind to help...

Here is some relevant code from my plugin project. The classes are very bare-bones, but they work. Again, I'm able to select my custom project from the New Selection wizard, and I get to my custom wizard (displaying my custom wizard page). However, clicking the back button will take me back to the New Selection wizard page, but no project types are listed.

Excerpt from plugin.xml:

<extension
point="org.eclipse.ui.newWizards">
<category
name="Organization Jobs"
id="Organization">
</category>
<wizard name=" Job"
category="Organization Jobs"
canFinishEarly="false"
class="NewWizard"
id="NewWizard"
project="true">
</wizard>
</extension>


My NewWizard class:

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExecutableExtension;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.ui.INewWizard;
import org.eclipse.ui.IWorkbench;

public class NewWizard extends Wizard
implements INewWizard, IExecutableExtension
{
@Override
public boolean performFinish() {
return false;
}

@Override
public void init(IWorkbench workbench,
IStructuredSelection selection)
{
}

public void addPages()
{
addPage(new NewWizardPage("Test"));
}

@Override
public void setInitializationData(IConfigurationElement
config, String propertyName, Object data)
throws CoreException
{
}

}


My NewWizardPage class:

import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.widgets.Composite;

public class NewWizardPage extends WizardPage
{

protected NewRRDonnelleySpotJobWizardPage2(String pageName) {
super(pageName);
}

@Override
public void createControl(Composite parent) {
setControl(parent);
}

}


Re: Custom Wizard Page Back Button Not Functional [message #543093 is a reply to message #542754] Mon, 28 June 2010 11:38 Go to previous messageGo to next message
Prakash G.R. is currently offline Prakash G.R.Friend
Messages: 621
Registered: July 2009
Senior Member
On 26/06/10 2:08 AM, David Hober wrote:
> My NewWizardPage class:
>
> import org.eclipse.jface.wizard.WizardPage;
> import org.eclipse.swt.widgets.Composite;
>
> public class NewWizardPage extends WizardPage {
>
> @Override
> public void createControl(Composite parent) {
> setControl(parent);
> }

You shouldn't be passing the parent to setControl(). You should be
passing your own control there. Try creating a label or at least an
empty composite and then use it in setControl.

HTH

--
- Prakash
Platform UI Team, IBM

www.eclipse-tips.com
Re: Custom Wizard Page Back Button Not Functional [message #543108 is a reply to message #543093] Mon, 28 June 2010 12:27 Go to previous messageGo to next message
David Hober is currently offline David HoberFriend
Messages: 6
Registered: June 2010
Junior Member
Prakash,

Thanks! I suspected it was something minor :c)
Re: Custom Wizard Page Back Button Not Functional [message #606188 is a reply to message #542754] Mon, 28 June 2010 11:38 Go to previous messageGo to next message
Prakash G.R. is currently offline Prakash G.R.Friend
Messages: 621
Registered: July 2009
Senior Member
On 26/06/10 2:08 AM, David Hober wrote:
> My NewWizardPage class:
>
> import org.eclipse.jface.wizard.WizardPage;
> import org.eclipse.swt.widgets.Composite;
>
> public class NewWizardPage extends WizardPage {
>
> @Override
> public void createControl(Composite parent) {
> setControl(parent);
> }

You shouldn't be passing the parent to setControl(). You should be
passing your own control there. Try creating a label or at least an
empty composite and then use it in setControl.

HTH

--
- Prakash
Platform UI Team, IBM

www.eclipse-tips.com
Re: Custom Wizard Page Back Button Not Functional [message #606193 is a reply to message #543093] Mon, 28 June 2010 12:27 Go to previous message
David Hober is currently offline David HoberFriend
Messages: 6
Registered: June 2010
Junior Member
Prakash,

Thanks! I suspected it was something minor :c)
Previous Topic:Only show menu-contribution in selected view?
Next Topic:Problem launching Eclipse product
Goto Forum:
  


Current Time: Tue Apr 16 04:25:48 GMT 2024

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

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

Back to the top