Lines 35-40
Link Here
|
35 |
import java.awt.Window; |
35 |
import java.awt.Window; |
36 |
import java.beans.PropertyChangeListener; |
36 |
import java.beans.PropertyChangeListener; |
37 |
import java.beans.PropertyChangeEvent; |
37 |
import java.beans.PropertyChangeEvent; |
|
|
38 |
import java.io.IOException; |
38 |
import java.net.URL; |
39 |
import java.net.URL; |
39 |
import java.lang.ref.WeakReference; |
40 |
import java.lang.ref.WeakReference; |
40 |
|
41 |
|
Lines 259-264
Link Here
|
259 |
*/ |
260 |
*/ |
260 |
public WizardDescriptor (Iterator panels, Object settings) { |
261 |
public WizardDescriptor (Iterator panels, Object settings) { |
261 |
super ("", "", true, DEFAULT_OPTION, null, CLOSE_PREVENTER); // NOI18N |
262 |
super ("", "", true, DEFAULT_OPTION, null, CLOSE_PREVENTER); // NOI18N |
|
|
263 |
|
262 |
this.settings = settings == CLOSE_PREVENTER ? this : settings; |
264 |
this.settings = settings == CLOSE_PREVENTER ? this : settings; |
263 |
|
265 |
|
264 |
listener = new Listener (); |
266 |
listener = new Listener (); |
Lines 273-281
Link Here
|
273 |
super.setOptions (new Object[] { previousButton, nextButton, finishButton, cancelButton }); |
275 |
super.setOptions (new Object[] { previousButton, nextButton, finishButton, cancelButton }); |
274 |
super.setClosingOptions (new Object[] { finishOption, cancelButton }); |
276 |
super.setClosingOptions (new Object[] { finishOption, cancelButton }); |
275 |
|
277 |
|
|
|
278 |
// must be there? |
279 |
if (panels instanceof InstantiatingIterator) { |
280 |
((InstantiatingIterator)panels).initialize (this); |
281 |
} |
282 |
|
276 |
this.panels = panels; |
283 |
this.panels = panels; |
277 |
panels.addChangeListener (listener); |
284 |
panels.addChangeListener (listener); |
278 |
|
|
|
279 |
} |
285 |
} |
280 |
|
286 |
|
281 |
/** Create wizard for a sequence of panels, with settings |
287 |
/** Create wizard for a sequence of panels, with settings |
Lines 292-297
Link Here
|
292 |
*/ |
298 |
*/ |
293 |
protected void initialize () { |
299 |
protected void initialize () { |
294 |
super.initialize (); |
300 |
super.initialize (); |
|
|
301 |
|
302 |
|
295 |
|
303 |
|
296 |
updateState (); |
304 |
updateState (); |
297 |
} |
305 |
} |
Lines 853-858
Link Here
|
853 |
} |
861 |
} |
854 |
} |
862 |
} |
855 |
panels.removeChangeListener(listener); |
863 |
panels.removeChangeListener(listener); |
|
|
864 |
if (panels instanceof InstantiatingIterator) { |
865 |
((InstantiatingIterator)panels).uninitialize (this); |
866 |
} |
856 |
} |
867 |
} |
857 |
|
868 |
|
858 |
ResourceBundle bundle = NbBundle.getBundle(WizardDescriptor.class); |
869 |
ResourceBundle bundle = NbBundle.getBundle(WizardDescriptor.class); |
Lines 1162-1167
Link Here
|
1162 |
|
1173 |
|
1163 |
} |
1174 |
} |
1164 |
|
1175 |
|
|
|
1176 |
/** Instantiating iterator. PENDING |
1177 |
*/ |
1178 |
public interface InstantiatingIterator extends Iterator { |
1179 |
|
1180 |
/** PENDING |
1181 |
* |
1182 |
* @param settings |
1183 |
* @throws IOException |
1184 |
* @return |
1185 |
*/ |
1186 |
public java.util.Set instantiate () throws IOException; |
1187 |
|
1188 |
/** PENDING |
1189 |
* |
1190 |
* @param wizard |
1191 |
*/ |
1192 |
public void initialize (WizardDescriptor wizard); |
1193 |
|
1194 |
/** PENDING |
1195 |
* |
1196 |
* @param wizard |
1197 |
*/ |
1198 |
public void uninitialize (WizardDescriptor wizard); |
1199 |
} |
1200 |
|
1165 |
private boolean lazyValidate (WizardDescriptor.Panel panel, WizardDescriptor.WizardPanel wizard) { |
1201 |
private boolean lazyValidate (WizardDescriptor.Panel panel, WizardDescriptor.WizardPanel wizard) { |
1166 |
if (panel instanceof ValidatingPanel) { |
1202 |
if (panel instanceof ValidatingPanel) { |
1167 |
ValidatingPanel v = (ValidatingPanel)panel; |
1203 |
ValidatingPanel v = (ValidatingPanel)panel; |
Lines 1252-1257
Link Here
|
1252 |
resetWizard(); |
1288 |
resetWizard(); |
1253 |
} |
1289 |
} |
1254 |
firePropertyChange (PROP_VALUE, oldValue, OK_OPTION); |
1290 |
firePropertyChange (PROP_VALUE, oldValue, OK_OPTION); |
|
|
1291 |
if (panels instanceof InstantiatingIterator) { |
1292 |
try { |
1293 |
((InstantiatingIterator)panels).instantiate (); |
1294 |
} catch (IOException ioe) { |
1295 |
ErrorManager.getDefault ().notify (ioe); |
1296 |
} |
1297 |
} |
1255 |
} |
1298 |
} |
1256 |
|
1299 |
|
1257 |
if (ev.getSource () == cancelButton) { |
1300 |
if (ev.getSource () == cancelButton) { |