Class EASyPreferenceStore


  • public class EASyPreferenceStore
    extends java.lang.Object
    Implements a frontend for EASy-specific Eclipse preference store values.
    Author:
    Holger Eichelberger, Niko Nowatzki
    • Constructor Detail

      • EASyPreferenceStore

        public EASyPreferenceStore()
    • 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 in Configuration.PathKind will 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 in Configuration.DEFAULT are only overwritten if actual values are given in the preference store. All constants defined in Configuration.PathKind will 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:
        true for 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 (default false, 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)