Package com.e1c.g5.v8.dt.check.settings
Interface ICheckRepository
-
- All Superinterfaces:
com.e1c.g5.v8.dt.internal.check.ICheckMetadataManager
public interface ICheckRepository extends com.e1c.g5.v8.dt.internal.check.ICheckMetadataManager
Unified check repository. Provides access to all registered checks and their metadata (settings, parameters, etc) It's a public service and may be used as a standard EDT lifecycle-aware service
-
-
Field Summary
Fields Modifier and Type Field Description static String
SERVICE_NAME
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addChangeListener(ICheckSettingsChangeListener listener)
Adds check settings change listenervoid
applyChanges(Collection<ICheckSettings> checkSettings, org.eclipse.core.resources.IProject project)
Apply changes to the currently active settings profilevoid
deleteSettingsProfile(String profileName, org.eclipse.core.resources.IProject project)
Deletes the settings profile with the given name (if exists).void
duplicateSettingsProfile(String profileName, String newProfileName, org.eclipse.core.resources.IProject project)
Duplicates the settings profile.void
exportSettingsProfile(String profileName, Path destinationPath, org.eclipse.core.resources.IProject project)
Export check settings profile as a file to an external destinationString
getActiveSettingsProfile(org.eclipse.core.resources.IProject project)
Gets an active settings profile name for the given projectCollection<CheckUid>
getApplicableDelegates(Class<?> targetObjectClass, Object sourceObject, IDtProject dtProject)
Gets applicable delegate checks for the given context, if anyCollection<String>
getAvailableSettingsProfiles(org.eclipse.core.resources.IProject project)
Gets the set of available check settings profiles for the projectICheck
getCheck(CheckUid checkId, IDtProject dtProject)
Gets the check using its UID and corresponding project settingsMap<CheckUid,ICheck>
getCheck(String checkId, IDtProject project)
Gets the set of checks using their public identifier.ICheckParameters
getCheckParameters(CheckUid checkId, org.eclipse.core.resources.IProject project)
Returns the immutable view of check execution parameters by names.ICheckProcessPreferences
getCheckProcessPreferences()
Gets the check process preferencesSet<CheckUid>
getCheckUidForCheckId(String checkId, org.eclipse.core.resources.IProject project)
Gets all applicable check unique identifiers by the check id and the given projectCollection<INamedElement>
getChildren(INamedElement parent, org.eclipse.core.resources.IProject project)
Returns children elements of the check tree.Map<CheckUid,ICheckSettings>
getCustomizedSettingsFromProfile(String profileName, org.eclipse.core.resources.IProject project)
Gets the user-changed settings of the given profile.ICheckSettings
getDefaultSettings(CheckUid checkUid, org.eclipse.core.resources.IProject project)
Get default settings for the given check (as defined in the check itself)Map<CheckUid,ICheckSettings>
getDefaultSettingsForProfile(String value, org.eclipse.core.resources.IProject project)
Get alll default settings for all registereds check (as defined in the check itself)List<INamedElement>
getPath(INamedElement element)
Returns path formINamedElement
Collection<INamedElement>
getRootElements(org.eclipse.core.resources.IProject project)
Returns top level elements.ICheckSettings
getSettings(CheckUid checkUid, org.eclipse.core.resources.IProject project)
Returns check settings using for given projectString
getShortUid(CheckUid checkUid, IDtProject dtProject)
Gets the short UID for the givenCheckUid
and the projectString
getShortUid(CheckUid checkUid, org.eclipse.core.resources.IProject project)
Gets the short UID for the givenCheckUid
and the projectCheckUid
getUidForShortUid(String shortUid, org.eclipse.core.resources.IProject project)
Converts short check UID into the full check UID for the given project based on the previously registered checksvoid
importSettingsProfile(Path path, org.eclipse.core.resources.IProject project)
Imports an external settings profile into the project's set of profilesvoid
removeChangeListener(ICheckSettingsChangeListener listener)
Removes check settings change listener.void
renameSettingsProfile(String currentProfileName, String newProfileName, org.eclipse.core.resources.IProject project)
Renames the settings profile using the provided name.void
setActiveSettingsProfile(String profileName, Collection<ICheckSettings> checkSettings, org.eclipse.core.resources.IProject project)
Sets an active profile for the given project.void
setCheckProvider(ICheckProvider checkProvider)
Sets the external check provider Used by the testing ifrastructure, shouln't be used by clientsSet<CheckUid>
toUid(String checkId, org.eclipse.core.resources.IProject project)
Translates check-provided identifier into the internal unique identifier of check.String
validateParameterValue(String value, String parameterName, ICheckSettings checkSettings)
Validates the given value for the appliance to the chosen parameter.boolean
validateProfileName(String newProfileName)
Validates that the profile name matches the standard
-
-
-
Field Detail
-
SERVICE_NAME
static final String SERVICE_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
addChangeListener
void addChangeListener(ICheckSettingsChangeListener listener)
Adds check settings change listener- Parameters:
listener
- The listener to add, notnull
-
applyChanges
void applyChanges(Collection<ICheckSettings> checkSettings, org.eclipse.core.resources.IProject project)
Apply changes to the currently active settings profile- Parameters:
checkSettings
- The set of changed settings to apply. May not benull
project
- The target project for the profile settings update. May not benull
-
deleteSettingsProfile
void deleteSettingsProfile(String profileName, org.eclipse.core.resources.IProject project)
Deletes the settings profile with the given name (if exists). In case of active profile removal - select the firts available profile as active one. The last profile may be removed as well. In this case the default one will be recreated- Parameters:
profileName
- The name of the profile to remove. May not benull
project
- The target projet for the profile removal. May not benull
-
duplicateSettingsProfile
void duplicateSettingsProfile(String profileName, String newProfileName, org.eclipse.core.resources.IProject project)
Duplicates the settings profile. Creates a new profile with same settings as provided with a given name- Parameters:
profileName
- The source profile name to duplicate. May not benull
newProfileName
- The name for the a new profile. May not benull
project
- The target projet for the profile duplcication. May not benull
-
exportSettingsProfile
void exportSettingsProfile(String profileName, Path destinationPath, org.eclipse.core.resources.IProject project)
Export check settings profile as a file to an 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
project
- The project which profile should be exported. May not benull
-
getActiveSettingsProfile
String getActiveSettingsProfile(org.eclipse.core.resources.IProject project)
Gets an active settings profile name for the given project- Parameters:
project
- The project to get the settings profile name for. May not benull
- Returns:
- The name of the profile. Never
null
-
getApplicableDelegates
Collection<CheckUid> getApplicableDelegates(Class<?> targetObjectClass, Object sourceObject, IDtProject dtProject)
Gets applicable delegate checks for the given context, if any- Parameters:
targetObjectClass
- The target objectClass
to get delegates for. May not benull
sourceObject
- Source object which check was delegated in a form of some derived delegated model. Used to filter out all inapproprite data sources. May not benull
dtProject
- The target project. May not benull
- Returns:
- The set of applicables checks. May not be
null
-
getAvailableSettingsProfiles
Collection<String> getAvailableSettingsProfiles(org.eclipse.core.resources.IProject project)
Gets the set of available check settings profiles for the project- Parameters:
project
- The project to get settings profiles for. May not benull
- Returns:
- The collection of available profile names. May not be
null
-
getCheck
ICheck getCheck(CheckUid checkId, IDtProject dtProject)
Gets the check using its UID and corresponding project settings- Parameters:
checkId
- The check UID to get the check by. May not benull
dtProject
- The target project. May not benull
- Returns:
- The target check if exists. May not be
null
-
getCheck
Map<CheckUid,ICheck> getCheck(String checkId, IDtProject project)
Gets the set of checks using their public identifier. In case if there is no conflicts in check ids the only check will be returned- Parameters:
checkId
- The identifier of the check. May not benull
- Returns:
- The checks mapped to their internal unique identifier, if exists. May not be
null
- Throws:
IllegalStateException
- In case if the required check isn't registered in the repository
-
getCheckParameters
ICheckParameters getCheckParameters(CheckUid checkId, org.eclipse.core.resources.IProject project)
Returns the immutable view of check execution parameters by names.- Parameters:
project
- The target project. May not benull
checkId
- check id, notnull
- Returns:
- check execution parameters by names, not
null
.
-
getCheckProcessPreferences
ICheckProcessPreferences getCheckProcessPreferences()
Gets the check process preferences- Returns:
- The set of user-defined preferences that affects the check process. May not be
null
-
getCheckUidForCheckId
Set<CheckUid> getCheckUidForCheckId(String checkId, org.eclipse.core.resources.IProject project)
Gets all applicable check unique identifiers by the check id and the given project- Parameters:
checkId
- The identifier of the check. May not benull
project
- The target project. May not benull
- Returns:
- The set of check UIDs. May not be
null
-
getChildren
Collection<INamedElement> getChildren(INamedElement parent, org.eclipse.core.resources.IProject project)
Returns children elements of the check tree. The element may be eitherICheckDescription
orICheckCategory
- Parameters:
parent
- Parent element, notnull
- Returns:
- Children elements, not
null
-
getCustomizedSettingsFromProfile
Map<CheckUid,ICheckSettings> getCustomizedSettingsFromProfile(String profileName, org.eclipse.core.resources.IProject project)
Gets the user-changed settings of the given profile. All default settings are ignored- Parameters:
profileName
- The target profile name. May not benull
project
- The target project. May not benull
- Returns:
- The user-changed settings mapped to respective check identifiers. May not be
null
-
getDefaultSettings
ICheckSettings getDefaultSettings(CheckUid checkUid, org.eclipse.core.resources.IProject project)
Get default settings for the given check (as defined in the check itself)- Parameters:
checkUid
- The identifier of the target check. May not benull
project
- The target project. May not benull
- Returns:
- The default settings of the check. May be
null
in case if the check is absent
-
getDefaultSettingsForProfile
Map<CheckUid,ICheckSettings> getDefaultSettingsForProfile(String value, org.eclipse.core.resources.IProject project)
Get alll default settings for all registereds check (as defined in the check itself)- Parameters:
project
- The target project. May not benull
- Returns:
- The default settings of checks mapped to their check identifiers. May not be
null
-
getPath
List<INamedElement> getPath(INamedElement element)
Returns path formINamedElement
- Parameters:
element
- element, notnull
- Returns:
- list of parents, not
null
-
getRootElements
Collection<INamedElement> getRootElements(org.eclipse.core.resources.IProject project)
Returns top level elements.- Returns:
- top level elements, not
null
-
getSettings
ICheckSettings getSettings(CheckUid checkUid, org.eclipse.core.resources.IProject project)
Returns check settings using for given project- Parameters:
checkUid
- check id, notnull
project
- project,null
if none- Returns:
- check settings, not
null
- Throws:
NoSuchElementException
- if none.
-
getShortUid
String getShortUid(CheckUid checkUid, IDtProject dtProject)
Gets the short UID for the givenCheckUid
and the project- Parameters:
checkUid
- The target check UID. May not benull
dtProject
- The target project. May not benull
- Returns:
- The short UID of the check. May not be
null
- Throws:
IllegalStateException
- In case if the given CheckUID isn't registered
-
getShortUid
String getShortUid(CheckUid checkUid, org.eclipse.core.resources.IProject project)
Gets the short UID for the givenCheckUid
and the project- Parameters:
checkUid
- The target check UID. May not benull
project
- The target project. May not benull
- Returns:
- The short UID of the check. May not be
null
- Throws:
IllegalStateException
- In case if the given CheckUID isn't registered
-
getUidForShortUid
CheckUid getUidForShortUid(String shortUid, org.eclipse.core.resources.IProject project)
Converts short check UID into the full check UID for the given project based on the previously registered checks- Parameters:
shortUid
- The short UID to convert. May not benull
project
- The target project. May not benull
- Returns:
- The full UID of the check. May be
null
in case if the shory UID is a stale one
-
importSettingsProfile
void importSettingsProfile(Path path, org.eclipse.core.resources.IProject project)
Imports an external settings profile into the project's set of profiles- Parameters:
path
- The path to the profile. May not benull
project
- The target project. May not benull
-
removeChangeListener
void removeChangeListener(ICheckSettingsChangeListener listener)
Removes check settings change listener.- Parameters:
listener
- the listener, notnull
-
renameSettingsProfile
void renameSettingsProfile(String currentProfileName, String newProfileName, org.eclipse.core.resources.IProject project)
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
project
- The target project. May not benull
-
setActiveSettingsProfile
void setActiveSettingsProfile(String profileName, Collection<ICheckSettings> checkSettings, org.eclipse.core.resources.IProject project)
Sets an active profile for the given project. The name should be received via thegetAvailableSettingsProfiles(IProject)
. Does nothing in case of supplying of arbitrary name- Parameters:
profileName
- The name of the profile. May not benull
project
- The target project. May not benull
-
setCheckProvider
void setCheckProvider(ICheckProvider checkProvider)
Sets the external check provider Used by the testing ifrastructure, shouln't be used by clients- Parameters:
checkProvider
- The check provider to set. May not benull
-
toUid
Set<CheckUid> toUid(String checkId, org.eclipse.core.resources.IProject project)
Translates check-provided identifier into the internal unique identifier of check. Could return more then one identifier in case of the check id conflict.- Parameters:
checkId
- The check identifier. May not benull
project
- The project to get the check UID for. May not benull
- Returns:
- The set of UIDs, may not be
null
-
validateParameterValue
String validateParameterValue(String value, String parameterName, ICheckSettings checkSettings)
Validates the given value for the appliance to the chosen parameter.- Parameters:
value
- The value to validate. May benull
parameterName
- The parameter name. May not benull
checkSettings
- The target check settings. May not benull
- Returns:
- The validation message if any.
null
if the parameter value is a valid one
-
validateProfileName
boolean validateProfileName(String newProfileName)
Validates that the profile name matches the standard- Parameters:
newProfileName
- The name to validate. May not benull
- Returns:
- True if the profile name is valid
-
-