Skip to content

Commit

Permalink
Merge pull request #112 from opwvhk/new-logo
Browse files Browse the repository at this point in the history
New logo & icons
  • Loading branch information
opwvhk authored Nov 23, 2023
2 parents 00053fd + 21db553 commit 58d3d0d
Show file tree
Hide file tree
Showing 85 changed files with 3,708 additions and 517 deletions.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
IntelliJ plugin supporting Apache Avro™ IDL
<img align="right" height="160" src="src/main/resources/META-INF/pluginIcon.svg" alt="Pigeon Logo"/>IntelliJ plugin for Apache Avro™ IDL
===========================================

Plugin for IntelliJ to handle Avro™ IDL schemas. Provides full support for IDL (<code>.avdl</code>)
Expand Down Expand Up @@ -33,3 +33,14 @@ Please don't file bug reports as a review. GitHub is the place where you can fin
[support for fixing bugs and making improvements](https://github.com/opwvhk/avro-schema-support/issues), as well as a
[discussion forum to ask questions](https://github.com/opwvhk/avro-schema-support/discussions).



Trademarks, Logo's, etc.
------------------------

The pigeon logo was created by **Emma K** ([emmak3l :octocat:](https://github.com/emmak3l)),
and is used for this plugin with permission.

The names Apache Avro, Avro™, Apache®, and the Apache Avro paper plane logo are either registered
trademarks or trademarks of The Apache Software Foundation. They are used in the project to signal
intended compatibility, and are not authoritative.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ public String getDefaultExtension() {
@Override
@Nullable
public Icon getIcon() {
return AvroIdlIcons.FILE;
return AvroIdlIcons.AVDL_FILE;
}
}
58 changes: 25 additions & 33 deletions src/main/java/opwvhk/intellij/avro_idl/AvroIdlIcons.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,64 +12,56 @@
* The set of all icons used by the plugin for representing Apache Avro™ IDL.
*/
public class AvroIdlIcons {
public static final Icon LOGO = IconManager.getInstance().getIcon("/META-INF/avroLogo16.svg", AvroIdlIcons.class);
public static final Icon FILE = IconManager.getInstance().getIcon("/META-INF/fileIconAvro.svg", AvroIdlIcons.class);
private static final IconManager ICON_MANAGER = IconManager.getInstance();
public static final Icon LOGO = ICON_MANAGER.getIcon("/icons/avroLogo16.svg", AvroIdlIcons.class);
public static final Icon AVDL_FILE = LOGO;
public static final Icon AVSC_FILE = LOGO;
public static final Icon AVPR_FILE = ICON_MANAGER.getIcon("/icons/pigeon.svg", AvroIdlIcons.class);

@Nullable
public static Icon getAvroIdlIcon(PsiElement element) {
if (element instanceof AvroIdlFile) {
return FILE;
return AVDL_FILE;
}
if (element instanceof AvroIdlRecordDeclaration) {
return ((AvroIdlRecordDeclaration) element).isErrorType() ? Nodes.AVRO_ERROR : Nodes.AVRO_RECORD;
}
if (element instanceof AvroIdlEnumDeclaration) {
return Nodes.AVRO_ENUM;
}
if (element instanceof AvroIdlRecordDeclaration && ((AvroIdlRecordDeclaration) element).isErrorType()) {
return Nodes.AVRO_EXCEPTION;
if (element instanceof AvroIdlEnumConstant) {
return Nodes.AVRO_SYMBOL;
}
if (element instanceof AvroIdlNamedSchemaDeclaration) { // Record & fixed (error & enum are matched above)
return Nodes.AVRO_CLASS;
if (element instanceof AvroIdlNamedSchemaDeclaration) { // Fixed (record, error & enum are matched above)
return Nodes.AVRO_FIXED;
}
if (element instanceof AvroIdlVariableDeclarator) {
boolean isField = element.getParent() instanceof AvroIdlFieldDeclaration;
return isField ? Nodes.AVRO_FIELD : null;
}
if (element instanceof AvroIdlEnumConstant) {
// Previously used: new LayeredIcon(AllIcons.Nodes.Field, AllIcons.Nodes.FinalMark, AllIcons.Nodes.StaticMark);
return Nodes.AVRO_CONSTANT;
if (element instanceof AvroIdlNamespaceDeclaration) {
return AllIcons.Nodes.CustomRegion;
}
if (element instanceof AvroIdlImportDeclaration) {
return AllIcons.Nodes.Include;
}
if (element instanceof AvroIdlProtocolDeclaration) {
return Nodes.AVRO_INTERFACE;
return Nodes.AVRO_PROTOCOL;
}
if (element instanceof AvroIdlMessageDeclaration) {
return Nodes.AVRO_METHOD;
return Nodes.AVRO_MESSAGE;
}
return null;
}

public static final class Nodes {
// Records & Fixed
public static final Icon AVRO_CLASS = IconManager.getInstance()
.getIcon("/icons/nodes/class.svg", AvroIdlIcons.class);
// Errors
public static final Icon AVRO_EXCEPTION = IconManager.getInstance()
.getIcon("/icons/nodes/exception.svg", AvroIdlIcons.class);
// Class fields
public static final Icon AVRO_FIELD = IconManager.getInstance()
.getIcon("/icons/nodes/field.svg", AvroIdlIcons.class);
// Enums
public static final Icon AVRO_ENUM = IconManager.getInstance()
.getIcon("/icons/nodes/enum.svg", AvroIdlIcons.class);
// Enum constants
public static final Icon AVRO_CONSTANT = IconManager.getInstance()
.getIcon("/icons/nodes/constant.svg", AvroIdlIcons.class);
// Protocols
public static final Icon AVRO_INTERFACE = IconManager.getInstance()
.getIcon("/icons/nodes/interface.svg", AvroIdlIcons.class);
// Protocol messages
public static final Icon AVRO_METHOD = IconManager.getInstance()
.getIcon("/icons/nodes/method.svg", AvroIdlIcons.class);
public static final Icon AVRO_RECORD = LOGO;
public static final Icon AVRO_ERROR = ICON_MANAGER.getIcon("/icons/nodes/error.svg", AvroIdlIcons.class);
public static final Icon AVRO_FIELD = ICON_MANAGER.getIcon("/icons/nodes/field.svg", AvroIdlIcons.class);
public static final Icon AVRO_FIXED = ICON_MANAGER.getIcon("/icons/nodes/fixed.svg", AvroIdlIcons.class);
public static final Icon AVRO_ENUM = ICON_MANAGER.getIcon("/icons/nodes/enum.svg", AvroIdlIcons.class);
public static final Icon AVRO_SYMBOL = ICON_MANAGER.getIcon("/icons/nodes/enum_symbol.svg", AvroIdlIcons.class);
public static final Icon AVRO_PROTOCOL = ICON_MANAGER.getIcon("/icons/nodes/protocol.svg", AvroIdlIcons.class);
public static final Icon AVRO_MESSAGE = ICON_MANAGER.getIcon("/icons/nodes/message.svg", AvroIdlIcons.class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ public String getDefaultExtension() {
@Override
@Nullable
public Icon getIcon() {
return AvroIdlIcons.FILE;
return AvroIdlIcons.AVPR_FILE;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ public String getDefaultExtension() {
@Override
@Nullable
public Icon getIcon() {
return AvroIdlIcons.FILE;
return AvroIdlIcons.AVSC_FILE;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

public class AvroIdlCreateFileFromAction extends CreateFileFromTemplateAction implements DumbAware {
public AvroIdlCreateFileFromAction() {
super("Avro IDL File", "Create a new Avro IDL file", AvroIdlIcons.FILE);
super("Avro IDL File", "Create a new Avro IDL file", AvroIdlIcons.AVSC_FILE);
}

@Override
Expand All @@ -27,10 +27,10 @@ protected void buildDialog(@NotNull Project project,
*/
builder.setTitle("New Avro IDL File")
// TODO: Enable schema templates when Avro supports the schema syntax (Avro 1.12.0)
//.addKind("Empty Schema IDL", AvroIdlIcons.FILE, "AvroIDL_EmptySchema")
.addKind("Empty Protocol IDL", AvroIdlIcons.FILE, "AvroIDL_EmptyProtocol")
//.addKind("Example schema", AvroIdlIcons.FILE, "AvroIDL_ExampleSchema")
.addKind("Example protocol", AvroIdlIcons.FILE, "AvroIDL_ExampleProtocol")
//.addKind("Empty Schema IDL", AvroIdlIcons.AVDL_FILE, "AvroIDL_EmptySchema")
.addKind("Empty Protocol IDL", AvroIdlIcons.AVDL_FILE, "AvroIDL_EmptyProtocol")
//.addKind("Example schema", AvroIdlIcons.AVDL_FILE, "AvroIDL_ExampleSchema")
.addKind("Example protocol", AvroIdlIcons.AVDL_FILE, "AvroIDL_ExampleProtocol")
.setValidator(new NonEmptyInputValidator());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class AvroIdlColorSettingsPage implements ColorSettingsPage {
@Override
@Nullable
public Icon getIcon() {
return AvroIdlIcons.FILE;
return AvroIdlIcons.LOGO;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ private Stream<AvroIdlEnumConstant> findConstants() {
return findConstants()
.filter(enumValue -> enumValue.getName() != null && !enumValue.getName().isBlank())
.map(enumValue -> LookupElementBuilder.create(enumValue.getName())
.withTypeText(enumValue.getContainingFile().getName(), AvroIdlIcons.FILE, false))
.withTypeText(enumValue.getContainingFile().getName(), AvroIdlIcons.LOGO, false))
.toArray();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.intellij.psi.util.PsiTreeUtil;
import groovy.json.StringEscapeUtils;
import opwvhk.intellij.avro_idl.AvroIdlFileType;
import opwvhk.intellij.avro_idl.AvroIdlIcons;
import opwvhk.intellij.avro_idl.psi.*;
import org.apache.avro.Protocol;
import org.apache.avro.Schema;
Expand Down Expand Up @@ -315,10 +316,10 @@ private static LookupElement lookupElement(@NotNull PsiElement psiElement, @NotN
return LookupElementBuilder.create(psiElement, schemaName);
} else if (namespace.equals(currentNamespace)) {
return LookupElementBuilder.create(psiElement, schemaName).withLookupString(schemaFullName)
.withTypeText(namespace);
.withTypeText(namespace, AvroIdlIcons.getAvroIdlIcon(psiElement), false);
} else {
return LookupElementBuilder.create(psiElement, schemaFullName).withLookupString(schemaName)
.withTypeText(namespace);
.withTypeText(namespace, AvroIdlIcons.getAvroIdlIcon(psiElement), false);
}
}

Expand Down
Binary file removed src/main/resources/META-INF/avroLogo16.png
Binary file not shown.
8 changes: 0 additions & 8 deletions src/main/resources/META-INF/avroLogo16.svg

This file was deleted.

8 changes: 0 additions & 8 deletions src/main/resources/META-INF/avroLogo16_dark.svg

This file was deleted.

8 changes: 0 additions & 8 deletions src/main/resources/META-INF/fileIconAvro.svg

This file was deleted.

13 changes: 0 additions & 13 deletions src/main/resources/META-INF/fileIconAvro_dark.svg

This file was deleted.

4 changes: 2 additions & 2 deletions src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
-->
<description><![CDATA[
<p>
Extend IntelliJ, PyCharm and other JetBrains IDEs to more easily work with Avro schemata and protocols in both
IDL or JSON format.
Extend IntelliJ, PyCharm and other JetBrains IDEs to more easily work with Avro&trade; schemata and protocols in
both IDL or JSON format.
</p>
<p>
<br/>
Expand Down
Loading

0 comments on commit 58d3d0d

Please sign in to comment.