Index: openide/dialogs/src/org/openide/WizardDescriptor.java =================================================================== RCS file: /shared/data/ccvs/repository/openide/dialogs/src/org/openide/WizardDescriptor.java,v retrieving revision 1.46 diff -u -r1.46 WizardDescriptor.java --- openide/dialogs/src/org/openide/WizardDescriptor.java 7 Mar 2007 10:30:39 -0000 1.46 +++ openide/dialogs/src/org/openide/WizardDescriptor.java 24 Apr 2007 01:32:56 -0000 @@ -380,7 +380,7 @@ * * @param panels iterator over all {@link WizardDescriptor.Panel}s that can appear in the wizard */ - public WizardDescriptor(Iterator panels) { + public WizardDescriptor(Iterator panels) { this(SettingsAndIterator.create(panels)); } @@ -2718,8 +2718,8 @@ this.settings = settings; this.useThis = useThis; } - public static SettingsAndIterator create(Iterator iterator) { - return new SettingsAndIterator(iterator, null, true); + public static SettingsAndIterator create(Iterator iterator) { + return new SettingsAndIterator(iterator, null, true); } public Iterator getIterator(WizardDescriptor caller) { Index: ant/src/org/apache/tools/ant/module/wizards/shortcut/CustomizeScriptPanel.java =================================================================== RCS file: /shared/data/ccvs/repository/ant/src/org/apache/tools/ant/module/wizards/shortcut/CustomizeScriptPanel.java,v retrieving revision 1.14 diff -u -r1.14 CustomizeScriptPanel.java --- ant/src/org/apache/tools/ant/module/wizards/shortcut/CustomizeScriptPanel.java 27 Mar 2007 00:01:11 -0000 1.14 +++ ant/src/org/apache/tools/ant/module/wizards/shortcut/CustomizeScriptPanel.java 24 Apr 2007 01:32:56 -0000 @@ -98,7 +98,7 @@ // End of variables declaration//GEN-END:variables - public static class CustomizeScriptWizardPanel implements WizardDescriptor.Panel { + public static class CustomizeScriptWizardPanel implements WizardDescriptor.Panel { private CustomizeScriptPanel panel = null; @@ -127,13 +127,11 @@ public final void addChangeListener (ChangeListener l) {} public final void removeChangeListener (ChangeListener l) {} - public void readSettings (Object settings) { - ShortcutWizard wiz = (ShortcutWizard) settings; + public void readSettings(ShortcutWizard wiz) { String contents = wiz.getContents(); getPanel().scriptPane.setText(contents); } - public void storeSettings (Object settings) { - ShortcutWizard wiz = (ShortcutWizard) settings; + public void storeSettings(ShortcutWizard wiz) { wiz.putContents(getPanel().scriptPane.getText()); } } Index: ant/src/org/apache/tools/ant/module/wizards/shortcut/IntroPanel.java =================================================================== RCS file: /shared/data/ccvs/repository/ant/src/org/apache/tools/ant/module/wizards/shortcut/IntroPanel.java,v retrieving revision 1.17 diff -u -r1.17 IntroPanel.java --- ant/src/org/apache/tools/ant/module/wizards/shortcut/IntroPanel.java 27 Mar 2007 00:01:11 -0000 1.17 +++ ant/src/org/apache/tools/ant/module/wizards/shortcut/IntroPanel.java 24 Apr 2007 01:32:56 -0000 @@ -151,7 +151,7 @@ private javax.swing.JCheckBox toolbarCheck; // End of variables declaration//GEN-END:variables - public static class IntroWizardPanel implements WizardDescriptor.Panel { + public static class IntroWizardPanel implements WizardDescriptor.Panel { private IntroPanel panel = null; private ShortcutWizard wiz = null; @@ -196,11 +196,10 @@ cs.fireChange(); } - public void readSettings (Object settings) { + public void readSettings(ShortcutWizard wiz) { // XXX should read checkboxes from settings... skip for now. } - public void storeSettings (Object settings) { - WizardDescriptor wiz = (WizardDescriptor) settings; + public void storeSettings(ShortcutWizard wiz) { wiz.putProperty(ShortcutWizard.PROP_SHOW_CUST, getPanel().customizeCheck.isSelected() ? Boolean.TRUE : Boolean.FALSE); wiz.putProperty(ShortcutWizard.PROP_SHOW_MENU, getPanel().menuCheck.isSelected() ? Boolean.TRUE : Boolean.FALSE); wiz.putProperty(ShortcutWizard.PROP_SHOW_TOOL, getPanel().toolbarCheck.isSelected() ? Boolean.TRUE : Boolean.FALSE); Index: ant/src/org/apache/tools/ant/module/wizards/shortcut/SelectFolderPanel.java =================================================================== RCS file: /shared/data/ccvs/repository/ant/src/org/apache/tools/ant/module/wizards/shortcut/SelectFolderPanel.java,v retrieving revision 1.15 diff -u -r1.15 SelectFolderPanel.java --- ant/src/org/apache/tools/ant/module/wizards/shortcut/SelectFolderPanel.java 27 Mar 2007 00:01:12 -0000 1.15 +++ ant/src/org/apache/tools/ant/module/wizards/shortcut/SelectFolderPanel.java 24 Apr 2007 01:32:56 -0000 @@ -228,7 +228,7 @@ private javax.swing.JTextArea hintsArea; // End of variables declaration//GEN-END:variables - public static class SelectFolderWizardPanel implements WizardDescriptor.Panel { + public static class SelectFolderWizardPanel implements WizardDescriptor.Panel { private SelectFolderPanel panel; @@ -279,16 +279,14 @@ cs.fireChange(); } - public void readSettings (Object settings) { - WizardDescriptor wiz = (WizardDescriptor) settings; + public void readSettings(ShortcutWizard wiz) { getPanel().setFolder((DataFolder)wiz.getProperty(getPanel().prop)); String dn = (String)wiz.getProperty(ShortcutWizard.PROP_DISPLAY_NAME); getPanel().displayNameField.setText(dn != null ? dn : ""); // NOI18N } - public void storeSettings (Object settings) { + public void storeSettings(ShortcutWizard wiz) { DataFolder folder = getPanel().getFolder(); - WizardDescriptor wiz = (WizardDescriptor) settings; wiz.putProperty(getPanel().prop, folder); wiz.putProperty(ShortcutWizard.PROP_DISPLAY_NAME, getPanel().displayNameField.getText()); } Index: ant/src/org/apache/tools/ant/module/wizards/shortcut/SelectKeyboardShortcutPanel.java =================================================================== RCS file: /shared/data/ccvs/repository/ant/src/org/apache/tools/ant/module/wizards/shortcut/SelectKeyboardShortcutPanel.java,v retrieving revision 1.14 diff -u -r1.14 SelectKeyboardShortcutPanel.java --- ant/src/org/apache/tools/ant/module/wizards/shortcut/SelectKeyboardShortcutPanel.java 27 Mar 2007 00:01:12 -0000 1.14 +++ ant/src/org/apache/tools/ant/module/wizards/shortcut/SelectKeyboardShortcutPanel.java 24 Apr 2007 01:32:56 -0000 @@ -112,7 +112,7 @@ e.consume (); } - public static class SelectKeyboardShortcutWizardPanel implements WizardDescriptor.Panel { + public static class SelectKeyboardShortcutWizardPanel implements WizardDescriptor.Panel { private SelectKeyboardShortcutPanel panel = null; private FileObject shortcutsFolder = null; @@ -151,11 +151,10 @@ cs.fireChange(); } - public void readSettings (Object settings) { + public void readSettings(ShortcutWizard wiz) { // XXX later... } - public void storeSettings (Object settings) { - WizardDescriptor wiz = (WizardDescriptor) settings; + public void storeSettings(ShortcutWizard wiz) { wiz.putProperty(ShortcutWizard.PROP_STROKE, getPanel().stroke); } } Index: ant/src/org/apache/tools/ant/module/wizards/shortcut/ShortcutIterator.java =================================================================== RCS file: /shared/data/ccvs/repository/ant/src/org/apache/tools/ant/module/wizards/shortcut/ShortcutIterator.java,v retrieving revision 1.18 diff -u -r1.18 ShortcutIterator.java --- ant/src/org/apache/tools/ant/module/wizards/shortcut/ShortcutIterator.java 27 Mar 2007 00:01:12 -0000 1.18 +++ ant/src/org/apache/tools/ant/module/wizards/shortcut/ShortcutIterator.java 24 Apr 2007 01:32:56 -0000 @@ -20,6 +20,8 @@ package org.apache.tools.ant.module.wizards.shortcut; import java.awt.Component; +import java.util.ArrayList; +import java.util.List; import java.util.NoSuchElementException; import javax.swing.JComponent; import javax.swing.event.ChangeListener; @@ -29,30 +31,30 @@ import org.openide.util.ChangeSupport; import org.openide.util.NbBundle; -final class ShortcutIterator implements WizardDescriptor.Iterator { +final class ShortcutIterator implements WizardDescriptor.Iterator { ShortcutIterator() {} // You should define what panels you want to use here: - private WizardDescriptor.Panel[] createPanels () { - return new WizardDescriptor.Panel[] { - new IntroPanel.IntroWizardPanel (), - new SelectFolderPanel.SelectFolderWizardPanel( + private List> createPanels() { + List> panels = new ArrayList>(); + panels.add(new IntroPanel.IntroWizardPanel()); + panels.add(new SelectFolderPanel.SelectFolderWizardPanel( NbBundle.getMessage(ShortcutIterator.class, "SI_LBL_select_menu_to_add_to"), NbBundle.getMessage(ShortcutIterator.class, "SI_TEXT_menu_locn"), NbBundle.getMessage(ShortcutIterator.class, "SI_LBL_display_name_for_menu"), DataFolder.findFolder(Repository.getDefault().getDefaultFileSystem().findResource("Menu")), // NOI18N - true, ShortcutWizard.PROP_FOLDER_MENU), - new SelectFolderPanel.SelectFolderWizardPanel( + true, ShortcutWizard.PROP_FOLDER_MENU)); + panels.add(new SelectFolderPanel.SelectFolderWizardPanel( NbBundle.getMessage(ShortcutIterator.class, "SI_LBL_select_toolbar"), NbBundle.getMessage(ShortcutIterator.class, "SI_TEXT_toolbar_locn"), NbBundle.getMessage(ShortcutIterator.class, "SI_LBL_display_name_for_toolbar"), DataFolder.findFolder(Repository.getDefault().getDefaultFileSystem().findResource("Toolbars")), // NOI18N - false, ShortcutWizard.PROP_FOLDER_TOOL), - new SelectKeyboardShortcutPanel.SelectKeyboardShortcutWizardPanel (), - new CustomizeScriptPanel.CustomizeScriptWizardPanel (), - }; + false, ShortcutWizard.PROP_FOLDER_TOOL)); + panels.add(new SelectKeyboardShortcutPanel.SelectKeyboardShortcutWizardPanel()); + panels.add(new CustomizeScriptPanel.CustomizeScriptWizardPanel()); + return panels; } // And the list of step names: @@ -68,7 +70,7 @@ } private transient int index; - private transient WizardDescriptor.Panel[] panels; + private transient List> panels; private transient ShortcutWizard wiz; // You can keep a reference to the TemplateWizard which can @@ -81,11 +83,11 @@ panels = createPanels (); // #44409: make sure IntroWizardPanel knows about wiz // XXX workaround should no longer be necessary... - ((IntroPanel.IntroWizardPanel) panels[0]).initialize(wiz); + ((IntroPanel.IntroWizardPanel) panels.get(0)).initialize(wiz); // Make sure list of steps is accurate. String[] steps = createSteps (); - for (int i = 0; i < panels.length; i++) { - Component c = panels[i].getComponent (); + for (int i = 0; i < panels.size(); i++) { + Component c = panels.get(i).getComponent(); if (steps[i] == null) { // Default step name to component name of panel. // Mainly useful for getting the name of the target @@ -106,7 +108,7 @@ public String name () { return NbBundle.getMessage (ShortcutIterator.class, "TITLE_x_of_y", - new Integer (index + 1), new Integer (panels.length)); + index + 1, panels.size()); } boolean showing(String prop) { @@ -130,7 +132,7 @@ } } public boolean hasNext () { - for (int i = index + 1; i < panels.length; i++) { + for (int i = index + 1; i < panels.size(); i++) { if (showing (i)) { return true; } @@ -158,8 +160,8 @@ index--; while (! showing (index)) index--; } - public WizardDescriptor.Panel current () { - return panels[index]; + public WizardDescriptor.Panel current() { + return panels.get(index); } private transient ChangeSupport cs = new ChangeSupport(this);