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.
This commit is contained in:
Kirill Likhodedov
2012-10-04 18:13:02 +04:00
parent 0cd0876cf0
commit 464dc05345
@@ -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) {