# This patch file was generated by NetBeans IDE
# Following Index: paths are relative to: /doma/jarda/netbeans-src/openide/dialogs
# This patch can be applied using context Tools: Patch action on respective folder.
# It uses platform neutral UTF-8 encoding and \n newlines.
# Above lines and this line are ignored by the patching process.
Index: apichanges.xml
*** /doma/jarda/netbeans-src/openide/dialogs/apichanges.xml Base (1.13)
--- /doma/jarda/netbeans-src/openide/dialogs/apichanges.xml Locally Modified (Based On 1.13)
***************
*** 23,28 ****
--- 23,42 ----
Dialogs API
+
+
+ New WizardDescriptor
constructor.
+
+
+
+
+
+ New WizardDescriptor
constructor for subclasses.
+ It allows to eliminate unchecked warnings.
+
+
+
+
Method notifyLater improved to work before main window is opened
Index: src/org/openide/WizardDescriptor.java
*** /doma/jarda/netbeans-src/openide/dialogs/src/org/openide/WizardDescriptor.java Base (1.46)
--- /doma/jarda/netbeans-src/openide/dialogs/src/org/openide/WizardDescriptor.java Locally Modified (Based On 1.46)
***************
*** 338,343 ****
--- 338,354 ----
this(new SettingsAndIterator(panels, settings));
}
+ /** Constructor for subclasses. The expected use is to call this
+ * constructor and then call {@link #setPanelsAndSettings} to provide
+ * the right iterator, panels and data the wizard should use. This
+ * allows to eliminate unchecked warnings as described in
+ * issue 102261.
+ * @since 7.4
+ */
+ protected WizardDescriptor() {
+ this(SettingsAndIterator.empty());
+ }
+
private WizardDescriptor(SettingsAndIterator data) {
super("", "", true, DEFAULT_OPTION, null, CLOSE_PREVENTER); // NOI18N
***************
*** 2721,2726 ****
--- 2732,2740 ----
public static SettingsAndIterator create(Iterator iterator) {
return new SettingsAndIterator(iterator, null, true);
}
+ public static SettingsAndIterator empty() {
+ return new SettingsAndIterator(new EmptyPanel(), (Void)null);
+ }
public Iterator getIterator(WizardDescriptor caller) {
return panels;
***************
*** 2736,2742 ****
--- 2750,2805 ----
return s;
}
}
+
+ private static final class EmptyPanel implements Panel, Iterator {
+ public Component getComponent() {
+ return new JPanel();
}
+
+ public HelpCtx getHelp() {
+ return HelpCtx.DEFAULT_HELP;
+ }
+
+ public void readSettings(Void settings) {
+ }
+
+ public void storeSettings(Void settings) {
+ }
+
+ public boolean isValid() {
+ return true;
+ }
+
+ public void addChangeListener(ChangeListener l) {
+ }
+
+ public void removeChangeListener(ChangeListener l) {
+ }
+
+ public Panel current() {
+ return this;
+ }
+
+ public String name() {
+ return ""; // NORTH
+ }
+
+ public boolean hasNext() {
+ return false;
+ }
+
+ public boolean hasPrevious() {
+ return false;
+ }
+
+ public void nextPanel() {
+ }
+
+ public void previousPanel() {
+ }
+ } // end of EmptyPanel
+ }
Index: manifest.mf
*** /doma/jarda/netbeans-src/openide/dialogs/manifest.mf Base (1.11)
--- /doma/jarda/netbeans-src/openide/dialogs/manifest.mf Locally Modified (Based On 1.11)
***************
*** 1,5 ****
Manifest-Version: 1.0
OpenIDE-Module: org.openide.dialogs
! OpenIDE-Module-Specification-Version: 7.3
OpenIDE-Module-Localizing-Bundle: org/openide/Bundle.properties
--- 1,5 ----
Manifest-Version: 1.0
OpenIDE-Module: org.openide.dialogs
! OpenIDE-Module-Specification-Version: 7.4
OpenIDE-Module-Localizing-Bundle: org/openide/Bundle.properties
Index: test/unit/src/org/openide/WizardSetDataAndIteratorTest.java
*** /doma/jarda/netbeans-src/openide/dialogs/test/unit/src/org/openide/WizardSetDataAndIteratorTest.java No Base Revision
--- /doma/jarda/netbeans-src/openide/dialogs/test/unit/src/org/openide/WizardSetDataAndIteratorTest.java Locally New
***************
*** 1,0 ****
--- 1,114 ----
+ /*
+ * The contents of this file are subject to the terms of the Common Development
+ * and Distribution License (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
+ * or http://www.netbeans.org/cddl.txt.
+ *
+ * When distributing Covered Code, include this CDDL Header Notice in each file
+ * and include the License file at http://www.netbeans.org/cddl.txt.
+ * If applicable, add the following below the CDDL Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Portions Copyrighted 2007 Sun Microsystems, Inc.
+ */
+ package org.openide;
+
+ import java.awt.Component;
+ import javax.swing.JPanel;
+ import javax.swing.event.ChangeListener;
+ import org.netbeans.junit.NbTestCase;
+ import org.openide.WizardDescriptor.Panel;
+ import org.openide.util.HelpCtx;
+
+ /**
+ *
+ * @author Jaroslav Tulach
+ */
+ public class WizardSetDataAndIteratorTest extends NbTestCase {
+
+ public WizardSetDataAndIteratorTest(String s) {
+ super(s);
+ }
+
+
+ public void testSetDataAndIterator() throws Exception {
+ MyWizard w = new MyWizard();
+ assertTrue("Finish enabled", w.isFinishEnabled());
+ assertEquals("Right Settings passed", w, MyPanel.set);
+ }
+ private static class MyWizard extends WizardDescriptor {
+ public MyWizard() {
+ super();
+ setPanelsAndSettings(new MyIter(), this);
+ }
+ }
+
+ private static class MyIter implements WizardDescriptor.Iterator {
+ private MyPanel myPanel = new MyPanel();
+
+ public Panel current() {
+ return myPanel;
+ }
+
+ public String name() {
+ return "OneName";
+ }
+
+ public boolean hasNext() {
+ return false;
+ }
+
+ public boolean hasPrevious() {
+ return false;
+ }
+
+ public void nextPanel() {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public void previousPanel() {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public void addChangeListener(ChangeListener l) {
+ }
+
+ public void removeChangeListener(ChangeListener l) {
+ }
+ }
+
+ private static class MyPanel implements WizardDescriptor.Panel {
+ private static MyWizard set;
+
+ private JPanel cmp = new JPanel();
+
+ public Component getComponent() {
+ return cmp;
+ }
+
+ public HelpCtx getHelp() {
+ return HelpCtx.DEFAULT_HELP;
+ }
+
+ public void readSettings(org.openide.WizardSetDataAndIteratorTest.MyWizard settings) {
+ assertNull("Not yet set", set);
+ set = settings;
+ }
+
+ public void storeSettings(org.openide.WizardSetDataAndIteratorTest.MyWizard settings) {
+ }
+
+ public boolean isValid() {
+ return true;
+ }
+
+ public void addChangeListener(ChangeListener l) {
+ }
+
+ public void removeChangeListener(ChangeListener l) {
+ }
+ }
+ }