當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。