HighlightDisplayLevel (NamedScope scope, Project project) { if (myTools != null && scope != null){ for (ScopeToolState state : myTools) { if (Comparing.equal(state.getScope(project), scope)) { return state.getLevel(); } } } return myDefaultState.getLevel(); }