From 464dc05345c4ff34e7610fd1cef8aab3821cd69c Mon Sep 17 00:00:00 2001 From: Kirill Likhodedov Date: Thu, 4 Oct 2012 18:12:12 +0400 Subject: [PATCH] IDEA-92422 Unable to Annotate plain text files When the UI Designer plugin is disabled, it doesn't register its own FileType, thus StdFileTypes.GUI_DESIGNER_FORM is precalculated as plain text. Anyway, here is no reason anymore to prohibit Annotate on UI Designer forms, because there is a tab with XML, and annotate is perfectly valid for the XML. This change undoes the change made for IDEA-34646. --- .../intellij/openapi/vcs/actions/AnnotateToggleAction.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/actions/AnnotateToggleAction.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/actions/AnnotateToggleAction.java index a93a90f873ee..f6fe7b1bc6f8 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/actions/AnnotateToggleAction.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/actions/AnnotateToggleAction.java @@ -26,8 +26,6 @@ import com.intellij.openapi.fileEditor.FileDocumentManager; import com.intellij.openapi.fileEditor.FileEditor; import com.intellij.openapi.fileEditor.FileEditorManager; import com.intellij.openapi.fileEditor.TextEditor; -import com.intellij.openapi.fileTypes.FileType; -import com.intellij.openapi.fileTypes.StdFileTypes; import com.intellij.openapi.localVcs.UpToDateLineNumberProvider; import com.intellij.openapi.progress.ProgressIndicator; import com.intellij.openapi.progress.ProgressManager; @@ -93,9 +91,8 @@ public class AnnotateToggleAction extends ToggleAction implements DumbAware, Ann return hasTextEditor(file); } - private static boolean hasTextEditor(VirtualFile selectedFile) { - FileType fileType = selectedFile.getFileType(); - return !fileType.isBinary() && fileType != StdFileTypes.GUI_DESIGNER_FORM; + private static boolean hasTextEditor(@NotNull VirtualFile selectedFile) { + return !selectedFile.getFileType().isBinary(); } public boolean isSelected(AnActionEvent e) {