From 12d935efc75984f2225e7ff5c5a2534530060abf Mon Sep 17 00:00:00 2001 From: Karl Duderstadt Date: Fri, 29 Jul 2022 16:20:27 +0200 Subject: [PATCH 1/2] update pom version, add dependencies for syntax highlighting bump pom to 32.0.0-beta-4 add org.scijava:script-editor add com.fifesoft:rsyntaxtextarea --- pom.xml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9c1ba9b..c305150 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.scijava pom-scijava - 27.0.1 + 32.0.0-beta-4 @@ -102,6 +102,10 @@ Institute of Molecular Cell Biology and Genetics. org.scijava scijava-common + + org.scijava + script-editor + @@ -109,6 +113,10 @@ Institute of Molecular Cell Biology and Genetics. jython-slim ${jython-slim.version} + + com.fifesoft + rsyntaxtextarea + @@ -117,4 +125,10 @@ Institute of Molecular Cell Biology and Genetics. test + + + scijava.public + https://maven.scijava.org/content/groups/public + + From f45a9d21d0280cf2dab9712bdf1009996e12617a Mon Sep 17 00:00:00 2001 From: Karl Duderstadt Date: Fri, 29 Jul 2022 16:21:06 +0200 Subject: [PATCH 2/2] Add SyntaxHighlighter for language name python-(jython) --- .../jython/JythonScriptSyntaxHighlighter.java | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 src/main/java/org/scijava/plugins/scripting/jython/JythonScriptSyntaxHighlighter.java diff --git a/src/main/java/org/scijava/plugins/scripting/jython/JythonScriptSyntaxHighlighter.java b/src/main/java/org/scijava/plugins/scripting/jython/JythonScriptSyntaxHighlighter.java new file mode 100644 index 0000000..08db318 --- /dev/null +++ b/src/main/java/org/scijava/plugins/scripting/jython/JythonScriptSyntaxHighlighter.java @@ -0,0 +1,46 @@ +/* + * #%L + * Python scripting language plugin to be used with PyImageJ. + * %% + * Copyright (C) 2021 - 2022 SciJava developers. + * %% + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * #L% + */ + +package org.scijava.plugins.scripting.jython; + +import org.fife.ui.rsyntaxtextarea.modes.PythonTokenMaker; +import org.scijava.plugin.Plugin; +import org.scijava.ui.swing.script.SyntaxHighlighter; + +/** + * SyntaxHighlighter for Python (Jython). + * + * @author Karl Duderstadt + */ +@Plugin(type = SyntaxHighlighter.class, name = "python-(jython)") +public class JythonScriptSyntaxHighlighter extends PythonTokenMaker implements +SyntaxHighlighter +{ + // Everything implemented in PythonTokenMaker +}