Constant for language name and several usage for this constant
This commit is contained in:
@@ -43,13 +43,13 @@ public class JetFileType extends LanguageFileType {
|
||||
@Override
|
||||
@NotNull
|
||||
public String getName() {
|
||||
return "Kotlin";
|
||||
return JetLanguage.NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getDescription() {
|
||||
return "Kotlin";
|
||||
return getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -23,8 +23,14 @@ import com.intellij.lang.Language;
|
||||
|
||||
public class JetLanguage extends Language {
|
||||
public static JetLanguage INSTANCE = new JetLanguage();
|
||||
public static String NAME = "Kotlin";
|
||||
|
||||
private JetLanguage() {
|
||||
super("jet");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDisplayName() {
|
||||
return NAME;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ public class JetCodeStyleSettingsProvider extends CodeStyleSettingsProvider {
|
||||
|
||||
@Override
|
||||
public String getConfigurableDisplayName() {
|
||||
return "Kotlin";
|
||||
return JetLanguage.NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -47,7 +47,7 @@ public class JetCodeStyleSettingsProvider extends CodeStyleSettingsProvider {
|
||||
@NotNull
|
||||
@Override
|
||||
public Configurable createSettingsPage(CodeStyleSettings settings, CodeStyleSettings originalSettings) {
|
||||
return new CodeStyleAbstractConfigurable(settings, originalSettings, "Kotlin") {
|
||||
return new CodeStyleAbstractConfigurable(settings, originalSettings, JetLanguage.NAME) {
|
||||
@Override
|
||||
protected CodeStyleAbstractPanel createPanel(CodeStyleSettings settings) {
|
||||
return new TabbedLanguageCodeStylePanel(JetLanguage.INSTANCE, getCurrentSettings(), settings) {
|
||||
|
||||
+1
-1
@@ -69,7 +69,7 @@ public class JetLanguageCodeStyleSettingsProvider extends LanguageCodeStyleSetti
|
||||
|
||||
@Override
|
||||
public String getLanguageName() {
|
||||
return "Kotlin";
|
||||
return JetLanguage.NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -25,6 +25,7 @@ import com.intellij.openapi.options.colors.ColorSettingsPage;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jet.plugin.JetBundle;
|
||||
import org.jetbrains.jet.plugin.JetIcons;
|
||||
import org.jetbrains.jet.plugin.JetLanguage;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.lang.reflect.Field;
|
||||
@@ -171,6 +172,6 @@ public class JetColorSettingsPage implements ColorSettingsPage {
|
||||
@NotNull
|
||||
@Override
|
||||
public String getDisplayName() {
|
||||
return "Kotlin";
|
||||
return JetLanguage.NAME;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ public abstract class JetTemplateContextType extends TemplateContextType {
|
||||
|
||||
public static class Generic extends JetTemplateContextType {
|
||||
public Generic() {
|
||||
super("KOTLIN", "Kotlin", EverywhereContextType.class);
|
||||
super("KOTLIN", JetLanguage.NAME, EverywhereContextType.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -20,6 +20,7 @@ import com.intellij.execution.configurations.*;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jet.plugin.JetIcons;
|
||||
import org.jetbrains.jet.plugin.JetLanguage;
|
||||
|
||||
/**
|
||||
* @author yole
|
||||
@@ -30,7 +31,7 @@ public class JetRunConfigurationType extends ConfigurationTypeBase {
|
||||
}
|
||||
|
||||
public JetRunConfigurationType() {
|
||||
super("JetRunConfigurationType", "Kotlin", "Kotlin", JetIcons.LAUNCH);
|
||||
super("JetRunConfigurationType", JetLanguage.NAME, JetLanguage.NAME, JetIcons.LAUNCH);
|
||||
addFactory(new JetRunConfigurationFactory(this));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user