• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java InspectionProfileEntry类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: SingleCheckboxOptionsPanel

import com.intellij.codeInspection.InspectionProfileEntry; //导入依赖的package包/类
public SingleCheckboxOptionsPanel(@NotNull String label,
                                  @NotNull InspectionProfileEntry owner,
                                  @NonNls String property) {
    super(new GridBagLayout());
    final boolean selected = getPropertyValue(owner, property);
    final JCheckBox checkBox = new JCheckBox(label, selected);
    final ButtonModel model = checkBox.getModel();
    final SingleCheckboxChangeListener listener =
            new SingleCheckboxChangeListener(owner, property, model);
    model.addChangeListener(listener);

    final GridBagConstraints constraints = new GridBagConstraints();
    constraints.gridx = 0;
    constraints.gridy = 0;
    constraints.weightx = 1.0;
    constraints.weighty = 1.0;
    constraints.anchor = GridBagConstraints.FIRST_LINE_START;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    add(checkBox, constraints);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:SingleCheckboxOptionsPanel.java


示例2: SingleIntegerFieldOptionsPanel

import com.intellij.codeInspection.InspectionProfileEntry; //导入依赖的package包/类
public SingleIntegerFieldOptionsPanel(String labelString,
                                      final InspectionProfileEntry owner,
                                      @NonNls final String property,
                                      int integerFieldColumns) {
    super(new GridBagLayout());
    final JLabel label = new JLabel(labelString);
    final JFormattedTextField valueField = createIntegerFieldTrackingValue(owner, property, integerFieldColumns);
    final GridBagConstraints constraints = new GridBagConstraints();
    constraints.gridx = 0;
    constraints.gridy = 0;
    constraints.insets.right = UIUtil.DEFAULT_HGAP;
    constraints.weightx = 0.0;
    constraints.anchor = GridBagConstraints.BASELINE_LEADING;
    constraints.fill = GridBagConstraints.NONE;
    add(label, constraints);
    constraints.gridx = 1;
    constraints.gridy = 0;
    constraints.weightx = 1.0;
    constraints.weighty = 1.0;
    constraints.insets.right = 0;
    constraints.anchor = GridBagConstraints.BASELINE_LEADING;
    constraints.fill = GridBagConstraints.NONE;
    add(valueField, constraints);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:SingleIntegerFieldOptionsPanel.java


示例3: compute

import com.intellij.codeInspection.InspectionProfileEntry; //导入依赖的package包/类
@Override
protected Ref<UnusedDeclarationInspectionBase> compute(PsiFile file, RefManagerImpl refManager) {
  Tools tools = ((GlobalInspectionContextBase)refManager.getContext()).getTools().get(UnusedDeclarationInspectionBase.SHORT_NAME);
  InspectionToolWrapper toolWrapper = tools == null ? null : tools.getEnabledTool(file);
  InspectionProfileEntry tool = toolWrapper == null ? null : toolWrapper.getTool();
  return Ref.create(tool instanceof UnusedDeclarationInspectionBase ? (UnusedDeclarationInspectionBase)tool : null);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:RefJavaManagerImpl.java


示例4: getInspection

import com.intellij.codeInspection.InspectionProfileEntry; //导入依赖的package包/类
@Nullable
@Override
protected InspectionProfileEntry getInspection() {
  final LambdaParameterNamingConventionInspection inspection = new LambdaParameterNamingConventionInspection();
  inspection.m_minLength = 2;
  return inspection;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:LambdaParameterNamingConventionInspectionTest.java


示例5: enableInspectionToolsFromProvider

import com.intellij.codeInspection.InspectionProfileEntry; //导入依赖的package包/类
protected void enableInspectionToolsFromProvider(InspectionToolProvider toolProvider){
  try {
    for (Class c : toolProvider.getInspectionClasses()) {
      enableInspectionTool((InspectionProfileEntry)c.newInstance());
    }
  }
  catch (Exception e) {
    throw new RuntimeException(e);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:DaemonAnalyzerTestCase.java


示例6: setUp

import com.intellij.codeInspection.InspectionProfileEntry; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
  super.setUp();

  for (String environmentClass : getEnvironmentClasses()) {
    myFixture.addClass(environmentClass);
  }
  final InspectionProfileEntry inspection = getInspection();
  if (inspection != null) {
    myFixture.enableInspections(inspection);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:LightInspectionTestCase.java


示例7: getPropertyValue

import com.intellij.codeInspection.InspectionProfileEntry; //导入依赖的package包/类
private static int getPropertyValue(InspectionProfileEntry owner,
                                    String property) {
    try {
        return owner.getClass().getField(property).getInt(owner);
    } catch (Exception e) {
        return 0;
    }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:SingleIntegerFieldOptionsPanel.java


示例8: getInspection

import com.intellij.codeInspection.InspectionProfileEntry; //导入依赖的package包/类
@Nullable
@Override
protected InspectionProfileEntry getInspection() {
  final TypeMayBeWeakenedInspection inspection = new TypeMayBeWeakenedInspection();
  inspection.doNotWeakenToJavaLangObject = false;
  inspection.onlyWeakentoInterface = false;
  return inspection;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:TypeMayBeWeakenedInspectionTest.java


示例9: CheckBox

import com.intellij.codeInspection.InspectionProfileEntry; //导入依赖的package包/类
public CheckBox(@NotNull String label,
                @NotNull InspectionProfileEntry owner,
                @NonNls String property) {
    super(label, getPropertyValue(owner, property));
    final ButtonModel model = getModel();
    final SingleCheckboxChangeListener listener =
            new SingleCheckboxChangeListener(owner, property, model);
    model.addChangeListener(listener);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:CheckBox.java


示例10: isToCheckFile

import com.intellij.codeInspection.InspectionProfileEntry; //导入依赖的package包/类
public static boolean isToCheckFile(PsiFile file, @NotNull InspectionProfileEntry tool, Tools tools, ProfileManager profileManager) {
  if (tools != null && file != null) {
    for (ScopeToolState state : tools.getTools()) {
      final NamedScope namedScope = state.getScope(file.getProject());
      if (namedScope == null || namedScope.getValue().contains(file, profileManager.getScopesManager())) {
        if (state.isEnabled()) {
          InspectionToolWrapper toolWrapper = state.getTool();
          if (toolWrapper.getTool() == tool) return true;
        }
        return false;
      }
    }
  }
  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:GlobalInspectionContextUtil.java


示例11: modifyToolSettings

import com.intellij.codeInspection.InspectionProfileEntry; //导入依赖的package包/类
@Override
public <T extends InspectionProfileEntry> void modifyToolSettings(@NotNull final Key<T> shortNameKey,
                                                                  @NotNull final PsiElement psiElement,
                                                                  @NotNull final Consumer<T> toolConsumer) {
  modifyProfile(new Consumer<ModifiableModel>() {
    @Override
    public void consume(@NotNull ModifiableModel model) {
      InspectionProfileEntry tool = model.getUnwrappedTool(shortNameKey.toString(), psiElement);
      //noinspection unchecked
      toolConsumer.consume((T) tool);
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:InspectionProfileImpl.java


示例12: getInspection

import com.intellij.codeInspection.InspectionProfileEntry; //导入依赖的package包/类
@Nullable
@Override
protected InspectionProfileEntry getInspection() {
  final MalformedFormatStringInspection inspection = new MalformedFormatStringInspection();
  inspection.classNames.add("com.siyeh.igtest.bugs.malformed_format_string.MalformedFormatString.SomeOtherLogger");
  inspection.methodNames.add("d");
  return inspection;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:MalformedFormatStringInspectionTest.java


示例13: getInspection

import com.intellij.codeInspection.InspectionProfileEntry; //导入依赖的package包/类
@Nullable
@Override
protected InspectionProfileEntry getInspection() {
  final ParameterNamingConventionInspection inspection = new ParameterNamingConventionInspection();
  inspection.m_minLength = 3;
  inspection.m_maxLength = 5;
  return inspection;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:ParameterNamingConventionInspectionTest.java


示例14: configureInspections

import com.intellij.codeInspection.InspectionProfileEntry; //导入依赖的package包/类
public static void configureInspections(@NotNull InspectionProfileEntry[] tools,
                                        @NotNull final Project project,
                                        @NotNull final Collection<String> disabledInspections,
                                        @NotNull Disposable parentDisposable) {
  InspectionToolWrapper[] wrapped =
    ContainerUtil.map2Array(tools, InspectionToolWrapper.class, new Function<InspectionProfileEntry, InspectionToolWrapper>() {
      @Override
      public InspectionToolWrapper fun(InspectionProfileEntry tool) {
        return InspectionToolRegistrar.wrapTool(tool);
      }
    });

  final InspectionProfileImpl profile = InspectionProfileImpl.createSimple(LightPlatformTestCase.PROFILE, project, wrapped);
  profile.disableToolByDefault(new ArrayList<String>(disabledInspections), project);

  final InspectionProfileManager inspectionProfileManager = InspectionProfileManager.getInstance();
  final Profile oldRootProfile = inspectionProfileManager.getRootProfile();
  inspectionProfileManager.addProfile(profile);
  Disposer.register(parentDisposable, new Disposable() {
    @Override
    public void dispose() {
      inspectionProfileManager.deleteProfile(profile.getName());
      inspectionProfileManager.setRootProfile(oldRootProfile.getName());
      clearAllToolsIn(InspectionProfileImpl.getDefaultProfile(), project);
    }
  });
  inspectionProfileManager.setRootProfile(profile.getName());
  InspectionProfileImpl.initAndDo(new Computable() {
    @Override
    public Object compute() {
      InspectionProjectProfileManager.getInstance(project).updateProfile(profile);
      InspectionProjectProfileManager.getInstance(project).setProjectProfile(profile.getName());
      return null;
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:37,代码来源:CodeInsightTestFixtureImpl.java


示例15: isAvailable

import com.intellij.codeInspection.InspectionProfileEntry; //导入依赖的package包/类
private static boolean isAvailable(PyCallExpression node) {
  final InspectionProfile profile = InspectionProjectProfileManager.getInstance(node.getProject()).getInspectionProfile();
  final InspectionToolWrapper inspectionTool = profile.getInspectionTool("PyCompatibilityInspection", node.getProject());
  if (inspectionTool != null) {
    final InspectionProfileEntry inspection = inspectionTool.getTool();
    if (inspection instanceof PyCompatibilityInspection) {
      final JDOMExternalizableStringList versions = ((PyCompatibilityInspection)inspection).ourVersions;
      for (String s : versions) {
        if (!LanguageLevel.fromPythonVersion(s).supportsSetLiterals()) return false;
      }
    }
  }
  return LanguageLevel.forElement(node).supportsSetLiterals();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:PySetFunctionToLiteralInspection.java


示例16: getSuitableInspection

import com.intellij.codeInspection.InspectionProfileEntry; //导入依赖的package包/类
@Nullable
private static DomElementsInspection getSuitableInspection(InspectionProfileEntry entry, Class rootType) {
  if (entry instanceof DomElementsInspection) {
    if (((DomElementsInspection)entry).getDomClasses().contains(rootType)) {
      return (DomElementsInspection) entry;
    }
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:DomElementAnnotationsManagerImpl.java


示例17: TextField

import com.intellij.codeInspection.InspectionProfileEntry; //导入依赖的package包/类
public TextField(@NotNull InspectionProfileEntry owner,
                 @NonNls String property) {
  super(getPropertyValue(owner, property));
  final DocumentListener documentListener =
    new TextFieldDocumentListener(owner, property);
  getDocument().addDocumentListener(documentListener);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:TextField.java


示例18: getInspection

import com.intellij.codeInspection.InspectionProfileEntry; //导入依赖的package包/类
@Nullable
@Override
protected InspectionProfileEntry getInspection() {
  RefusedBequestInspection inspection = new RefusedBequestInspection();
  inspection.onlyReportWhenAnnotated = false;
  return inspection;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:RefusedBequestInspectionTest.java


示例19: getInspection

import com.intellij.codeInspection.InspectionProfileEntry; //导入依赖的package包/类
@Override
protected InspectionProfileEntry getInspection() {
  final MagicNumberInspection tool = new MagicNumberInspection();
  tool.ignoreInHashCode = true;
  tool.ignoreInAnnotations = true;
  tool.ignoreInitialCapacity = true;
  return tool;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:MagicNumberInspectionTest.java


示例20: enableInspectionTool

import com.intellij.codeInspection.InspectionProfileEntry; //导入依赖的package包/类
protected void enableInspectionTool(@NotNull InspectionProfileEntry tool) {
  InspectionToolWrapper toolWrapper = InspectionToolRegistrar.wrapTool(tool);
  LightPlatformTestCase.enableInspectionTool(getProject(), toolWrapper);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:DaemonAnalyzerTestCase.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SQSActions类代码示例发布时间:2022-05-23
下一篇:
Java XmlAnyAttributeWriter类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap