Top Description Methods
com.dlsc.preferencesfx.util

public Interface StorageHandler

Known Direct Implementers
com.dlsc.preferencesfx.util.PreferencesBasedStorageHandler
Imports
com.dlsc.preferencesfx.model.Setting, java.util.prefs.Preferences, javafx.collections.ObservableList

Abstraction for storing values of Setting. API user able to provide custom implementations by creating a new class and implementing this interface.
Authors
François Martin, Marco Sanfratello, kivimango

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if successful, false if there was an exception.
clearPreferences
()

Clears the storage.

public double

Returns:

the double value of the divider position
loadDividerPosition
()

Gets the stored divider position of the MasterDetailPane.

public Object

Returns:

the deserialized Object or the default Object if nothing is found
loadObject
(String
the key which is used to search the serialized Object
breadcrumb
,
Object
the Object which will be returned if nothing is found
defaultObject
)

Searches in the storage 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 found
loadObject
(String
the 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
)

Searches in the storage after a serialized Object using the given key, deserializes and returns it.

public ObservableList<E>

Returns:

the deserialized ObservableList or the default ObservableList if nothing is found
loadObservableList
(String
the key which is used to search the serialized ArrayList
breadcrumb
,
ObservableList<E>
the default ObservableList which will be returned if nothing is found
defaultObservableList
)

Searches in the storage 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<T>

Returns:

the deserialized ObservableList or the default ObservableList if nothing is found
loadObservableList
(String
the 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
)

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
loadSelectedCategory
()

Gets the last selected category in TreeSearchView.

public double

Returns:

the double value of the window height
loadWindowHeight
()

Searches for the window height of the PreferencesFxDialog.

public double

Returns:

the double value of the horizontal window position
loadWindowPosX
()

Searches for the horizontal window position.

public double

Returns:

the double value of the vertical window position
loadWindowPosY
()

Searches for the vertical window position.

public double

Returns:

the double value of the window width
loadWindowWidth
()

Searches for the window width of the PreferencesFxDialog.

public void
saveDividerPosition(double
the divider position to be stored
dividerPosition
)

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
)

Serializes a given Object and saves it to the storage using the given key.

public void
saveSelectedCategory(String
the category path as a breadcrumb string
breadcrumb
)

Stores the last selected category in TreeSearchView.

public void
saveWindowHeight(double
the height of the window to be stored
windowHeight
)

Stores the window height of the PreferencesFxDialog.

public void
saveWindowPosX(double
the double value of the window position in horizontal orientation
windowPosX
)

Stores the position of the PreferencesFxDialog in horizontal orientation.

public void
saveWindowPosY(double
the double value of the window position in vertical orientation
windowPosY
)

Stores the position of the PreferencesFxDialog in vertical orientation.

public void
saveWindowWidth(double
the width of the window to be stored
windowWidth
)

Stores the window width of the PreferencesFxDialog.

Method Detail

clearPreferencesback to summary
public boolean clearPreferences()

Clears the storage.

Returns:boolean

true if successful, false if there was an exception.

loadDividerPositionback to summary
public double loadDividerPosition()

Gets the stored divider position of the MasterDetailPane.

Returns:double

the double value of the divider position

loadObjectback to summary
public Object loadObject(String breadcrumb, Object defaultObject)

Searches in the storage after a serialized Object using the given key, deserializes and returns it. Returns a default Object if nothing is found.

Parameters
breadcrumb:String

the key which is used to search the serialized Object

defaultObject:Object

the Object which will be returned if nothing is found

Returns:Object

the deserialized Object or the default Object if nothing is found

loadObjectback to summary
public <T> T loadObject(String breadcrumb, Class<T> type, T defaultObject)

Searches in the storage after a serialized Object using the given key, deserializes and returns it. Returns a default Object if nothing is found.

Parameters
<T>
the type of object returned by this method
breadcrumb:String

the key which is used to search the serialized Object

type:Class<T>

the type of object used for deserialization

defaultObject:T

the Object which will be returned if nothing is found

Returns:T

the deserialized Object or the default Object if nothing is found

loadObservableListback to summary
public ObservableList<E> loadObservableList(String breadcrumb, ObservableList<E> defaultObservableList)

Searches in the storage after a serialized List using the given key, deserializes and returns it as ObservableList.

Parameters
breadcrumb:String

the key which is used to search the serialized ArrayList

defaultObservableList:ObservableList<E>

the default ObservableList which will be returned if nothing is found

Returns:ObservableList<E>

the deserialized ObservableList or the default ObservableList if nothing is found

loadObservableListback to summary
public <T> ObservableList<T> loadObservableList(String breadcrumb, Class<T> type, ObservableList<T> defaultObservableList)

Searches in the storage after a serialized List using the given key, deserializes and returns it as ObservableList.

Parameters
<T>
the type inside the list returned by this method
breadcrumb:String

the key which is used to search the serialized ArrayList

type:Class<T>

the of object used for deserialization the objects inside the list

defaultObservableList:ObservableList<T>

the default ObservableList which will be returned if nothing is found

Returns:ObservableList<T>

the deserialized ObservableList or the default ObservableList if nothing is found

loadSelectedCategoryback to summary
public String loadSelectedCategory()

Gets the last selected category in TreeSearchView.

Returns:String

the breadcrumb string of the selected category

loadWindowHeightback to summary
public double loadWindowHeight()

Searches for the window height of the PreferencesFxDialog.

Returns:double

the double value of the window height

loadWindowPosXback to summary
public double loadWindowPosX()

Searches for the horizontal window position.

Returns:double

the double value of the horizontal window position

loadWindowPosYback to summary
public double loadWindowPosY()

Searches for the vertical window position.

Returns:double

the double value of the vertical window position

loadWindowWidthback to summary
public double loadWindowWidth()

Searches for the window width of the PreferencesFxDialog.

Returns:double

the double value of the window width

saveDividerPositionback to summary
public void saveDividerPosition(double dividerPosition)

Stores the given divider position of the MasterDetailPane.

Parameters
dividerPosition:double

the divider position to be stored

saveObjectback to summary
public void saveObject(String breadcrumb, Object object)

Serializes a given Object and saves it to the storage using the given key.

Parameters
breadcrumb:String

the key which is used to save the serialized Object

object:Object

the Object which will be saved

saveSelectedCategoryback to summary
public void saveSelectedCategory(String breadcrumb)

Stores the last selected category in TreeSearchView.

Parameters
breadcrumb:String

the category path as a breadcrumb string

saveWindowHeightback to summary
public void saveWindowHeight(double windowHeight)

Stores the window height of the PreferencesFxDialog.

Parameters
windowHeight:double

the height of the window to be stored

saveWindowPosXback to summary
public void saveWindowPosX(double windowPosX)

Stores the position of the PreferencesFxDialog in horizontal orientation.

Parameters
windowPosX:double

the double value of the window position in horizontal orientation

saveWindowPosYback to summary
public void saveWindowPosY(double windowPosY)

Stores the position of the PreferencesFxDialog in vertical orientation.

Parameters
windowPosY:double

the double value of the window position in vertical orientation

saveWindowWidthback to summary
public void saveWindowWidth(double windowWidth)

Stores the window width of the PreferencesFxDialog.

Parameters
windowWidth:double

the width of the window to be stored