Class VaadinPreferences
java.lang.Object
java.util.prefs.Preferences
java.util.prefs.AbstractPreferences
vaadinx.util.prefs.VaadinPreferences
A
java.util.prefs.Preferences node backed by the browser's
localStorage — the web-faithful analog of Swing's machine-local
preferences store (Windows registry / ~/.java/.userPrefs/ / macOS
plist). Selected JVM-wide by VaadinPreferencesFactory through the
standard PreferencesFactory SPI, so migrated code keeps calling
Preferences.userNodeForPackage(...) unchanged. See D_preferences.
Extending AbstractPreferences means the tree walk,
keys()/childrenNames()/node(path)/removeNode(),
and the PreferenceChangeListener/NodeChangeListener fan-out
all come from the JDK. This class implements only the nine backing
*Spi methods, delegating storage to the per-UI PrefsCache.
The class is public only so tests and diagnostics can name the
type; every constructor is non-public, so user code cannot instantiate a node
directly (it obtains nodes via Preferences.userRoot() et al.).
Change listeners fire for local mutations (this UI) via
AbstractPreferences; a mutation in another browser tab does not fire
here — the documented multi-tab gap (D_preferences).
-
Field Summary
Fields inherited from class AbstractPreferences
lock, newNodeFields inherited from class Preferences
MAX_KEY_LENGTH, MAX_NAME_LENGTH, MAX_VALUE_LENGTH -
Method Summary
Methods inherited from class AbstractPreferences
absolutePath, addNodeChangeListener, addPreferenceChangeListener, cachedChildren, childrenNames, clear, exportNode, exportSubtree, flush, get, getBoolean, getByteArray, getChild, getDouble, getFloat, getInt, getLong, isRemoved, keys, name, node, nodeExists, parent, put, putBoolean, putByteArray, putDouble, putFloat, putInt, putLong, remove, removeNode, removeNodeChangeListener, removePreferenceChangeListener, sync, toStringMethods inherited from class Preferences
importPreferences, systemNodeForPackage, systemRoot, userNodeForPackage, userRoot
-
Method Details
-
getSpi
- Specified by:
getSpiin classAbstractPreferences
-
putSpi
- Specified by:
putSpiin classAbstractPreferences
-
removeSpi
- Specified by:
removeSpiin classAbstractPreferences
-
keysSpi
- Specified by:
keysSpiin classAbstractPreferences- Throws:
BackingStoreException
-
childrenNamesSpi
- Specified by:
childrenNamesSpiin classAbstractPreferences- Throws:
BackingStoreException
-
childSpi
- Specified by:
childSpiin classAbstractPreferences
-
removeNodeSpi
- Specified by:
removeNodeSpiin classAbstractPreferences- Throws:
BackingStoreException
-
syncSpi
- Specified by:
syncSpiin classAbstractPreferences- Throws:
BackingStoreException
-
flushSpi
- Specified by:
flushSpiin classAbstractPreferences- Throws:
BackingStoreException
-
isUserNode
public boolean isUserNode()Alwaystrue. Overridden so we don't inheritAbstractPreferences.isUserNode()'s default, which compares againstPreferences.userRoot()— that would re-enter our factory and require a current UI just to answer a boolean.- Overrides:
isUserNodein classAbstractPreferences
-