From 69590c1f89aedb361f300aaa681bd4990432f83b Mon Sep 17 00:00:00 2001 From: Nikolay Krasko Date: Mon, 25 Feb 2013 17:07:44 +0400 Subject: [PATCH] Rename framework classes --- idea/src/META-INF/plugin.xml | 8 ++--- .../jet/plugin/compiler/JetCompiler.java | 4 +-- .../jet/plugin/compiler/K2JSCompiler.java | 6 ++-- .../completion/JetTypesCompletionHelper.java | 4 +-- .../handlers/JetClassInsertHandler.java | 4 +-- ...rkDetector.java => FrameworkDetector.java} | 6 ++-- ...r.java => JSFrameworkSupportProvider.java} | 10 +++--- ...rameworkType.java => JSFrameworkType.java} | 10 +++--- ...ava => JSHeadersPresentationProvider.java} | 10 +++--- ...ription.java => JSLibraryDescription.java} | 2 +- ...java => JavaFrameworkSupportProvider.java} | 10 +++--- ...meworkType.java => JavaFrameworkType.java} | 10 +++--- ...ava => JavaRuntimeLibraryDescription.java} | 2 +- ...a => JavaRuntimePresentationProvider.java} | 10 +++--- .../framework/JetFrameworkConfigurator.java | 31 ------------------- .../project/AnalyzerFacadeProvider.java | 4 +-- .../jet/plugin/project/IDEAConfig.java | 4 +-- .../plugin/quickfix/ImportClassAndFunFix.java | 6 ++-- .../run/JetRunConfigurationProducer.java | 4 +-- .../KotlinLibrariesNotificationProvider.java | 12 +++---- 20 files changed, 63 insertions(+), 94 deletions(-) rename idea/src/org/jetbrains/jet/plugin/framework/{KotlinFrameworkDetector.java => FrameworkDetector.java} (97%) rename idea/src/org/jetbrains/jet/plugin/framework/{JetJavaScriptFrameworkSupportProvider.java => JSFrameworkSupportProvider.java} (89%) rename idea/src/org/jetbrains/jet/plugin/framework/{JavaScriptFrameworkType.java => JSFrameworkType.java} (80%) rename idea/src/org/jetbrains/jet/plugin/framework/{KotlinJavaScriptHeadersPresentationProvider.java => JSHeadersPresentationProvider.java} (79%) rename idea/src/org/jetbrains/jet/plugin/framework/{JetJavaScriptLibraryDescription.java => JSLibraryDescription.java} (98%) rename idea/src/org/jetbrains/jet/plugin/framework/{JetJavaFrameworkSupportProvider.java => JavaFrameworkSupportProvider.java} (89%) rename idea/src/org/jetbrains/jet/plugin/framework/{JetJavaFrameworkType.java => JavaFrameworkType.java} (81%) rename idea/src/org/jetbrains/jet/plugin/framework/{JetJavaRuntimeLibraryDescription.java => JavaRuntimeLibraryDescription.java} (98%) rename idea/src/org/jetbrains/jet/plugin/framework/{KotlinJavaRuntimePresentationProvider.java => JavaRuntimePresentationProvider.java} (82%) delete mode 100644 idea/src/org/jetbrains/jet/plugin/framework/JetFrameworkConfigurator.java diff --git a/idea/src/META-INF/plugin.xml b/idea/src/META-INF/plugin.xml index 9d960956777..5ac8d75040c 100644 --- a/idea/src/META-INF/plugin.xml +++ b/idea/src/META-INF/plugin.xml @@ -214,10 +214,10 @@ - - - - + + + + diff --git a/idea/src/org/jetbrains/jet/plugin/compiler/JetCompiler.java b/idea/src/org/jetbrains/jet/plugin/compiler/JetCompiler.java index fb7cda0acf1..01ee4d60c1e 100644 --- a/idea/src/org/jetbrains/jet/plugin/compiler/JetCompiler.java +++ b/idea/src/org/jetbrains/jet/plugin/compiler/JetCompiler.java @@ -34,7 +34,7 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.jet.cli.common.messages.MessageCollector; import org.jetbrains.jet.compiler.runner.*; import org.jetbrains.jet.plugin.JetFileType; -import org.jetbrains.jet.plugin.framework.KotlinFrameworkDetector; +import org.jetbrains.jet.plugin.framework.FrameworkDetector; import java.io.File; import java.io.IOException; @@ -50,7 +50,7 @@ public class JetCompiler implements TranslatingCompiler { return false; } Module module = compileContext.getModuleByFile(virtualFile); - if (module != null && KotlinFrameworkDetector.isJsModule(module)) { + if (module != null && FrameworkDetector.isJsModule(module)) { return false; } return true; diff --git a/idea/src/org/jetbrains/jet/plugin/compiler/K2JSCompiler.java b/idea/src/org/jetbrains/jet/plugin/compiler/K2JSCompiler.java index 43f7ca7d1eb..093363a2487 100644 --- a/idea/src/org/jetbrains/jet/plugin/compiler/K2JSCompiler.java +++ b/idea/src/org/jetbrains/jet/plugin/compiler/K2JSCompiler.java @@ -42,7 +42,7 @@ import org.jetbrains.jet.compiler.runner.CompilerEnvironment; import org.jetbrains.jet.compiler.runner.CompilerRunnerUtil; import org.jetbrains.jet.compiler.runner.OutputItemsCollectorImpl; import org.jetbrains.jet.plugin.JetFileType; -import org.jetbrains.jet.plugin.framework.KotlinFrameworkDetector; +import org.jetbrains.jet.plugin.framework.FrameworkDetector; import java.io.File; import java.io.PrintStream; @@ -63,7 +63,7 @@ public final class K2JSCompiler implements TranslatingCompiler { if (module == null) { return false; } - return KotlinFrameworkDetector.isJsModule(module); + return FrameworkDetector.isJsModule(module); } @Override @@ -178,7 +178,7 @@ public final class K2JSCompiler implements TranslatingCompiler { } private static void addLibLocationAndTarget(@NotNull Module module, @NotNull ArrayList args) { - Pair, String> libLocationAndTarget = KotlinFrameworkDetector.getLibLocationAndTargetForProject(module); + Pair, String> libLocationAndTarget = FrameworkDetector.getLibLocationAndTargetForProject(module); StringBuilder sb = StringBuilderSpinAllocator.alloc(); AccessToken token = ReadAction.start(); diff --git a/idea/src/org/jetbrains/jet/plugin/completion/JetTypesCompletionHelper.java b/idea/src/org/jetbrains/jet/plugin/completion/JetTypesCompletionHelper.java index 2a1536f3529..5f26ff57562 100644 --- a/idea/src/org/jetbrains/jet/plugin/completion/JetTypesCompletionHelper.java +++ b/idea/src/org/jetbrains/jet/plugin/completion/JetTypesCompletionHelper.java @@ -28,7 +28,7 @@ import org.jetbrains.jet.lang.resolve.lazy.ResolveSessionUtils; import org.jetbrains.jet.lang.resolve.name.FqName; import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns; import org.jetbrains.jet.plugin.caches.JetShortNamesCache; -import org.jetbrains.jet.plugin.framework.KotlinFrameworkDetector; +import org.jetbrains.jet.plugin.framework.FrameworkDetector; import org.jetbrains.jet.plugin.libraries.DecompiledDataFactory; public class JetTypesCompletionHelper { @@ -45,7 +45,7 @@ public class JetTypesCompletionHelper { jetCompletionResult.addAllElements(namesCache.getJetClassesDescriptors( jetCompletionResult.getShortNameFilter(), jetCompletionResult.getResolveSession())); - if (!KotlinFrameworkDetector.isJsModule((JetFile) parameters.getOriginalFile())) { + if (!FrameworkDetector.isJsModule((JetFile) parameters.getOriginalFile())) { addAdaptedJavaCompletion(parameters,jetCompletionResult); } } diff --git a/idea/src/org/jetbrains/jet/plugin/completion/handlers/JetClassInsertHandler.java b/idea/src/org/jetbrains/jet/plugin/completion/handlers/JetClassInsertHandler.java index d737654b832..1ee5d620211 100644 --- a/idea/src/org/jetbrains/jet/plugin/completion/handlers/JetClassInsertHandler.java +++ b/idea/src/org/jetbrains/jet/plugin/completion/handlers/JetClassInsertHandler.java @@ -27,7 +27,7 @@ import org.jetbrains.jet.lang.psi.JetFile; import org.jetbrains.jet.lang.resolve.DescriptorUtils; import org.jetbrains.jet.lang.resolve.name.FqName; import org.jetbrains.jet.plugin.completion.JetLookupObject; -import org.jetbrains.jet.plugin.framework.KotlinFrameworkDetector; +import org.jetbrains.jet.plugin.framework.FrameworkDetector; import org.jetbrains.jet.plugin.quickfix.ImportInsertHelper; public class JetClassInsertHandler implements InsertHandler { @@ -60,7 +60,7 @@ public class JetClassInsertHandler implements InsertHandler { if (targetElement != null) { ImportInsertHelper.addImportDirectiveOrChangeToFqName(fqn, jetFile, context.getStartOffset(), targetElement); } - else if (KotlinFrameworkDetector.isJsModule(jetFile)) { + else if (FrameworkDetector.isJsModule(jetFile)) { ImportInsertHelper.addImportDirective(fqn, jetFile); } } diff --git a/idea/src/org/jetbrains/jet/plugin/framework/KotlinFrameworkDetector.java b/idea/src/org/jetbrains/jet/plugin/framework/FrameworkDetector.java similarity index 97% rename from idea/src/org/jetbrains/jet/plugin/framework/KotlinFrameworkDetector.java rename to idea/src/org/jetbrains/jet/plugin/framework/FrameworkDetector.java index 63485ca4dda..4055103a5b9 100644 --- a/idea/src/org/jetbrains/jet/plugin/framework/KotlinFrameworkDetector.java +++ b/idea/src/org/jetbrains/jet/plugin/framework/FrameworkDetector.java @@ -30,11 +30,11 @@ import java.util.Arrays; import java.util.Collection; import java.util.List; -public class KotlinFrameworkDetector { +public class FrameworkDetector { private static final Key> IS_KOTLIN_JS_MODULE = Key.create("IS_KOTLIN_JS_MODULE"); private static final Key> IS_KOTLIN_JAVA_MODULE = Key.create("IS_KOTLIN_JAVA_MODULE"); - private KotlinFrameworkDetector() { + private FrameworkDetector() { } public static boolean isJsModule(@NotNull JetFile file) { @@ -87,7 +87,7 @@ public class KotlinFrameworkDetector { ModuleRootManager.getInstance(module).orderEntries().librariesOnly().forEachLibrary(new Processor() { @Override public boolean process(Library library) { - if (KotlinJavaScriptHeadersPresentationProvider.getInstance().detect( + if (JSHeadersPresentationProvider.getInstance().detect( Arrays.asList(library.getFiles(OrderRootType.CLASSES))) != null) { headersLibraries.add(library); } diff --git a/idea/src/org/jetbrains/jet/plugin/framework/JetJavaScriptFrameworkSupportProvider.java b/idea/src/org/jetbrains/jet/plugin/framework/JSFrameworkSupportProvider.java similarity index 89% rename from idea/src/org/jetbrains/jet/plugin/framework/JetJavaScriptFrameworkSupportProvider.java rename to idea/src/org/jetbrains/jet/plugin/framework/JSFrameworkSupportProvider.java index a55215109fe..13fa1992bd5 100644 --- a/idea/src/org/jetbrains/jet/plugin/framework/JetJavaScriptFrameworkSupportProvider.java +++ b/idea/src/org/jetbrains/jet/plugin/framework/JSFrameworkSupportProvider.java @@ -32,11 +32,11 @@ import org.jetbrains.jet.plugin.framework.ui.FrameworkSourcePanel; import javax.swing.*; -public class JetJavaScriptFrameworkSupportProvider extends FrameworkSupportInModuleProvider { +public class JSFrameworkSupportProvider extends FrameworkSupportInModuleProvider { @NotNull @Override public FrameworkTypeEx getFrameworkType() { - return JavaScriptFrameworkType.getInstance(); + return JSFrameworkType.getInstance(); } @NotNull @@ -48,7 +48,7 @@ public class JetJavaScriptFrameworkSupportProvider extends FrameworkSupportInMod @Nullable @Override public CustomLibraryDescription createLibraryDescription() { - JetJavaScriptLibraryDescription description = new JetJavaScriptLibraryDescription(); + JSLibraryDescription description = new JSLibraryDescription(); description.setConfigurationPanel(getConfigurationPanel()); return description; } @@ -71,8 +71,8 @@ public class JetJavaScriptFrameworkSupportProvider extends FrameworkSupportInMod @NotNull ModifiableModelsProvider modifiableModelsProvider) { FrameworksCompatibilityUtils.suggestRemoveIncompatibleFramework( rootModel, - new JetJavaRuntimeLibraryDescription(), - JetJavaFrameworkType.getInstance()); + new JavaRuntimeLibraryDescription(), + JavaFrameworkType.getInstance()); } private FrameworkSourcePanel getConfigurationPanel() { diff --git a/idea/src/org/jetbrains/jet/plugin/framework/JavaScriptFrameworkType.java b/idea/src/org/jetbrains/jet/plugin/framework/JSFrameworkType.java similarity index 80% rename from idea/src/org/jetbrains/jet/plugin/framework/JavaScriptFrameworkType.java rename to idea/src/org/jetbrains/jet/plugin/framework/JSFrameworkType.java index 9986d62ea30..628704ec339 100644 --- a/idea/src/org/jetbrains/jet/plugin/framework/JavaScriptFrameworkType.java +++ b/idea/src/org/jetbrains/jet/plugin/framework/JSFrameworkType.java @@ -23,19 +23,19 @@ import org.jetbrains.jet.plugin.JetIcons; import javax.swing.*; -public class JavaScriptFrameworkType extends FrameworkTypeEx { - public static JavaScriptFrameworkType getInstance() { - return FrameworkTypeEx.EP_NAME.findExtension(JavaScriptFrameworkType.class); +public class JSFrameworkType extends FrameworkTypeEx { + public static JSFrameworkType getInstance() { + return FrameworkTypeEx.EP_NAME.findExtension(JSFrameworkType.class); } - public JavaScriptFrameworkType() { + public JSFrameworkType() { super("kotlin-js-framework-id"); } @NotNull @Override public FrameworkSupportInModuleProvider createProvider() { - return new JetJavaScriptFrameworkSupportProvider(); + return new JSFrameworkSupportProvider(); } @NotNull diff --git a/idea/src/org/jetbrains/jet/plugin/framework/KotlinJavaScriptHeadersPresentationProvider.java b/idea/src/org/jetbrains/jet/plugin/framework/JSHeadersPresentationProvider.java similarity index 79% rename from idea/src/org/jetbrains/jet/plugin/framework/KotlinJavaScriptHeadersPresentationProvider.java rename to idea/src/org/jetbrains/jet/plugin/framework/JSHeadersPresentationProvider.java index b48badbef20..cebeb6b77cd 100644 --- a/idea/src/org/jetbrains/jet/plugin/framework/KotlinJavaScriptHeadersPresentationProvider.java +++ b/idea/src/org/jetbrains/jet/plugin/framework/JSHeadersPresentationProvider.java @@ -26,13 +26,13 @@ import org.jetbrains.jet.plugin.JetIcons; import javax.swing.*; import java.util.List; -public class KotlinJavaScriptHeadersPresentationProvider extends LibraryPresentationProvider { - public static KotlinJavaScriptHeadersPresentationProvider getInstance() { - return LibraryPresentationProvider.EP_NAME.findExtension(KotlinJavaScriptHeadersPresentationProvider.class); +public class JSHeadersPresentationProvider extends LibraryPresentationProvider { + public static JSHeadersPresentationProvider getInstance() { + return LibraryPresentationProvider.EP_NAME.findExtension(JSHeadersPresentationProvider.class); } - protected KotlinJavaScriptHeadersPresentationProvider() { - super(JetJavaScriptLibraryDescription.KOTLIN_JAVASCRIPT_KIND); + protected JSHeadersPresentationProvider() { + super(JSLibraryDescription.KOTLIN_JAVASCRIPT_KIND); } @Nullable diff --git a/idea/src/org/jetbrains/jet/plugin/framework/JetJavaScriptLibraryDescription.java b/idea/src/org/jetbrains/jet/plugin/framework/JSLibraryDescription.java similarity index 98% rename from idea/src/org/jetbrains/jet/plugin/framework/JetJavaScriptLibraryDescription.java rename to idea/src/org/jetbrains/jet/plugin/framework/JSLibraryDescription.java index ca070a9c6bb..7f62c8ca7d6 100644 --- a/idea/src/org/jetbrains/jet/plugin/framework/JetJavaScriptLibraryDescription.java +++ b/idea/src/org/jetbrains/jet/plugin/framework/JSLibraryDescription.java @@ -37,7 +37,7 @@ import java.io.File; import java.io.IOException; import java.util.Set; -public class JetJavaScriptLibraryDescription extends CustomLibraryDescription { +public class JSLibraryDescription extends CustomLibraryDescription { public static final LibraryKind KOTLIN_JAVASCRIPT_KIND = LibraryKind.create("kotlin-js-stdlib"); private static final String JAVA_SCRIPT_LIBRARY_CREATION = "JavaScript Library Creation"; diff --git a/idea/src/org/jetbrains/jet/plugin/framework/JetJavaFrameworkSupportProvider.java b/idea/src/org/jetbrains/jet/plugin/framework/JavaFrameworkSupportProvider.java similarity index 89% rename from idea/src/org/jetbrains/jet/plugin/framework/JetJavaFrameworkSupportProvider.java rename to idea/src/org/jetbrains/jet/plugin/framework/JavaFrameworkSupportProvider.java index a4c45ef88e9..2f4a10b171a 100644 --- a/idea/src/org/jetbrains/jet/plugin/framework/JetJavaFrameworkSupportProvider.java +++ b/idea/src/org/jetbrains/jet/plugin/framework/JavaFrameworkSupportProvider.java @@ -32,11 +32,11 @@ import org.jetbrains.jet.plugin.framework.ui.FrameworkSourcePanel; import javax.swing.*; -public class JetJavaFrameworkSupportProvider extends FrameworkSupportInModuleProvider { +public class JavaFrameworkSupportProvider extends FrameworkSupportInModuleProvider { @NotNull @Override public FrameworkTypeEx getFrameworkType() { - return JetJavaFrameworkType.getInstance(); + return JavaFrameworkType.getInstance(); } @NotNull @@ -48,7 +48,7 @@ public class JetJavaFrameworkSupportProvider extends FrameworkSupportInModulePro @Nullable @Override public CustomLibraryDescription createLibraryDescription() { - JetJavaRuntimeLibraryDescription description = new JetJavaRuntimeLibraryDescription(); + JavaRuntimeLibraryDescription description = new JavaRuntimeLibraryDescription(); description.setFrameworkSourcePanel(getConfigurationPanel()); return description; } @@ -76,8 +76,8 @@ public class JetJavaFrameworkSupportProvider extends FrameworkSupportInModulePro @NotNull ModifiableModelsProvider modifiableModelsProvider) { FrameworksCompatibilityUtils.suggestRemoveIncompatibleFramework( rootModel, - new JetJavaScriptLibraryDescription(), - JavaScriptFrameworkType.getInstance()); + new JSLibraryDescription(), + JSFrameworkType.getInstance()); } private FrameworkSourcePanel getConfigurationPanel() { diff --git a/idea/src/org/jetbrains/jet/plugin/framework/JetJavaFrameworkType.java b/idea/src/org/jetbrains/jet/plugin/framework/JavaFrameworkType.java similarity index 81% rename from idea/src/org/jetbrains/jet/plugin/framework/JetJavaFrameworkType.java rename to idea/src/org/jetbrains/jet/plugin/framework/JavaFrameworkType.java index a31d1748473..b02c4d6aad7 100644 --- a/idea/src/org/jetbrains/jet/plugin/framework/JetJavaFrameworkType.java +++ b/idea/src/org/jetbrains/jet/plugin/framework/JavaFrameworkType.java @@ -23,19 +23,19 @@ import org.jetbrains.jet.plugin.JetIcons; import javax.swing.*; -public class JetJavaFrameworkType extends FrameworkTypeEx { - public static JetJavaFrameworkType getInstance() { - return FrameworkTypeEx.EP_NAME.findExtension(JetJavaFrameworkType.class); +public class JavaFrameworkType extends FrameworkTypeEx { + public static JavaFrameworkType getInstance() { + return FrameworkTypeEx.EP_NAME.findExtension(JavaFrameworkType.class); } - public JetJavaFrameworkType() { + public JavaFrameworkType() { super("kotlin-java-framework-id"); } @NotNull @Override public FrameworkSupportInModuleProvider createProvider() { - return new JetJavaFrameworkSupportProvider(); + return new JavaFrameworkSupportProvider(); } @NotNull diff --git a/idea/src/org/jetbrains/jet/plugin/framework/JetJavaRuntimeLibraryDescription.java b/idea/src/org/jetbrains/jet/plugin/framework/JavaRuntimeLibraryDescription.java similarity index 98% rename from idea/src/org/jetbrains/jet/plugin/framework/JetJavaRuntimeLibraryDescription.java rename to idea/src/org/jetbrains/jet/plugin/framework/JavaRuntimeLibraryDescription.java index d28c400c5d9..db5a03a6423 100644 --- a/idea/src/org/jetbrains/jet/plugin/framework/JetJavaRuntimeLibraryDescription.java +++ b/idea/src/org/jetbrains/jet/plugin/framework/JavaRuntimeLibraryDescription.java @@ -39,7 +39,7 @@ import java.io.File; import java.io.IOException; import java.util.Set; -public class JetJavaRuntimeLibraryDescription extends CustomLibraryDescription { +public class JavaRuntimeLibraryDescription extends CustomLibraryDescription { public static final LibraryKind KOTLIN_JAVA_RUNTIME_KIND = LibraryKind.create("kotlin-java-runtime"); private static final String JAVA_RUNTIME_LIBRARY_CREATION = "Java Runtime Library Creation"; diff --git a/idea/src/org/jetbrains/jet/plugin/framework/KotlinJavaRuntimePresentationProvider.java b/idea/src/org/jetbrains/jet/plugin/framework/JavaRuntimePresentationProvider.java similarity index 82% rename from idea/src/org/jetbrains/jet/plugin/framework/KotlinJavaRuntimePresentationProvider.java rename to idea/src/org/jetbrains/jet/plugin/framework/JavaRuntimePresentationProvider.java index cca450a2b5e..41db0d3121e 100644 --- a/idea/src/org/jetbrains/jet/plugin/framework/KotlinJavaRuntimePresentationProvider.java +++ b/idea/src/org/jetbrains/jet/plugin/framework/JavaRuntimePresentationProvider.java @@ -27,13 +27,13 @@ import org.jetbrains.jet.plugin.versions.KotlinRuntimeLibraryUtil; import javax.swing.*; import java.util.List; -public class KotlinJavaRuntimePresentationProvider extends LibraryPresentationProvider { - public static KotlinJavaRuntimePresentationProvider getInstance() { - return LibraryPresentationProvider.EP_NAME.findExtension(KotlinJavaRuntimePresentationProvider.class); +public class JavaRuntimePresentationProvider extends LibraryPresentationProvider { + public static JavaRuntimePresentationProvider getInstance() { + return LibraryPresentationProvider.EP_NAME.findExtension(JavaRuntimePresentationProvider.class); } - protected KotlinJavaRuntimePresentationProvider() { - super(JetJavaRuntimeLibraryDescription.KOTLIN_JAVA_RUNTIME_KIND); + protected JavaRuntimePresentationProvider() { + super(JavaRuntimeLibraryDescription.KOTLIN_JAVA_RUNTIME_KIND); } @Nullable diff --git a/idea/src/org/jetbrains/jet/plugin/framework/JetFrameworkConfigurator.java b/idea/src/org/jetbrains/jet/plugin/framework/JetFrameworkConfigurator.java deleted file mode 100644 index d437669a877..00000000000 --- a/idea/src/org/jetbrains/jet/plugin/framework/JetFrameworkConfigurator.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2010-2013 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.jetbrains.jet.plugin.framework; - -import com.intellij.openapi.module.Module; - -public class JetFrameworkConfigurator { - private JetFrameworkConfigurator() {} - - public static boolean configureAsJavaModule(Module module) { - return false; - } - - public static boolean configureAsJavaScriptModule(Module module) { - return false; - } -} diff --git a/idea/src/org/jetbrains/jet/plugin/project/AnalyzerFacadeProvider.java b/idea/src/org/jetbrains/jet/plugin/project/AnalyzerFacadeProvider.java index fa4976fddb6..d0affa27bae 100644 --- a/idea/src/org/jetbrains/jet/plugin/project/AnalyzerFacadeProvider.java +++ b/idea/src/org/jetbrains/jet/plugin/project/AnalyzerFacadeProvider.java @@ -24,7 +24,7 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.jet.analyzer.AnalyzerFacade; import org.jetbrains.jet.lang.psi.JetFile; import org.jetbrains.jet.lang.resolve.java.AnalyzerFacadeForJVM; -import org.jetbrains.jet.plugin.framework.KotlinFrameworkDetector; +import org.jetbrains.jet.plugin.framework.FrameworkDetector; public final class AnalyzerFacadeProvider { @@ -55,7 +55,7 @@ public final class AnalyzerFacadeProvider { @NotNull private static AnalyzerFacade getAnalyzerFacadeForModule(@NotNull Module module) { - if (KotlinFrameworkDetector.isJsModule(module)) { + if (FrameworkDetector.isJsModule(module)) { return JSAnalyzerFacadeForIDEA.INSTANCE; } return AnalyzerFacadeForJVM.INSTANCE; diff --git a/idea/src/org/jetbrains/jet/plugin/project/IDEAConfig.java b/idea/src/org/jetbrains/jet/plugin/project/IDEAConfig.java index ae52bc41e7f..0c56cd29768 100644 --- a/idea/src/org/jetbrains/jet/plugin/project/IDEAConfig.java +++ b/idea/src/org/jetbrains/jet/plugin/project/IDEAConfig.java @@ -18,12 +18,12 @@ package org.jetbrains.jet.plugin.project; import com.intellij.openapi.project.Project; import org.jetbrains.annotations.NotNull; -import org.jetbrains.jet.plugin.framework.KotlinFrameworkDetector; +import org.jetbrains.jet.plugin.framework.FrameworkDetector; import org.jetbrains.k2js.config.EcmaVersion; import org.jetbrains.k2js.config.LibrarySourcesConfig; public final class IDEAConfig extends LibrarySourcesConfig { public IDEAConfig(@NotNull Project project) { - super(project, "default", KotlinFrameworkDetector.getLibLocationAndTargetForProject(project).first, EcmaVersion.defaultVersion()); + super(project, "default", FrameworkDetector.getLibLocationAndTargetForProject(project).first, EcmaVersion.defaultVersion()); } } diff --git a/idea/src/org/jetbrains/jet/plugin/quickfix/ImportClassAndFunFix.java b/idea/src/org/jetbrains/jet/plugin/quickfix/ImportClassAndFunFix.java index 6e954d20056..e317d9a6ca9 100644 --- a/idea/src/org/jetbrains/jet/plugin/quickfix/ImportClassAndFunFix.java +++ b/idea/src/org/jetbrains/jet/plugin/quickfix/ImportClassAndFunFix.java @@ -52,7 +52,7 @@ import org.jetbrains.jet.lang.resolve.name.FqName; import org.jetbrains.jet.plugin.JetBundle; import org.jetbrains.jet.plugin.actions.JetAddImportAction; import org.jetbrains.jet.plugin.caches.JetShortNamesCache; -import org.jetbrains.jet.plugin.framework.KotlinFrameworkDetector; +import org.jetbrains.jet.plugin.framework.FrameworkDetector; import org.jetbrains.jet.plugin.project.WholeProjectAnalyzerFacade; import org.jetbrains.jet.plugin.util.JetPsiHeuristicsUtil; @@ -162,7 +162,7 @@ public class ImportClassAndFunFix extends JetHintAction public static Collection getClassNames(@NotNull String referenceName, @NotNull JetFile file, @NotNull KotlinCodeAnalyzer analyzer) { Set possibleResolveNames = Sets.newHashSet(); - if (!KotlinFrameworkDetector.isJsModule(file)) { + if (!FrameworkDetector.isJsModule(file)) { possibleResolveNames.addAll(getClassesFromCache(referenceName, file)); } else { @@ -199,7 +199,7 @@ public class ImportClassAndFunFix extends JetHintAction } private static PsiShortNamesCache getShortNamesCache(@NotNull JetFile jetFile) { - if (KotlinFrameworkDetector.isJsModule(jetFile)) { + if (FrameworkDetector.isJsModule(jetFile)) { return JetShortNamesCache.getKotlinInstance(jetFile.getProject()); } diff --git a/idea/src/org/jetbrains/jet/plugin/run/JetRunConfigurationProducer.java b/idea/src/org/jetbrains/jet/plugin/run/JetRunConfigurationProducer.java index fb98345074a..ae59521a579 100644 --- a/idea/src/org/jetbrains/jet/plugin/run/JetRunConfigurationProducer.java +++ b/idea/src/org/jetbrains/jet/plugin/run/JetRunConfigurationProducer.java @@ -32,7 +32,7 @@ import org.jetbrains.jet.lang.psi.JetPsiUtil; import org.jetbrains.jet.lang.resolve.java.PackageClassUtils; import org.jetbrains.jet.lang.resolve.name.FqName; import org.jetbrains.jet.plugin.JetMainDetector; -import org.jetbrains.jet.plugin.framework.KotlinFrameworkDetector; +import org.jetbrains.jet.plugin.framework.FrameworkDetector; public class JetRunConfigurationProducer extends RuntimeConfigurationProducer implements Cloneable { @Nullable @@ -55,7 +55,7 @@ public class JetRunConfigurationProducer extends RuntimeConfigurationProducer im return null; } - if (KotlinFrameworkDetector.isJsModule(module)) { + if (FrameworkDetector.isJsModule(module)) { return null; } diff --git a/idea/src/org/jetbrains/jet/plugin/versions/KotlinLibrariesNotificationProvider.java b/idea/src/org/jetbrains/jet/plugin/versions/KotlinLibrariesNotificationProvider.java index 68b9023895f..ff395149370 100644 --- a/idea/src/org/jetbrains/jet/plugin/versions/KotlinLibrariesNotificationProvider.java +++ b/idea/src/org/jetbrains/jet/plugin/versions/KotlinLibrariesNotificationProvider.java @@ -37,9 +37,9 @@ import com.intellij.util.messages.MessageBusConnection; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.jet.plugin.JetFileType; -import org.jetbrains.jet.plugin.framework.JetJavaFrameworkSupportProvider; -import org.jetbrains.jet.plugin.framework.JetJavaScriptFrameworkSupportProvider; -import org.jetbrains.jet.plugin.framework.KotlinFrameworkDetector; +import org.jetbrains.jet.plugin.framework.FrameworkDetector; +import org.jetbrains.jet.plugin.framework.JSFrameworkSupportProvider; +import org.jetbrains.jet.plugin.framework.JavaFrameworkSupportProvider; import org.jetbrains.jet.plugin.framework.ui.AddSupportForSingleFrameworkDialogFixed; public class KotlinLibrariesNotificationProvider extends EditorNotifications.Provider { @@ -105,7 +105,7 @@ public class KotlinLibrariesNotificationProvider extends EditorNotifications.Pro } public static boolean isModuleAlreadyConfigured(Module module) { - return isMavenModule(module) || KotlinFrameworkDetector.isJsModule(module) || KotlinFrameworkDetector.isJavaModule(module); + return isMavenModule(module) || FrameworkDetector.isJsModule(module) || FrameworkDetector.isJavaModule(module); } private static boolean isMavenModule(@NotNull Module module) { @@ -123,7 +123,7 @@ public class KotlinLibrariesNotificationProvider extends EditorNotifications.Pro @Override public void run() { DialogWrapper dialog = AddSupportForSingleFrameworkDialogFixed.createDialog( - module, new JetJavaFrameworkSupportProvider()); + module, new JavaFrameworkSupportProvider()); if (dialog != null) { dialog.show(); } @@ -134,7 +134,7 @@ public class KotlinLibrariesNotificationProvider extends EditorNotifications.Pro @Override public void run() { DialogWrapper dialog = AddSupportForSingleFrameworkDialogFixed.createDialog( - module, new JetJavaScriptFrameworkSupportProvider()); + module, new JSFrameworkSupportProvider()); if (dialog != null) { dialog.show(); }