本文整理汇总了Java中com.intellij.codeInspection.ex.InspectionToolWrapper.getShortName方法的典型用法代码示例。如果您正苦于以下问题:Java InspectionToolWrapper.getShortName方法的具体用法?Java InspectionToolWrapper.getShortName怎么用?Java InspectionToolWrapper.getShortName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.codeInspection.ex.InspectionToolWrapper
的用法示例。
在下文中一共展示了InspectionToolWrapper.getShortName方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: enableInspectionTool
import com.intellij.codeInspection.ex.InspectionToolWrapper; //导入方法依赖的package包/类
public static void enableInspectionTool(@NotNull final Project project, @NotNull final InspectionToolWrapper toolWrapper) {
final InspectionProfile profile = InspectionProjectProfileManager.getInstance(project).getInspectionProfile();
final String shortName = toolWrapper.getShortName();
final HighlightDisplayKey key = HighlightDisplayKey.find(shortName);
if (key == null) {
HighlightDisplayKey.register(shortName, toolWrapper.getDisplayName(), toolWrapper.getID());
}
InspectionProfileImpl.initAndDo(new Computable() {
@Override
public Object compute() {
InspectionProfileImpl impl = (InspectionProfileImpl)profile;
InspectionToolWrapper existingWrapper = impl.getInspectionTool(shortName, project);
if (existingWrapper == null || existingWrapper.isInitialized() != toolWrapper.isInitialized() || toolWrapper.isInitialized() && toolWrapper.getTool() != existingWrapper.getTool()) {
impl.addTool(project, toolWrapper, new THashMap<String, List<String>>());
}
impl.enableTool(shortName, project);
return null;
}
});
}
示例2: getWorkedTools
import com.intellij.codeInspection.ex.InspectionToolWrapper; //导入方法依赖的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;
}
示例3: getInspectionShortNameByIssue
import com.intellij.codeInspection.ex.InspectionToolWrapper; //导入方法依赖的package包/类
public static String getInspectionShortNameByIssue(@NotNull Project project, @NotNull Issue issue) {
synchronized (ISSUE_MAP_LOCK) {
if (ourIssue2InspectionShortName == null) {
ourIssue2InspectionShortName = new HashMap<Issue, String>();
final InspectionProfile profile = InspectionProjectProfileManager.getInstance(project).getInspectionProfile();
for (InspectionToolWrapper e : profile.getInspectionTools(null)) {
final String shortName = e.getShortName();
if (shortName.startsWith("AndroidLint")) {
final InspectionProfileEntry entry = e.getTool();
if (entry instanceof AndroidLintInspectionBase) {
final Issue s = ((AndroidLintInspectionBase)entry).getIssue();
ourIssue2InspectionShortName.put(s, shortName);
}
}
}
}
return ourIssue2InspectionShortName.get(issue);
}
}
示例4: getWorkedTools
import com.intellij.codeInspection.ex.InspectionToolWrapper; //导入方法依赖的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;
}
示例5: exportHTML
import com.intellij.codeInspection.ex.InspectionToolWrapper; //导入方法依赖的package包/类
@RequiredReadAction
private void exportHTML(HTMLExportFrameMaker frameMaker, InspectionNode node) {
final Set<InspectionToolWrapper> toolWrappers = getWorkedTools(node);
final InspectionToolWrapper toolWrapper = node.getToolWrapper();
final HTMLExporter exporter =
new HTMLExporter(frameMaker.getRootFolder() + "/" + toolWrapper.getShortName(), myView.getGlobalInspectionContext().getPresentation(toolWrapper).getComposer());
frameMaker.startInspection(toolWrapper);
HTMLExportUtil.runExport(myView.getProject(), new ThrowableRunnable<IOException>() {
@Override
@RequiredReadAction
public void run() throws IOException {
exportHTML(toolWrappers, exporter);
exporter.generateReferencedPages();
}
});
}
示例6: convertToShortName
import com.intellij.codeInspection.ex.InspectionToolWrapper; //导入方法依赖的package包/类
@Nullable
private static String convertToShortName(String displayName, InspectionToolWrapper[] tools) {
if (displayName == null) return null;
for (InspectionToolWrapper tool : tools) {
if (displayName.equals(tool.getDisplayName())) {
return tool.getShortName();
}
}
return null;
}
示例7: runTool
import com.intellij.codeInspection.ex.InspectionToolWrapper; //导入方法依赖的package包/类
public static void runTool(@NotNull InspectionToolWrapper toolWrapper,
@NotNull final AnalysisScope scope,
@NotNull final GlobalInspectionContextForTests globalContext) {
final String shortName = toolWrapper.getShortName();
final HighlightDisplayKey key = HighlightDisplayKey.find(shortName);
if (key == null){
HighlightDisplayKey.register(shortName);
}
globalContext.doInspections(scope);
do {
UIUtil.dispatchAllInvocationEvents();
}
while (!globalContext.isFinished());
}
示例8: exportHTML
import com.intellij.codeInspection.ex.InspectionToolWrapper; //导入方法依赖的package包/类
private void exportHTML(HTMLExportFrameMaker frameMaker, InspectionNode node) {
final Set<InspectionToolWrapper> toolWrappers = getWorkedTools(node);
final InspectionToolWrapper toolWrapper = node.getToolWrapper();
final HTMLExporter exporter =
new HTMLExporter(frameMaker.getRootFolder() + "/" + toolWrapper.getShortName(), myView.getGlobalInspectionContext().getPresentation(toolWrapper).getComposer());
frameMaker.startInspection(toolWrapper);
HTMLExportUtil.runExport(myView.getProject(), new ThrowableRunnable<IOException>() {
@Override
public void run() throws IOException {
exportHTML(toolWrappers, exporter);
exporter.generateReferencedPages();
}
});
}
示例9: runTool
import com.intellij.codeInspection.ex.InspectionToolWrapper; //导入方法依赖的package包/类
public static void runTool(@NotNull InspectionToolWrapper toolWrapper,
@NotNull final AnalysisScope scope,
@NotNull final GlobalInspectionContextImpl globalContext,
@NotNull final InspectionManagerEx inspectionManager) {
final String shortName = toolWrapper.getShortName();
final HighlightDisplayKey key = HighlightDisplayKey.find(shortName);
if (key == null){
HighlightDisplayKey.register(shortName);
}
globalContext.doInspections(scope);
}
示例10: runTool
import com.intellij.codeInspection.ex.InspectionToolWrapper; //导入方法依赖的package包/类
public static void runTool(@Nonnull InspectionToolWrapper toolWrapper,
@Nonnull final AnalysisScope scope,
@Nonnull final GlobalInspectionContextImpl globalContext,
@Nonnull final InspectionManagerEx inspectionManager) {
final String shortName = toolWrapper.getShortName();
final HighlightDisplayKey key = HighlightDisplayKey.find(shortName);
if (key == null){
HighlightDisplayKey.register(shortName);
}
globalContext.doInspections(scope);
}