mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
singleton instances for internal file types
This commit is contained in:
@@ -26,9 +26,13 @@ import org.jetbrains.annotations.NotNull;
|
||||
import javax.swing.*;
|
||||
|
||||
public class WorkspaceFileType implements InternalFileType {
|
||||
public static final WorkspaceFileType INSTANCE = new WorkspaceFileType();
|
||||
|
||||
@NonNls public static final String DEFAULT_EXTENSION = "iws";
|
||||
@NonNls public static final String DOT_DEFAULT_EXTENSION = "." + DEFAULT_EXTENSION;
|
||||
|
||||
private WorkspaceFileType() {}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getName() {
|
||||
|
||||
+3
-3
@@ -27,8 +27,8 @@ import org.jetbrains.annotations.NotNull;
|
||||
*/
|
||||
public class InternalFileTypeFactory extends FileTypeFactory {
|
||||
public void createFileTypes(@NotNull final FileTypeConsumer consumer) {
|
||||
consumer.consume(new WorkspaceFileType(), WorkspaceFileType.DEFAULT_EXTENSION);
|
||||
consumer.consume(new ModuleFileType(), ModuleFileType.DEFAULT_EXTENSION);
|
||||
consumer.consume(new ProjectFileType(), ProjectFileType.DEFAULT_EXTENSION);
|
||||
consumer.consume(WorkspaceFileType.INSTANCE, WorkspaceFileType.DEFAULT_EXTENSION);
|
||||
consumer.consume(ModuleFileType.INSTANCE, ModuleFileType.DEFAULT_EXTENSION);
|
||||
consumer.consume(ProjectFileType.INSTANCE, ProjectFileType.DEFAULT_EXTENSION);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,9 +26,13 @@ import org.jetbrains.annotations.NotNull;
|
||||
import javax.swing.*;
|
||||
|
||||
public class ModuleFileType implements InternalFileType {
|
||||
public static final ModuleFileType INSTANCE = new ModuleFileType();
|
||||
|
||||
@NonNls public static final String DEFAULT_EXTENSION = "iml";
|
||||
@NonNls public static final String DOT_DEFAULT_EXTENSION = ".iml";
|
||||
|
||||
private ModuleFileType() {}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getName() {
|
||||
|
||||
@@ -26,9 +26,13 @@ import org.jetbrains.annotations.NotNull;
|
||||
import javax.swing.*;
|
||||
|
||||
public class ProjectFileType implements InternalFileType {
|
||||
public static final ProjectFileType INSTANCE = new ProjectFileType();
|
||||
|
||||
@NonNls public static final String DEFAULT_EXTENSION = "ipr";
|
||||
@NonNls public static final String DOT_DEFAULT_EXTENSION = ".ipr";
|
||||
|
||||
private ProjectFileType() {}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getName() {
|
||||
|
||||
Reference in New Issue
Block a user