本文整理汇总了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();
}
示例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();
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}