Package de.sciss.gui

Class PrefMenuAction

    • Field Summary

      • Fields inherited from class javax.swing.AbstractAction

        changeSupport, enabled
      • Fields inherited from interface javax.swing.Action

        ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
    • Constructor Summary

      Constructors 
      Constructor Description
      PrefMenuAction​(java.lang.String text, javax.swing.KeyStroke shortcut)  
      PrefMenuAction​(java.lang.String text, javax.swing.KeyStroke shortcut, boolean readPrefs, boolean writePrefs)  
    • Constructor Detail

      • PrefMenuAction

        public PrefMenuAction​(java.lang.String text,
                              javax.swing.KeyStroke shortcut)
      • PrefMenuAction

        public PrefMenuAction​(java.lang.String text,
                              javax.swing.KeyStroke shortcut,
                              boolean readPrefs,
                              boolean writePrefs)
    • Method Detail

      • canWritePrefs

        protected boolean canWritePrefs()
      • shouldWritePrefs

        protected boolean shouldWritePrefs()
      • setPreferences

        public void setPreferences​(java.util.prefs.Preferences prefs,
                                   java.lang.String key)
        Description copied from interface: PreferenceEntrySync
        Enables Preferences synchronization. This method is not thread safe and must be called from the event thread. When a preference change is received, the GUI is updated and dispatches an event to registered listeners. Likewise, if the user adjusts the GUI value, the preference will be updated. The same is true, if you call one of the value changing methods.
        Specified by:
        setPreferences in interface PreferenceEntrySync
        Parameters:
        prefs - the preferences node in which the value is stored, or null to disable prefs sync.
        key - the key used to store and recall prefs. the value is converted into a string.
      • getPreferenceNode

        public java.util.prefs.Preferences getPreferenceNode()
        Description copied from interface: PreferenceEntrySync
        Gets the recently set preference node
        Specified by:
        getPreferenceNode in interface PreferenceEntrySync
        Returns:
        the node set with setPreferences or null if no prefs were set
      • getPreferenceKey

        public java.lang.String getPreferenceKey()
        Description copied from interface: PreferenceEntrySync
        Gets the recently set preference key
        Specified by:
        getPreferenceKey in interface PreferenceEntrySync
        Returns:
        the key set with setPreferences or null if no prefs were set
      • preferenceChange

        public void preferenceChange​(java.util.prefs.PreferenceChangeEvent e)
        Specified by:
        preferenceChange in interface java.util.prefs.PreferenceChangeListener
      • readPrefsFromString

        protected abstract void readPrefsFromString​(java.lang.String prefsValue)