Class ProjectCheckSettings

java.lang.Object
com.e1c.g5.v8.dt.internal.check.settings.ProjectCheckSettings

public class ProjectCheckSettings extends Object
Holder of the check settings for the project and basic data manipulation methods
  • Field Details

  • Constructor Details

  • Method Details

    • applyChanges

      public Collection<CheckSettingsChange> applyChanges(Collection<ICheckSettings> settings)
      Applies changes to the active settings profile
      Parameters:
      settings - The collection of changed settings. May not be null
      newProfileName -
    • deleteProfile

      public Collection<CheckSettingsChange> deleteProfile(String profileName)
      Deletes the profile. In case of the removal of an active profile - switches to the first applicable profile and returns the change delta. In case of the removal of the last profile - creates a default and returns the delta with the removed profile
      Parameters:
      profileName - The name of the profile to delete. May not be null
      Returns:
      The settings delta between the new active profile and removed one (in case if the profile is active). Empty collection otherwise. Never null
    • duplicateSettingsProfile

      public void duplicateSettingsProfile(String sourceSettingsProfile, String destinationSettingsProfile)
      Duplicates given profile and names it accordingly
      Parameters:
      sourceProfileName - The source profile name. May not be null
      destinationProfileName - The destination profile name. May not be null. Must be unqique among currently registered profiles
    • exportSettingsProfile

      public void exportSettingsProfile(String profileName, Path destinationPath)
      Export check settings profile as a file to external destination
      Parameters:
      profileName - The name of the profile to export. May not be null
      destinationPath - The destination path to export file to. May not be null
    • getActiveSettingsProfile

      public String getActiveSettingsProfile()
      Gets an active settings profile name for the corresponding project
      Returns:
      The name of the profile. Never null
    • getAvailableSettingsProfiles

      public Collection<String> getAvailableSettingsProfiles()
      Gets the set of available check settings profiles for the corresponding project
      Returns:
      The collection of available profile names. May not be null
    • getCustomizedSettingsFromProfile

      public Map<CheckUid,ICheckSettings> getCustomizedSettingsFromProfile(String profileName)
      Gets the set of changed settings from the profile
      Parameters:
      profileName - The name of the profile, may not be null
      Returns:
    • getDefaultSettings

      public ICheckSettings getDefaultSettings(CheckUid checkUid)
      Gets default settings (defined during the check registration/inside the check itself) for the given check
      Parameters:
      checkId - The check to get settings for. May not be null
      Returns:
      The settings of the check. May not be null
    • getDefaultSettingsForProfile

      public Map<CheckUid,ICheckSettings> getDefaultSettingsForProfile(String profileName)
      Gets the default settings for the given profile (for all changed settings)
      Parameters:
      profileName - The name of the profile to get default settings for. May not be null
      Returns:
      The set of settings which may return all changed settings to the default level. May not be null
    • getSettings

      public ICheckSettings getSettings(CheckUid checkId)
      Gets the settings for the given check. Takes user-defined settings into the account
      Parameters:
      checkId - The unique identifier of the check. May not be null
      Returns:
      The settings of the check, never null
      Throws:
      IllegalStateException - In case if the given checkId isn't registered in the system
    • importSettingsProfile

      public void importSettingsProfile(Path path)
      Imports an external settings profile into the project's set of profiles
      Parameters:
      path - The path to the profile. May not be null
    • isSettingsProfileFileUpdateExpected

      public boolean isSettingsProfileFileUpdateExpected(String profileName)
    • refreshAvailableProfiles

      public void refreshAvailableProfiles()
      Forced update of available profiles from the store
    • renameSettingsProfile

      public void renameSettingsProfile(String currentProfileName, String newProfileName)
      Renames the settings profile using the provided name.
      Parameters:
      currentProfileName - Current name of the profile. May not be null
      newName - The new name of the profile. May not be null
    • resetSettingsProfileFileUpdatedFlag

      public void resetSettingsProfileFileUpdatedFlag(String profileName)
    • setActiveSettingsProfile

      public Collection<CheckSettingsChange> setActiveSettingsProfile(String profileName, Collection<ICheckSettings> checkSettings, boolean forceUpdate)
      Sets an active profile
      Parameters:
      profileName - The new profile name to set. May not be null
      checkSettings - The set of profile's check settings with protentional modifications made by user after the profile change. May not be null, may be empty
      Returns:
      The collection of changes comparing to the current settings. Used for the revalidation. Never null
      Throws:
      ProfileStorageException - In case if provided profile
    • isMassiveCheckProcessDisabled

      public boolean isMassiveCheckProcessDisabled()
      Checks if the massive automatic check pre-computation process is disabled
      Returns:
      True if the process is disabled
    • setMassiveCheckProcessDisabled

      public void setMassiveCheckProcessDisabled(boolean massiveCheckProcessDisabled)
      Sets/resets massive check mode
      Parameters:
      massiveCheckProcessDisabled - The mode to set
    • reloadFromResources

      public Collection<CheckSettingsChange> reloadFromResources()
      Loads the state from external resources. Sets all necessary defaults
      Returns:
      The set of changes based on the current state of the settings
    • loadSettingsFromStore

      public void loadSettingsFromStore()
      Loads data from a persistent store