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


Java InspectionProjectProfileManager.getProfile方法代码示例

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


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

示例1: testSettingsModification

import com.intellij.profile.codeInspection.InspectionProjectProfileManager; //导入方法依赖的package包/类
public void testSettingsModification() throws Exception {
  Project project = ProjectManager.getInstance().getDefaultProject();
  InspectionProjectProfileManager profileManager = InspectionProjectProfileManager.getInstance(project);
  InspectionProfileImpl profile = (InspectionProfileImpl)profileManager.getProfile(PROFILE);
  profile.initInspectionTools(project);

  InspectionProfileImpl model = (InspectionProfileImpl)profile.getModifiableModel();
  SingleInspectionProfilePanel panel = new SingleInspectionProfilePanel(profileManager, PROFILE, model, profile);
  panel.setVisible(true);
  panel.reset();

  JavaDocLocalInspection tool = getInspection(model);
  assertEquals("", tool.myAdditionalJavadocTags);
  tool.myAdditionalJavadocTags = "foo";
  model.setModified(true);
  panel.apply();
  assertEquals(1, InspectionProfileTest.countInitializedTools(model));

  assertEquals("foo", getInspection(profile).myAdditionalJavadocTags);
  panel.disposeUI();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:SingleInspectionProfilePanelTest.java

示例2: testModifyInstantiatedTool

import com.intellij.profile.codeInspection.InspectionProjectProfileManager; //导入方法依赖的package包/类
public void testModifyInstantiatedTool() throws Exception {
  Project project = ProjectManager.getInstance().getDefaultProject();
  InspectionProjectProfileManager profileManager = InspectionProjectProfileManager.getInstance(project);
  InspectionProfileImpl profile = (InspectionProfileImpl)profileManager.getProfile(PROFILE);
  profile.initInspectionTools(project);

  JavaDocLocalInspection originalTool = getInspection(profile);
  originalTool.myAdditionalJavadocTags = "foo";

  InspectionProfileImpl model = (InspectionProfileImpl)profile.getModifiableModel();

  SingleInspectionProfilePanel panel = new SingleInspectionProfilePanel(profileManager, PROFILE, model, profile);
  panel.setVisible(true);
  panel.reset();
  assertEquals(InspectionProfileTest.getInitializedTools(model).toString(), 1, InspectionProfileTest.countInitializedTools(model));

  JavaDocLocalInspection copyTool = getInspection(model);
  copyTool.myAdditionalJavadocTags = "bar";

  model.setModified(true);
  panel.apply();
  assertEquals(1, InspectionProfileTest.countInitializedTools(model));

  assertEquals("bar", getInspection(profile).myAdditionalJavadocTags);
  panel.disposeUI();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:SingleInspectionProfilePanelTest.java

示例3: testDoNotChangeSettingsOnCancel

import com.intellij.profile.codeInspection.InspectionProjectProfileManager; //导入方法依赖的package包/类
public void testDoNotChangeSettingsOnCancel() throws Exception {
  Project project = ProjectManager.getInstance().getDefaultProject();
  InspectionProjectProfileManager profileManager = InspectionProjectProfileManager.getInstance(project);
  InspectionProfileImpl profile = (InspectionProfileImpl)profileManager.getProfile(PROFILE);
  profile.initInspectionTools(project);

  JavaDocLocalInspection originalTool = getInspection(profile);
  assertEquals("", originalTool.myAdditionalJavadocTags);

  InspectionProfileImpl model = (InspectionProfileImpl)profile.getModifiableModel();
  JavaDocLocalInspection copyTool = getInspection(model);
  copyTool.myAdditionalJavadocTags = "foo";
  // this change IS NOT COMMITTED

  assertEquals("", getInspection(profile).myAdditionalJavadocTags);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:SingleInspectionProfilePanelTest.java

示例4: getCurrentProfile

import com.intellij.profile.codeInspection.InspectionProjectProfileManager; //导入方法依赖的package包/类
public InspectionProfile getCurrentProfile() {
  if (myExternalProfile != null) return myExternalProfile;
  InspectionManagerBase managerEx = (InspectionManagerBase)InspectionManager.getInstance(myProject);
  String currentProfile = managerEx.getCurrentProfile();
  final InspectionProjectProfileManager inspectionProfileManager = InspectionProjectProfileManager.getInstance(myProject);
  Profile profile = inspectionProfileManager.getProfile(currentProfile, false);
  if (profile == null) {
    profile = InspectionProfileManager.getInstance().getProfile(currentProfile);
    if (profile != null) return (InspectionProfile)profile;

    final String[] availableProfileNames = inspectionProfileManager.getAvailableProfileNames();
    if (availableProfileNames.length == 0) {
      //can't be
      return null;
    }
    profile = inspectionProfileManager.getProfile(availableProfileNames[0]);
  }
  return (InspectionProfile)profile;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:GlobalInspectionContextBase.java

示例5: testSettingsModification

import com.intellij.profile.codeInspection.InspectionProjectProfileManager; //导入方法依赖的package包/类
public void testSettingsModification() throws Exception {

    Project project = ProjectManager.getInstance().getDefaultProject();
    InspectionProjectProfileManager profileManager = InspectionProjectProfileManager.getInstance(project);
    InspectionProfileImpl profile = (InspectionProfileImpl)profileManager.getProfile(PROFILE);
    profile.initInspectionTools(project);
    assertEquals(0, InspectionProfileTest.countInitializedTools(profile));

    InspectionProfileImpl model = (InspectionProfileImpl)profile.getModifiableModel();
    assertEquals(0, InspectionProfileTest.countInitializedTools(model));
    SingleInspectionProfilePanel panel = new SingleInspectionProfilePanel(profileManager, PROFILE, model);
    panel.setVisible(true);
    panel.reset();
    assertEquals(InspectionProfileTest.getInitializedTools(model).toString(), 0, InspectionProfileTest.countInitializedTools(model));

    JavaDocLocalInspection tool = getInspection(model);
    assertEquals("", tool.myAdditionalJavadocTags);
    tool.myAdditionalJavadocTags = "foo";
    model.setModified(true);
    panel.apply();
    assertEquals(1, InspectionProfileTest.countInitializedTools(model));

    assertEquals("foo", getInspection(profile).myAdditionalJavadocTags);
  }
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:25,代码来源:SingleInspectionProfilePanelTest.java

示例6: testModifyInstantiatedTool

import com.intellij.profile.codeInspection.InspectionProjectProfileManager; //导入方法依赖的package包/类
public void testModifyInstantiatedTool() throws Exception {
  Project project = ProjectManager.getInstance().getDefaultProject();
  InspectionProjectProfileManager profileManager = InspectionProjectProfileManager.getInstance(project);
  InspectionProfileImpl profile = (InspectionProfileImpl)profileManager.getProfile(PROFILE);
  profile.initInspectionTools(project);
  assertEquals(0, InspectionProfileTest.countInitializedTools(profile));

  JavaDocLocalInspection originalTool = getInspection(profile);
  originalTool.myAdditionalJavadocTags = "foo";

  InspectionProfileImpl model = (InspectionProfileImpl)profile.getModifiableModel();

  SingleInspectionProfilePanel panel = new SingleInspectionProfilePanel(profileManager, PROFILE, model);
  panel.setVisible(true);
  panel.reset();
  assertEquals(InspectionProfileTest.getInitializedTools(model).toString(), 1, InspectionProfileTest.countInitializedTools(model));

  JavaDocLocalInspection copyTool = getInspection(model);
  copyTool.myAdditionalJavadocTags = "bar";

  model.setModified(true);
  panel.apply();
  assertEquals(1, InspectionProfileTest.countInitializedTools(model));

  assertEquals("bar", getInspection(profile).myAdditionalJavadocTags);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:27,代码来源:SingleInspectionProfilePanelTest.java

示例7: testDoNotChangeSettingsOnCancel

import com.intellij.profile.codeInspection.InspectionProjectProfileManager; //导入方法依赖的package包/类
public void testDoNotChangeSettingsOnCancel() throws Exception {
  Project project = ProjectManager.getInstance().getDefaultProject();
  InspectionProjectProfileManager profileManager = InspectionProjectProfileManager.getInstance(project);
  InspectionProfileImpl profile = (InspectionProfileImpl)profileManager.getProfile(PROFILE);
  profile.initInspectionTools(project);
  assertEquals(0, InspectionProfileTest.countInitializedTools(profile));

  JavaDocLocalInspection originalTool = getInspection(profile);
  assertEquals("", originalTool.myAdditionalJavadocTags);

  InspectionProfileImpl model = (InspectionProfileImpl)profile.getModifiableModel();
  JavaDocLocalInspection copyTool = getInspection(model);
  copyTool.myAdditionalJavadocTags = "foo";
  // this change IS NOT COMMITTED

  assertEquals("", getInspection(profile).myAdditionalJavadocTags);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:18,代码来源:SingleInspectionProfilePanelTest.java


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