Skip to content

Commit

Permalink
Use language specific editor icons
Browse files Browse the repository at this point in the history
Editor icons for following languages created based on the Generic Text
Editor icon
(<https://github.com/eclipse-platform/eclipse.platform.images/blob/master/org.eclipse.images/eclipse-svg/org.eclipse.ui.genericeditor/icons/full/obj16/generic_editor.svg>):
- Batch File
- Clojure
- Rust
  • Loading branch information
howlger committed Apr 28, 2022
1 parent 58efb88 commit d4bb7b8
Show file tree
Hide file tree
Showing 13 changed files with 23 additions and 9 deletions.
Binary file added artwork/bat/bat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added artwork/bat/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added artwork/clojure/clojure.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added artwork/clojure/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added artwork/rust/rust.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added artwork/rust/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions de.agilantis.language_pack/build.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
bin.includes = META-INF/,\
[email protected],\
lngeditor.png,\
plugin.xml
Binary file removed de.agilantis.language_pack/lngeditor.png
Binary file not shown.
Binary file removed de.agilantis.language_pack/[email protected]
Binary file not shown.
6 changes: 3 additions & 3 deletions info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ https://en.wikipedia.org/w/api.php?action=query&format=xml&prop=pageprops&ppprop
-->
<info>
<extension id="bat">
<language name="Batch" better-name="Batch File" wikidata="Q479833"/>
<language name="Batch" better-name="Batch File" wikidata="Q479833" icon="bat.png"/>
</extension>
<extension id="clojure">
<language name="Clojure" wikidata="Q51798"/>
<language name="Clojure" wikidata="Q51798" icon="clojure.png"/>
</extension>
<extension id="coffeescript">
<language name="CoffeeScript" wikidata="Q1106819"/>
Expand Down Expand Up @@ -175,7 +175,7 @@ https://en.wikipedia.org/w/api.php?action=query&format=xml&prop=pageprops&ppprop
<language name="Ruby" wikidata="Q161053" issues="syntax highlighting broken"/>
</extension>
<extension id="rust">
<language name="Rust" wikidata="Q575650"/>
<language name="Rust" wikidata="Q575650" icon="rust.png"/>
</extension>
<extension id="scss">
<language name="SCSS" wikidata="Q1572865"/>
Expand Down
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@
<param name="base-url"
expression="https://raw.githubusercontent.com/@{dir}@{extension}"/>
<param name="info-file" expression="${project.basedir}/../info.xml"/>
<param name="icons-dir" expression="${project.basedir}/../artwork/@{extension}"/>
</xslt>
<subant inheritall="yes" inheritrefs="yes">
<fileset file="${project.build.directory}/generated_temp/@{extension}/build.xml"/>
Expand Down
7 changes: 7 additions & 0 deletions transform_to_extension_build.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<xsl:param name="extension"/>
<xsl:param name="base-url"/>
<xsl:param name="info-file"/>
<xsl:param name="icons-dir"/>

<!-- Wikidata link query -->
<xsl:variable name="wikidata-link-query"
Expand Down Expand Up @@ -84,6 +85,12 @@
<xsl:text>&lt;/href></xsl:text>
</xsl:attribute>
</echo>
<xsl:if test="$language-info/@icon">
<mkdir dir="${{project.build.directory}}/generated/${{extension}}"/>
<copy todir="${{project.build.directory}}/generated/${{extension}}">
<fileset dir="{$icons-dir}" includes="*.png"/>
</copy>
</xsl:if>
</xsl:if>
</xsl:for-each>

Expand Down
16 changes: 12 additions & 4 deletions transform_to_plugin_snippet.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,19 @@
</xsl:if>

<!-- editor icons -->
<extension point="org.eclipse.ui.genericeditor.icons">
<xsl:for-each select="exsl:node-set($languages)/o">
<icon contentType="lng.{e[@name='id']/@string}" icon="lngeditor.png"/>
</xsl:for-each>
<xsl:if test="document($info-file)/info/extension[@id=$extension]/language/@icon">
<extension point="org.eclipse.ui.genericeditor.icons">
<xsl:for-each select="exsl:node-set($languages)/o">
<xsl:variable name="language-name" select="a[@name='aliases']/v[1]/@string"/>
<xsl:if test="document($info-file)/info/extension[@id=$extension]
/language[@name = $language-name]/@icon">
<icon contentType="lng.{e[@name='id']/@string}"
icon="{$extension}/{document($info-file)/info/extension[@id=$extension]
/language[@name = $language-name]/@icon}"/>
</xsl:if>
</xsl:for-each>
</extension>
</xsl:if>

</xsl:if>

Expand Down

0 comments on commit d4bb7b8

Please sign in to comment.