001package jmri;
002
003import java.awt.*;
004import java.beans.PropertyChangeListener;
005import java.util.ArrayList;
006import java.util.HashMap;
007
008import javax.annotation.CheckForNull;
009import javax.annotation.Nonnull;
010
011import org.jdom2.Element;
012
013/**
014 * Interface for the User Preferences Manager.
015 * <p>
016 * The User Message Preference Manager keeps track of the options that a user
017 * has selected in messages where they have selected "Remember this setting for
018 * next time"
019 *
020 * @see jmri.managers.JmriUserPreferencesManager
021 *
022 * @author Kevin Dickerson Copyright (C) 2010
023 */
024public interface UserPreferencesManager {
025
026    public static final String GENERIC_NAMESPACE = "http://jmri.org/xml/schema/auxiliary-configuration/generic-details-5-15-8.xsd"; // NOI18N
027
028    String PREFERENCES_UPDATED = "PreferencesUpdated"; // NOI18N
029
030    void setLoading();
031
032    void finishLoading();
033
034    /**
035     * Enquire as to the state of a user preference.
036     * <p>
037     * Preferences that have not been set will be considered to be false.
038     * <p>
039     * The name is free-form, but to avoid ambiguity it should start with the
040     * package name (package.Class) for the primary using class.
041     *
042     * @param name the name of the preference
043     * @return the state or false if never set
044     */
045    boolean getSimplePreferenceState(String name);
046
047    /**
048     * This is used to remember the last selected state of a checkBox and thus
049     * allow that checkBox to be set to a true state when it is next
050     * initialized. This can also be used anywhere else that a simple yes/no,
051     * true/false type preference needs to be stored.
052     * <p>
053     * It should not be used for remembering if a user wants to suppress a
054     * message as there is no means in the GUI for the user to reset the flag.
055     * setPreferenceState() should be used in this instance The name is
056     * free-form, but to avoid ambiguity it should start with the package name
057     * (package.Class) for the primary using class.
058     *
059     * @param name  A unique name to identify the state being stored
060     * @param state simple boolean
061     */
062    void setSimplePreferenceState(String name, boolean state);
063
064    /**
065     * Enquire as to the state of a user preference.
066     * <p>
067     * Preferences that have not been set will be considered to be defaultState.
068     * <p>
069     * The name is free-form, but to avoid ambiguity it should start with the
070     * package name (package.Class) for the primary using class.
071     *
072     * @param name the name of the preference
073     * @param defaultState the default state if not set
074     * @return the state or defaultState if never set
075     */
076    boolean getCheckboxPreferenceState(String name, boolean defaultState);
077
078    /**
079     * This is used to remember the last selected state of a checkBox and thus
080     * allow that checkBox to be set to a true state when it is next
081     * initialized. This can also be used anywhere else that a simple yes/no,
082     * true/false type preference needs to be stored.
083     * <p>
084     * It should not be used for remembering if a user wants to suppress a
085     * message as there is no means in the GUI for the user to reset the flag.
086     * setPreferenceState() should be used in this instance The name is
087     * free-form, but to avoid ambiguity it should start with the package name
088     * (package.Class) for the primary using class.
089     *
090     * @param name  A unique name to identify the state being stored
091     * @param state simple boolean
092     */
093    void setCheckboxPreferenceState(String name, boolean state);
094
095    /**
096     * Returns an ArrayList of the check box states set as true.
097     *
098     * @return list of simple preferences names
099     */
100    ArrayList<String> getSimplePreferenceStateList();
101
102    /**
103     * Used to save the state of checkboxes which can suppress messages from
104     * being displayed. This method should be used by the initiating code in
105     * conjunction with the preferenceItemDetails. Here the items are stored
106     * against a specific class and access to change them is made available via
107     * the GUI, in the preference manager.
108     * <p>
109     * The strClass parameter does not have to be the exact class name of the
110     * initiating code, but can be one where the information is related and
111     * therefore can be grouped together with.
112     * <p>
113     * Both the strClass and item although free form, should make up a unique
114     * reference.
115     *
116     * @param strClass The class that this preference should be stored or
117     *                 grouped with.
118     * @param item     The specific item that is to be stored
119     * @param state    Boolean state of the item.
120     */
121    void setPreferenceState(String strClass, String item, boolean state);
122
123    /**
124     * Returns the state of a given item registered against a specific class or
125     * item.
126     *
127     * @param strClass name of the class for this preference
128     * @param item     name of the item for which the state is being retrieved
129     * @return the state or false if not set
130     */
131    boolean getPreferenceState(String strClass, String item);
132
133    /**
134     * Register details about a particular preference, so that it can be
135     * displayed in the GUI and provide a meaning full description when
136     * presented to the user.
137     *
138     * @param strClass    A string form of the class that the preference is
139     *                    stored or grouped with
140     * @param item        The specific item that is being stored
141     * @param description A meaningful description of the item that the user
142     *                    will understand
143     */
144    void setPreferenceItemDetails(String strClass, String item, String description);
145
146    /**
147     * Returns a list of preferences that are registered against a specific
148     * class.
149     *
150     * @param strClass the class name
151     * @return the list of preference names
152     */
153    ArrayList<String> getPreferenceList(String strClass);
154
155    /**
156     * Returns the itemName of the n preference in the given class
157     *
158     * @param strClass the name of the class
159     * @param n        the position in an array
160     * @return the name of the preference or null if non-existent
161     */
162    @CheckForNull
163    String getPreferenceItemName(String strClass, int n);
164
165    /**
166     * Returns the description of the given item preference in the given class
167     *
168     * @param strClass the name of the class
169     * @param item     the name of the item
170     * @return the description of the preference
171     */
172    @CheckForNull
173    String getPreferenceItemDescription(String strClass, String item);
174
175    /**
176     * Enquire as to the state of a user preference for the current session.
177     * <p>
178     * Preferences that have not been set will be considered to be false.
179     * <p>
180     * The name is free-form, but to avoid ambiguity it should start with the
181     * package name (package.Class) for the primary using class.
182     *
183     * @param name the name of the preference
184     * @return the state or false if not set
185     */
186    boolean getSessionPreferenceState(String name);
187
188    /**
189     * Used to suppress messages for the current session, the information is not
190     * stored, can not be changed via the GUI.
191     * <p>
192     * This can be used to help prevent over loading the user with repetitive
193     * error messages such as turnout not found while loading a panel file due
194     * to a connection failing. The name is free-form, but to avoid ambiguity it
195     * should start with the package name (package.Class) for the primary using
196     * class.
197     *
198     * @param name  A unique identifier for preference.
199     * @param state suppression state of the item.
200     */
201    void setSessionPreferenceState(String name, boolean state);
202
203    // The reset is used after the preferences have been loaded for the first time
204    void resetChangeMade();
205
206    /**
207     * Show an info message ("don't forget ...") with a given dialog title and
208     * user message. Use a given preference name to determine whether to show it
209     * in the future. The combination of the classString and item parameters
210     * should form a unique value.
211     *
212     * @param title       message Box title
213     * @param message     message to be displayed
214     * @param classString name of the calling class
215     * @param item        name of the specific item this is used for
216     */
217    void showInfoMessage(String title, String message, String classString, String item);
218
219    /**
220     * Show an info message ("don't forget ...") with a given dialog title and
221     * user message.
222     * Use a given preference name to determine whether to show it in the future.
223     * The combination of the classString and item parameters should form a unique value.
224     *
225     * @param parentComponent Used to improve Dialog display, can be null.
226     * @param title       message Box title
227     * @param message     message to be displayed
228     * @param classString name of the calling class
229     * @param item        name of the specific item this is used for
230     */
231    void showInfoMessage(@CheckForNull Component parentComponent, String title,
232        String message, String classString, String item);
233
234    /**
235     * Show an error message ("don't forget ...") with a given dialog title and
236     * user message. Use a given preference name to determine whether to show it
237     * in the future. added flag to indicate that the message should be
238     * suppressed JMRI session only. The classString and item
239     * parameters should form a unique value
240     *
241     * @param title          Message Box title
242     * @param message        Message to be displayed
243     * @param classString    String value of the calling class
244     * @param item           String value of the specific item this is used for
245     * @param sessionOnly    Means this message will be suppressed in this JMRI
246     *                       session and not be remembered
247     * @param alwaysRemember Means that the suppression of the message will be
248     *                       saved
249     */
250    void showErrorMessage(String title, String message, String classString,
251        String item, boolean sessionOnly, boolean alwaysRemember);
252
253    /**
254     * Show an error message ("don't forget ...") with a given dialog title and
255     * user message.
256     * Use a given preference name to determine whether to show it in the future.
257     * Flag to indicate that the message should be suppressed JMRI session only.
258     * The classString and item parameters should form a unique value.
259     *
260     * @param parentComponent Used to improve Dialog display, can be null.
261     * @param title          Message Box title
262     * @param message        Message to be displayed
263     * @param classString    String value of the calling class
264     * @param item           String value of the specific item this is used for
265     * @param sessionOnly    Means this message will be suppressed in this JMRI
266     *                       session and not be remembered
267     * @param alwaysRemember Means that the suppression of the message will be
268     *                       saved
269     */
270    void showErrorMessage(@CheckForNull Component parentComponent, String title,
271        String message, String classString, String item, boolean sessionOnly, boolean alwaysRemember);
272
273    /**
274     * Show an info message ("don't forget ...") with a given dialog title and
275     * user message. Use a given preference name to determine whether to show it
276     * in the future. added flag to indicate that the message should be
277     * suppressed JMRI session only. The classString and item
278     * parameters should form a unique value
279     *
280     * @param title          Message Box title
281     * @param message        Message to be displayed
282     * @param classString    String value of the calling class
283     * @param item           String value of the specific item this is used for
284     * @param sessionOnly    Means this message will be suppressed in this JMRI
285     *                       session and not be remembered
286     * @param alwaysRemember Means that the suppression of the message will be
287     *                       saved
288     */
289    void showInfoMessage(String title, String message, String classString, String item, boolean sessionOnly, boolean alwaysRemember);
290
291    /**
292     * Show an info message ("don't forget ...") with a given dialog title and
293     * user message.
294     * Use a given preference name to determine whether to show it in the future.
295     * Flag to indicate that the message should be suppressed JMRI session only.
296     * The classString and item parameters should form a unique value.
297     *
298     * @param parentComponent Used to improve Dialog display, can be null.
299     * @param title          Message Box title
300     * @param message        Message to be displayed
301     * @param classString    String value of the calling class
302     * @param item           String value of the specific item this is used for
303     * @param sessionOnly    Means this message will be suppressed in this JMRI
304     *                       session and not be remembered
305     * @param alwaysRemember Means that the suppression of the message will be
306     *                       saved
307     */
308    void showInfoMessage(@CheckForNull Component parentComponent, String title,
309        String message, String classString, String item, boolean sessionOnly, boolean alwaysRemember);
310
311    /**
312     * Show a warning message ("don't forget ...") with a given dialog title and
313     * user message. Use a given preference name to determine whether to show it
314     * in the future. added flag to indicate that the message should be
315     * suppressed JMRI session only. The classString and item
316     * parameters should form a unique value
317     *
318     * @param title          Message Box title
319     * @param message        Message to be displayed
320     * @param classString    String value of the calling class
321     * @param item           String value of the specific item this is used for
322     * @param sessionOnly    Means this message will be suppressed in this JMRI
323     *                       session and not be remembered
324     * @param alwaysRemember Means that the suppression of the message will be
325     *                       saved
326     */
327    void showWarningMessage(String title, String message, String classString,
328        String item, boolean sessionOnly, boolean alwaysRemember);
329
330    /**
331     * Show a warning message ("don't forget ...") with a given dialog title and
332     * user message.
333     * Use a given preference name to determine whether to show it in the future.
334     * Flag to indicate that the message should be suppressed JMRI session only.
335     * The classString and item parameters should form a unique value.
336     *
337     * @param parentComponent Used to improve Dialog display, can be null.
338     * @param title          Message Box title
339     * @param message        Message to be displayed
340     * @param classString    String value of the calling class
341     * @param item           String value of the specific item this is used for
342     * @param sessionOnly    Means this message will be suppressed in this JMRI
343     *                       session and not be remembered
344     * @param alwaysRemember Means that the suppression of the message will be
345     *                       saved
346     */
347    void showWarningMessage(@CheckForNull Component parentComponent, String title,
348        String message, String classString, String item, boolean sessionOnly, boolean alwaysRemember);
349
350    /**
351     * The last selected value in a given combo box.
352     *
353     * @param comboBoxName the combo box name
354     * @return the selected value
355     */
356    @CheckForNull
357    String getComboBoxLastSelection(String comboBoxName);
358
359    /**
360     * Set the last selected value in a given combo box.
361     * <p>
362     * The name is free-form, but to avoid ambiguity it should start with the
363     * package name (package.Class) for the primary using class, followed by an
364     * identifier for the combo box.
365     *
366     * @param comboBoxName the combo box name
367     * @param lastValue    the selected value
368     */
369    void setComboBoxLastSelection(String comboBoxName, String lastValue);
370
371    Dimension getScreen();
372
373    /**
374     * Check if saving preferences is allowed.
375     *
376     * @return true if saving is allowed; false otherwise
377     */
378    boolean isSaveAllowed();
379
380    /**
381     * Set if saving preferences is allowed. When setting true, preferences will
382     * be saved immediately if needed.
383     * <p>
384     * <strong>Note</strong> only set false if a number of preferences will be
385     * set together to avoid excessive disk I/O while setting preferences.
386     * <p>
387     * <strong>Note</strong> remember to allow saving as soon as blocking saving
388     * is no longer needed.
389     *
390     * @param saveAllowed true to allow saving; false to block saving
391     */
392    void setSaveAllowed(boolean saveAllowed);
393
394    void removePropertyChangeListener(PropertyChangeListener l);
395
396    void addPropertyChangeListener(PropertyChangeListener l);
397
398    /**
399     * Get the description of a class/group registered with the preferences.
400     *
401     * @param strClass the class name
402     * @return the description
403     */
404    @Nonnull
405    String getClassDescription(String strClass);
406
407    /**
408     * Get the list of the classes registered with the preference manager.
409     *
410     * @return the list of class names
411     */
412    @Nonnull
413    ArrayList<String> getPreferencesClasses();
414
415    /**
416     * Given that we know the class as a string, we will try and attempt to
417     * gather details about the preferences that has been added, so that we can
418     * make better sense of the details in the preferences window.
419     * <p>
420     * This looks for specific methods within the class called
421     * "getClassDescription" and "setMessagePreferenceDetails". If found it will
422     * invoke the methods, this will then trigger the class to send details
423     * about its preferences back to this code.
424     *
425     * @param strClass description to use for the class
426     */
427    void setClassDescription(String strClass);
428
429    /**
430     * Add descriptive details about a specific message box, so that if it needs
431     * to be reset in the preferences, then it is easily identifiable. displayed
432     * to the user in the preferences GUI.
433     *
434     * @param strClass      String value of the calling class/group
435     * @param item          String value of the specific item this is used for.
436     * @param description   A meaningful description that can be used in a label
437     *                      to describe the item
438     * @param options       A map of the integer value of the option against a
439     *                      meaningful description.
440     * @param defaultOption The default option for the given item.
441     */
442    void setMessageItemDetails(String strClass, String item, String description, HashMap<Integer, String> options, int defaultOption);
443
444    /**
445     * Returns a map of the value against description of the different items in
446     * a given class. This information can then be used to build a Combo box.
447     *
448     * @param strClass Class or group of the given item
449     * @param item     the item which we wish to return the details about.
450     * @return map of choices
451     */
452    HashMap<Integer, String> getChoiceOptions(String strClass, String item);
453
454    /**
455     * Get the number of Multiple Choice items registered with a given class.
456     *
457     * @param strClass the class name
458     * @return number of items
459     */
460    int getMultipleChoiceSize(String strClass);
461
462    /**
463     * Get a list of all the multiple choice items registered with a given
464     * class.
465     *
466     * @param strClass the class name
467     * @return list of item names
468     */
469    ArrayList<String> getMultipleChoiceList(String strClass);
470
471    /**
472     * Get the nth item name in a given class.
473     *
474     * @param strClass the class name
475     * @param n        the position
476     * @return the item name
477     */
478    String getChoiceName(String strClass, int n);
479
480    /**
481     * Get the a meaningful description of a given item in a given class or
482     * group.
483     *
484     * @param strClass the class name
485     * @param item     the item name
486     * @return the item description
487     */
488    String getChoiceDescription(String strClass, String item);
489
490    /**
491     * Get the current value of a given item in a given class.
492     *
493     * @param strClass the class name
494     * @param item     the item name
495     * @return the value
496     */
497    int getMultipleChoiceOption(String strClass, String item);
498
499    /**
500     * Returns the default value of a given item in a given class
501     *
502     * @param strClass the class name
503     * @param choice   the item name
504     * @return the default value
505     */
506    int getMultipleChoiceDefaultOption(String strClass, String choice);
507
508    /**
509     * Sets the value of a given item in a given class, by its string
510     * description.
511     *
512     * @param strClass the class name
513     * @param choice   the item name
514     * @param value    the item value description
515     */
516    void setMultipleChoiceOption(String strClass, String choice, String value);
517
518    /**
519     * Sets the value of a given item in a given class, by its integer value.
520     *
521     * @param strClass the class name
522     * @param choice   the item name
523     * @param value    the item value
524     */
525    void setMultipleChoiceOption(String strClass, String choice, int value);
526
527    /**
528     * Get the combined size of both types of items registered.
529     *
530     * @param strClass the class name
531     * @return number of registered preferences
532     */
533    int getPreferencesSize(String strClass);
534
535    /**
536     * Saves the last location of a given component on the screen.
537     * <p>
538     * The jmri.util.JmriJFrame, will automatically use the class name of the
539     * frame if the class name returned is equal to jmri.util.JmriJFrame, the
540     * location is not stored
541     *
542     * @param strClass This is a unique identifier for window location being
543     *                 saved
544     * @param location The x,y location of the window given in a Point
545     */
546    void setWindowLocation(String strClass, Point location);
547
548    /**
549     * Saves the last size of a given component on the screen
550     * <p>
551     * The jmri.util.JmriJFrame, will automatically use the class name of the
552     * frame if the class name returned is equal to jmri.util.JmriJFrame, the
553     * size is not stored
554     *
555     * @param strClass This is a unique identifier for window size being saved
556     * @param dim      The width, height size of the window given in a Dimension
557     */
558    void setWindowSize(String strClass, Dimension dim);
559
560    /**
561     * Get the x,y location of a given Window.
562     *
563     * @param strClass the class name
564     * @return the location
565     */
566    Point getWindowLocation(String strClass);
567
568    /**
569     * Returns the width, height size of a given Window
570     *
571     * @param strClass the class name
572     * @return the size
573     */
574    Dimension getWindowSize(String strClass);
575
576    ArrayList<String> getWindowList();
577
578    /**
579     * Check if there are properties for the given class
580     *
581     * @param strClass class to check
582     * @return true if properties for strClass are maintained; false otherwise
583     */
584    boolean hasProperties(String strClass);
585
586    boolean getSaveWindowSize(String strClass);
587
588    boolean getSaveWindowLocation(String strClass);
589
590    /**
591     * Set if window sizes should be saved for a given class. Method has no
592     * effect if strClass is null or equals {@code jmri.util.JmriJFrame}.
593     *
594     * @param strClass name of the class
595     * @param b        true if window sizes should be saved; false otherwise
596     */
597    void setSaveWindowSize(String strClass, boolean b);
598
599    /**
600     * Set if window locations should be saved for a given class. Method has no
601     * effect if strClass is null or equals {@code jmri.util.JmriJFrame}.
602     *
603     * @param strClass name of the class
604     * @param b        true if window locations should be saved; false otherwise
605     */
606    void setSaveWindowLocation(String strClass, boolean b);
607
608    /**
609     * Attach a key/value pair to the given class, which can be retrieved later.
610     * These are not bound properties as yet, and don't throw events on
611     * modification. Key must not be null.
612     *
613     * @param strClass class to use
614     * @param key      Prior to 4.3.5, this could be an Object.
615     * @param value    value to use
616     */
617    void setProperty(String strClass, String key, Object value);
618
619    /**
620     * Retrieve the value associated with a key in a given class If no value has
621     * been set for that key, returns null.
622     *
623     * @param strClass class to use
624     * @param key      item to retrieve
625     * @return stored value
626     */
627    Object getProperty(String strClass, String key);
628
629    /**
630     * Retrieve the complete current set of keys for a given class.
631     *
632     * @param strClass class to use
633     * @return complete set of keys
634     */
635    java.util.Set<String> getPropertyKeys(String strClass);
636
637    /**
638     * Stores the element e to the user-interface.xml file.
639     * @param e the element to store
640     */
641    void storeElement(Element e);
642
643    /**
644     * Loads the element e from the user-interface.xml file.
645     * @param  elementName  the tag name of the element to load.
646     * @return the loaded element
647     * @throws IllegalArgumentException if there is no such element
648     */
649    @CheckForNull
650    Element loadElement(@Nonnull String elementName);
651
652    /*
653     Example informational message dialog box.
654
655     final UserPreferencesManager p;
656     p = jmri.InstanceManager.getDefault(jmri.UserPreferencesManager.class);
657     if (p.getProperty("thisClass", "routeSaveMsg") { // NOI18N
658         final JDialog dialog = new JDialog();
659         dialog.setTitle(Bundle.getMessage(""ReminderTitle")); // I18N
660         dialog.setLocationRelativeTo(null);
661         dialog.setDefaultCloseOperation(javax.swing.JFrame.DISPOSE_ON_CLOSE);
662         JPanel container = new JPanel();
663         container.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
664         container.setLayout(new BoxLayout(container, BoxLayout.Y_AXIS));
665
666         JLabel question = new JLabel("Remember to save your Route information.", JLabel.CENTER); // I18N
667         question.setAlignmentX(Component.CENTER_ALIGNMENT);
668         container.add(question);
669
670         JButton okButton = new JButton(Bundle.getMessage("ButtonOK");
671         JPanel buttons = new JPanel();
672         button.setAlignmentX(Component.CENTER_ALIGNMENT);
673         buttons.add(okButton);
674         container.add(buttons);
675
676         final JCheckBox remember = new JCheckBox(Bundle.getMessage("DontRemind");
677         remember.setAlignmentX(Component.CENTER_ALIGNMENT);
678         remember.setFont(remember.getFont().deriveFont(10f));
679         container.add(remember);
680
681         okButton.addActionListener(new ActionListener() {
682             public void actionPerformed(ActionEvent e) {
683                 p.setProperty("thisClass", "routeSaveMsg", remember.isSelected()) // NOI18N
684             }
685             dialog.dispose();
686         }
687         });
688
689         dialog.getContentPane().add(container);
690         dialog.pack();
691         dialog.setModal(true);
692         dialog.setVisible(true);
693     }
694
695 */
696
697 /*
698     Example question message dialog box.
699
700     final DefaultUserMessagePreferences p;
701     p = jmri.InstanceManager.getDefault(jmri.UserPreferencesManager.class);
702     if (p.getProperty("thisClass", "QuitAfterSave") == 0x00) { // NOI18N
703         final JDialog dialog = new JDialog();
704         dialog.setTitle(Bundle.getMessage("MessageShortQuitWarning")); // I18N
705         dialog.setLocationRelativeTo(null);
706         dialog.setDefaultCloseOperation(javax.swing.JFrame.DISPOSE_ON_CLOSE);
707         JPanel container = new JPanel();
708         container.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
709         container.setLayout(new BoxLayout(container, BoxLayout.Y_AXIS));
710
711         JLabel question = new JLabel(Bundle.getMessage("MessageLongQuitWarning")); // resource is in # AppsConfigBundle.properties
712         question.setAlignmentX(Component.CENTER_ALIGNMENT);
713         container.add(question);
714
715         final JCheckBox remember = new JCheckBox(Bundle.getMessage("MessageRememberSetting")); // I18N
716         remember.setFont(remember.getFont().deriveFont(10f));
717         remember.setAlignmentX(Component.CENTER_ALIGNMENT);
718
719         JButton yesButton = new JButton(Bundle.getMessage("ButtonYes"));
720         JButton noButton = new JButton(Bundle.getMessage("ButtonNo"));
721         JPanel buttons = new JPanel();
722         buttons.setAlignmentX(Component.CENTER_ALIGNMENT);
723         buttons.add(yesButton);
724         buttons.add(noButton);
725         container.add(buttons);
726
727         noButton.addActionListener(new ActionListener(){
728             public void actionPerformed(ActionEvent e) {
729                 if (remember.isSelected()) {
730                    p.setProperty("thisClass", "QuitAfterSave", 0x01) // NOI18N
731                 }
732                 dialog.dispose();
733             }
734         });
735
736         yesButton.addActionListener(new ActionListener(){
737             public void actionPerformed(ActionEvent e) {
738                 if (remember.isSelected()) {
739                    p.setProperty("thisClass", "QuitAfterSave", 0x02); // NOI18N
740                 }
741                 dialog.dispose();
742             }
743         });
744         container.add(remember);
745         container.setAlignmentX(Component.CENTER_ALIGNMENT);
746         container.setAlignmentY(Component.CENTER_ALIGNMENT);
747         dialog.getContentPane().add(container);
748         dialog.pack();
749         dialog.setModal(true);
750         dialog.setVisible(true);
751     }
752     */
753
754}