public boolean isExecutable() {
   initInspectionTools();
   for (ToolsImpl tools : myTools.values()) {
     if (tools.isEnabled()) return true;
   }
   return false;
 }
 public List<ScopeToolState> getDefaultStates() {
   initInspectionTools();
   final List<ScopeToolState> result = new ArrayList<ScopeToolState>();
   for (Tools tools : myTools.values()) {
     result.add(tools.getDefaultState());
   }
   return result;
 }
 @NotNull
 public InspectionProfileEntry[] getInspectionTools(PsiElement element) {
   initInspectionTools();
   List<InspectionTool> result = new ArrayList<InspectionTool>();
   for (Tools toolList : myTools.values()) {
     result.add((InspectionTool) toolList.getInspectionTool(element));
   }
   return result.toArray(new InspectionTool[result.size()]);
 }
 public List<ToolsImpl> getAllEnabledInspectionTools() {
   initInspectionTools();
   final ArrayList<ToolsImpl> result = new ArrayList<ToolsImpl>();
   for (final ToolsImpl toolList : myTools.values()) {
     if (toolList.isEnabled()) {
       result.add(toolList);
     }
   }
   return result;
 }
 @Nullable
 private Map<String, Boolean> getDisplayLevelMap() {
   if (myBaseProfile == null) return null;
   if (myDisplayLevelMap == null) {
     initInspectionTools();
     myDisplayLevelMap = new TreeMap<String, Boolean>();
     for (String toolId : myTools.keySet()) {
       myDisplayLevelMap.put(toolId, toolSettingsAreEqual(toolId, myBaseProfile, this));
     }
   }
   return myDisplayLevelMap;
 }
 public InspectionProfileEntry getToolById(String id, PsiElement element) {
   initInspectionTools();
   for (Tools toolList : myTools.values()) {
     final InspectionProfileEntry tool = toolList.getInspectionTool(element);
     String toolId =
         tool instanceof LocalInspectionToolWrapper
             ? ((LocalInspectionToolWrapper) tool).getID()
             : tool.getShortName();
     if (id.equals(toolId)) return tool;
   }
   return null;
 }
  public InspectionProfileImpl(InspectionProfileImpl inspectionProfile) {
    super(inspectionProfile.getName());

    myRegistrar = inspectionProfile.myRegistrar;
    myTools = new HashMap<String, ToolsImpl>();
    myDeinstalledInspectionsSettings =
        new LinkedHashMap<String, Element>(inspectionProfile.myDeinstalledInspectionsSettings);

    myBaseProfile = inspectionProfile.myBaseProfile;
    myLocal = inspectionProfile.myLocal;
    myLockedProfile = inspectionProfile.myLockedProfile;
    mySource = inspectionProfile;
    setProfileManager(inspectionProfile.getProfileManager());
    copyFrom(inspectionProfile);
    initInspectionTools();
  }
 public void convert(Element element) {
   initInspectionTools();
   final Element scopes = element.getChild(DefaultProjectProfileManager.SCOPES);
   if (scopes != null) {
     final List children = scopes.getChildren(SCOPE);
     if (children != null) {
       for (Object s : children) {
         Element scopeElement = (Element) s;
         final String profile =
             scopeElement.getAttributeValue(DefaultProjectProfileManager.PROFILE);
         if (profile != null) {
           final InspectionProfileImpl inspectionProfile =
               (InspectionProfileImpl) getProfileManager().getProfile(profile);
           if (inspectionProfile != null) {
             final NamedScope scope =
                 getProfileManager()
                     .getScopesManager()
                     .getScope(scopeElement.getAttributeValue(NAME));
             if (scope != null) {
               for (InspectionProfileEntry entry : inspectionProfile.getInspectionTools(null)) {
                 final HighlightDisplayKey key = HighlightDisplayKey.find(entry.getShortName());
                 try {
                   getTools(entry.getShortName())
                       .addTool(
                           scope,
                           copyToolSettings((InspectionTool) entry),
                           inspectionProfile.isToolEnabled(key),
                           inspectionProfile.getErrorLevel(key, (NamedScope) null));
                 } catch (Exception e) {
                   LOG.error(e);
                 }
               }
             }
           }
         }
       }
       reduceConvertedScopes();
     }
   }
 }
 private ToolsImpl getTools(String toolId) {
   initInspectionTools();
   return myTools.get(toolId);
 }
  public void resetToBase() {
    initInspectionTools();

    copyToolsConfigurations(myBaseProfile);
    myDisplayLevelMap = null;
  }