diff --git a/images/images.iml b/images/images.iml
index 5a3f83d41703..a6257f336679 100644
--- a/images/images.iml
+++ b/images/images.iml
@@ -10,6 +10,6 @@
+
-
-
+
\ No newline at end of file
diff --git a/images/src/org/intellij/images/fileTypes/impl/ImageFileTypeManagerImpl.java b/images/src/org/intellij/images/fileTypes/impl/ImageFileTypeManagerImpl.java
index 98c181096671..3dca4014d13a 100644
--- a/images/src/org/intellij/images/fileTypes/impl/ImageFileTypeManagerImpl.java
+++ b/images/src/org/intellij/images/fileTypes/impl/ImageFileTypeManagerImpl.java
@@ -19,8 +19,6 @@ import com.intellij.openapi.fileTypes.FileType;
import com.intellij.openapi.fileTypes.FileTypeConsumer;
import com.intellij.openapi.fileTypes.UserBinaryFileType;
import com.intellij.openapi.fileTypes.UserFileType;
-import com.intellij.openapi.options.SettingsEditor;
-import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.VirtualFile;
import gnu.trove.THashSet;
@@ -44,17 +42,12 @@ final class ImageFileTypeManagerImpl extends ImageFileTypeManager {
@NonNls private static final String IMAGE_FILE_TYPE_NAME = "Images";
private static final String IMAGE_FILE_TYPE_DESCRIPTION = ImagesBundle.message("images.filetype.description");
private static final UserFileType imageFileType;
- private static final UserFileType svgFileType;
static {
imageFileType = new ImageFileType();
imageFileType.setIcon(ImagesIcons.ImagesFileType);
imageFileType.setName(IMAGE_FILE_TYPE_NAME);
imageFileType.setDescription(IMAGE_FILE_TYPE_DESCRIPTION);
- svgFileType = new SvgFileType();
- svgFileType.setIcon(ImagesIcons.ImagesFileType);
- svgFileType.setName("Scalable Vector Graphics");
- svgFileType.setDescription("SVG images");
}
public boolean isImage(VirtualFile file) {
@@ -68,17 +61,6 @@ final class ImageFileTypeManagerImpl extends ImageFileTypeManager {
public static final class ImageFileType extends UserBinaryFileType {
}
- public static final class SvgFileType extends UserFileType {
- @Override
- public SettingsEditor getEditor() {
- return null;
- }
-
- @Override
- public boolean isBinary() {
- return false;
- }
- }
public void createFileTypes(final @NotNull FileTypeConsumer consumer) {
@@ -93,8 +75,6 @@ final class ImageFileTypeManagerImpl extends ImageFileTypeManager {
processed.add(IfsUtil.ICO_FORMAT.toLowerCase());
consumer.consume(imageFileType, StringUtil.join(processed, FileTypeConsumer.EXTENSION_DELIMITER));
- if (Registry.is("ide.svg.editor")) {
- consumer.consume(svgFileType, "svg");
- }
+ consumer.consume(SvgFileType.INSTANCE, "svg");
}
}
diff --git a/images/src/org/intellij/images/fileTypes/impl/SvgFileType.java b/images/src/org/intellij/images/fileTypes/impl/SvgFileType.java
new file mode 100644
index 000000000000..a230b241a0db
--- /dev/null
+++ b/images/src/org/intellij/images/fileTypes/impl/SvgFileType.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2000-2017 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.intellij.images.fileTypes.impl;
+
+import com.intellij.ide.highlighter.XmlLikeFileType;
+import com.intellij.lang.xml.XMLLanguage;
+import icons.ImagesIcons;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+
+/**
+ * @author Konstantin Bulenkov
+ */
+public final class SvgFileType extends XmlLikeFileType {
+ public static final SvgFileType INSTANCE = new SvgFileType();
+
+ private SvgFileType() {
+ super(XMLLanguage.INSTANCE);
+ }
+
+ @NotNull
+ @Override
+ public String getName() {
+ return "SVG";
+ }
+
+ @NotNull
+ @Override
+ public String getDescription() {
+ return "Scalable Vector Graphics";
+ }
+
+ @NotNull
+ @Override
+ public String getDefaultExtension() {
+ return "svg";
+ }
+
+ @Nullable
+ @Override
+ public Icon getIcon() {
+ return ImagesIcons.ImagesFileType;
+ }
+}