本文整理汇总了Java中com.intellij.codeInspection.InspectionsBundle类的典型用法代码示例。如果您正苦于以下问题:Java InspectionsBundle类的具体用法?Java InspectionsBundle怎么用?Java InspectionsBundle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
InspectionsBundle类属于com.intellij.codeInspection包,在下文中一共展示了InspectionsBundle类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: visitTypeCastExpression
import com.intellij.codeInspection.InspectionsBundle; //导入依赖的package包/类
@Override
public void visitTypeCastExpression(final PsiTypeCastExpression expression) {
if (PsiUtil.isLanguageLevel7OrHigher(expression)) return;
final PsiTypeElement type = expression.getCastType();
if (type != null) {
type.accept(new JavaRecursiveElementWalkingVisitor() {
@Override
public void visitReferenceParameterList(final PsiReferenceParameterList list) {
super.visitReferenceParameterList(list);
if (list.getFirstChild() != null && QUALIFIER_REFERENCE.accepts(list)) {
final String message = InspectionsBundle.message("inspection.compiler.javac.quirks.qualifier.type.args.problem");
final String fixName = InspectionsBundle.message("inspection.compiler.javac.quirks.qualifier.type.args.fix");
myHolder.registerProblem(list, message, new RemoveElementQuickFix(fixName));
}
}
});
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:JavacQuirksInspectionVisitor.java
示例2: getName
import com.intellij.codeInspection.InspectionsBundle; //导入依赖的package包/类
@NotNull
public static String getName(PsiElement element) {
if (element instanceof PsiAnonymousClass) {
PsiAnonymousClass psiAnonymousClass = (PsiAnonymousClass)element;
PsiClass psiBaseClass = psiAnonymousClass.getBaseClassType().resolve();
return InspectionsBundle.message("inspection.reference.anonymous.name", psiBaseClass == null ? "" : psiBaseClass.getQualifiedName());
}
if (element instanceof PsiSyntheticClass) {
final PsiSyntheticClass jspClass = (PsiSyntheticClass)element;
final PsiFile jspxFile = jspClass.getContainingFile();
return "<" + jspxFile.getName() + ">";
}
if (element instanceof PsiMethod && element instanceof SyntheticElement ) {
return InspectionsBundle.message("inspection.reference.jsp.holder.method.anonymous.name");
}
String name = null;
if (element instanceof PsiNamedElement) {
name = ((PsiNamedElement)element).getName();
}
return name == null ? InspectionsBundle.message("inspection.reference.anonymous") : name;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:RefJavaElementImpl.java
示例3: createTagsPanel
import com.intellij.codeInspection.InspectionsBundle; //导入依赖的package包/类
private JPanel createTagsPanel(String[] tags, Options options) {
JPanel panel = new JPanel(new GridBagLayout());
panel.setBorder(BorderFactory.createCompoundBorder(IdeBorderFactory.createTitledBorder(
InspectionsBundle.message("inspection.javadoc.required.tags.option.title"), true),
BorderFactory.createEmptyBorder(0, 3, 3, 3)));
GridBagConstraints gc = new GridBagConstraints();
gc.weightx = 1;
gc.weighty = 0;
gc.fill = GridBagConstraints.HORIZONTAL;
gc.anchor = GridBagConstraints.NORTHWEST;
for (int i = 0; i < tags.length; i++) {
JCheckBox box = new JCheckBox(tags[i]);
gc.gridy = i;
if (i == tags.length - 1) gc.weighty = 1;
panel.add(box, gc);
box.setSelected(isTagRequired(options, tags[i]));
box.addChangeListener(new MyChangeListener(box, options, tags[i]));
}
return panel;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:JavaDocLocalInspection.java
示例4: createAdditionalJavadocTagsPanel
import com.intellij.codeInspection.InspectionsBundle; //导入依赖的package包/类
public FieldPanel createAdditionalJavadocTagsPanel(){
FieldPanel additionalTagsPanel = new FieldPanel(InspectionsBundle.message("inspection.javadoc.label.text"), InspectionsBundle.message("inspection.javadoc.dialog.title"), null, null);
additionalTagsPanel.setPreferredSize(new Dimension(150, additionalTagsPanel.getPreferredSize().height));
additionalTagsPanel.getTextField().getDocument().addDocumentListener(new DocumentAdapter() {
@Override
protected void textChanged(DocumentEvent e) {
final Document document = e.getDocument();
try {
final String text = document.getText(0, document.getLength());
if (text != null) {
myAdditionalJavadocTags = text.trim();
}
}
catch (BadLocationException e1) {
LOG.error(e1);
}
}
});
additionalTagsPanel.setText(myAdditionalJavadocTags);
return additionalTagsPanel;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:JavaDocLocalInspection.java
示例5: appendClassOrInterface
import com.intellij.codeInspection.InspectionsBundle; //导入依赖的package包/类
@Override
public void appendClassOrInterface(StringBuffer buf, RefClass refClass, boolean capitalizeFirstLetter) {
if (refClass.isInterface()) {
buf.append(capitalizeFirstLetter
? InspectionsBundle.message("inspection.export.results.capitalized.interface")
: InspectionsBundle.message("inspection.export.results.interface"));
}
else if (refClass.isAbstract()) {
buf.append(capitalizeFirstLetter
? InspectionsBundle.message("inspection.export.results.capitalized.abstract.class")
: InspectionsBundle.message("inspection.export.results.abstract.class"));
}
else {
buf.append(capitalizeFirstLetter
? InspectionsBundle.message("inspection.export.results.capitalized.class")
: InspectionsBundle.message("inspection.export.results.class"));
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:HTMLJavaHTMLComposerImpl.java
示例6: appendDerivedClasses
import com.intellij.codeInspection.InspectionsBundle; //导入依赖的package包/类
@Override
public void appendDerivedClasses(StringBuffer buf, RefClass refClass) {
if (refClass.getSubClasses().size() > 0) {
if (refClass.isInterface()) {
HTMLComposerImpl.appendHeading(buf, InspectionsBundle.message("inspection.export.results.extended.implemented"));
}
else {
HTMLComposerImpl.appendHeading(buf, InspectionsBundle.message("inspection.export.results.extended"));
}
myComposer.startList(buf);
for (RefClass refDerived : refClass.getSubClasses()) {
myComposer.appendListItem(buf, refDerived);
}
myComposer.doneList(buf);
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:HTMLJavaHTMLComposerImpl.java
示例7: appendClassInstantiations
import com.intellij.codeInspection.InspectionsBundle; //导入依赖的package包/类
private void appendClassInstantiations(StringBuffer buf, RefClass refClass) {
if (!refClass.isInterface() && !refClass.isAbstract() && !refClass.isUtilityClass()) {
boolean found = false;
appendHeading(buf, InspectionsBundle.message("inspection.dead.code.export.results.instantiated.from.heading"));
startList(buf);
for (Iterator<RefMethod> iterator = refClass.getConstructors().iterator(); iterator.hasNext();) {
RefMethod refMethod = iterator.next();
for (Iterator<RefElement> constructorCallersIterator = refMethod.getInReferences().iterator(); constructorCallersIterator.hasNext();) {
RefElement refCaller = constructorCallersIterator.next();
appendListItem(buf, refCaller);
found = true;
}
}
if (!found) {
startListItem(buf);
buf.append(InspectionsBundle.message("inspection.dead.code.export.results.no.instantiations.found"));
doneListItem(buf);
}
doneList(buf);
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:DeadHTMLComposer.java
示例8: appendCallesList
import com.intellij.codeInspection.InspectionsBundle; //导入依赖的package包/类
private void appendCallesList(RefElement element, StringBuffer buf, Set<RefElement> mentionedElements, boolean appendCallees){
final Set<RefElement> possibleChildren = getPossibleChildren(new RefElementNode(element, myToolPresentation), element);
if (!possibleChildren.isEmpty()) {
if (appendCallees){
appendHeading(buf, InspectionsBundle.message("inspection.export.results.callees"));
}
@NonNls final String ul = "<ul>";
buf.append(ul);
for (RefElement refElement : possibleChildren) {
if (!mentionedElements.contains(refElement)) {
mentionedElements.add(refElement);
@NonNls final String li = "<li>";
buf.append(li);
appendElementReference(buf, refElement, true);
@NonNls final String closeLi = "</li>";
buf.append(closeLi);
appendCallesList(refElement, buf, mentionedElements, false);
}
}
@NonNls final String closeUl = "</ul>";
buf.append(closeUl);
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:DeadHTMLComposer.java
示例9: createOptionsPanel
import com.intellij.codeInspection.InspectionsBundle; //导入依赖的package包/类
@Override
public JComponent createOptionsPanel() {
final JButton editDependencies = new JButton(InspectionsBundle.message("inspection.dependency.configure.button.text"));
editDependencies.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
Project project = CommonDataKeys.PROJECT.getData(DataManager.getInstance().getDataContext(editDependencies));
if (project == null) project = ProjectManager.getInstance().getDefaultProject();
ShowSettingsUtil.getInstance().editConfigurable(editDependencies, new DependencyConfigurable(project));
}
});
JPanel depPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
depPanel.add(editDependencies);
return depPanel;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:DependencyInspection.java
示例10: genPageHeader
import com.intellij.codeInspection.InspectionsBundle; //导入依赖的package包/类
protected void genPageHeader(final StringBuffer buf, RefEntity refEntity) {
if (refEntity instanceof RefElement) {
RefElement refElement = (RefElement)refEntity;
appendHeading(buf, InspectionsBundle.message("inspection.offline.view.tool.display.name.title"));
buf.append(BR);
appendAfterHeaderIndention(buf);
appendShortName(buf, refElement);
buf.append(BR).append(BR);
appendHeading(buf, InspectionsBundle.message("inspection.export.results.capitalized.location"));
buf.append(BR);
appendAfterHeaderIndention(buf);
appendLocation(buf, refElement);
buf.append(BR).append(BR);
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:HTMLComposerImpl.java
示例11: appendResolution
import com.intellij.codeInspection.InspectionsBundle; //导入依赖的package包/类
protected void appendResolution(StringBuffer buf, RefEntity where, String[] quickFixes) {
if (myExporter != null) return;
if (where instanceof RefElement && !where.isValid()) return;
if (quickFixes != null) {
boolean listStarted = false;
for (int i = 0; i < quickFixes.length; i++) {
final String text = quickFixes[i];
if (text == null) continue;
if (!listStarted) {
appendHeading(buf, InspectionsBundle.message("inspection.problem.resolution"));
startList(buf);
listStarted = true;
}
startListItem(buf);
appendQuickFix(buf, text, i);
doneListItem(buf);
}
if (listStarted) {
doneList(buf);
}
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:HTMLComposerImpl.java
示例12: customizeCellRenderer
import com.intellij.codeInspection.InspectionsBundle; //导入依赖的package包/类
@Override
public void customizeCellRenderer(JTree tree,
Object value,
boolean selected,
boolean expanded,
boolean leaf,
int row,
boolean hasFocus) {
InspectionTreeNode node = (InspectionTreeNode)value;
append(node.toString(),
patchAttr(node, appearsBold(node) ? SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES : getMainForegroundAttributes(node)));
int problemCount = node.getProblemCount();
if (!leaf) {
append(" " + InspectionsBundle.message("inspection.problem.descriptor.count", problemCount), patchAttr(node, SimpleTextAttributes.GRAYED_ATTRIBUTES));
}
if (!node.isValid()) {
append(" " + InspectionsBundle.message("inspection.invalid.node.text"), patchAttr(node, SimpleTextAttributes.ERROR_ATTRIBUTES));
} else {
setIcon(node.getIcon(expanded));
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:InspectionTree.java
示例13: writeFile
import com.intellij.codeInspection.InspectionsBundle; //导入依赖的package包/类
public static void writeFile(final String folder, @NonNls final String fileName, CharSequence buf, final Project project) {
try {
HTMLExporter.writeFileImpl(folder, fileName, buf);
}
catch (IOException e) {
Runnable showError = new Runnable() {
@Override
public void run() {
final String fullPath = folder + File.separator + fileName;
Messages.showMessageDialog(
project,
InspectionsBundle.message("inspection.export.error.writing.to", fullPath),
InspectionsBundle.message("inspection.export.results.error.title"),
Messages.getErrorIcon()
);
}
};
ApplicationManager.getApplication().invokeLater(showError, ModalityState.NON_MODAL);
throw new ProcessCanceledException();
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:HTMLExportUtil.java
示例14: runExport
import com.intellij.codeInspection.InspectionsBundle; //导入依赖的package包/类
public static void runExport(final Project project, @NotNull ThrowableRunnable<IOException> runnable) {
try {
runnable.run();
}
catch (IOException e) {
Runnable showError = new Runnable() {
@Override
public void run() {
Messages.showMessageDialog(
project,
InspectionsBundle.message("inspection.export.error.writing.to", "export file"),
InspectionsBundle.message("inspection.export.results.error.title"),
Messages.getErrorIcon()
);
}
};
ApplicationManager.getApplication().invokeLater(showError, ModalityState.NON_MODAL);
throw new ProcessCanceledException();
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:HTMLExportUtil.java
示例15: startInspection
import com.intellij.codeInspection.InspectionsBundle; //导入依赖的package包/类
public void startInspection(@NotNull InspectionToolWrapper toolWrapper) {
myInspectionToolWrappers.add(toolWrapper);
@NonNls StringBuffer buf = new StringBuffer();
buf.append("<HTML><HEAD><TITLE>");
buf.append(ApplicationNamesInfo.getInstance().getFullProductName());
buf.append(InspectionsBundle.message("inspection.export.title"));
buf.append("</TITLE></HEAD>");
buf.append("<FRAMESET cols=\"30%,70%\"><FRAMESET rows=\"30%,70%\">");
buf.append("<FRAME src=\"");
buf.append(toolWrapper.getFolderName());
buf.append("/index.html\" name=\"inspectionFrame\">");
buf.append("<FRAME src=\"empty.html\" name=\"packageFrame\">");
buf.append("</FRAMESET>");
buf.append("<FRAME src=\"empty.html\" name=\"elementFrame\">");
buf.append("</FRAMESET></BODY></HTML");
HTMLExportUtil.writeFile(myRootFolder, toolWrapper.getFolderName() + "-index.html", buf, myProject);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:HTMLExportFrameMaker.java
示例16: getDescription
import com.intellij.codeInspection.InspectionsBundle; //导入依赖的package包/类
@Override
public String getDescription(@NotNull final String refSuffix, @NotNull final Editor editor) {
final Project project = editor.getProject();
if (project == null) {
LOG.error(editor);
return null;
}
if (project.isDisposed()) return null;
final PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument());
if (file == null) {
return null;
}
final InspectionProfile profile = (InspectionProfile)InspectionProfileManager.getInstance().getRootProfile();
final InspectionToolWrapper toolWrapper = profile.getInspectionTool(refSuffix, file);
if (toolWrapper == null) return null;
String description = toolWrapper.loadDescription();
if (description == null) {
LOG.warn("No description for inspection '" + refSuffix + "'");
description = InspectionsBundle.message("inspection.tool.description.under.construction.text");
}
return description;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:InspectionDescriptionLinkHandler.java
示例17: getName
import com.intellij.codeInspection.InspectionsBundle; //导入依赖的package包/类
public static String getName(PsiElement element) {
if (element instanceof PsiAnonymousClass) {
PsiAnonymousClass psiAnonymousClass = (PsiAnonymousClass)element;
PsiClass psiBaseClass = psiAnonymousClass.getBaseClassType().resolve();
return InspectionsBundle.message("inspection.reference.anonymous.name", psiBaseClass == null ? "" : psiBaseClass.getQualifiedName());
}
if (element instanceof PsiSyntheticClass) {
final PsiSyntheticClass jspClass = (PsiSyntheticClass)element;
final PsiFile jspxFile = jspClass.getContainingFile();
return "<" + jspxFile.getName() + ">";
}
if (element instanceof PsiMethod && element instanceof SyntheticElement ) {
return InspectionsBundle.message("inspection.reference.jsp.holder.method.anonymous.name");
}
String name = null;
if (element instanceof PsiNamedElement) {
name = ((PsiNamedElement)element).getName();
}
return name == null ? InspectionsBundle.message("inspection.reference.anonymous") : name;
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:25,代码来源:RefJavaElementImpl.java
示例18: getDescription
import com.intellij.codeInspection.InspectionsBundle; //导入依赖的package包/类
@Override
public String getDescription(@NotNull final String refSuffix, @NotNull final Editor editor) {
final Project project = editor.getProject();
if (project == null) {
LOG.error(editor);
return null;
}
final PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument());
if (file == null) {
return null;
}
final InspectionProfile profile = (InspectionProfile)InspectionProfileManager.getInstance().getRootProfile();
final InspectionToolWrapper toolWrapper = profile.getInspectionTool(refSuffix, file);
if (toolWrapper == null) return null;
String description = toolWrapper.loadDescription();
if (description == null) {
LOG.warn("No description for inspection '" + refSuffix + "'");
description = InspectionsBundle.message("inspection.tool.description.under.construction.text");
}
return description;
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:25,代码来源:InspectionDescriptionLinkHandler.java
示例19: startInspection
import com.intellij.codeInspection.InspectionsBundle; //导入依赖的package包/类
public void startInspection(@Nonnull InspectionToolWrapper toolWrapper) {
myInspectionToolWrappers.add(toolWrapper);
@NonNls StringBuffer buf = new StringBuffer();
buf.append("<HTML><HEAD><TITLE>");
buf.append(ApplicationNamesInfo.getInstance().getFullProductName());
buf.append(InspectionsBundle.message("inspection.export.title"));
buf.append("</TITLE></HEAD>");
buf.append("<FRAMESET cols=\"30%,70%\"><FRAMESET rows=\"30%,70%\">");
buf.append("<FRAME src=\"");
buf.append(toolWrapper.getFolderName());
buf.append("/index.html\" name=\"inspectionFrame\">");
buf.append("<FRAME src=\"empty.html\" name=\"packageFrame\">");
buf.append("</FRAMESET>");
buf.append("<FRAME src=\"empty.html\" name=\"elementFrame\">");
buf.append("</FRAMESET></BODY></HTML");
HTMLExportUtil.writeFile(myRootFolder, toolWrapper.getFolderName() + "-index.html", buf, myProject);
}
开发者ID:consulo,项目名称:consulo,代码行数:19,代码来源:HTMLExportFrameMaker.java
示例20: getDescription
import com.intellij.codeInspection.InspectionsBundle; //导入依赖的package包/类
@Override
public String getDescription(@Nonnull final String refSuffix, @Nonnull final Editor editor) {
final Project project = editor.getProject();
if (project == null) {
LOG.error(editor);
return null;
}
final PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument());
if (file == null) {
return null;
}
final InspectionProfile profile = (InspectionProfile)InspectionProfileManager.getInstance().getRootProfile();
final InspectionToolWrapper toolWrapper = profile.getInspectionTool(refSuffix, file);
if (toolWrapper == null) return null;
String description = toolWrapper.loadDescription();
if (description == null) {
LOG.warn("No description for inspection '" + refSuffix + "'");
description = InspectionsBundle.message("inspection.tool.description.under.construction.text");
}
return description;
}
开发者ID:consulo,项目名称:consulo,代码行数:25,代码来源:InspectionDescriptionLinkHandler.java
注:本文中的com.intellij.codeInspection.InspectionsBundle类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论