当前位置: 首页>>代码示例>>Java>>正文


Java ScopeToolState类代码示例

本文整理汇总了Java中com.intellij.codeInspection.ex.ScopeToolState的典型用法代码示例。如果您正苦于以下问题:Java ScopeToolState类的具体用法?Java ScopeToolState怎么用?Java ScopeToolState使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ScopeToolState类属于com.intellij.codeInspection.ex包,在下文中一共展示了ScopeToolState类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getWorkedTools

import com.intellij.codeInspection.ex.ScopeToolState; //导入依赖的package包/类
@NotNull
private Set<InspectionToolWrapper> getWorkedTools(@NotNull InspectionNode node) {
  final Set<InspectionToolWrapper> result = new HashSet<InspectionToolWrapper>();
  final InspectionToolWrapper wrapper = node.getToolWrapper();
  if (myView.getCurrentProfileName() != null){
    result.add(wrapper);
    return result;
  }
  final String shortName = wrapper.getShortName();
  final GlobalInspectionContextImpl context = myView.getGlobalInspectionContext();
  final Tools tools = context.getTools().get(shortName);
  if (tools != null) {   //dummy entry points tool
    for (ScopeToolState state : tools.getTools()) {
      InspectionToolWrapper toolWrapper = state.getTool();
      result.add(toolWrapper);
    }
  }
  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:ExportHTMLAction.java

示例2: isEnabled

import com.intellij.codeInspection.ex.ScopeToolState; //导入依赖的package包/类
@Nullable
private Boolean isEnabled(final int rowIndex) {
  Boolean previousValue = null;
  final ExistedScopesStatesAndNonExistNames existedScopesStatesAndNonExistNames = getScopeToolState(rowIndex);
  for (final ScopeToolState scopeToolState : existedScopesStatesAndNonExistNames.getExistedStates()) {
    final boolean currentValue = scopeToolState.isEnabled();
    if (previousValue == null) {
      previousValue = currentValue;
    } else if (!previousValue.equals(currentValue)){
      return null;
    }
  }
  if (!existedScopesStatesAndNonExistNames.getNonExistNames().isEmpty() && !Boolean.FALSE.equals(previousValue)) {
    return null;
  }
  return previousValue;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:ScopesAndSeveritiesTable.java

示例3: getScopeToolState

import com.intellij.codeInspection.ex.ScopeToolState; //导入依赖的package包/类
@Nullable
private ScopeToolState getScopeToolState(final String keyName, final int rowIndex) {
  if (rowIndex == lastRowIndex()) {
    return myInspectionProfile.getToolDefaultState(keyName, myProject);
  }
  else {
    final String scopeName = myScopeNames[rowIndex];
    final List<ScopeToolState> nonDefaultTools = myInspectionProfile.getNonDefaultTools(keyName, myProject);
    for (final ScopeToolState nonDefaultTool : nonDefaultTools) {
      if (Comparing.equal(scopeName, nonDefaultTool.getScopeName())) {
        return nonDefaultTool;
      }
    }
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:ScopesAndSeveritiesTable.java

示例4: isEnabled

import com.intellij.codeInspection.ex.ScopeToolState; //导入依赖的package包/类
@Nullable
private Boolean isEnabled(final List<HighlightDisplayKey> selectedInspectionsNodes) {
  Boolean isPreviousEnabled = null;
  for (final HighlightDisplayKey key : selectedInspectionsNodes) {
    final ToolsImpl tools = mySettings.getInspectionProfile().getTools(key.toString(), mySettings.getProject());
    for (final ScopeToolState state : tools.getTools()) {
      final boolean enabled = state.isEnabled();
      if (isPreviousEnabled == null) {
        isPreviousEnabled = enabled;
      } else if (!isPreviousEnabled.equals(enabled)) {
        return null;
      }
    }
  }
  return isPreviousEnabled;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:InspectionsConfigTreeTable.java

示例5: putOne

import com.intellij.codeInspection.ex.ScopeToolState; //导入依赖的package包/类
private void putOne(final ScopeToolState state) {
  if (!state.isEnabled()) {
    return;
  }
  final Icon icon = state.getLevel().getIcon();
  final String scopeName = state.getScopeName();
  if (icon instanceof HighlightDisplayLevel.ColoredIcon) {
    final SeverityAndOccurrences severityAndOccurrences = myScopeToAverageSeverityMap.get(scopeName);
    final String inspectionName = state.getTool().getShortName();
    if (severityAndOccurrences == null) {
      myScopeToAverageSeverityMap.put(scopeName, new SeverityAndOccurrences().incOccurrences(inspectionName, state.getLevel().getSeverity()));
    } else {
      severityAndOccurrences.incOccurrences(inspectionName, state.getLevel().getSeverity());
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:InspectionsConfigTreeTable.java

示例6: getAvailableScopes

import com.intellij.codeInspection.ex.ScopeToolState; //导入依赖的package包/类
private List<String> getAvailableScopes(Project project, List<Descriptor> descriptors) {
  final ArrayList<NamedScope> scopes = new ArrayList<NamedScope>();
  for (NamedScopesHolder holder : NamedScopesHolder.getAllNamedScopeHolders(project)) {
    Collections.addAll(scopes, holder.getScopes());
  }
  scopes.remove(CustomScopesProviderEx.getAllScope());

  CustomScopesProviderEx.filterNoSettingsScopes(project, scopes);

  final Set<NamedScope> used = new HashSet<NamedScope>();
  for (Descriptor descriptor : descriptors) {
    final List<ScopeToolState> nonDefaultTools = getSelectedProfile().getNonDefaultTools(descriptor.getKey().toString(), project);
    if (nonDefaultTools != null) {
      for (ScopeToolState state : nonDefaultTools) {
        used.add(state.getScope(project));
      }
    }
  }
  scopes.removeAll(used);

  final List<String> availableScopes = new ArrayList<String>();
  for (NamedScope scope : scopes) {
    availableScopes.add(scope.getName());
  }
  return availableScopes;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:27,代码来源:AddScopeAction.java

示例7: getWorkedTools

import com.intellij.codeInspection.ex.ScopeToolState; //导入依赖的package包/类
@Nonnull
private Set<InspectionToolWrapper> getWorkedTools(@Nonnull InspectionNode node) {
  final Set<InspectionToolWrapper> result = new HashSet<InspectionToolWrapper>();
  final InspectionToolWrapper wrapper = node.getToolWrapper();
  if (myView.getCurrentProfileName() != null){
    result.add(wrapper);
    return result;
  }
  final String shortName = wrapper.getShortName();
  final GlobalInspectionContextImpl context = myView.getGlobalInspectionContext();
  final Tools tools = context.getTools().get(shortName);
  if (tools != null) {   //dummy entry points tool
    for (ScopeToolState state : tools.getTools()) {
      InspectionToolWrapper toolWrapper = state.getTool();
      result.add(toolWrapper);
    }
  }
  return result;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:20,代码来源:ExportHTMLAction.java

示例8: GotoInspectionModel

import com.intellij.codeInspection.ex.ScopeToolState; //导入依赖的package包/类
public GotoInspectionModel(Project project) {
  super(project, IdeBundle.message("prompt.goto.inspection.enter.name"), "goto.inspection.help.id");
  final InspectionProfileImpl rootProfile = (InspectionProfileImpl)InspectionProfileManager.getInstance().getRootProfile();
  for (ScopeToolState state : rootProfile.getAllTools(project)) {
    InspectionToolWrapper tool = state.getTool();
    if (tool instanceof LocalInspectionToolWrapper && ((LocalInspectionToolWrapper)tool).isUnfair()) {
      continue;
    }
    final String name = tool.getDisplayName() + " " + StringUtil.join(tool.getGroupPath(), " ");
    myToolNames.put(name, tool);
  }
  myNames = ArrayUtil.toStringArray(myToolNames.keySet());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:GotoInspectionModel.java

示例9: fromScopeToolState

import com.intellij.codeInspection.ex.ScopeToolState; //导入依赖的package包/类
public static ToolDescriptors fromScopeToolState(final ScopeToolState state,
                                                 final InspectionProfileImpl profile,
                                                 final Project project) {
  final InspectionToolWrapper toolWrapper = state.getTool();
  final List<ScopeToolState> nonDefaultTools = profile.getNonDefaultTools(toolWrapper.getShortName(), project);
  final ArrayList<Descriptor> descriptors = new ArrayList<Descriptor>(nonDefaultTools.size());
  for (final ScopeToolState nonDefaultToolState : nonDefaultTools) {
    descriptors.add(new Descriptor(nonDefaultToolState, profile, project));
  }
  return new ToolDescriptors(new Descriptor(state, profile, project), descriptors);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:ToolDescriptors.java

示例10: getSeverity

import com.intellij.codeInspection.ex.ScopeToolState; //导入依赖的package包/类
@NotNull
public static HighlightSeverity getSeverity(final List<ScopeToolState> scopeToolStates) {
  HighlightSeverity previousValue = null;
  for (final ScopeToolState scopeToolState : scopeToolStates) {
    final HighlightSeverity currentValue = scopeToolState.getLevel().getSeverity();
    if (previousValue == null) {
      previousValue = currentValue;
    } else if (!previousValue.equals(currentValue)){
      return MIXED_FAKE_SEVERITY;
    }
  }
  return previousValue;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:ScopesAndSeveritiesTable.java

示例11: refreshAggregatedScopes

import com.intellij.codeInspection.ex.ScopeToolState; //导入依赖的package包/类
private void refreshAggregatedScopes() {
  final LinkedHashSet<String> scopesNames = new LinkedHashSet<String>();
  for (final String keyName : myKeyNames) {
    final List<ScopeToolState> nonDefaultTools = myInspectionProfile.getNonDefaultTools(keyName, myProject);
    for (final ScopeToolState tool : nonDefaultTools) {
      scopesNames.add(tool.getScopeName());
    }
  }
  myScopeNames = ArrayUtil.toStringArray(scopesNames);
  Arrays.sort(myScopeNames, myScopeComparator);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:ScopesAndSeveritiesTable.java

示例12: matches

import com.intellij.codeInspection.ex.ScopeToolState; //导入依赖的package包/类
public boolean matches(final Tools tools) {
  if (myShowOnlyCleanupInspections && !tools.getTool().isCleanupTool()) {
    return false;
  }

  if (mySuitableInspectionsStates != null && mySuitableInspectionsStates != tools.isEnabled()) {
    return false;
  }

  if (myAvailableOnlyForAnalyze && !isAvailableOnlyForAnalyze(tools)) {
    return false;
  }

  if (!mySuitableSeverities.isEmpty()) {
    boolean suitable = false;
    for (final ScopeToolState state : tools.getTools()) {
      if (mySuitableInspectionsStates != null && mySuitableInspectionsStates != state.isEnabled()) {
        continue;
      }
      if (mySuitableSeverities.contains(tools.getDefaultState().getLevel().getSeverity())) {
        suitable = true;
        break;
      }
    }
    if (!suitable) {
      return false;
    }
  }

  final String languageId = tools.getDefaultState().getTool().getLanguage();
  return mySuitableLanguageIds.isEmpty() || mySuitableLanguageIds.contains(languageId);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:33,代码来源:InspectionsFilter.java

示例13: setToolEnabled

import com.intellij.codeInspection.ex.ScopeToolState; //导入依赖的package包/类
private void setToolEnabled(boolean newState, InspectionProfileImpl profile, HighlightDisplayKey tool) {
  final String toolId = tool.toString();
  if (newState) {
    profile.enableTool(toolId, mySettings.getProject());
  }
  else {
    profile.disableTool(toolId, mySettings.getProject());
  }
  for (ScopeToolState scopeToolState : profile.getTools(toolId, mySettings.getProject()).getTools()) {
    scopeToolState.setEnabled(newState);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:InspectionsConfigTreeTable.java

示例14: put

import com.intellij.codeInspection.ex.ScopeToolState; //导入依赖的package包/类
public void put(@NotNull final ScopeToolState defaultState, @NotNull final List<ScopeToolState> nonDefault) {
  putOne(defaultState);
  if (myDefaultScopeName == null) {
    myDefaultScopeName = defaultState.getScopeName();
  }
  for (final ScopeToolState scopeToolState : nonDefault) {
    putOne(scopeToolState);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:InspectionsConfigTreeTable.java

示例15: GotoInspectionModel

import com.intellij.codeInspection.ex.ScopeToolState; //导入依赖的package包/类
public GotoInspectionModel(Project project) {
  super(project, IdeBundle.message("prompt.goto.inspection.enter.name"), "goto.inspection.help.id");
  final InspectionProfileImpl rootProfile = (InspectionProfileImpl)InspectionProfileManager.getInstance().getRootProfile();
  for (ScopeToolState state : rootProfile.getAllTools(project)) {
    InspectionToolWrapper tool = state.getTool();
    InspectionToolWrapper workingTool = tool;
    if (tool instanceof LocalInspectionToolWrapper) {
      workingTool = LocalInspectionToolWrapper.findTool2RunInBatch(project, null, tool.getShortName());
      if (workingTool == null) {
        continue;
      }
    }
    myToolNames.put(tool.getDisplayName(), workingTool);
    final String groupName = tool.getGroupDisplayName();
    Set<InspectionToolWrapper> toolsInGroup = myGroupNames.get(groupName);
    if (toolsInGroup == null) {
      toolsInGroup = new HashSet<InspectionToolWrapper>();
      myGroupNames.put(groupName, toolsInGroup);
    }
    toolsInGroup.add(workingTool);
    myToolShortNames.put(tool.getShortName(), workingTool);
  }

  final Set<String> nameIds = new HashSet<String>();
  nameIds.addAll(myToolNames.keySet());
  nameIds.addAll(myGroupNames.keySet());
  myNames = ArrayUtil.toStringArray(nameIds);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:29,代码来源:GotoInspectionModel.java


注:本文中的com.intellij.codeInspection.ex.ScopeToolState类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。