Class EASyPreferenceStore
- java.lang.Object
-
- net.ssehub.easy.producer.ui.internal.EASyPreferenceStore
-
public class EASyPreferenceStore extends java.lang.ObjectImplements a frontend for EASy-specific Eclipse preference store values.- Author:
- Holger Eichelberger, Niko Nowatzki
-
-
Constructor Summary
Constructors Constructor Description EASyPreferenceStore()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static voidflush(org.eclipse.core.runtime.preferences.IEclipsePreferences prefs)Flushes (and saves) the given preferences object.private static java.lang.StringgetArgumentsKey(VilArgumentProvider provider)Returns the key for the free arguments of a VIL argument provider.static java.util.LocalegetDefaultLocale()Returns the default locale from preferences.static java.lang.StringgetDefaultLocaleAsString()Returns the default locale as string.static ReasonerDescriptorgetDefaultReasoner()Returns the default reasoner via the preferences store.static java.lang.StringgetInitialLocaleAsString()Returns the initial locale as string.static intgetIvmlIndentStep()Get the indentation.private static java.lang.StringgetKey(Configuration.PathKind kind)Returns the key used for a path kind.static booleangetOclCompliance()Returns whether OCL compliance settings shall be enabled.private static org.eclipse.core.runtime.preferences.IEclipsePreferencesgetPreferences()Returns the actual preferences.private static java.lang.StringgetStateKey(VilArgumentProvider provider)Returns the key for the state of a VIL argument provider.static booleangetUseIvmlWhitespace()Get to know whether tabs are allowed or not.static voidloadDefaultConfiguration()Loads the default configuration from the preference store.static voidloadIvmlPreferences()Loads the properties for indentation.static voidloadOnStart()Loads default information on startup.static voidloadVilArgumentProviderStates()Loads the state of all VIL argument providers.static voidpersistDefaultConfiguration()Persists the default configuration into the preference store.static voidpersistVilArgumentProviderStates()Stores the state of all VIL argument providers.static voidsetDefaultLocale(java.lang.String loc)Changes the default locale.static voidsetDefaultReasoner(ReasonerDescriptor desc)Sets the default reasoner.static voidsetIvmlPrefs(int indentStep, boolean useWhitespaces)Save the indentation and the permission of whitespaces in preferences.static voidsetOclCompliance(boolean compliance)Defines the actual OCL compliance state for EASy-Producer.
-
-
-
Method Detail
-
getPreferences
private static org.eclipse.core.runtime.preferences.IEclipsePreferences getPreferences()
Returns the actual preferences.- Returns:
- the preferences
-
getKey
private static java.lang.String getKey(Configuration.PathKind kind)
Returns the key used for a path kind.- Parameters:
kind- the path kind to return the key for- Returns:
- the key
-
persistDefaultConfiguration
public static void persistDefaultConfiguration()
Persists the default configuration into the preference store. All constants defined inConfiguration.PathKindwill be considered.
-
flush
private static void flush(org.eclipse.core.runtime.preferences.IEclipsePreferences prefs)
Flushes (and saves) the given preferences object.- Parameters:
prefs- the preferences to be flushed
-
loadOnStart
public static void loadOnStart()
Loads default information on startup. To be called by an activator.
-
loadDefaultConfiguration
public static void loadDefaultConfiguration()
Loads the default configuration from the preference store. Values inConfiguration.DEFAULTare only overwritten if actual values are given in the preference store. All constants defined inConfiguration.PathKindwill be considered.
-
getArgumentsKey
private static final java.lang.String getArgumentsKey(VilArgumentProvider provider)
Returns the key for the free arguments of a VIL argument provider.- Parameters:
provider- the provider- Returns:
- the key
-
getStateKey
private static final java.lang.String getStateKey(VilArgumentProvider provider)
Returns the key for the state of a VIL argument provider.- Parameters:
provider- the provider- Returns:
- the key
-
persistVilArgumentProviderStates
public static void persistVilArgumentProviderStates()
Stores the state of all VIL argument providers.
-
loadVilArgumentProviderStates
public static void loadVilArgumentProviderStates()
Loads the state of all VIL argument providers.
-
loadIvmlPreferences
public static void loadIvmlPreferences()
Loads the properties for indentation.
-
setIvmlPrefs
public static void setIvmlPrefs(int indentStep, boolean useWhitespaces)Save the indentation and the permission of whitespaces in preferences.- Parameters:
indentStep- Amount of spaces for indentation.useWhitespaces- true - whitespaces are allowed. false - whitespaces are not allowed.
-
getIvmlIndentStep
public static int getIvmlIndentStep()
Get the indentation.- Returns:
- indent the stored indentation.
-
getUseIvmlWhitespace
public static boolean getUseIvmlWhitespace()
Get to know whether tabs are allowed or not.- Returns:
- useWhitespaces Returns true - whitespaces are allowed. false - whitespaces are not allowed.
-
getOclCompliance
public static boolean getOclCompliance()
Returns whether OCL compliance settings shall be enabled.- Returns:
truefor OCL compliance settings,false(default) else
-
getDefaultLocale
public static java.util.Locale getDefaultLocale()
Returns the default locale from preferences.- Returns:
- the default locale
-
getDefaultLocaleAsString
public static java.lang.String getDefaultLocaleAsString()
Returns the default locale as string.- Returns:
- the default locale
-
setDefaultLocale
public static void setDefaultLocale(java.lang.String loc)
Changes the default locale.- Parameters:
loc- the textual description for the default locale (ignored if null or empty)
-
getInitialLocaleAsString
public static java.lang.String getInitialLocaleAsString()
Returns the initial locale as string.- Returns:
- the initial locale
-
setOclCompliance
public static void setOclCompliance(boolean compliance)
Defines the actual OCL compliance state for EASy-Producer.- Parameters:
compliance- the compliance state (defaultfalse, i.e., no compliance checking)
-
setDefaultReasoner
public static void setDefaultReasoner(ReasonerDescriptor desc)
Sets the default reasoner. Propagates the default reasoner into the reasoner frontend.- Parameters:
desc- the new default reasoner (may be null to clear the default reasoner)
-
getDefaultReasoner
public static ReasonerDescriptor getDefaultReasoner()
Returns the default reasoner via the preferences store.- Returns:
- the default reasoner (may be null if no default reasoner is selected)
-
-