Skip to content

Commit

Permalink
Add AutoconfigFileType with Icon
Browse files Browse the repository at this point in the history
  • Loading branch information
nailujx86 committed Aug 2, 2024
1 parent 75f66b6 commit 264f382
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Autoconfig Plugin Properties
pluginVersion = 0.0.4
pluginVersion = 0.0.5
preRelease = false
hidden = false
pluginGroup = de.gebit.plugins.autoconfig
Expand Down
40 changes: 40 additions & 0 deletions src/main/java/de/gebit/plugins/autoconfig/AutoconfigFileType.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package de.gebit.plugins.autoconfig;

import com.intellij.icons.AllIcons;
import com.intellij.openapi.fileTypes.LanguageFileType;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.yaml.YAMLLanguage;

import javax.swing.*;

/**
* {@link LanguageFileType} for Autoconfig Files
*/
public class AutoconfigFileType extends LanguageFileType {
@SuppressWarnings("unused")
public static final AutoconfigFileType INSTANCE = new AutoconfigFileType();

protected AutoconfigFileType() {
super(YAMLLanguage.INSTANCE);
}

@Override
public @NotNull String getName() {
return "Autoconfig File";
}

@Override
public @NotNull String getDescription() {
return "Autoconfig Configuration file";
}

@Override
public @NotNull String getDefaultExtension() {
return "yaml";
}

@Override
public Icon getIcon() {
return AllIcons.FileTypes.Config;
}
}
1 change: 1 addition & 0 deletions src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<notificationGroup displayType="STICKY_BALLOON" id="AutoconfigSDK"/>
<formatOnSaveOptions.defaultsProvider implementation="de.gebit.plugins.autoconfig.FormatOnSaveOptionsDefaultsProvider"/>
<updateSettingsProvider implementation="de.gebit.plugins.autoconfig.plugins.AutoconfigUpdateSettingsProvider"/>
<fileType name="Autoconfig File" language="yaml" patterns="autoconfig*.yaml" implementationClass="de.gebit.plugins.autoconfig.AutoconfigFileType" fieldName="INSTANCE"/>
</extensions>
<extensions defaultExtensionNs="JavaScript.JsonSchema">
<ProviderFactory implementation="de.gebit.plugins.autoconfig.json.ConfigurationJsonSchemeProviderFactory"/>
Expand Down

0 comments on commit 264f382

Please sign in to comment.