Author: dgeraskov
Date: 2009-12-08 05:04:19 -0500 (Tue, 08 Dec 2009)
New Revision: 19099
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingElementsSelectionPage2.java
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-5403
Finish button fix.
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingElementsSelectionPage2.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingElementsSelectionPage2.java 2009-12-08
08:25:36 UTC (rev 19098)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingElementsSelectionPage2.java 2009-12-08
10:04:19 UTC (rev 19099)
@@ -15,6 +15,7 @@
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.TableItem;
import org.hibernate.eclipse.jdt.ui.internal.JdtUiMessages;
@@ -25,7 +26,7 @@
*/
public class NewHibernateMappingElementsSelectionPage2 extends WizardPage {
- AddRemoveTableComposite addRemoveTableComposite;
+ private AddRemoveTableComposite addRemoveTableComposite;
private IStructuredSelection selection;
@@ -36,7 +37,13 @@
}
public void createControl(Composite parent) {
- addRemoveTableComposite = new AddRemoveTableComposite(parent, SWT.NONE);
+ addRemoveTableComposite = new AddRemoveTableComposite(parent, SWT.NONE){
+ @Override
+ protected void handleButtonPressed(Button button) {
+ super.handleButtonPressed(button);
+ itemsChanged();
+ }
+ };
addRemoveTableComposite.getTableViewer().setInput(selection.toArray());
setControl(addRemoveTableComposite);
}
@@ -49,5 +56,9 @@
}
return new StructuredSelection(data);
}
+
+ protected void itemsChanged(){
+ getContainer().updateButtons();
+ }
}
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-12-08
08:25:36 UTC (rev 19098)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingFileWizard.java 2009-12-08
10:04:19 UTC (rev 19099)
@@ -165,7 +165,7 @@
for (int k = 0; k < rootChildren.length; k++) {
if (rootChildren[k] instanceof IParent &&
((IParent)rootChildren[k]).hasChildren()){
filteredElements.add(rootChildren[k]);
- }
+ }
}
}
}
@@ -428,4 +428,9 @@
}
}
}
+
+ @Override
+ public boolean canFinish() {
+ return !page0.getSelection().isEmpty() || cPage.isPageComplete();
+ }
}