This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 92762
Collapse All | Expand All

(-)openide/dialogs/apichanges.xml (+16 lines)
Lines 23-28 Link Here
23
<apidef name="dialogs">Dialogs API</apidef>
23
<apidef name="dialogs">Dialogs API</apidef>
24
</apidefs>
24
</apidefs>
25
<changes>
25
<changes>
26
    <change id="generified.wizarddescriptor.panel">
27
           <api name="dialogs"/>
28
           <summary>Generified <code>WizardDescriptor.Panel</code></summary>
29
           <version major="7" minor="2"/>
30
           <date day="2" month="2" year="2007"/>
31
           <author login="jtulach"/>
32
           <compatibility addition="yes" binary="compatible" semantic="compatible" source="compatible" deprecation="no" deletion="no" modification="no"/>
33
           <description>
34
               <code>WizardDescriptor.Panel</code> and <code>WizardDescriptor.Iterator</code>
35
               has been generified to take generic type for data passed
36
               into <code>readSettings</code> and <code>storeSettings</code>
37
               objects.
38
           </description>
39
           <class package="org.openide" name="WizardDescriptor"/>
40
           <issue number="92762"/>
41
    </change>
26
    <change id="WizardDescriptor.ProgressInstantiatingIterator">
42
    <change id="WizardDescriptor.ProgressInstantiatingIterator">
27
           <api name="dialogs"/>
43
           <api name="dialogs"/>
28
           <summary>Interface <code>ProgressInstantiatingIterator</code> added</summary>
44
           <summary>Interface <code>ProgressInstantiatingIterator</code> added</summary>
(-)openide/dialogs/manifest.mf (-1 / +1 lines)
Lines 1-5 Link Here
1
Manifest-Version: 1.0
1
Manifest-Version: 1.0
2
OpenIDE-Module: org.openide.dialogs
2
OpenIDE-Module: org.openide.dialogs
3
OpenIDE-Module-Specification-Version: 7.1
3
OpenIDE-Module-Specification-Version: 7.2
4
OpenIDE-Module-Localizing-Bundle: org/openide/Bundle.properties
4
OpenIDE-Module-Localizing-Bundle: org/openide/Bundle.properties
5
5
(-)openide/dialogs/nbproject/project.properties (+2 lines)
Lines 16-21 Link Here
16
# Microsystems, Inc. All Rights Reserved.
16
# Microsystems, Inc. All Rights Reserved.
17
17
18
is.autoload=true
18
is.autoload=true
19
javac.compilerargs=-Xlint:unchecked
20
javac.source=1.5
19
#javadoc.main.page=org/openide/doc-files/api.html
21
#javadoc.main.page=org/openide/doc-files/api.html
20
javadoc.arch=${basedir}/../arch/arch-openide-dialogs.xml
22
javadoc.arch=${basedir}/../arch/arch-openide-dialogs.xml
21
javadoc.apichanges=${basedir}/apichanges.xml
23
javadoc.apichanges=${basedir}/apichanges.xml
(-)openide/dialogs/src/org/openide/DialogDisplayer.java (-1 / +1 lines)
Lines 286-292 Link Here
286
            }
286
            }
287
287
288
            public void updateOptions() {
288
            public void updateOptions() {
289
                Set addedOptions = new HashSet(5);
289
                Set<Object> addedOptions = new HashSet<Object>(5);
290
                Object[] options = nd.getOptions();
290
                Object[] options = nd.getOptions();
291
291
292
                if (options == null) {
292
                if (options == null) {
(-)openide/dialogs/src/org/openide/WizardDescriptor.java (-101 / +168 lines)
Lines 253-260 Link Here
253
    /** 'North' or 'South' */
253
    /** 'North' or 'South' */
254
    private String imageAlignment = "North"; // NOI18N
254
    private String imageAlignment = "North"; // NOI18N
255
255
256
    /** Iterator between panels in the wizard */
256
    /** Iterator between panels in the wizard and its settings */
257
    private Iterator panels;
257
    private SettingsAndIterator<?> data;
258
258
259
    /** Change listener that invokes method update state */
259
    /** Change listener that invokes method update state */
260
    private ChangeListener weakChangeListener;
260
    private ChangeListener weakChangeListener;
Lines 267-285 Link Here
267
    // base listener which won't be directly attached, will only wrapped by WeakListener
267
    // base listener which won't be directly attached, will only wrapped by WeakListener
268
    private Listener baseListener;
268
    private Listener baseListener;
269
269
270
    /** current panel */
271
    private Panel current;
272
273
    /** settings to be used for the panels */
274
    private Object settings;
275
276
    /** message format to create title of the document */
270
    /** message format to create title of the document */
277
    private MessageFormat titleFormat;
271
    private MessageFormat titleFormat;
278
272
279
    /** hashtable with additional settings that is usually used
273
    /** hashtable with additional settings that is usually used
280
    * by Panels to store their data
274
    * by Panels to store their data
281
    */
275
    */
282
    private Map properties;
276
    private Map<String,Object> properties;
283
    ResourceBundle bundle = NbBundle.getBundle(WizardDescriptor.class);
277
    ResourceBundle bundle = NbBundle.getBundle(WizardDescriptor.class);
284
278
285
    /** Request processor that is used for asynchronous jobs (background validation, 
279
    /** Request processor that is used for asynchronous jobs (background validation, 
Lines 320-338 Link Here
320
    * @param settings the settings to pass to panels, or <code>null</code>
314
    * @param settings the settings to pass to panels, or <code>null</code>
321
    * @see #WizardDescriptor(WizardDescriptor.Iterator, Object)
315
    * @see #WizardDescriptor(WizardDescriptor.Iterator, Object)
322
    */
316
    */
323
    public WizardDescriptor(Panel[] wizardPanels, Object settings) {
317
    public <Data> WizardDescriptor(Panel<Data>[] wizardPanels, Data settings) {
324
        this(new ArrayIterator(wizardPanels), settings);
318
        this(new SettingsAndIterator<Data>(new ArrayIterator<Data>(wizardPanels), settings));
325
    }
319
    }
326
320
    
327
    /** Create a new wizard from a fixed list of panels with settings
321
    /** Create a new wizard from a fixed list of panels with settings
328
    * defaulted to <CODE>this</CODE>.
322
    * defaulted to <CODE>this</CODE>.
329
    *
323
    *
330
    * @param wizardPanels the panels to use
324
    * @param wizardPanels the panels to use
331
    * @see #WizardDescriptor(WizardDescriptor.Iterator, Object)
325
    * @see #WizardDescriptor(WizardDescriptor.Iterator, Object)
332
    */
326
    */
333
    public WizardDescriptor(Panel[] wizardPanels) {
327
    public WizardDescriptor(Panel<WizardDescriptor>[] wizardPanels) {
334
        // passing CLOSE_PREVENTER which is treated especially
328
        this(SettingsAndIterator.create(new ArrayIterator<WizardDescriptor>(wizardPanels)));
335
        this(wizardPanels, CLOSE_PREVENTER);
336
    }
329
    }
337
330
338
    /** Create wizard for a sequence of panels, passing some settings to the panels.
331
    /** Create wizard for a sequence of panels, passing some settings to the panels.
Lines 341-369 Link Here
341
    * @see WizardDescriptor.Panel#readSettings
334
    * @see WizardDescriptor.Panel#readSettings
342
    * @see WizardDescriptor.Panel#storeSettings
335
    * @see WizardDescriptor.Panel#storeSettings
343
    */
336
    */
344
    public WizardDescriptor(Iterator panels, Object settings) {
337
    public <Data>WizardDescriptor(Iterator<Data> panels, Data settings) {
338
        this(new SettingsAndIterator<Data>(panels, settings));
339
    }
340
    
341
    private <Data> WizardDescriptor(SettingsAndIterator<Data> data) {
345
        super("", "", true, DEFAULT_OPTION, null, CLOSE_PREVENTER); // NOI18N
342
        super("", "", true, DEFAULT_OPTION, null, CLOSE_PREVENTER); // NOI18N
346
343
347
        this.settings = (settings == CLOSE_PREVENTER) ? this : settings;
344
        this.data = data;
348
345
349
        baseListener = new Listener();
346
        baseListener = new Listener();
350
347
351
        try {
348
        weakNextButtonListener = WeakListeners.create(ActionListener.class, 
352
            weakNextButtonListener = (ActionListener) WeakListeners.create(
349
                baseListener, nextButton
353
                    Class.forName("java.awt.event.ActionListener"), baseListener, nextButton
350
            ); // NOI18N
354
                ); // NOI18N
351
        weakPreviousButtonListener = WeakListeners.create(
355
            weakPreviousButtonListener = (ActionListener) WeakListeners.create(
352
                ActionListener.class, baseListener, previousButton
356
                    Class.forName("java.awt.event.ActionListener"), baseListener, previousButton
353
            ); // NOI18N
357
                ); // NOI18N
354
        weakFinishButtonListener = WeakListeners.create(
358
            weakFinishButtonListener = (ActionListener) WeakListeners.create(
355
                ActionListener.class, baseListener, finishButton
359
                    Class.forName("java.awt.event.ActionListener"), baseListener, finishButton
356
            ); // NOI18N
360
                ); // NOI18N
357
        weakCancelButtonListener = WeakListeners.create(
361
            weakCancelButtonListener = (ActionListener) WeakListeners.create(
358
                ActionListener.class, baseListener, cancelButton
362
                    Class.forName("java.awt.event.ActionListener"), baseListener, cancelButton
359
            ); // NOI18N
363
                ); // NOI18N
364
        } catch (ClassNotFoundException e) {
365
            // cannot happen, java.awt.event.ActionListener listener can always be found
366
        }
367
360
368
        nextButton.addActionListener(weakNextButtonListener);
361
        nextButton.addActionListener(weakNextButtonListener);
369
        previousButton.addActionListener(weakPreviousButtonListener);
362
        previousButton.addActionListener(weakPreviousButtonListener);
Lines 375-385 Link Here
375
        super.setOptions(new Object[] { previousButton, nextButton, finishButton, cancelButton });
368
        super.setOptions(new Object[] { previousButton, nextButton, finishButton, cancelButton });
376
        super.setClosingOptions(new Object[] { finishOption, cancelButton });
369
        super.setClosingOptions(new Object[] { finishOption, cancelButton });
377
370
378
        this.panels = panels;
379
380
        // attach the change listener to iterator
371
        // attach the change listener to iterator
381
        weakChangeListener = WeakListeners.change(baseListener, panels);
372
        weakChangeListener = WeakListeners.change(baseListener, data.getIterator(this));
382
        panels.addChangeListener(weakChangeListener);
373
        data.getIterator(this).addChangeListener(weakChangeListener);
383
374
384
        callInitialize();
375
        callInitialize();
385
    }
376
    }
Lines 389-397 Link Here
389
    *
380
    *
390
    * @param panels iterator over all {@link WizardDescriptor.Panel}s that can appear in the wizard
381
    * @param panels iterator over all {@link WizardDescriptor.Panel}s that can appear in the wizard
391
    */
382
    */
392
    public WizardDescriptor(Iterator panels) {
383
    public WizardDescriptor(Iterator<WizardDescriptor> panels) {
393
        // passing CLOSE_PREVENTER which is treated especially
384
        this(SettingsAndIterator.create(panels));
394
        this(panels, CLOSE_PREVENTER);
395
    }
385
    }
396
386
397
    /** Initializes settings.
387
    /** Initializes settings.
Lines 434-448 Link Here
434
    /** Set a different list of panels.
424
    /** Set a different list of panels.
435
    * Correctly updates the buttons.
425
    * Correctly updates the buttons.
436
    * @param panels the new list of {@link WizardDescriptor.Panel}s
426
    * @param panels the new list of {@link WizardDescriptor.Panel}s
427
    * @deprecated use setPanelsAndSettings if needed.
437
    */
428
    */
429
    @Deprecated
430
    @SuppressWarnings("unchecked")
438
    public final synchronized void setPanels(Iterator panels) {
431
    public final synchronized void setPanels(Iterator panels) {
439
        if (this.panels != null) {
432
        if (data.getIterator(this) != null) {
440
            this.panels.removeChangeListener(weakChangeListener);
433
            data.getIterator(this).removeChangeListener(weakChangeListener);
441
        }
434
        }
442
435
443
        this.panels = panels;
436
        data = data.clone(panels);
444
        weakChangeListener = WeakListeners.change(baseListener, panels);
437
        weakChangeListener = WeakListeners.change(baseListener, data.getIterator(this));
445
        panels.addChangeListener(weakChangeListener);
438
        data.getIterator(this).addChangeListener(weakChangeListener);
439
        init = false;
440
441
        updateState();
442
    }
443
444
    /** Set a different list of panels.
445
    * Correctly updates the buttons.
446
    * @param panels the new list of {@link WizardDescriptor.Panel}s
447
    * @param settings the new settings that will be passed to the panels
448
    * @since 7.2
449
    */
450
    public final synchronized <Data> void setPanelsAndSettings(Iterator<Data> panels, Data settings) {
451
        if (data.getIterator(this) != null) {
452
            data.getIterator(this).removeChangeListener(weakChangeListener);
453
        }
454
455
        data = new SettingsAndIterator<Data>(panels, settings);
456
        weakChangeListener = WeakListeners.change(baseListener, data.getIterator(this));
457
        data.getIterator(this).addChangeListener(weakChangeListener);
446
        init = false;
458
        init = false;
447
459
448
        updateState();
460
        updateState();
Lines 474-480 Link Here
474
    /** Converts some options.
486
    /** Converts some options.
475
    */
487
    */
476
    private Object[] convertOptions(Object[] options) {
488
    private Object[] convertOptions(Object[] options) {
477
        Object[] clonedOptions = (Object[]) options.clone();
489
        Object[] clonedOptions = options.clone();
478
490
479
        for (int i = clonedOptions.length - 1; i >= 0; i--) {
491
        for (int i = clonedOptions.length - 1; i >= 0; i--) {
480
            if (clonedOptions[i] == NEXT_OPTION) {
492
            if (clonedOptions[i] == NEXT_OPTION) {
Lines 576-582 Link Here
576
588
577
        synchronized (this) {
589
        synchronized (this) {
578
            if (properties == null) {
590
            if (properties == null) {
579
                properties = new HashMap(7);
591
                properties = new HashMap<String,Object>(7);
580
            }
592
            }
581
593
582
            oldValue = properties.get(name);
594
            oldValue = properties.get(name);
Lines 653-685 Link Here
653
    * </PRE></code>
665
    * </PRE></code>
654
    */
666
    */
655
    protected synchronized void updateState() {
667
    protected synchronized void updateState() {
656
        Panel p = panels.current();
668
        updateStateOpen(data);
669
    }
670
    private <A> void updateStateOpen(SettingsAndIterator<A> data) {
671
        Panel<A> p = data.getIterator(this).current();
657
672
658
        // listeners on the panel
673
        // listeners on the panel
659
        if (current != p) {
674
        if (data.current != p) {
660
            if (current != null) {
675
            if (data.current != null) {
661
                // remove
676
                // remove
662
                current.removeChangeListener(weakChangeListener);
677
                data.current.removeChangeListener(weakChangeListener);
663
                current.storeSettings(settings);
678
                data.current.storeSettings(data.getSettings(this));
664
            }
679
            }
665
680
666
            // Hack - obtain current panel again
681
            // Hack - obtain current panel again
667
            // It's here to allow dynamic change of panels in wizard
682
            // It's here to allow dynamic change of panels in wizard
668
            // (which can be done in storeSettings method)
683
            // (which can be done in storeSettings method)
669
            p = panels.current();
684
            p = data.getIterator(this).current();
670
685
671
            // add to new, detach old change listener and attach new one
686
            // add to new, detach old change listener and attach new one
672
            panels.removeChangeListener(weakChangeListener);
687
            data.getIterator(this).removeChangeListener(weakChangeListener);
673
            weakChangeListener = WeakListeners.change(baseListener, p);
688
            weakChangeListener = WeakListeners.change(baseListener, p);
674
            panels.addChangeListener(weakChangeListener);
689
            data.getIterator(this).addChangeListener(weakChangeListener);
675
            p.addChangeListener(weakChangeListener);
690
            p.addChangeListener(weakChangeListener);
676
691
677
            current = p;
692
            data.current = p;
678
            current.readSettings(settings);
693
            p.readSettings(data.getSettings(this));
679
        }
694
        }
680
695
681
        boolean next = panels.hasNext();
696
        boolean next = data.getIterator(this).hasNext();
682
        boolean prev = panels.hasPrevious();
697
        boolean prev = data.getIterator(this).hasPrevious();
683
        boolean valid = p.isValid();
698
        boolean valid = p.isValid();
684
699
685
        // AWT sensitive code
700
        // AWT sensitive code
Lines 774-780 Link Here
774
            panelName = ""; // NOI18N
789
            panelName = ""; // NOI18N
775
        }
790
        }
776
791
777
        Object[] args = { panelName, panels.name() };
792
        Object[] args = { panelName, data.getIterator(this).name() };
778
        MessageFormat mf = getTitleFormat();
793
        MessageFormat mf = getTitleFormat();
779
794
780
        if (autoWizardStyle) {
795
        if (autoWizardStyle) {
Lines 792-813 Link Here
792
    
807
    
793
    // for xtesting usage only
808
    // for xtesting usage only
794
    boolean isForwardEnabled () {
809
    boolean isForwardEnabled () {
795
        return panels.current ().isValid () && !validationRuns;
810
        return data.getIterator(this).current ().isValid () && !validationRuns;
796
    }
811
    }
797
812
798
    private void updateStateInAWT () {
813
    private void updateStateInAWT () {
799
        Panel p = panels.current ();        
814
        Panel<?> p = data.getIterator(this).current ();        
800
        boolean next = panels.hasNext ();
815
        boolean next = data.getIterator(this).hasNext ();
801
        boolean prev = panels.hasPrevious ();
816
        boolean prev = data.getIterator(this).hasPrevious ();
802
        boolean valid = p.isValid () && !validationRuns;
817
        boolean valid = p.isValid () && !validationRuns;
803
818
804
        nextButton.setEnabled (next && valid);
819
        nextButton.setEnabled (next && valid);
805
        previousButton.setEnabled (prev);
820
        previousButton.setEnabled (prev);
806
        cancelButton.setEnabled (true);
821
        cancelButton.setEnabled (true);
807
        
822
        
808
        if (current instanceof FinishablePanel) {
823
        if (data.current instanceof FinishablePanel) {
809
            // check if isFinishPanel
824
            // check if isFinishPanel
810
            if (((FinishablePanel)current).isFinishPanel ()) {
825
            if (((FinishablePanel)data.current).isFinishPanel ()) {
811
                finishButton.setEnabled (valid);
826
                finishButton.setEnabled (valid);
812
            } else {
827
            } else {
813
                // XXX What if the last panel is not FinishPanel ??? enable ?
828
                // XXX What if the last panel is not FinishPanel ??? enable ?
Lines 817-823 Link Here
817
            // original way
832
            // original way
818
            finishButton.setEnabled (
833
            finishButton.setEnabled (
819
                valid &&
834
                valid &&
820
                (!next || (current instanceof FinishPanel))
835
                (!next || (data.current instanceof FinishPanel))
821
            );
836
            );
822
        }
837
        }
823
    }
838
    }
Lines 877-883 Link Here
877
     * wizard window exceeds screen bounds after resize.
892
     * wizard window exceeds screen bounds after resize.
878
     */
893
     */
879
    private void resizeWizard(Window parentWindow, Dimension prevSize) {
894
    private void resizeWizard(Window parentWindow, Dimension prevSize) {
880
        Dimension curSize = panels.current().getComponent().getPreferredSize();
895
        Dimension curSize = data.getIterator(this).current().getComponent().getPreferredSize();
881
896
882
        // only enlarge if needed, don't shrink
897
        // only enlarge if needed, don't shrink
883
        if ((curSize.width > prevSize.width) || (curSize.height > prevSize.height)) {
898
        if ((curSize.width > prevSize.width) || (curSize.height > prevSize.height)) {
Lines 1113-1120 Link Here
1113
    /** Overrides superclass method. Adds reseting of wizard
1128
    /** Overrides superclass method. Adds reseting of wizard
1114
     * for <code>CLOSED_OPTION</code>. */
1129
     * for <code>CLOSED_OPTION</code>. */
1115
    public void setValue(Object value) {
1130
    public void setValue(Object value) {
1131
        setValueOpen(value, data);
1132
    }
1133
    
1134
    private <A> void setValueOpen(Object value, SettingsAndIterator<A> data) {
1116
        Object convertedValue = backConvertOption(value);
1135
        Object convertedValue = backConvertOption(value);
1117
1118
        // set new value w/o fire PROP_VALUE change
1136
        // set new value w/o fire PROP_VALUE change
1119
        Object oldValue = getValue();
1137
        Object oldValue = getValue();
1120
        setValueWithoutPCH(convertedValue);
1138
        setValueWithoutPCH(convertedValue);
Lines 1125-1132 Link Here
1125
        } else if (FINISH_OPTION.equals(convertedValue) || NEXT_OPTION.equals(convertedValue)) {
1143
        } else if (FINISH_OPTION.equals(convertedValue) || NEXT_OPTION.equals(convertedValue)) {
1126
            //Bugfix #25820: make sure that storeSettings
1144
            //Bugfix #25820: make sure that storeSettings
1127
            //is called before propertyChange.
1145
            //is called before propertyChange.
1128
            if (current != null) {
1146
            if (data.current != null) {
1129
                current.storeSettings(settings);
1147
                data.current.storeSettings(data.getSettings(this));
1130
            }
1148
            }
1131
        }
1149
        }
1132
1150
Lines 1136-1145 Link Here
1136
1154
1137
    /** Resets wizard when after closed/cancelled/finished the wizard dialog. */
1155
    /** Resets wizard when after closed/cancelled/finished the wizard dialog. */
1138
    private void resetWizard() {
1156
    private void resetWizard() {
1139
        if (current != null) {
1157
        resetWizardOpen(data);
1140
            current.storeSettings(settings);
1158
    }
1141
            current.removeChangeListener(weakChangeListener);
1159
    
1142
            current = null;
1160
    private <A> void resetWizardOpen(SettingsAndIterator<A> data) {
1161
        if (data.current != null) {
1162
            data.current.storeSettings(data.getSettings(this));
1163
            data.current.removeChangeListener(weakChangeListener);
1164
            data.current = null;
1143
1165
1144
            if (wizardPanel != null) {
1166
            if (wizardPanel != null) {
1145
                wizardPanel.resetPreferredSize();
1167
                wizardPanel.resetPreferredSize();
Lines 1149-1155 Link Here
1149
        callUninitialize();
1171
        callUninitialize();
1150
1172
1151
        // detach the change listener at the end of wizard
1173
        // detach the change listener at the end of wizard
1152
        panels.removeChangeListener(weakChangeListener);
1174
        data.getIterator(this).removeChangeListener(weakChangeListener);
1153
    }
1175
    }
1154
1176
1155
    private int getIntFromBundle(String key) {
1177
    private int getIntFromBundle(String key) {
Lines 1210-1216 Link Here
1210
                    }
1232
                    }
1211
1233
1212
                    // focus source of this problem
1234
                    // focus source of this problem
1213
                    final JComponent comp = (JComponent) wve.getSource();
1235
                    final JComponent comp = wve.getSource();
1214
                    if (comp != null && comp.isFocusable()) {
1236
                    if (comp != null && comp.isFocusable()) {
1215
                        comp.requestFocus();
1237
                        comp.requestFocus();
1216
                    }
1238
                    }
Lines 1239-1262 Link Here
1239
1261
1240
    // helper methods which call to InstantiatingIterator
1262
    // helper methods which call to InstantiatingIterator
1241
    private void callInitialize() {
1263
    private void callInitialize() {
1242
        assert panels != null;
1264
        assert data.getIterator(this) != null;
1243
1265
1244
        if (panels instanceof InstantiatingIterator) {
1266
        if (data.getIterator(this) instanceof InstantiatingIterator) {
1245
            ((InstantiatingIterator) panels).initialize(this);
1267
            ((InstantiatingIterator) data.getIterator(this)).initialize(this);
1246
        }
1268
        }
1247
1269
1248
        newObjects = Collections.EMPTY_SET;
1270
        newObjects = Collections.EMPTY_SET;
1249
    }
1271
    }
1250
1272
1251
    private void callUninitialize() {
1273
    private void callUninitialize() {
1252
        assert panels != null;
1274
        assert data.getIterator(this) != null;
1253
1275
1254
        if (panels instanceof InstantiatingIterator) {
1276
        if (data.getIterator(this) instanceof InstantiatingIterator) {
1255
            ((InstantiatingIterator) panels).uninitialize(this);
1277
            ((InstantiatingIterator) data.getIterator(this)).uninitialize(this);
1256
        }
1278
        }
1257
    }
1279
    }
1258
1280
1259
    private void callInstantiate() throws IOException {
1281
    private void callInstantiate() throws IOException {
1282
        callInstantiateOpen(data);
1283
    }
1284
    
1285
    private <A> void callInstantiateOpen(SettingsAndIterator<A> data) throws IOException {
1286
        Iterator<A> panels = data.getIterator(this);
1287
        
1260
        assert panels != null;
1288
        assert panels != null;
1261
        
1289
        
1262
        err.log (Level.FINE, "Is AsynchronousInstantiatingIterator? " + (panels instanceof AsynchronousInstantiatingIterator));
1290
        err.log (Level.FINE, "Is AsynchronousInstantiatingIterator? " + (panels instanceof AsynchronousInstantiatingIterator));
Lines 1283-1289 Link Here
1283
        }
1311
        }
1284
         
1312
         
1285
        // bugfix #44444, force store settings before do instantiate new objects
1313
        // bugfix #44444, force store settings before do instantiate new objects
1286
        panels.current().storeSettings(settings);
1314
        panels.current().storeSettings(data.getSettings(this));
1287
1315
1288
        if (panels instanceof InstantiatingIterator) {
1316
        if (panels instanceof InstantiatingIterator) {
1289
            showWaitCursor();
1317
            showWaitCursor();
Lines 1357-1367 Link Here
1357
    /** Iterator on the sequence of panels.
1385
    /** Iterator on the sequence of panels.
1358
    * @see WizardDescriptor.Panel
1386
    * @see WizardDescriptor.Panel
1359
    */
1387
    */
1360
    public interface Iterator {
1388
    public interface Iterator<Data> {
1361
        /** Get the current panel.
1389
        /** Get the current panel.
1362
        * @return the panel
1390
        * @return the panel
1363
        */
1391
        */
1364
        public Panel current();
1392
        public Panel<Data> current();
1365
1393
1366
        /** Get the name of the current panel.
1394
        /** Get the name of the current panel.
1367
        * @return the name
1395
        * @return the name
Lines 1410-1416 Link Here
1410
     *
1438
     *
1411
     * Please see complete guide at http://performance.netbeans.org/howto/dialogs/wizard-panels.html
1439
     * Please see complete guide at http://performance.netbeans.org/howto/dialogs/wizard-panels.html
1412
     */
1440
     */
1413
    public interface Panel {
1441
    public interface Panel<Data> {
1414
        /** Get the component displayed in this panel.
1442
        /** Get the component displayed in this panel.
1415
         *
1443
         *
1416
         * Note; method can be called from any thread, but not concurrently
1444
         * Note; method can be called from any thread, but not concurrently
Lines 1438-1444 Link Here
1438
        * @exception IllegalStateException if the the data provided
1466
        * @exception IllegalStateException if the the data provided
1439
        * by the wizard are not valid.
1467
        * by the wizard are not valid.
1440
        */
1468
        */
1441
        public void readSettings(Object settings);
1469
        public void readSettings(Data settings);
1442
1470
1443
        /** Provides the wizard panel with the opportunity to update the
1471
        /** Provides the wizard panel with the opportunity to update the
1444
        * settings with its current customized state.
1472
        * settings with its current customized state.
Lines 1453-1459 Link Here
1453
        * in fact the <code>TemplateWizard</code>.
1481
        * in fact the <code>TemplateWizard</code>.
1454
        * @param settings the object representing wizard panel state
1482
        * @param settings the object representing wizard panel state
1455
        */
1483
        */
1456
        public void storeSettings(Object settings);
1484
        public void storeSettings(Data settings);
1457
1485
1458
        /** Test whether the panel is finished and it is safe to proceed to the next one.
1486
        /** Test whether the panel is finished and it is safe to proceed to the next one.
1459
        * If the panel is valid, the "Next" (or "Finish") button will be enabled.
1487
        * If the panel is valid, the "Next" (or "Finish") button will be enabled.
Lines 1483-1496 Link Here
1483
    * implementing this interface.
1511
    * implementing this interface.
1484
    * @deprecated 4.28 Use FinishablePanel instead.
1512
    * @deprecated 4.28 Use FinishablePanel instead.
1485
    */
1513
    */
1486
    public interface FinishPanel extends Panel {
1514
    @Deprecated
1515
    public interface FinishPanel<Data> extends Panel<Data> {
1487
    }
1516
    }
1488
1517
1489
    /** A special interface for panels that need to do additional
1518
    /** A special interface for panels that need to do additional
1490
     * validation when Next or Finish button is clicked.
1519
     * validation when Next or Finish button is clicked.
1491
     * @since 4.28
1520
     * @since 4.28
1492
     */
1521
     */
1493
    public interface ValidatingPanel extends Panel {
1522
    public interface ValidatingPanel<Data> extends Panel<Data> {
1494
        /**
1523
        /**
1495
         * Is called when Next of Finish buttons are clicked and
1524
         * Is called when Next of Finish buttons are clicked and
1496
         * allows deeper check to find out that panel is in valid
1525
         * allows deeper check to find out that panel is in valid
Lines 1516-1522 Link Here
1516
     *
1545
     *
1517
     * @since 6.2 (16 May 2005)
1546
     * @since 6.2 (16 May 2005)
1518
     */
1547
     */
1519
    public interface AsynchronousValidatingPanel extends ValidatingPanel {
1548
    public interface AsynchronousValidatingPanel<Data> extends ValidatingPanel<Data> {
1520
1549
1521
        /**
1550
        /**
1522
         * Called synchronously from UI thread when Next
1551
         * Called synchronously from UI thread when Next
Lines 1540-1546 Link Here
1540
     * Finish button.
1569
     * Finish button.
1541
     * @since 4.28
1570
     * @since 4.28
1542
     */
1571
     */
1543
    public interface FinishablePanel extends Panel {
1572
    public interface FinishablePanel<Data> extends Panel<Data> {
1544
        /** Specify if this panel would enable Finish button. Finish button is
1573
        /** Specify if this panel would enable Finish button. Finish button is
1545
         * enabled if and only if isValid() returns true and isFinishPanel()
1574
         * enabled if and only if isValid() returns true and isFinishPanel()
1546
         * returns true.
1575
         * returns true.
Lines 1558-1564 Link Here
1558
     * in a template's declaration.)
1587
     * in a template's declaration.)
1559
     * @since org.openide/1 4.33
1588
     * @since org.openide/1 4.33
1560
     */
1589
     */
1561
    public interface InstantiatingIterator extends Iterator {
1590
    public interface InstantiatingIterator<Data> extends Iterator<Data> {
1562
        /** Returns set of instantiated objects. If instantiation fails then wizard remains open to enable correct values.
1591
        /** Returns set of instantiated objects. If instantiation fails then wizard remains open to enable correct values.
1563
         *
1592
         *
1564
         * @throws IOException
1593
         * @throws IOException
Lines 1587-1593 Link Here
1587
     * in a template's declaration.)
1616
     * in a template's declaration.)
1588
     * @since org.openide/1 6.5
1617
     * @since org.openide/1 6.5
1589
     */
1618
     */
1590
    public interface AsynchronousInstantiatingIterator extends InstantiatingIterator {
1619
    public interface AsynchronousInstantiatingIterator<Data> extends InstantiatingIterator<Data> {
1591
1620
1592
        /**
1621
        /**
1593
         * Is called in separate thread when the Finish button
1622
         * Is called in separate thread when the Finish button
Lines 1609-1615 Link Here
1609
     * in a template's declaration.)
1638
     * in a template's declaration.)
1610
     * @since org.openide.dialogs 7.1
1639
     * @since org.openide.dialogs 7.1
1611
     */
1640
     */
1612
    public interface ProgressInstantiatingIterator extends AsynchronousInstantiatingIterator {
1641
    public interface ProgressInstantiatingIterator<Data> extends AsynchronousInstantiatingIterator<Data> {
1613
1642
1614
        /**
1643
        /**
1615
         * Is called in separate thread when the Finish button
1644
         * Is called in separate thread when the Finish button
Lines 1629-1638 Link Here
1629
1658
1630
    /** Special iterator that works on an array of <code>Panel</code>s.
1659
    /** Special iterator that works on an array of <code>Panel</code>s.
1631
    */
1660
    */
1632
    public static class ArrayIterator extends Object implements Iterator {
1661
    public static class ArrayIterator<Data> extends Object implements Iterator<Data> {
1633
        /** Array of items.
1662
        /** Array of items.
1634
        */
1663
        */
1635
        private Panel[] panels;
1664
        private Panel<Data>[] panels;
1636
1665
1637
        /** Index into the array
1666
        /** Index into the array
1638
        */
1667
        */
Lines 1649-1655 Link Here
1649
        /** Construct an iterator.
1678
        /** Construct an iterator.
1650
        * @param array the list of panels to use
1679
        * @param array the list of panels to use
1651
        */
1680
        */
1652
        public ArrayIterator(Panel[] array) {
1681
        public ArrayIterator(Panel<Data>[] array) {
1653
            panels = array;
1682
            panels = array;
1654
            index = 0;
1683
            index = 0;
1655
        }
1684
        }
Lines 1658-1670 Link Here
1658
        * constructed using default constructor.
1687
        * constructed using default constructor.
1659
        * (for example during deserialization.
1688
        * (for example during deserialization.
1660
        * Default implementation returns empty array. */
1689
        * Default implementation returns empty array. */
1661
        protected Panel[] initializePanels() {
1690
        @SuppressWarnings("unchecked")
1691
        protected Panel<Data>[] initializePanels() {
1662
            return new Panel[0];
1692
            return new Panel[0];
1663
        }
1693
        }
1664
1694
1665
        /* The current panel.
1695
        /* The current panel.
1666
        */
1696
        */
1667
        public Panel current() {
1697
        public Panel<Data> current() {
1668
            return panels[index];
1698
            return panels[index];
1669
        }
1699
        }
1670
1700
Lines 1742-1747 Link Here
1742
1772
1743
        /** Action listener */
1773
        /** Action listener */
1744
        public void actionPerformed(ActionEvent ev) {
1774
        public void actionPerformed(ActionEvent ev) {
1775
            final Iterator<?> panels = data.getIterator(WizardDescriptor.this);
1745
            if (wizardPanel != null) {
1776
            if (wizardPanel != null) {
1746
                wizardPanel.setErrorMessage(" ", null); //NOI18N
1777
                wizardPanel.setErrorMessage(" ", null); //NOI18N
1747
            }
1778
            }
Lines 2546-2551 Link Here
2546
2577
2547
        /** Overriden to delegate call to user component.
2578
        /** Overriden to delegate call to user component.
2548
         */
2579
         */
2580
        @Deprecated
2549
        public boolean requestDefaultFocus() {
2581
        public boolean requestDefaultFocus() {
2550
            if (rightComponent instanceof JComponent) {
2582
            if (rightComponent instanceof JComponent) {
2551
                return ((JComponent) rightComponent).requestDefaultFocus();
2583
                return ((JComponent) rightComponent).requestDefaultFocus();
Lines 2633-2638 Link Here
2633
            assert ESTIMATED_HEIGHT == Utilities.loadImage ("org/netbeans/modules/dialogs/warning.gif").getHeight (null) : "Use only 16px icon.";
2665
            assert ESTIMATED_HEIGHT == Utilities.loadImage ("org/netbeans/modules/dialogs/warning.gif").getHeight (null) : "Use only 16px icon.";
2634
            preferredSize.height = Math.max (ESTIMATED_HEIGHT, preferredSize.height);
2666
            preferredSize.height = Math.max (ESTIMATED_HEIGHT, preferredSize.height);
2635
            return preferredSize;
2667
            return preferredSize;
2668
        }
2669
    }
2670
    
2671
    private static final class SettingsAndIterator<Data> {
2672
        private final Iterator<Data> panels;
2673
        private final Data settings;
2674
        private final boolean useThis;
2675
        /** current panel */
2676
        private Panel<Data> current;
2677
2678
        
2679
        public SettingsAndIterator(Iterator<Data> iterator, Data settings) {
2680
            this(iterator, settings, false);
2681
        }
2682
        public SettingsAndIterator(Iterator<Data> iterator, Data settings, boolean useThis) {
2683
            this.panels = iterator;
2684
            this.settings = settings;
2685
            this.useThis = useThis;
2686
        }
2687
        public static SettingsAndIterator<WizardDescriptor> create(Iterator<WizardDescriptor> iterator) {
2688
            return new SettingsAndIterator<WizardDescriptor>(iterator, null, true);
2689
        }
2690
2691
        public Iterator<Data> getIterator(WizardDescriptor caller) {
2692
            return panels;
2693
        }
2694
        
2695
        @SuppressWarnings("unchecked")
2696
        public Data getSettings(WizardDescriptor caller) {
2697
            return useThis ? (Data)caller : settings;
2698
        }
2699
        
2700
        public SettingsAndIterator<Data> clone(Iterator<Data> it) {
2701
            SettingsAndIterator<Data> s = new SettingsAndIterator<Data>(it, settings, useThis);
2702
            return s;
2636
        }
2703
        }
2637
    }
2704
    }
2638
}
2705
}
(-)openide/loaders/src/org/openide/loaders/NewObjectWizardPanel.java (-3 / +3 lines)
Lines 30-36 Link Here
30
 *
30
 *
31
 * @author Jiri Rechtacek
31
 * @author Jiri Rechtacek
32
 */
32
 */
33
final class NewObjectWizardPanel implements WizardDescriptor.FinishablePanel {
33
final class NewObjectWizardPanel implements WizardDescriptor.FinishablePanel<WizardDescriptor> {
34
    private NewObjectPanel newObjectPanelUI;
34
    private NewObjectPanel newObjectPanelUI;
35
    /** listener to changes in the wizard */
35
    /** listener to changes in the wizard */
36
    private ChangeListener listener;
36
    private ChangeListener listener;
Lines 135-141 Link Here
135
     * This method can be called multiple times on one instance of <code>WizardDescriptor.Panel</code>.
135
     * This method can be called multiple times on one instance of <code>WizardDescriptor.Panel</code>.
136
     * @param settings the object representing wizard panel state, as originally supplied to {@link WizardDescriptor#WizardDescriptor(WizardDescriptor.Iterator,Object)}
136
     * @param settings the object representing wizard panel state, as originally supplied to {@link WizardDescriptor#WizardDescriptor(WizardDescriptor.Iterator,Object)}
137
     */
137
     */
138
    public void readSettings(Object settings) {
138
    public void readSettings(WizardDescriptor settings) {
139
        this.wizard = (TemplateWizard)settings;
139
        this.wizard = (TemplateWizard)settings;
140
        DataObject template = wizard.getTemplate ();
140
        DataObject template = wizard.getTemplate ();
141
        if (template != null) {
141
        if (template != null) {
Lines 159-165 Link Here
159
     * This method can be called multiple times on one instance of <code>WizardDescriptor.Panel</code>.
159
     * This method can be called multiple times on one instance of <code>WizardDescriptor.Panel</code>.
160
     * @param settings the object representing a settings of the wizard
160
     * @param settings the object representing a settings of the wizard
161
     */
161
     */
162
    public void storeSettings(Object settings) {
162
    public void storeSettings(WizardDescriptor settings) {
163
        String name = getPanelUI ().getNewObjectName ();
163
        String name = getPanelUI ().getNewObjectName ();
164
        if (name.equals (NewObjectPanel.defaultNewObjectName ())) {
164
        if (name.equals (NewObjectPanel.defaultNewObjectName ())) {
165
            name = null;
165
            name = null;
(-)openide/loaders/src/org/openide/loaders/TemplateWizard.java (-13 / +18 lines)
Lines 68-76 Link Here
68
    static java.awt.Dimension PREF_DIM = new java.awt.Dimension (560, 350);
68
    static java.awt.Dimension PREF_DIM = new java.awt.Dimension (560, 350);
69
69
70
    /** panel */
70
    /** panel */
71
    private Panel templateChooser;
71
    private Panel<WizardDescriptor> templateChooser;
72
    /** panel */
72
    /** panel */
73
    private Panel targetChooser;
73
    private Panel<WizardDescriptor> targetChooser;
74
    /** whether to show target chooser */
74
    /** whether to show target chooser */
75
    private boolean showTargetChooser = true;
75
    private boolean showTargetChooser = true;
76
    
76
    
Lines 271-277 Link Here
271
    /** Returns wizard panel that is used to choose a template.
271
    /** Returns wizard panel that is used to choose a template.
272
     * @return wizard panel
272
     * @return wizard panel
273
     */
273
     */
274
    public Panel templateChooser () {
274
    public Panel<WizardDescriptor> templateChooser () {
275
        synchronized (this) {
275
        synchronized (this) {
276
            if (templateChooser == null) {
276
            if (templateChooser == null) {
277
                templateChooser = createTemplateChooser ();
277
                templateChooser = createTemplateChooser ();
Lines 284-290 Link Here
284
     * name of the template.
284
     * name of the template.
285
     * @return wizard panel
285
     * @return wizard panel
286
     */
286
     */
287
    public Panel targetChooser () {
287
    public Panel<WizardDescriptor> targetChooser () {
288
        synchronized (this) {
288
        synchronized (this) {
289
            if (targetChooser == null) {
289
            if (targetChooser == null) {
290
                targetChooser = createTargetChooser ();
290
                targetChooser = createTargetChooser ();
Lines 307-313 Link Here
307
     * 
307
     * 
308
     * @return the panel
308
     * @return the panel
309
     */
309
     */
310
    protected Panel createTemplateChooser () {
310
    protected Panel<WizardDescriptor> createTemplateChooser () {
311
        return new TemplateWizardPanel1 ();
311
        return new TemplateWizardPanel1 ();
312
    }
312
    }
313
313
Lines 315-322 Link Here
315
     * 
315
     * 
316
     * @return the panel
316
     * @return the panel
317
     */
317
     */
318
    protected Panel createTargetChooser () {
318
    protected Panel<WizardDescriptor> createTargetChooser () {
319
        return showTargetChooser ? (Panel)new TemplateWizardPanel2 () : (Panel)new NewObjectWizardPanel ();
319
        if (showTargetChooser) {
320
            return new TemplateWizardPanel2 ();
321
        } else {
322
            return new NewObjectWizardPanel ();
323
        }
320
    }
324
    }
321
    
325
    
322
    /** Allows subclasses to provide their own default iterator
326
    /** Allows subclasses to provide their own default iterator
Lines 661-666 Link Here
661
    * @param obj the data object
665
    * @param obj the data object
662
    * @return custom iterator or null
666
    * @return custom iterator or null
663
    */
667
    */
668
    @SuppressWarnings("unchecked")
664
    public static Iterator getIterator (DataObject obj) {
669
    public static Iterator getIterator (DataObject obj) {
665
        Object unknownIterator = obj.getPrimaryFile ().getAttribute(CUSTOM_ITERATOR);
670
        Object unknownIterator = obj.getPrimaryFile ().getAttribute(CUSTOM_ITERATOR);
666
        if (unknownIterator == null) {
671
        if (unknownIterator == null) {
Lines 672-678 Link Here
672
            it = (Iterator)unknownIterator;
677
            it = (Iterator)unknownIterator;
673
        // own brigde for each one iterator type
678
        // own brigde for each one iterator type
674
        } if (unknownIterator instanceof WizardDescriptor.InstantiatingIterator) {
679
        } if (unknownIterator instanceof WizardDescriptor.InstantiatingIterator) {
675
            it = new InstantiatingIteratorBridge((WizardDescriptor.InstantiatingIterator) unknownIterator);
680
            it = new InstantiatingIteratorBridge((WizardDescriptor.InstantiatingIterator<WizardDescriptor>) unknownIterator);
676
        }
681
        }
677
        if (it != null) {
682
        if (it != null) {
678
            return it;
683
            return it;
Lines 808-814 Link Here
808
    * <P>
813
    * <P>
809
    * Implements <code>Node.Cookie</code> since version 2.13
814
    * Implements <code>Node.Cookie</code> since version 2.13
810
    */
815
    */
811
    public interface Iterator extends WizardDescriptor.Iterator,
816
    public interface Iterator extends WizardDescriptor.Iterator<WizardDescriptor>,
812
    java.io.Serializable, org.openide.nodes.Node.Cookie {
817
    java.io.Serializable, org.openide.nodes.Node.Cookie {
813
        /** Instantiates the template using information provided by
818
        /** Instantiates the template using information provided by
814
         * the wizard. If instantiation fails then wizard remains open to enable correct values.
819
         * the wizard. If instantiation fails then wizard remains open to enable correct values.
Lines 890-896 Link Here
890
        /** Get the current panel.
895
        /** Get the current panel.
891
        * @return the panel
896
        * @return the panel
892
        */
897
        */
893
        public Panel current() {
898
        public Panel<WizardDescriptor> current() {
894
            return targetChooser ();
899
            return targetChooser ();
895
        }
900
        }
896
        
901
        
Lines 939-946 Link Here
939
    }
944
    }
940
    
945
    
941
    private static class InstantiatingIteratorBridge implements TemplateWizard.Iterator {
946
    private static class InstantiatingIteratorBridge implements TemplateWizard.Iterator {
942
        private WizardDescriptor.InstantiatingIterator instantiatingIterator;
947
        private WizardDescriptor.InstantiatingIterator<WizardDescriptor> instantiatingIterator;
943
        public InstantiatingIteratorBridge (WizardDescriptor.InstantiatingIterator it) {
948
        public InstantiatingIteratorBridge (WizardDescriptor.InstantiatingIterator<WizardDescriptor> it) {
944
            instantiatingIterator = it;
949
            instantiatingIterator = it;
945
        }
950
        }
946
        
951
        
Lines 952-958 Link Here
952
            instantiatingIterator.addChangeListener (l);
957
            instantiatingIterator.addChangeListener (l);
953
        }
958
        }
954
        
959
        
955
        public org.openide.WizardDescriptor.Panel current () {
960
        public org.openide.WizardDescriptor.Panel<WizardDescriptor> current () {
956
            return instantiatingIterator.current ();
961
            return instantiatingIterator.current ();
957
        }
962
        }
958
        
963
        
(-)openide/loaders/src/org/openide/loaders/TemplateWizardIterImpl.java (-2 / +2 lines)
Lines 57-63 Link Here
57
    /** Getter for the first panel.
57
    /** Getter for the first panel.
58
     * @return the first and default panel
58
     * @return the first and default panel
59
     */
59
     */
60
    private WizardDescriptor.Panel firstPanel () {
60
    private WizardDescriptor.Panel<WizardDescriptor> firstPanel () {
61
        return wizardInstance.templateChooser();
61
        return wizardInstance.templateChooser();
62
    }
62
    }
63
63
Lines 114-120 Link Here
114
    /** Get the current panel.
114
    /** Get the current panel.
115
     * @return the panel
115
     * @return the panel
116
     */
116
     */
117
    public WizardDescriptor.Panel current() {
117
    public WizardDescriptor.Panel<WizardDescriptor> current() {
118
        return showingPanel ? firstPanel () : getIterator ().current ();
118
        return showingPanel ? firstPanel () : getIterator ().current ();
119
    }
119
    }
120
120
(-)openide/loaders/src/org/openide/loaders/TemplateWizardIteratorWrapper.java (-5 / +5 lines)
Lines 29-35 Link Here
29
 *
29
 *
30
 * @author Jiri Rechtacek
30
 * @author Jiri Rechtacek
31
 */
31
 */
32
class TemplateWizardIteratorWrapper implements WizardDescriptor.Iterator, ChangeListener {
32
class TemplateWizardIteratorWrapper implements WizardDescriptor.Iterator<WizardDescriptor>, ChangeListener {
33
33
34
    private TemplateWizardIterImpl iterImpl;
34
    private TemplateWizardIterImpl iterImpl;
35
    
35
    
Lines 63-69 Link Here
63
    /** Get the current panel.
63
    /** Get the current panel.
64
     * @return the panel
64
     * @return the panel
65
     */
65
     */
66
    public WizardDescriptor.Panel current() {
66
    public WizardDescriptor.Panel<WizardDescriptor> current() {
67
        return iterImpl.current ();
67
        return iterImpl.current ();
68
    }
68
    }
69
69
Lines 143-161 Link Here
143
        return iterImpl.instantiate (handle);
143
        return iterImpl.instantiate (handle);
144
    }
144
    }
145
    
145
    
146
    static class InstantiatingIterator extends TemplateWizardIteratorWrapper implements WizardDescriptor.InstantiatingIterator {
146
    static class InstantiatingIterator extends TemplateWizardIteratorWrapper implements WizardDescriptor.InstantiatingIterator<WizardDescriptor> {
147
        public InstantiatingIterator (TemplateWizardIterImpl it) {
147
        public InstantiatingIterator (TemplateWizardIterImpl it) {
148
            super (it);
148
            super (it);
149
        }
149
        }
150
    }
150
    }
151
    
151
    
152
    static class AsynchronousInstantiatingIterator extends InstantiatingIterator implements WizardDescriptor.AsynchronousInstantiatingIterator {
152
    static class AsynchronousInstantiatingIterator extends InstantiatingIterator implements WizardDescriptor.AsynchronousInstantiatingIterator<WizardDescriptor> {
153
        public AsynchronousInstantiatingIterator (TemplateWizardIterImpl it) {
153
        public AsynchronousInstantiatingIterator (TemplateWizardIterImpl it) {
154
            super (it);
154
            super (it);
155
        }
155
        }
156
    }
156
    }
157
    
157
    
158
    static class ProgressInstantiatingIterator extends InstantiatingIterator implements WizardDescriptor.ProgressInstantiatingIterator {
158
    static class ProgressInstantiatingIterator extends InstantiatingIterator implements WizardDescriptor.ProgressInstantiatingIterator<WizardDescriptor> {
159
        private TemplateWizardIterImpl itImpl;
159
        private TemplateWizardIterImpl itImpl;
160
        public ProgressInstantiatingIterator (TemplateWizardIterImpl it) {
160
        public ProgressInstantiatingIterator (TemplateWizardIterImpl it) {
161
            super (it);
161
            super (it);
(-)openide/loaders/src/org/openide/loaders/TemplateWizardPanel1.java (-3 / +3 lines)
Lines 28-34 Link Here
28
 *
28
 *
29
 * @author Jiri Rechtacek
29
 * @author Jiri Rechtacek
30
 */
30
 */
31
final class TemplateWizardPanel1 implements WizardDescriptor.Panel {
31
final class TemplateWizardPanel1 implements WizardDescriptor.Panel<WizardDescriptor> {
32
    private TemplateWizard1 templateWizard1UI;
32
    private TemplateWizard1 templateWizard1UI;
33
    /** listener to changes in the wizard */
33
    /** listener to changes in the wizard */
34
    private ChangeListener listener;
34
    private ChangeListener listener;
Lines 101-107 Link Here
101
    * This method can be called multiple times on one instance of <code>WizardDescriptor.Panel</code>.
101
    * This method can be called multiple times on one instance of <code>WizardDescriptor.Panel</code>.
102
    * @param settings the object representing wizard panel state, as originally supplied to {@link WizardDescriptor#WizardDescriptor(WizardDescriptor.Iterator,Object)}
102
    * @param settings the object representing wizard panel state, as originally supplied to {@link WizardDescriptor#WizardDescriptor(WizardDescriptor.Iterator,Object)}
103
    */
103
    */
104
    public void readSettings(Object settings) {
104
    public void readSettings(WizardDescriptor settings) {
105
        getPanelUI ().implReadSettings (settings);
105
        getPanelUI ().implReadSettings (settings);
106
    }
106
    }
107
    
107
    
Lines 114-120 Link Here
114
    * This method can be called multiple times on one instance of <code>WizardDescriptor.Panel</code>.
114
    * This method can be called multiple times on one instance of <code>WizardDescriptor.Panel</code>.
115
    * @param settings the object representing a settings of the wizard
115
    * @param settings the object representing a settings of the wizard
116
    */
116
    */
117
    public void storeSettings(Object settings) {
117
    public void storeSettings(WizardDescriptor settings) {
118
        getPanelUI ().implStoreSettings (settings);
118
        getPanelUI ().implStoreSettings (settings);
119
    }
119
    }
120
    
120
    
(-)openide/loaders/src/org/openide/loaders/TemplateWizardPanel2.java (-3 / +3 lines)
Lines 27-33 Link Here
27
 *
27
 *
28
 * @author Jiri Rechtacek
28
 * @author Jiri Rechtacek
29
 */
29
 */
30
final class TemplateWizardPanel2 implements WizardDescriptor.FinishablePanel {
30
final class TemplateWizardPanel2 implements WizardDescriptor.FinishablePanel<WizardDescriptor> {
31
    private TemplateWizard2 templateWizard2UI;
31
    private TemplateWizard2 templateWizard2UI;
32
    /** listener to changes in the wizard */
32
    /** listener to changes in the wizard */
33
    private ChangeListener listener;
33
    private ChangeListener listener;
Lines 111-117 Link Here
111
     * by the wizard are not valid.
111
     * by the wizard are not valid.
112
     *
112
     *
113
     */
113
     */
114
    public void readSettings(Object settings) {
114
    public void readSettings(WizardDescriptor settings) {
115
        this.settings = (WizardDescriptor)settings;
115
        this.settings = (WizardDescriptor)settings;
116
        getPanelUI ().implReadSettings (settings);
116
        getPanelUI ().implReadSettings (settings);
117
    }
117
    }
Lines 130-136 Link Here
130
     * @param settings the object representing wizard panel state
130
     * @param settings the object representing wizard panel state
131
     *
131
     *
132
     */
132
     */
133
    public void storeSettings(Object settings) {
133
    public void storeSettings(WizardDescriptor settings) {
134
        getPanelUI ().implStoreSettings (settings);
134
        getPanelUI ().implStoreSettings (settings);
135
        this.settings = null;
135
        this.settings = null;
136
    }
136
    }

Return to bug 92762