Class ProjectCheckSettings
java.lang.Object
com.e1c.g5.v8.dt.internal.check.settings.ProjectCheckSettings
Holder of the check settings for the project and basic data manipulation methods
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionProjectCheckSettings
(IProjectCheckSettingsProfileStore store, ICheckMetadataManager checkMetadataManager, ICheckDescriptionStore checkDescriptionStore) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionapplyChanges
(Collection<ICheckSettings> settings) Applies changes to the active settings profiledeleteProfile
(String profileName) Deletes the profile.void
duplicateSettingsProfile
(String sourceSettingsProfile, String destinationSettingsProfile) Duplicates given profile and names it accordinglyvoid
exportSettingsProfile
(String profileName, Path destinationPath) Export check settings profile as a file to external destinationGets an active settings profile name for the corresponding projectGets the set of available check settings profiles for the corresponding projectgetCustomizedSettingsFromProfile
(String profileName) Gets the set of changed settings from the profilegetDefaultSettings
(CheckUid checkUid) Gets default settings (defined during the check registration/inside the check itself) for the given checkgetDefaultSettingsForProfile
(String profileName) Gets the default settings for the given profile (for all changed settings)getSettings
(CheckUid checkId) Gets the settings for the given check.void
importSettingsProfile
(Path path) Imports an external settings profile into the project's set of profilesboolean
Checks if the massive automatic check pre-computation process is disabledboolean
isSettingsProfileFileUpdateExpected
(String profileName) void
Loads data from a persistent storevoid
Forced update of available profiles from the storeLoads the state from external resources.void
renameSettingsProfile
(String currentProfileName, String newProfileName) Renames the settings profile using the provided name.void
resetSettingsProfileFileUpdatedFlag
(String profileName) setActiveSettingsProfile
(String profileName, Collection<ICheckSettings> checkSettings, boolean forceUpdate) Sets an active profilevoid
setMassiveCheckProcessDisabled
(boolean massiveCheckProcessDisabled) Sets/resets massive check mode
-
Field Details
-
PROFILE_EXTENSION
- See Also:
-
-
Constructor Details
-
ProjectCheckSettings
public ProjectCheckSettings(IProjectCheckSettingsProfileStore store, ICheckMetadataManager checkMetadataManager, ICheckDescriptionStore checkDescriptionStore) Creates a new instance.- Parameters:
store
- preferences store, notnull
checkRepository
- check repository, notnull
-
-
Method Details
-
applyChanges
Applies changes to the active settings profile- Parameters:
settings
- The collection of changed settings. May not benull
newProfileName
-
-
deleteProfile
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 benull
- 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 benull
destinationProfileName
- The destination profile name. May not benull
. Must be unqique among currently registered profiles
-
exportSettingsProfile
Export check settings profile as a file to external destination- Parameters:
profileName
- The name of the profile to export. May not benull
destinationPath
- The destination path to export file to. May not benull
-
getActiveSettingsProfile
Gets an active settings profile name for the corresponding project- Returns:
- The name of the profile. Never
null
-
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
Gets the set of changed settings from the profile- Parameters:
profileName
- The name of the profile, may not benull
- Returns:
-
getDefaultSettings
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 benull
- Returns:
- The settings of the check. May not be
null
-
getDefaultSettingsForProfile
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 benull
- Returns:
- The set of settings which may return all changed settings to the default level. May not be
null
-
getSettings
Gets the settings for the given check. Takes user-defined settings into the account- Parameters:
checkId
- The unique identifier of the check. May not benull
- Returns:
- The settings of the check, never
null
- Throws:
IllegalStateException
- In case if the given checkId isn't registered in the system
-
importSettingsProfile
Imports an external settings profile into the project's set of profiles- Parameters:
path
- The path to the profile. May not benull
-
isSettingsProfileFileUpdateExpected
-
refreshAvailableProfiles
public void refreshAvailableProfiles()Forced update of available profiles from the store -
renameSettingsProfile
Renames the settings profile using the provided name.- Parameters:
currentProfileName
- Current name of the profile. May not benull
newName
- The new name of the profile. May not benull
-
resetSettingsProfileFileUpdatedFlag
-
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 benull
checkSettings
- The set of profile's check settings with protentional modifications made by user after the profile change. May not benull
, 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
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
-