Author: vyemialyanchyk
Date: 2009-06-25 07:39:30 -0400 (Thu, 25 Jun 2009)
New Revision: 16201
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingFileWizard.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4423 - fixed
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingFileWizard.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingFileWizard.java 2009-06-25
09:46:27 UTC (rev 16200)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingFileWizard.java 2009-06-25
11:39:30 UTC (rev 16201)
@@ -37,6 +37,7 @@
import org.eclipse.jface.dialogs.PageChangingEvent;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.IWizardContainer;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.ui.INewWizard;
@@ -55,6 +56,7 @@
* @author Dmitry Geraskov
*
*/
+@SuppressWarnings("restriction")
public class NewHibernateMappingFileWizard extends Wizard implements INewWizard,
IPageChangingListener{
/**
@@ -85,12 +87,18 @@
addPage(page1);
page2 = new NewHibernateMappingFilePage();
addPage(page2);
+ }
+
+ @Override
+ public void setContainer(IWizardContainer wizardContainer) {
if (getContainer() instanceof WizardDialog) {
+ ((WizardDialog) getContainer()).removePageChangingListener(this);
+ }
+ super.setContainer(wizardContainer);
+ if (getContainer() instanceof WizardDialog) {
((WizardDialog) getContainer()).addPageChangingListener(this);
- } else {
- throw new
IllegalArgumentException(HibernateConsoleMessages.NewHibernateMappingFileWizard_error);
}
- }
+ }
public void handlePageChanging(PageChangingEvent event) {
if (event.getTargetPage() == page2){