mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
cleanup
This commit is contained in:
@@ -55,6 +55,7 @@ public abstract class TextEditorHighlightingPass implements HighlightingPass {
|
||||
this(project, document, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void collectInformation(ProgressIndicator progress) {
|
||||
if (!isValid()) return; //Document has changed.
|
||||
myDumb = DumbService.getInstance(myProject).isDumb();
|
||||
@@ -88,6 +89,7 @@ public abstract class TextEditorHighlightingPass implements HighlightingPass {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void applyInformationToEditor() {
|
||||
if (!isValid()) return; // Document has changed.
|
||||
if (DumbService.getInstance(myProject).isDumb() && !(this instanceof DumbAware)) {
|
||||
|
||||
+2
-1
@@ -709,7 +709,8 @@ public class LocalInspectionsPass extends ProgressableTextEditorHighlightingPass
|
||||
return new ArrayList<PsiElement>(result);
|
||||
}
|
||||
|
||||
List<LocalInspectionToolWrapper> getInspectionTools(InspectionProfileWrapper profile) {
|
||||
@NotNull
|
||||
List<LocalInspectionToolWrapper> getInspectionTools(@NotNull InspectionProfileWrapper profile) {
|
||||
final List<LocalInspectionToolWrapper> tools = profile.getHighlightingLocalInspectionTools(myFile);
|
||||
for (Iterator<LocalInspectionToolWrapper> iterator = tools.iterator(); iterator.hasNext(); ) {
|
||||
LocalInspectionToolWrapper tool = iterator.next();
|
||||
|
||||
@@ -36,16 +36,19 @@ import org.jetbrains.annotations.NotNull;
|
||||
*/
|
||||
public class XmlSplitTagAction implements IntentionAction {
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getText() {
|
||||
return XmlBundle.message("xml.split.tag.intention.action");
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getFamilyName() {
|
||||
return XmlBundle.message("xml.split.tag.intention.action");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAvailable(@NotNull final Project project, final Editor editor, final PsiFile file) {
|
||||
if (file instanceof XmlFile) {
|
||||
if (editor != null) {
|
||||
@@ -75,6 +78,7 @@ public class XmlSplitTagAction implements IntentionAction {
|
||||
return "html".equals(name) || "body".equals(name) || "title".equals(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invoke(@NotNull final Project project, final Editor editor, final PsiFile file) throws IncorrectOperationException {
|
||||
if (!CodeInsightUtilBase.prepareFileForWrite(file)) return;
|
||||
|
||||
@@ -165,6 +169,7 @@ public class XmlSplitTagAction implements IntentionAction {
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean startInWriteAction() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -29,10 +29,12 @@ import org.jetbrains.annotations.NotNull;
|
||||
public abstract class XmlSuppressableInspectionTool extends LocalInspectionTool implements CustomSuppressableInspectionTool {
|
||||
@NonNls static final String ALL = "ALL";
|
||||
|
||||
@Override
|
||||
public SuppressIntentionAction[] getSuppressActions(final PsiElement element) {
|
||||
return new SuppressIntentionAction[]{new SuppressTag(), new SuppressForFile(getID()), new SuppressAllForFile()};
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSuppressedFor(final PsiElement element) {
|
||||
return XmlSuppressionProvider.isSuppressed(element, getID());
|
||||
}
|
||||
@@ -45,27 +47,30 @@ public abstract class XmlSuppressableInspectionTool extends LocalInspectionTool
|
||||
}
|
||||
|
||||
public static class SuppressTagStatic extends SuppressIntentionAction {
|
||||
|
||||
private String id;
|
||||
private final String id;
|
||||
|
||||
public SuppressTagStatic(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getText() {
|
||||
return InspectionsBundle.message("xml.suppressable.for.tag.title");
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getFamilyName() {
|
||||
return getText();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAvailable(@NotNull final Project project, final Editor editor, @NotNull final PsiElement element) {
|
||||
return PsiTreeUtil.getParentOfType(element, XmlTag.class) != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invoke(@NotNull final Project project, final Editor editor, @NotNull final PsiElement element) throws IncorrectOperationException {
|
||||
XmlSuppressionProvider.getProvider(element.getContainingFile()).suppressForTag(element, id);
|
||||
}
|
||||
@@ -78,20 +83,24 @@ public abstract class XmlSuppressableInspectionTool extends LocalInspectionTool
|
||||
myInspectionId = inspectionId;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getText() {
|
||||
return InspectionsBundle.message("xml.suppressable.for.file.title");
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getFamilyName() {
|
||||
return getText();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invoke(@NotNull final Project project, final Editor editor, @NotNull final PsiElement element) throws IncorrectOperationException {
|
||||
XmlSuppressionProvider.getProvider(element.getContainingFile()).suppressForFile(element, myInspectionId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAvailable(@NotNull final Project project, final Editor editor, @NotNull final PsiElement element) {
|
||||
return element.isValid() && element.getContainingFile() instanceof XmlFile;
|
||||
}
|
||||
@@ -103,6 +112,7 @@ public abstract class XmlSuppressableInspectionTool extends LocalInspectionTool
|
||||
super(ALL);
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getText() {
|
||||
return InspectionsBundle.message("xml.suppressable.all.for.file.title");
|
||||
|
||||
Reference in New Issue
Block a user