Setting using Preferences.
| Modifier and Type | Field and Description |
|---|---|
| private static final Logger | |
| private Preferences |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if successful, false if there was an exception.Implements com. Clears the preferences. |
| protected abstract < the type of object into which to deserialze the string T> T | Returns: the deserialized objectthe string to deserialze serialized, Class<T> the class into which to deserialize the string type)Deserializes an object from a string for storage. |
| protected abstract < the type of objects in the list T> List | Returns: deserialized listthe string to deserialze serialized, Class<T> the class into which to deserialize the string type)Deserializes a list of objects from a string for storage. |
| public Preferences | |
| private String | |
| private Class | |
| public String | |
| public double | Returns: the double value of the divider position. 0.2 if none is foundImplements com. Gets the stored divider position of the MasterDetailPane. |
| public Object | Returns: the deserialized Object or the default Object if nothing is foundthe key which is used to search the serialized Object breadcrumb, Object the Object which will be returned if nothing is found defaultObject)Implements com. Searches in the preferences after a serialized Object using the given key, deserializes and returns it. |
| public < the type of object returned by this method T> T | Returns: the deserialized Object or the default Object if nothing is foundthe key which is used to search the serialized Object breadcrumb, Class<T> the type of object used for deserialization type, T the Object which will be returned if nothing is found defaultObject)Implements com. Searches in the preferences after a serialized Object using the given key, deserializes and returns it. |
| public ObservableList | Returns: the deserialized ObservableList or the default ObservableList if nothing is foundthe key which is used to search the serialized ArrayList breadcrumb, ObservableList<E> the default ObservableList
which will be returned if nothing is found defaultObservableList)Implements com. Searches in the preferences after a serialized List using the given key, deserializes and returns it as ObservableList. |
| public < the type inside the list returned by this method T> ObservableList | Returns: the deserialized ObservableList or the default ObservableList if nothing is foundthe key which is used to search the serialized ArrayList breadcrumb, Class<T> the of object used for deserialization the objects inside the list type, ObservableList<T> the default ObservableList which will be returned if nothing is
found defaultObservableList)Implements com. Searches in the storage after a serialized List using the given key, deserializes and returns it as ObservableList. |
| public String | Returns: the breadcrumb string of the selected category. null if none is foundImplements com. Gets the last selected category in TreeSearchView. |
| public double | Returns: the double value of the window height. 700 if none is foundImplements com. Searches for the window height of the PreferencesFxDialog. |
| public double | Returns: the double value of the horizontal window positionImplements com. Searches for the horizontal window position. |
| public double | Returns: the double value of the vertical window positionImplements com. Searches for the vertical window position. |
| public double | Returns: the double value of the window width. 1000 if none is foundImplements com. Searches for the window width of the PreferencesFxDialog. |
| public void | saveDividerPosition(double
the divider position to be stored dividerPosition)Implements com. Stores the given divider position of the MasterDetailPane. |
| public void | saveObject(String
the key which is used to save the serialized Object breadcrumb, Object the Object which will be saved object)Implements com. Serializes a given Object and saves it to the preferences using the given key. |
| public void | saveSelectedCategory(String
the category path as a breadcrumb string breadcrumb)Implements com. Stores the last selected category in TreeSearchView. |
| public void | saveWindowHeight(double
the height of the window to be stored windowHeight)Implements com. Stores the window height of the PreferencesFxDialog. |
| public void | saveWindowPosX(double
the double value of the window position in horizontal orientation windowPosX)Implements com. Stores the position of the PreferencesFxDialog in horizontal orientation. |
| public void | saveWindowPosY(double
the double value of the window position in vertical orientation windowPosY)Implements com. Stores the position of the PreferencesFxDialog in vertical orientation. |
| public void | saveWindowWidth(double
the width of the window to be stored windowWidth)Implements com. Stores the window width of the PreferencesFxDialog. |
| protected abstract String |
| LOGGER | back to summary |
|---|---|
| private static final Logger LOGGER | |
| preferences | back to summary |
|---|---|
| private Preferences preferences | |
| PreferencesBasedStorageHandler | back to summary |
|---|---|
| public PreferencesBasedStorageHandler(Class<?> saveClass) | |
| clearPreferences | back to summary |
|---|---|
| public boolean clearPreferences() Implements com. Clears the preferences.
| |
| deserialize | back to summary |
|---|---|
| protected abstract <T> T deserialize(String serialized, Class<T> type) Deserializes an object from a string for storage. Subclasses may use any way to deserialize the object.
This should be the inverse operation of Therefore the following must hold true for any x of type X: Objects.equals(x, deserialize(serialize(x), X.class) | |
| deserializeList | back to summary |
|---|---|
| protected abstract <T> List Deserializes a list of objects from a string for storage. Subclasses may use any way to deserialize the list.
This should be the inverse operation of Therefore the following must hold true for any x of type List<X>: Objects.equals(x, deserializeList(serialize(x), X.class) | |
| getPreferences | back to summary |
|---|---|
| public Preferences getPreferences() | |
| getSerializedPreferencesValue | back to summary |
|---|---|
| private String getSerializedPreferencesValue(String breadcrumb, String serializedDefault) | |
| getTypeFromList | back to summary |
|---|---|
| private Class | |
| hash | back to summary |
|---|---|
| public String hash(String key) Generates a SHA-256 hash of a String.
Since | |
| loadDividerPosition | back to summary |
|---|---|
| public double loadDividerPosition() Implements com. Gets the stored divider position of the MasterDetailPane.
| |
| loadObject | back to summary |
|---|---|
| public Object loadObject(String breadcrumb, Object defaultObject) Implements com. Searches in the preferences after a serialized Object using the given key, deserializes and returns it. Returns a default Object if nothing is found. | |
| loadObject | back to summary |
|---|---|
| public <T> T loadObject(String breadcrumb, Class<T> type, T defaultObject) Implements com. Searches in the preferences after a serialized Object using the given key, deserializes and returns it. Returns a default Object if nothing is found.
| |
| loadObservableList | back to summary |
|---|---|
| public ObservableList Implements com. Searches in the preferences after a serialized List using the given key, deserializes and returns it as ObservableList.
| |
| loadObservableList | back to summary |
|---|---|
| public <T> ObservableList Implements com. Searches in the storage after a serialized List using the given key, deserializes and returns it as ObservableList.
| |
| loadSelectedCategory | back to summary |
|---|---|
| public String loadSelectedCategory() Implements com. Gets the last selected category in TreeSearchView.
| |
| loadWindowHeight | back to summary |
|---|---|
| public double loadWindowHeight() Implements com. Searches for the window height of the PreferencesFxDialog.
| |
| loadWindowPosX | back to summary |
|---|---|
| public double loadWindowPosX() Implements com. Searches for the horizontal window position.
| |
| loadWindowPosY | back to summary |
|---|---|
| public double loadWindowPosY() Implements com. Searches for the vertical window position.
| |
| loadWindowWidth | back to summary |
|---|---|
| public double loadWindowWidth() Implements com. Searches for the window width of the PreferencesFxDialog.
| |
| saveDividerPosition | back to summary |
|---|---|
| public void saveDividerPosition(double dividerPosition) Implements com. Stores the given divider position of the MasterDetailPane.
| |
| saveObject | back to summary |
|---|---|
| public void saveObject(String breadcrumb, Object object) Implements com. Serializes a given Object and saves it to the preferences using the given key. | |
| saveSelectedCategory | back to summary |
|---|---|
| public void saveSelectedCategory(String breadcrumb) Implements com. Stores the last selected category in TreeSearchView.
| |
| saveWindowHeight | back to summary |
|---|---|
| public void saveWindowHeight(double windowHeight) Implements com. Stores the window height of the PreferencesFxDialog.
| |
| saveWindowPosX | back to summary |
|---|---|
| public void saveWindowPosX(double windowPosX) Implements com. Stores the position of the PreferencesFxDialog in horizontal orientation.
| |
| saveWindowPosY | back to summary |
|---|---|
| public void saveWindowPosY(double windowPosY) Implements com. Stores the position of the PreferencesFxDialog in vertical orientation.
| |
| saveWindowWidth | back to summary |
|---|---|
| public void saveWindowWidth(double windowWidth) Implements com. Stores the window width of the PreferencesFxDialog.
| |
| serialize | back to summary |
|---|---|
| protected abstract String serialize(Object object) Serializes an object to a string for storage. Subclasses may use any way to serialize the object.
This should be the inverse operation of Therefore the following must hold true for any x of type X: Objects.equals(x, deserialize(serialize(x), X.class) | |