コード例 #1
0
 public boolean isExecutable() {
   initInspectionTools();
   for (ToolsImpl tools : myTools.values()) {
     if (tools.isEnabled()) return true;
   }
   return false;
 }
コード例 #2
0
 private void copyToolsConfigurations(InspectionProfileImpl profile) {
   try {
     for (ToolsImpl toolList : profile.myTools.values()) {
       final ToolsImpl tools = myTools.get(toolList.getShortName());
       final ScopeToolState defaultState = toolList.getDefaultState();
       tools.setDefaultState(
           copyToolSettings((InspectionTool) defaultState.getTool()),
           defaultState.isEnabled(),
           defaultState.getLevel());
       tools.removeAllScopes();
       tools.setEnabled(toolList.isEnabled());
       final List<ScopeToolState> nonDefaultToolStates = toolList.getNonDefaultTools();
       if (nonDefaultToolStates != null) {
         for (ScopeToolState state : nonDefaultToolStates) {
           final InspectionTool inspectionTool =
               copyToolSettings((InspectionTool) state.getTool());
           if (state.getScope() != null) {
             tools.addTool(state.getScope(), inspectionTool, state.isEnabled(), state.getLevel());
           } else {
             tools.addTool(
                 state.getScopeName(), inspectionTool, state.isEnabled(), state.getLevel());
           }
         }
       }
     }
   } catch (WriteExternalException e) {
     LOG.error(e);
   } catch (InvalidDataException e) {
     LOG.error(e);
   }
 }
コード例 #3
0
 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;
 }
コード例 #4
0
 public void cleanup(Project project) {
   for (final ToolsImpl toolList : myTools.values()) {
     if (toolList.isEnabled()) {
       for (InspectionProfileEntry tool : toolList.getAllTools()) {
         tool.projectClosed(project);
         if (((InspectionTool) tool).getContext() != null) {
           ((InspectionTool) tool).cleanup();
         }
       }
     }
   }
 }