KT-986 Kotlin file wizard
This commit is contained in:
Generated
+1
@@ -15,6 +15,7 @@
|
||||
<entry name="?*.tld" />
|
||||
<entry name="?*.ftl" />
|
||||
<entry name="?*.jet" />
|
||||
<entry name="?*.ft" />
|
||||
</wildcardResourcePatterns>
|
||||
<annotationProcessing enabled="false" useClasspath="true" />
|
||||
</component>
|
||||
|
||||
@@ -14,6 +14,10 @@
|
||||
</project-components>
|
||||
|
||||
<actions>
|
||||
<action id="Kotlin.NewFile" class="org.jetbrains.jet.plugin.actions.NewKotlinFileAction">
|
||||
<add-to-group group-id="NewGroup" anchor="before" relative-to-action="NewFromTemplate"/>
|
||||
</action>
|
||||
|
||||
<action id="ShowJetExpressionType" class="org.jetbrains.jet.plugin.actions.ShowExpressionTypeAction"
|
||||
text="Show Expression Type">
|
||||
<keyboard-shortcut keymap="$default" first-keystroke="control shift Q"/>
|
||||
@@ -32,6 +36,9 @@
|
||||
</actions>
|
||||
|
||||
<extensions defaultExtensionNs="com.intellij">
|
||||
|
||||
<internalFileTemplate name="Kotlin File"/>
|
||||
|
||||
<fileTypeFactory implementation="org.jetbrains.jet.plugin.JetFileFactory"/>
|
||||
<lang.syntaxHighlighterFactory key="jet" implementationClass="org.jetbrains.jet.plugin.JetSyntaxHighlighterFactory"/>
|
||||
<lang.braceMatcher language="jet" implementationClass="org.jetbrains.jet.plugin.JetPairMatcher"/>
|
||||
+2
-1
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="PLUGIN_MODULE" version="4">
|
||||
<component name="DevKit.ModuleBuildProperties" url="file://$MODULE_DIR$/src/META-INF/plugin.xml" />
|
||||
<component name="DevKit.ModuleBuildProperties" url="file://$MODULE_DIR$/META-INF/plugin.xml" />
|
||||
<component name="EclipseModuleManager">
|
||||
<libelement value="jar://$MODULE_DIR$/../lib/asm-util-3.3.1.jar!/" />
|
||||
<src_description expected_position="1">
|
||||
@@ -13,6 +13,7 @@
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/resources" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="jdk" jdkName="IDEA 10.x" jdkType="IDEA JDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
#parse("File Header.java")
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
<html>
|
||||
<body>
|
||||
<table border="0" cellpadding="2" cellspacing="0" style="border-collapse: collapse">
|
||||
<tr>
|
||||
<td colspan="3">
|
||||
<font face="verdana" size="-1">
|
||||
This is a built-in template used by <b>IDEA</b> each time you create a
|
||||
Kotlin file
|
||||
</font>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.jetbrains.jet.plugin;
|
||||
|
||||
import com.intellij.ide.IconProvider;
|
||||
import com.intellij.openapi.util.IconLoader;
|
||||
import com.intellij.openapi.util.Iconable;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
@@ -16,6 +17,7 @@ import javax.swing.*;
|
||||
*/
|
||||
public class JetIconProvider extends IconProvider {
|
||||
public static final Icon ICON_FOR_OBJECT = PlatformIcons.ANONYMOUS_CLASS_ICON;
|
||||
public static final Icon KOTLIN_ICON = IconLoader.getIcon("/org/jetbrains/jet/plugin/icons/kotlin16x16.png");
|
||||
|
||||
@Override
|
||||
public Icon getIcon(@NotNull PsiElement psiElement, int flags) {
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package org.jetbrains.jet.plugin.actions;
|
||||
|
||||
import com.intellij.ide.fileTemplates.FileTemplateManager;
|
||||
import com.intellij.ide.fileTemplates.actions.CreateFromTemplateAction;
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||
import org.jetbrains.jet.plugin.JetIconProvider;
|
||||
|
||||
/**
|
||||
* @author Nikolay Krasko
|
||||
*/
|
||||
public class NewKotlinFileAction extends CreateFromTemplateAction {
|
||||
|
||||
public NewKotlinFileAction() {
|
||||
super(FileTemplateManager.getInstance().getInternalTemplate("Kotlin File"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(AnActionEvent e) {
|
||||
super.update(e);
|
||||
e.getPresentation().setIcon(JetIconProvider.KOTLIN_ICON);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user