use of org.uberfire.preferences.shared.impl.exception.InvalidPreferenceScopeException in project kie-wb-common by kiegroup.
the class WorkbenchPreferenceScopeResolver method getScopeFromOrder.
private PreferenceScope getScopeFromOrder(final String... scopeTypes) {
for (PreferenceScope scope : order) {
boolean match = true;
PreferenceScope currentScope = scope;
for (int i = 0; i < scopeTypes.length; i++) {
if (currentScope == null || !currentScope.type().equals(scopeTypes[i])) {
match = false;
break;
}
currentScope = currentScope.childScope();
}
if (match && currentScope == null) {
return scope;
}
}
throw new InvalidPreferenceScopeException("The passed scope types are invalid.");
}
Aggregations