001/**
002*   Please feel free to use any fragment of the code in this file that you need
003*   in your own work. As far as I am concerned, it's in the public domain. No
004*   permission is necessary or required. Credit is always appreciated if you
005*   use a large chunk or base a significant product on one of my examples,
006*   but that's not required either.
007*
008*   This code is distributed in the hope that it will be useful,
009*   but WITHOUT ANY WARRANTY; without even the implied warranty of
010*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
011*
012*      --- Joseph A. Huwaldt
013*/
014package jahuwaldt.swing;
015
016
017/**
018*  An interface in common to preference classes in my applications.
019*
020*  <p>  Modified by:  Joseph A. Huwaldt   </p>
021*
022*  @author  Joseph A. Huwaldt   Date: February 18, 2009
023*  @version February 22, 2025
024*/
025public interface Preferences {
026
027        /**
028        *  Returns the file path to the parent of the last referenced file.
029        *  Returns null if no last path could be found.
030        *
031        *  @return The file path to the parent of the last referenced file.
032        */
033        public String getLastPath();
034        
035        /**
036        *  Set the last file path referenced by the user.  This is the path
037        *  to the last parent of the last referenced file.
038        *
039        * @param path The last file path referenced by the user. 
040        */
041        public void setLastPath(String path);
042        
043        /**
044        *  Method that displays a dialog that allows the user to change the application preferences.
045        *  This method may do nothing if the application does not support displaying a preference
046        *  dialog.
047        */
048        public void showPreferenceDialog();
049        
050        /**
051         * Return the preference with the specified key String.
052         *
053         *  @param key  The key String identifying the preference to be retrieved.
054         *  @return The preference with the specified key.
055         */
056        public String get(String key);
057        
058        /**
059         * Set the preference with the specified key String.
060         *
061         *  @param key  The key String identifying the preference to be set.
062         *  @param value THe String value to store as the preference.
063         */
064        public void set(String key, String value);
065        
066}