Search in sources :

Example 1 with PreferenceScopeResolutionStrategy

use of org.uberfire.preferences.shared.PreferenceScopeResolutionStrategy in project kie-wb-common by kiegroup.

the class WorkbenchPreferenceScopeResolutionStrategiesImpl method getUserInfoFor.

@Override
public PreferenceScopeResolutionStrategyInfo getUserInfoFor(final String scopeType, final String scopeKey) {
    PreferenceScopeResolutionStrategy scopeResolutionStrategy;
    if (scopeType != null) {
        PreferenceScope userScope = scopeFactory.createScope(WorkbenchPreferenceScopes.USER);
        PreferenceScope userScopedScope;
        if (scopeKey != null) {
            userScopedScope = scopeFactory.createScope(scopeType, scopeKey);
        } else {
            userScopedScope = scopeFactory.createScope(scopeType);
        }
        PreferenceScope projectUserScope = scopeFactory.createScope(userScope, userScopedScope);
        scopeResolutionStrategy = new WorkbenchPreferenceScopeResolutionStrategy(scopeFactory, projectUserScope);
    } else {
        scopeResolutionStrategy = new WorkbenchPreferenceScopeResolutionStrategy(scopeFactory);
    }
    return scopeResolutionStrategy.getInfo();
}
Also used : PreferenceScope(org.uberfire.preferences.shared.PreferenceScope) PreferenceScopeResolutionStrategy(org.uberfire.preferences.shared.PreferenceScopeResolutionStrategy)

Aggregations

PreferenceScope (org.uberfire.preferences.shared.PreferenceScope)1 PreferenceScopeResolutionStrategy (org.uberfire.preferences.shared.PreferenceScopeResolutionStrategy)1